diff options
311 files changed, 10588 insertions, 4246 deletions
diff --git a/docs/man/castool.1 b/docs/man/castool.1 index 1dd96b6eb3f..4e58374c317 100644 --- a/docs/man/castool.1 +++ b/docs/man/castool.1 @@ -6,7 +6,7 @@ .\" Cesare Falco <c.falco@ubuntu.com>, February 2011 .\" .\" -.TH CASTOOL 1 2015-07-22 0.164 "MESS Generic cassette manipulation tool" +.TH CASTOOL 1 2016-07-21 0.176 "MESS Generic cassette manipulation tool" .\" .\" .\" NAME chapter diff --git a/docs/man/chdman.1 b/docs/man/chdman.1 index f81b48abdea..34fd884eecd 100644 --- a/docs/man/chdman.1 +++ b/docs/man/chdman.1 @@ -6,7 +6,7 @@ .\" Ashley T. Howes <debiandev@ashleyhowes.com>, February 2005 .\" updated by Cesare Falco <c.falco@ubuntu.com>, February 2007 .\" -.TH CHDMAN 1 2015-07-22 0.164 "MAME Compressed Hunks of Data (CHD) manager" +.TH CHDMAN 1 2016-07-21 0.176 "MAME Compressed Hunks of Data (CHD) manager" .\" .\" NAME chapter .SH NAME diff --git a/docs/man/floptool.1 b/docs/man/floptool.1 index 24d8e97c46a..e9b07e189a7 100644 --- a/docs/man/floptool.1 +++ b/docs/man/floptool.1 @@ -6,7 +6,7 @@ .\" Cesare Falco <c.falco@ubuntu.com>, April 2014 .\" .\" -.TH FLOPTOOL 1 2015-07-22 0.164 "MESS Generic floppy manipulation tool" +.TH FLOPTOOL 1 2016-07-21 0.176 "MESS Generic floppy manipulation tool" .\" .\" .\" NAME chapter diff --git a/docs/man/imgtool.1 b/docs/man/imgtool.1 index 819da84de06..7dad51f4311 100644 --- a/docs/man/imgtool.1 +++ b/docs/man/imgtool.1 @@ -6,7 +6,7 @@ .\" Cesare Falco <c.falco@ubuntu.com>, February 2011 .\" .\" -.TH IMGTOOL 1 2015-07-22 0.164 "MESS media image manipulation tool" +.TH IMGTOOL 1 2016-07-21 0.176 "MESS media image manipulation tool" .\" .\" .\" NAME chapter diff --git a/docs/man/jedutil.1 b/docs/man/jedutil.1 index e93d07a8e22..4a0ce38e03f 100644 --- a/docs/man/jedutil.1 +++ b/docs/man/jedutil.1 @@ -8,7 +8,7 @@ .\" References .\" http://aarongiles.com/?p=159 .\" -.TH JEDUTIL 1 2015-07-22 0.164 "MAME JEDEC file utilities" +.TH JEDUTIL 1 2016-07-21 0.176 "MAME JEDEC file utilities" .\" .\" NAME chapter .SH NAME diff --git a/docs/man/ldresample.1 b/docs/man/ldresample.1 index c56b8af2c06..d829bfafa09 100644 --- a/docs/man/ldresample.1 +++ b/docs/man/ldresample.1 @@ -3,7 +3,7 @@ .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .\" -.TH LDRESAMPLE 1 2015-07-22 0.164 "MAME laserdisc audio manipulation tool" +.TH LDRESAMPLE 1 2016-07-21 0.176 "MAME laserdisc audio manipulation tool" .\" .\" Please adjust this date whenever revising the manpage. .\" diff --git a/docs/man/ldverify.1 b/docs/man/ldverify.1 index aae404164cb..ae36883a644 100644 --- a/docs/man/ldverify.1 +++ b/docs/man/ldverify.1 @@ -5,7 +5,7 @@ .\" Man page created from source and usage information by .\" Cesare Falco <c.falco@ubuntu.com>, August 2008 .\" -.TH LDVERIFY 1 2015-07-22 0.164 "MAME laserdisc data checker" +.TH LDVERIFY 1 2016-07-21 0.176 "MAME laserdisc data checker" .\" .\" NAME chapter .SH NAME diff --git a/docs/man/mame.6 b/docs/man/mame.6 index 64150f128ea..da51b1f2c41 100644 --- a/docs/man/mame.6 +++ b/docs/man/mame.6 @@ -13,7 +13,7 @@ .\" and updated by Andrew Burton <burtona@gol.com>, July 2003 .\" .\" -.TH MAME 6 2015-07-22 0.164 "MAME \- The Multiple Arcade Machine Emulator" +.TH MAME 6 2016-07-21 0.176 "MAME \- The Multiple Arcade Machine Emulator" .\" .\" .\" NAME chapter @@ -281,6 +281,16 @@ the MAME executable). If the Crosshair is set to default in the menu, MAME will look for gamename\cross#.png and then cross#.png in the specified crosshairpath, where # is the player number. Failing that, MAME will use built\-in default crosshairs. +.TP +.B \-pluginspath \fIpathname +Specifies a single path within which to find plugins. The default +is 'plugins' (that is, a directory 'plugins' in the same directory as +the MAME executable). +.TP +.B \-languagepath \fIpathname +Specifies a single path within which to find language files. The default +is 'language' (that is, a directory 'language' in the same directory as +the MAME executable). .\" .\" ******************************************************* .SS Output Directory Options @@ -632,15 +642,19 @@ Name of a PNG file to use for visual effects, or 'none'. Default is 'none'. .SS Vector rendering options .\" ******************************************************* .TP -.B \-[no]antialias, \-[no]aa -Enables antialiased line rendering for vector games. The default is ON -(\-antialias). +.B \-beam_width_min \fIvalue +.TP +.B \-beam_width_max \fIvalue +Sets the minimum and maximum width of the vectors. This is a scaling factor +against the standard vector width, which is interpolated between minimum and +maximum according to the beam's intensity. A value of 1.0 will keep the +default vector line width. Smaller values will reduce the width, and larger +values will increase the width. The default is 1.0. .TP -.B \-beam \fIvalue -Sets the width of the vectors. This is a scaling factor against the -standard vector width. A value of 1.0 will keep the default vector line -width. Smaller values will reduce the width, and larger values will -increase the width. The default is 1.0. +.B \-beam_intensity_weight \fIvalue +Applies an exponential weight to the minimum and maximum beam width. For +positive values the interpolated scaling factor will affect lines with higher +intensity more than lines with lower intensity. The default is 0.0. .TP .B \-flicker \fIvalue Simulates a vector "flicker" effect, similar to a vector monitor that @@ -666,7 +680,10 @@ output on some cards. .br \fBnone\fR does no drawing and is intended for CPU benchmarking. .br -Default is SOFT. +Default is 'soft'. +.TP +.B \-numscreens \fR[\fI1-4\fR] +Number of screens to create; usually, you want just one. Default is '1'. .TP .B \-[no]window, \-[no]w Run MAME in either full screen or a window. This is a fully\-featured window @@ -693,6 +710,18 @@ Allow non\-integer stretch factors. Video purists should stay far, far away from this option, while everyone else will be happy to know that it lets you fill the screen properly in full\-screen mode. Default is ON (\-unevenstretch). .TP +.B \-[no]unevenstretchx, \-[no]uesx +Act as \-[no]unevenstretch on horizontal basis only. +.TP +.B \-[no]intoverscan, \-[no]ios +Allow overscan on integer scaled targets. +.TP +.B \-intscalex, \-sx +Set horizontal integer scale factor. +.TP +.B \-intscaley, \-sy +Set vertical integer scale factor. +.TP .B \-[no]centerh Center horizontally within the view area. Default is ON (\-centerh). .TP @@ -745,7 +774,7 @@ Default is NONE. .\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ .B NOTE: All the options in this group are available only with OpenGL video -rendering subsystem, i.e \fB\-video opengl\fR or \fB\-video opengl16\fR. +rendering subsystem, i.e \fB\-video opengl\fR. .TP .B \-[no]filter, \-[no]glfilter, \-[no]flt Enable bilinear filtering on screen output. Default is ON (\-filter). @@ -783,10 +812,6 @@ Preferred custom OpenGL GLSL shader set mame bitmap (from 0 to 9). .B \-glsl_shader_screen[0\-9] Preferred custom OpenGL GLSL shader screen bitmap (from 0 to 9). .TP -.B \-gl_glsl_vid_attr -Enable OpenGL GLSL handling of brightness and contrast. Better RGB game -performance for free. Default is ON. -.TP .B \-screen Explicit name for all screens; 'auto' here will try to make a best guess. .TP @@ -816,6 +841,51 @@ format is \fIwidth\fRx\fIheight\fR[@\fIrefreshrate\fR] or 'auto'. Preferred view for the first|second|third|fourth screen. .\" .\" ******************************************************* +.SS BGFX post\-processing options +.\" ******************************************************* +.B NOTE: +All the options in this group are available only when BGFX video +post\-processing is enabled, i.e \fB\-video bgfx\fR. For full info on BGFX +please visit official MAME documentation page: +.br +http://docs.mamedev.org/advanced/bgfx.html +.TP +.B \-bgfx_path \fIpathname +This is where your BGFX shader files are stored. +The default is 'bgfx' (that is, a directory "bgfx" in the same directory +as the MAME executable). +.TP +.B \-bgfx_backend \fIauto\fR|\fIopengl\fR +Selects a rendering backend for BGFX to use. The default is 'auto', +which will let MAME choose the best selection for you. +.TP +.B \-bgfx_debug +Enables BGFX debugging features. Most users will not need to use this. +.TP +.B \-bgfx_screen_chains \fIdefault\fR|\fIunfiltered\fR|\fIhlsl\fR[,...] +This dictates how to handle BGFX rendering on a per\-display basis. +For each display specify one of the possible choices: +.br +\fBdefault\fR default bilinear filterered output +.br +\fBunfiltered\fR nearest neighbor unfiltered output +.br +\fBhlsl\fR HLSL display simulation through shaders +.br +Separate directives for each window with a comma (,) and for each physical +screen with a colon (:). For example, for an emulated game with 3 displays +emulated on 3 windows on your monitor, +.B \-bgfx_screen_chains default,unfiltered,default +specifies to apply default filter on what is been rendered on the first +and third window and leave the content of the second window unfiltered. +.TP +.B \-bgfx_shadow_mask \fIfilename +This specifies the shadow mask effect PNG file. Default is 'slot-mask.png'. +.TP +.B \-bgfx_avi_name \fIfilename +This specifies a filename for BGFX output logging. +.\" +.\" ******************************************************* .SS Full screen options .\" ******************************************************* .\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -973,9 +1043,27 @@ set \fItime\fR to 0 to obey driver or give a positive value to set impulse time. .\" SDL specific .\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ .TP -.B \-uimodekey, \-umk +.B \-uimodekey, \-umk \fIvalue Specifies the key used to toggle between full and partial UI mode. .TP +.B \-uifontprovider \fIauto\fR|\fIsdl\fR|\fInone +Provider for ui font. +.TP +.B \-output \fIconsole\fR|\fInetwork\fR|\fInone +Provider for output. +.TP +.B \-keyboardprovider \fIauto\fR|\fIsdl\fR|\fInone +Provider for keyboard input. +.TP +.B \-mouseprovider \fIauto\fR|\fIsdl\fR|\fInone +Provider for mouse input. +.TP +.B \-lightgunprovider \fIauto\fR|\fInone +Provider for lightgun input. +.TP +.B \-joystickprovider \fIauto\fR|\fIsdl\fR|\fInone +Provider for joystick input. +.TP .B \-[no]keymap Enable keymap for non\-QWERTY keyboards. Used in conjunction with \fB\-keymap_file\fR. Default is OFF (\-nokeymap). @@ -995,17 +1083,23 @@ Default is 'auto'. Use special handling for PS3 Sixaxis controllers. Default is OFF (\-nosixaxis). .TP -.B \-lightgun_index[1\-8] -Map lightgun to specific index in MAME. +.B \-mouse_index[1\-8] +Map mouse to specific index in MAME. +.TP +.B \-keyb_idx[0\-8] \fIkeyboard +With these options you can assign a keyboard to a specific index in MAME. .TP -.B \-videodriver, \-vd \fIx11\fR|\fIdirectfb\fR|\fIauto\fR -SDL video driver to use; auto selects SDL default. +.B \-videodriver, \-vd \fIauto\fR|\fIx11\fR|\fIdirectfb +SDL video driver to use; 'auto' selects SDL default. .TP -.B \-audiodriver, \-ad \fIalsa\fR|\fIarts\fR|\fIauto\fR -SDL audio driver to use; auto selects SDL default. +.B \-renderdriver, \-rd \fIauto\fR|\fIsoftware\fR|\fIopengl\fR|\fIdirectfb +SDL render driver to use; 'auto' selects SDL default. .TP -.B \-gl_lib \fIalsa\fR|\fIarts\fR|\fIauto\fR -Alternative libGL.so to use; auto selects SDL default. +.B \-audiodriver, \-ad \fIauto\fR|\fIalsa\fR|\fIarts +SDL audio driver to use; 'auto' selects SDL default. +.TP +.B \-gl_lib \fIauto\fR|\fIalsa\fR|\fIarts +Alternative libGL.so to use; 'auto' selects SDL default. .\" .\" ******************************************************* .SS Input automatic enable options @@ -1081,6 +1175,22 @@ the same time as \-log to output the log data to both targets as well. Default is OFF (\-nooslog). .\" .\" ******************************************************* +.SS Communication options +.\" ******************************************************* +.TP +.B \-comm_localhost +Local address to bind to. +.TP +.B \-comm_localport +Local port to bind to. +.TP +.B \-comm_remotehost +Remote address to connect to. +.TP +.B \-comm_remoteport +Remote port to connect to. +.\" +.\" ******************************************************* .SS Misc options .\" ******************************************************* .TP @@ -1117,6 +1227,9 @@ to its built\-in UI font. On some platforms \fIfontname\fP can be a system font name instead of a BDF font file. The default is 'default' (use the OSD\-determined default font). .TP +.B \-ui \fIsimple\fR|\fIcabinet +Type of UI. +.TP .B \-ramsize, \-ram \fIvalue Size of RAM (if supported by driver). .TP @@ -1142,6 +1255,18 @@ File containing scripting to execute after machine boot. .TP .B \-[no]console Enable emulator LUA console. Default is OFF (\-noconsole). +.TP +.B \-[no]plugins +Enable LUA plugin support. Default is ON (\-plugins). +.TP +.B \-plugin \fIvalue +List of plugins to enable. +.TP +.B \-noplugin \fIvalue +List of plugins to disable. +.TP +.B \-language, \-lang \fIvalue +Display language. Default is 'English'. .\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ .\" SDL specific .\" +++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/docs/man/romcmp.1 b/docs/man/romcmp.1 index d7a89f92e80..a3de1153d6f 100644 --- a/docs/man/romcmp.1 +++ b/docs/man/romcmp.1 @@ -9,7 +9,7 @@ .\" References .\" http://www.mame.net/mamefaq.html .\" -.TH ROMCMP 1 2015-07-22 0.164 "MAME romset checking tool" +.TH ROMCMP 1 2016-07-21 0.176 "MAME romset checking tool" .\" .\" NAME chapter .SH NAME diff --git a/hash/atom_rom.xml b/hash/atom_rom.xml index bb4eb423942..b1712ae2fbd 100644 --- a/hash/atom_rom.xml +++ b/hash/atom_rom.xml @@ -4,58 +4,75 @@ Missing: - - econet - axr2 (APP Laboratories) --> -<softwarelist name="atom_rom" description="Acorn Atom expansion ROMs"> +<softwarelist name="atom_cart" description="Acorn Atom Utility ROMs"> - <software name="josbox"> - <description>AXR1</description> + <software name="ace20"> + <description>ACE-2.0</description> <year>198?</year> - <publisher>ECD Computer Workshop</publisher> + <publisher><homebrew></publisher> + <info name="author" value="Gerard van den Brandhof" /> <part name="cart" interface="atom_cart"> <dataarea name="rom" size="4096"> - <rom name="axr1.rom" size="4096" crc="868fda8b" sha1="f8417787c28818a7646b9b59d706ef890255049f" offset="0" /> + <rom name="ace20.rom" size="4096" crc="55fa7172" sha1="93b080d3e00b8837f72b12852dabe3194249b08a" offset="0"/> </dataarea> </part> </software> - <software name="pcharme"> - <description>P-Charme Interpreter</description> - <year>1984</year> - <publisher>Frans van Hoesel</publisher> + <software name="ace22"> + <description>ACE-2.2</description> + <year>198?</year> + <publisher><homebrew></publisher> + <info name="author" value="Gerard van den Brandhof" /> <part name="cart" interface="atom_cart"> <dataarea name="rom" size="4096"> - <rom name="pcharme.rom" size="4096" crc="9e8bd79f" sha1="66c57622448b448aa6080911dccb03456d0e3b81" offset="0" /> + <rom name="ace22.rom" size="4096" crc="f435ffd4" sha1="0ded6633b455f11d1df119224ab19b4f01323f87" offset="0"/> </dataarea> </part> </software> - <software name="gags"> - <description>GAGS v2.3</description> + <software name="ace30"> + <description>ACE-3.0</description> <year>198?</year> - <publisher>G. Hillebrand</publisher> + <publisher><homebrew></publisher> + <info name="author" value="Gerard van den Brandhof" /> <part name="cart" interface="atom_cart"> <dataarea name="rom" size="4096"> - <rom name="gags.rom" size="4096" crc="35e1d713" sha1="94cc2887ad9fea1849d1d53c64d0668e77696ef4" offset="0" /> + <rom name="ace30.rom" size="4096" crc="c054fd62" sha1="a49bb8ef3db877e5bf9ae214dcbc5fa7eb06aead" offset="0"/> </dataarea> </part> </software> - <software name="werom"> - <description>WE-ROM</description> + <software name="aekmon"> + <description>AEK Monitor ROM</description> + <year>1982</year> + <publisher><homebrew></publisher> + <info name="usage" value="Type LINK #A7C7" /> + <info name="author" value="Alan Knowles" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="aek_monitor.rom" size="4096" crc="097d4e13" sha1="0dcdb884d5f38ff7c0c32810a397c18469edc348" offset="0"/> + </dataarea> + </part> + </software> + + <software name="aekscrn"> + <description>AEK Screen ROM</description> <year>1983</year> - <publisher>Watford Electronics</publisher> + <publisher><homebrew></publisher> + <info name="usage" value="Type LINK #AFF0" /> + <info name="author" value="Alan Knowles" /> <part name="cart" interface="atom_cart"> <dataarea name="rom" size="4096"> - <rom name="werom.rom" size="4096" crc="dfcb3bf8" sha1="85a19146844da2d6f03e1cde37ee17429eedeb0d" offset="0" /> + <rom name="aek_screen.rom" size="4096" crc="1be4706a" sha1="d43104f2f28f5a79a54aca7c41dbc8047d6d2120" offset="0"/> </dataarea> </part> </software> - <software name="afuk"> - <description>A&F Utility Kit</description> + <software name="afutilik"> + <description>A&F UtiliKit</description> <year>1982</year> <publisher>A&F Software</publisher> <part name="cart" interface="atom_cart"> @@ -65,10 +82,81 @@ </part> </software> + <software name="atomcalc"> + <description>Atom Calc</description> + <year>1982</year> + <publisher>Acornsoft</publisher> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="atomcalc.rom" size="4096" crc="3a7409cd" sha1="102e43a446e9ad5459916d432551044f419da0c3" offset="0" /> + </dataarea> + </part> + </software> + + <software name="atomdemo"> + <description>Atom Demo</description> + <year>1980</year> + <publisher>Acornsoft</publisher> + <info name="usage" value="Type RUN" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="atomdemo.rom" size="4096" crc="cdf4810f" sha1="36054b1a85341b2131d7c43231a6349a5c984116" offset="0"/> + </dataarea> + </part> + </software> + + <software name="atmwin10"> + <description>Atomic Windows v1.0</description> + <year>19??</year> + <publisher><homebrew></publisher> + <info name="author" value="Kees van Oss" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="atomicw.rom" size="4096" crc="a3fd737d" sha1="d418d9322c69c49106ed2c268ad0864c0f2c4c1b" offset="0" /> + </dataarea> + </part> + </software> + + <software name="atmwin11"> + <description>Atomic Windows v1.1</description> + <year>19??</year> + <publisher><homebrew></publisher> + <info name="author" value="Kees van Oss" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="atomicw11.rom" size="4096" crc="c3ad78cc" sha1="5177929bd26bd455f7bfade3a245e8f5221c751e" offset="0" /> + </dataarea> + </part> + </software> + + <software name="atmwin12"> + <description>Atomic Windows 1.2 BD</description> + <year>19??</year> + <publisher><homebrew></publisher> + <info name="author" value="Kees van Oss" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="atomicw12.rom" size="4096" crc="0801b4f1" sha1="40c2f0418bd9b38b17a913d23e5ed574f991cdeb" offset="0"/> + </dataarea> + </part> + </software> + + <software name="axr1"> + <description>AXR1</description> + <year>198?</year> + <publisher>ECD Computer Workshop</publisher> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="axr1.rom" size="4096" crc="868fda8b" sha1="f8417787c28818a7646b9b59d706ef890255049f" offset="0" /> + </dataarea> + </part> + </software> + <software name="combox"> <description>COM-Box</description> <year>198?</year> - <publisher>B. Poot</publisher> + <publisher><homebrew></publisher> + <info name="author" value="Bram Poot" /> <part name="cart" interface="atom_cart"> <dataarea name="rom" size="4096"> <rom name="combox.rom" size="4096" crc="9c8210ab" sha1="ea293f49a98721cdbdf985d6f2fe636290ef0e75" offset="0" /> @@ -76,21 +164,129 @@ </part> </software> - <software name="salfaa"> - <description>SALFAA v2.6</description> + <software name="disatom"> + <description>DisAtom Super ROM</description> + <year>1982</year> + <publisher>Procyon</publisher> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="disatom.rom" size="4096" crc="f0a28f40" sha1="c48f3c43dea6a71cdfba7d8beac617af5fabbbab" offset="0"/> + </dataarea> + </part> + </software> + + <software name="diskrom"> + <description>Disk ROM</description> + <year>198?</year> + <publisher><homebrew></publisher> + <info name="author" value="Frans le Blanc" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="diskrom.rom" size="4096" crc="797ae59d" sha1="93dd8731e4daec31aeb150b279e2da1493a0dbd1" offset="0"/> + </dataarea> + </part> + </software> + + <software name="econet"> + <description>Econet</description> + <year>198?</year> + <publisher>Acorn</publisher> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="econet.rom" size="4096" crc="f4e0fc4a" sha1="a3aaaa0f41557c94f668cf1aa019659116a38cfd" offset="0"/> + </dataarea> + </part> + </software> + + <software name="gags21" cloneof="gags24"> + <description>GAGS v2.1</description> + <year>198?</year> + <publisher><homebrew></publisher> + <info name="author" value="Gerrit Hillebrand" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="gags21.rom" size="4096" crc="eb4a72c2" sha1="059261bbee866c8f2ea19e04ebe84dfc55945bff" offset="0" /> + </dataarea> + </part> + </software> + + <software name="gags22" cloneof="gags24"> + <description>GAGS v2.2</description> <year>198?</year> - <publisher>B. Poot & J. Jobse</publisher> + <publisher><homebrew></publisher> + <info name="author" value="Gerrit Hillebrand" /> <part name="cart" interface="atom_cart"> <dataarea name="rom" size="4096"> - <rom name="salfaa.rom" size="4096" crc="ef857b25" sha1="b3812427233060972fa01faf3ce381a21576a5ed" offset="0" /> + <rom name="gags22.rom" size="4096" crc="cfa943f5" sha1="a750735839b78837e27bb0256890c1759a9278c8" offset="0" /> + </dataarea> + </part> + </software> + + <software name="gags23" cloneof="gags24"> + <description>GAGS v2.3</description> + <year>198?</year> + <publisher><homebrew></publisher> + <info name="author" value="Gerrit Hillebrand" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="gags23.rom" size="4096" crc="35e1d713" sha1="94cc2887ad9fea1849d1d53c64d0668e77696ef4" offset="0" /> + </dataarea> + </part> + </software> + + <software name="gags24"> + <description>GAGS v2.4</description> + <year>198?</year> + <publisher><homebrew></publisher> + <info name="author" value="Gerrit Hillebrand" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="gags24.rom" size="4096" crc="578dc6c7" sha1="de8fb4f6a67b18e5b73afb11738c348b1517f6e6" offset="0"/> + </dataarea> + </part> + </software> + + <software name="josbox"> + <description>JosBox</description> + <year>198?</year> + <publisher><homebrew></publisher> + <info name="author" value="Jos Horsmeijer" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="josbox.rom" size="4096" crc="ee8df1cd" sha1="5654332f668b52c0021dd277ddfc2400d0140182" offset="0"/> + </dataarea> + </part> + </software> + + <software name="pcharme"> + <description>P-Charme</description> + <year>1984</year> + <publisher><homebrew></publisher> + <info name="author" value="Frans van Hoesel" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="pcharme.rom" size="4096" crc="9e8bd79f" sha1="66c57622448b448aa6080911dccb03456d0e3b81" offset="0" /> + </dataarea> + </part> + </software> + + <software name="pcharmea" cloneof="pcharme"> + <description>P-Charme (Alt)</description> + <year>1984</year> + <publisher><homebrew></publisher> + <info name="author" value="Frans van Hoesel" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="pcharme_alt.rom" size="4096" crc="3824cce5" sha1="fd50428e18f039b642c967255c435e14df26c949" offset="0"/> </dataarea> </part> </software> <software name="mousebox"> <description>Mouse-Dos Box v1.01</description> - <year>198?</year> - <publisher><unknown></publisher> + <year>19??</year> + <publisher><homebrew></publisher> + <info name="author" value="Wouter Ras" /> <part name="cart" interface="atom_cart"> <dataarea name="rom" size="4096"> <rom name="mousebox.rom" size="4096" crc="0dff30e4" sha1="b7c0b9c23fcc5cfdc06cb2d2a9e7c2658e248ef7" offset="0" /> @@ -98,25 +294,186 @@ </part> </software> - <software name="windows"> - <description>Atomic Windows v1.0</description> - <year>198?</year> - <publisher>Kees van Oss</publisher> + <software name="toolbox"> + <description>Programmer's Toolbox</description> + <year>1981</year> + <publisher>Program Power</publisher> + <info name="usage" value="Type LINK #AF00" /> <part name="cart" interface="atom_cart"> <dataarea name="rom" size="4096"> - <rom name="atomicw.rom" size="4096" crc="a3fd737d" sha1="d418d9322c69c49106ed2c268ad0864c0f2c4c1b" offset="0" /> + <rom name="toolbox.rom" size="4096" crc="3d8d5c18" sha1="b80736c7a63152d89e66b9848e197b54f698aedc" offset="0" /> </dataarea> </part> </software> - <software name="toolkit"> + <software name="toolkit" cloneof="toolbox"> <description>Programmer's Toolkit</description> - <year>198?</year> - <publisher><unknown></publisher> + <year>1981</year> + <publisher>Program Power</publisher> + <info name="usage" value="Type LINK #AF00" /> <part name="cart" interface="atom_cart"> <dataarea name="rom" size="4096"> <rom name="toolkit.rom" size="4096" crc="9661561c" sha1="faa0394232caf7626499c9bc57c6af36017fe852" offset="0" /> </dataarea> </part> </software> + + <software name="psdebug"> + <description>Psion Debug</description> + <year>198?</year> + <publisher>Psion</publisher> + <info name="usage" value="Type DEBUG" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="psion_debug.rom" size="4096" crc="1a317711" sha1="a3dd1a5f25470006e0c76694796cf01b0f01ec64" offset="0"/> + </dataarea> + </part> + </software> + + <software name="psedit"> + <description>Psion Edit</description> + <year>198?</year> + <publisher>Psion</publisher> + <info name="usage" value="Type EDIT" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="psion_edit" size="4096" crc="4a80d67a" sha1="9c0bc1d41c88d88b601627de92026903d3d6a154" offset="0"/> + </dataarea> + </part> + </software> + + <software name="rossutil"> + <description>Ross Utility</description> + <year>198?</year> + <publisher>Ross Software</publisher> + <info name="usage" value="Type LINK 44992" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="ross_utility.rom" size="4096" crc="4e284c5e" sha1="9d6dd5d4bce4ea2c0d65131b56d666fecf590492" offset="0"/> + </dataarea> + </part> + </software> + + <software name="rxbox"> + <description>RX Box</description> + <year>198?</year> + <publisher>BiboSoft</publisher> + <info name="usage" value="Type RXBOX" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="rxbox.rom" size="4096" crc="109d879b" sha1="6a52769860933798492490a31fc82fd3865e3386" offset="0"/> + </dataarea> + </part> + </software> + + <software name="salfaa"> + <description>Salfaa 2.6</description> + <year>198?</year> + <publisher><homebrew></publisher> + <info name="usage" value="Type SALFAA" /> + <info name="author" value="B.Poot/J.Jobse" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="salfaa26.rom" size="4096" crc="48bfffaa" sha1="e267ef008eeb15ee598d5d81ae7d218b50f2ec20" offset="0" /> + </dataarea> + </part> + </software> + + <software name="salfaac20" cloneof="salfaa"> + <description>Salfaa C2.0</description> + <year>198?</year> + <publisher><homebrew></publisher> + <info name="usage" value="Type SALFAA" /> + <info name="author" value="B.Poot/J.Jobse" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="salfaac20.rom" size="4096" crc="45876648" sha1="b0419d0bc57e07c154230ce5ed0b441dc5f0d113" offset="0" /> + </dataarea> + </part> + </software> + + <software name="sdrom3"> + <description>SDDOS v3.2</description> + <year>2011</year> + <publisher><homebrew></publisher> + <info name="usage" value="Type SDDOS" /> + <info name="author" value="Kees van Oss" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="sdrom3.rom" size="4096" crc="1a9c9dd1" sha1="1a722878d00433f541ae26b95db325dd80de579a" offset="0" /> + </dataarea> + </part> + </software> + + <software name="superbas"> + <description>SuperBasic</description> + <year>1983</year> + <publisher>Program Power</publisher> + <info name="usage" value="Type LINK #AF00" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="superbasic.rom" size="4096" crc="d5392f92" sha1="2815eef95f4471a3674745abbb5547b6cf16d4ad" offset="0"/> + </dataarea> + </part> + </software> + + <software name="werom"> + <description>WE-ROM</description> + <year>1983</year> + <publisher>Watford Electronics</publisher> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="werom.rom" size="4096" crc="dfcb3bf8" sha1="85a19146844da2d6f03e1cde37ee17429eedeb0d" offset="0" /> + </dataarea> + </part> + </software> + + <software name="willow"> + <description>Willow Utility</description> + <year>1981</year> + <publisher>Willow Software</publisher> + <info name="usage" value="Type LINK #A000" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="willow_utility.rom" size="4096" crc="5f058699" sha1="4bfdd06f6298218d359f494c029d7099c50c1a8f" offset="0"/> + </dataarea> + </part> + </software> + + <software name="wordpack"> + <description>Word Pack</description> + <year>198?</year> + <publisher>Acornsoft</publisher> + <info name="usage" value="Type EDIT" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="wordpack.rom" size="4096" crc="a2c49c46" sha1="892aaae1ba349410e1ca20adbdddad1d999953a4" offset="0"/> + </dataarea> + </part> + </software> + + <software name="wordpack64" cloneof="wordpack"> + <description>Word Pack - ED64</description> + <year>198?</year> + <publisher>Acornsoft</publisher> + <info name="usage" value="Type ED64" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="wordpack64.rom" size="4096" crc="54e828dd" sha1="65b373800c5d816192e72cc9a817215840f83ed4" offset="0"/> + </dataarea> + </part> + </software> + + <software name="wordpack80" cloneof="wordpack"> + <description>Word Pack - ED80</description> + <year>198?</year> + <publisher>Acornsoft</publisher> + <info name="usage" value="Requires 80 column VDU board" /> + <part name="cart" interface="atom_cart"> + <dataarea name="rom" size="4096"> + <rom name="wordpack80.rom" size="4096" crc="0716607a" sha1="d85814c5aedadd4ca4fa8312483ce62eb4de9d5e" offset="0"/> + </dataarea> + </part> + </software> + </softwarelist> diff --git a/hash/gamate.xml b/hash/gamate.xml index d255116b78a..883590dc124 100644 --- a/hash/gamate.xml +++ b/hash/gamate.xml @@ -616,6 +616,18 @@ C1066 - ?? </part> </software> + <software name="hothero" supported="no"> + <description>Hot Hero</description> + <year>199?</year> + <publisher>Unknown</publisher> + <info name="serial" value="C1065" /> + <part name="cart" interface="gamate_cart"> + <dataarea name="rom" size="524288"> + <rom name="c1-065.bin" size="524288" crc="1ed9d0a3" sha1="568f87864c0ed6117fe34e3f79e56c01e911e482" offset="0" /> + </dataarea> + </part> + </software> + <software name="robinhoo" supported="no"> <description>Robin Hood</description> <year>1994</year> diff --git a/hash/vz_cass.xml b/hash/vz_cass.xml index 9274980f6b2..80f0a55878c 100644 --- a/hash/vz_cass.xml +++ b/hash/vz_cass.xml @@ -153,7 +153,7 @@ Demonstration Tape (included with the VZ300) <software name="hamsam"> <description>Hamburger Sam</description> <year>????</year> - <publisher></publisher> + <publisher><unknown></publisher> <part name="cass1" interface="vtech1_cass"> <dataarea name="cass" size="5109472"> <rom name="hamsam.wav" size="5109472" crc="7aed86a7" sha1="b5061edb1401cea4aee97d8cd92c582c9c14e66b" offset="0" /> @@ -201,7 +201,7 @@ Demonstration Tape (included with the VZ300) <software name="missile"> <description>Missile</description> <year>????</year> - <publisher></publisher> + <publisher><unknown></publisher> <part name="cass1" interface="vtech1_cass"> <dataarea name="cass" size="5109776"> <rom name="missile.wav" size="5109776" crc="55a1fda4" sha1="1de495534447cee16d3db22b043d53b6d15f05fe" offset="0" /> diff --git a/plugins/hiscore/hiscore.dat b/plugins/hiscore/hiscore.dat index f1cc8a6757f..83e6c5ef6b5 100644 --- a/plugins/hiscore/hiscore.dat +++ b/plugins/hiscore/hiscore.dat @@ -40,6 +40,7 @@ ;@s:1943.cpp 1943: +1943mii: 1943u: @:maincpu,program,e600,60,00,00 @:maincpu,program,e110,8,00,00 @@ -209,6 +210,7 @@ invasionrza: searthin: searthina: sicv: +sicv1: sinvemag: sinvzen: sisv: @@ -2923,13 +2925,16 @@ sf2v004: strider: striderj: striderua: +strideruc: @:maincpu,program,ff89aa,78,ff,20 @:maincpu,program,ff0ca4,04,00,00 ;varthr1:******varth - operation thunderstorm (world 920612) varth: +varthb: varthj: +varthjr: varthr1: varthu: @:maincpu,program,fff9ea,50,00,01 @@ -4373,6 +4378,13 @@ discoboyp: @:maincpu,program,f800,80,00,2e +;@s:divebomb.cpp + +divebomb: +@:fgcpu,program,e0fa,4c,00,53 +@:fgcpu,program,e040,4,00,00 + + ;@s:diverboy.cpp ;********(diver boy) @@ -4789,6 +4801,13 @@ theglob3: @:maincpu,program,7ab7,1,80,80 +;beastf:******beastie feastie +beastf: +@:maincpu,program,4c46,3c,4d,00 +@:maincpu,program,4c8a,1,01,01 +@:maincpu,program,4cb0,1,15,15 + + ;@s:eprom.cpp ;guts:******Guts n' Glory (prototype) @@ -5581,6 +5600,21 @@ galaxiac: ;@s:galaxian.cpp +anteatergg: +@:maincpu,program,40ef,3c,00,20 + + +pacmanblb: +@:maincpu,program,4688,3,00,00 +@:maincpu,program,5180,1,40,40 +@:maincpu,program,51a0,1,40,40 +@:maincpu,program,51c0,1,40,40 +@:maincpu,program,51e0,1,40,40 +@:maincpu,program,5200,1,40,40 +@:maincpu,program,5220,1,40,40 +@:maincpu,program,466f,1,03,03 + + ;spctbird:******space thunderbird spctbird: @:maincpu,program,8042,54,00,24 @@ -5964,6 +5998,7 @@ galaxbsf2: galaxian: galaxiana: galaxianbl: +galaxianbl2: galaxiani: galaxianm: galaxianmo: @@ -6189,6 +6224,7 @@ ninjemak: dangar: dangara: dangarb: +dangarj: @:maincpu,program,e209,82,00,20 @:maincpu,program,e394,3,00,00 @@ -6769,6 +6805,10 @@ junofrstg: ;@s:kaneko16.cpp +wingforc: +@:maincpu,program,30d7e7,13f,00,35 + + ;(Blaze On) (by tamphax) blazeon: @:maincpu,program,304fb0,77,00,0d @@ -6944,6 +6984,13 @@ kncljoea: @:maincpu,program,f01a,2d,00,43 +;@s:konamigq.cpp + +;******Crypt Killer (konamigq.c) (by GreatStone) +cryptklr: +@:maincpu,program,237dc0,50,40,00 + + ;@s:konamigx.cpp ;*******lethal enforcers II - gun fighters (ver eaa) @@ -7314,6 +7361,10 @@ lsasquad: ;@s:lwings.cpp +fball: +@:maincpu,program,d840,69,00,48 + + lwings: lwings2: lwingsb: @@ -8152,6 +8203,7 @@ kazan: ;edfu:******E.D.F. : Earth Defense Force (North America) edf: +edfa: edfbl: edfu: @:maincpu,program,64c17,107,01,00 @@ -8265,6 +8317,12 @@ metlclsh: @:maincpu,program,800a,3,30,05 +;@s:metlfrzr.cpp + +metlfrzr: +@:maincpu,program,d822,a0,00,37 + + ;@s:metro.cpp ;(mouja (japan)) @@ -8418,6 +8476,7 @@ knightb: kicknrun: kicknrunu: mexico86: +mexico86a: @:maincpu,program,ee18,2d,17,49 @@ -8859,6 +8918,7 @@ mtlchampu1: ;metamrphj:******Metamorphic Force (ver jaa) ;metamrphu:******Metamorphic Force (ver uaa) metamrph: +metamrpha: metamrphj: metamrphu: @:maincpu,program,203240,35,00,5a @@ -10295,13 +10355,6 @@ theglobp: @:maincpu,program,4cb9,1,15,15 -;beastf:******beastie feastie -beastf: -@:maincpu,program,4c46,3c,4d,00 -@:maincpu,program,4c8a,1,01,01 -@:maincpu,program,4cb0,1,15,15 - - ;(lizard wizard) (by GeoMan) lizwiz: @:maincpu,program,4daf,3c,4d,01 @@ -10611,7 +10664,9 @@ genix: ;pirates (by GeoMan) - 10th score not saved, driver pirates: -@:maincpu,program,10a544,80,4e,00 +piratesb: +@:maincpu,program,10a544,76,4e,10 +@:maincpu,program,10a5b0,1,4e,4e ;@s:pitnrun.cpp @@ -11480,6 +11535,8 @@ mrkougb2: 800fath: bomber: knockout: +knockoutb: +knockoutc: mariner: scramb2: scramblb: @@ -11932,24 +11989,6 @@ sonicbom: @:maincpu,program,ffc100,9e,20,20 -;altbeastj3:******altered beast (japan, fd1094 317-0068) -;altbeast4:******altered beast (set 4, mc-8123b 317-0066) -;altbeast5:******altered beast (set 5, 8751 317-0076) -;altbeastj:******altered beast (set 6, japan, 8751 317-0077) -;altbeastj1:******altered beast (set 1, japan, fd1094 317-0065) -altbeast: -altbeast2: -altbeast4: -altbeast5: -altbeast6: -altbeastbl: -altbeastj: -altbeastj1: -altbeastj3: -@:maincpu,program,fffc00,74,00,33 -@:maincpu,program,fff010,4,00,00 - - ;******dunk shot (fd1089 317-0022) dunkshot: dunkshota: @@ -11990,6 +12029,11 @@ defense: sdi: sdib: sdibl: +sdibl2: +sdibl3: +sdibl4: +sdibl5: +sdibl6: @:maincpu,program,fff800,320,00,20 @:maincpu,program,fffb88,4,00,00 @:maincpu,program,fffbca,3,4b,5a @@ -13083,6 +13127,11 @@ ikarinc: @:maincpu,program,fc5f,3,00,00 +ikariram: +@:maincpu,program,ff0b,50,00,4f +@:maincpu,program,fc5f,3,00,00 + + ;******Alpha Mission alphamis: @:maincpu,program,d83b,82,00,20 @@ -14159,6 +14208,25 @@ wboyu: ;@s:system16.cpp +;altbeastj3:******altered beast (japan, fd1094 317-0068) +;altbeast4:******altered beast (set 4, mc-8123b 317-0066) +;altbeast5:******altered beast (set 5, 8751 317-0076) +;altbeastj:******altered beast (set 6, japan, 8751 317-0077) +;altbeastj1:******altered beast (set 1, japan, fd1094 317-0065) +altbeast: +altbeast2: +altbeast4: +altbeast5: +altbeast6: +altbeastbl: +altbeastj: +altbeastj1: +altbeastj3: +mutantwarr: +@:maincpu,program,fffc00,74,00,33 +@:maincpu,program,fff010,4,00,00 + + tetrisbl: @:maincpu,program,ffe800,64,45,08 @@ -15012,6 +15080,20 @@ tankbust: @:maincpu,program,f602,50,00,10 +;@s:taotaido.cpp + +taotaido3: +@:maincpu,program,fe91d4,4e,01,02 + + +taotaidoa: +@:maincpu,program,fe9340,4e,01,02 + + +taotaido: +@:maincpu,program,fe91e4,4e,14,02 + + ;@s:tbowl.cpp ;*******tecmo bowl (world? & japan) @@ -15409,6 +15491,10 @@ tmntua: @:maincpu,program,63500,f3,03,41 +tmht24pe: +@:maincpu,program,107600,f3,03,41 + + blswhstl: blswhstla: detatwin: @@ -15599,6 +15685,12 @@ outzoneh: @:maincpu,program,240372,a,00,00 +outzonecv: +@:maincpu,program,801de,18,00,00 +@:maincpu,program,80503,4f,3f,3f +@:maincpu,program,80372,a,00,00 + + ;*note* top score does not display vimana: vimanaj: @@ -16039,6 +16131,8 @@ tunhuntc: turbo: turboa: turbob: +turbobl: +turbod: @:maincpu,program,e400,1e,94,94 @:maincpu,program,f310,1e,00,00 @:maincpu,program,f292,d,0f,f0 diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index f84cebf43ac..e3c29933220 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -722,6 +722,7 @@ end "-Wno-uninitialized", "-Wno-unused-function", "-Wno-unused-but-set-variable", + "-Wno-format-extra-args", -- temp for mingw 6.1 till update bgfx code } configuration { "rpi" } buildoptions { diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index f5283748490..fa5f6dabd15 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -1662,8 +1662,8 @@ if (BUSES["RS232"]~=null) then MAME_DIR .. "src/devices/bus/rs232/pty.h", MAME_DIR .. "src/devices/bus/rs232/ser_mouse.cpp", MAME_DIR .. "src/devices/bus/rs232/ser_mouse.h", - MAME_DIR .. "src/devices/bus/rs232/sparckbd.cpp", - MAME_DIR .. "src/devices/bus/rs232/sparckbd.h", + MAME_DIR .. "src/devices/bus/rs232/sun_kbd.cpp", + MAME_DIR .. "src/devices/bus/rs232/sun_kbd.h", MAME_DIR .. "src/devices/bus/rs232/terminal.cpp", MAME_DIR .. "src/devices/bus/rs232/terminal.h", MAME_DIR .. "src/devices/bus/rs232/xvd701.cpp", @@ -2577,6 +2577,20 @@ end --------------------------------------------------- -- +--@src/devices/bus/sunkbd/sunkbd.h,BUSES["SUNKBD"] = true +--------------------------------------------------- + +if (BUSES["SUNKBD"]~=null) then + files { + MAME_DIR .. "src/devices/bus/sunkbd/hlekbd.cpp", + MAME_DIR .. "src/devices/bus/sunkbd/hlekbd.h", + MAME_DIR .. "src/devices/bus/sunkbd/sunkbd.cpp", + MAME_DIR .. "src/devices/bus/sunkbd/sunkbd.h", + } +end + +--------------------------------------------------- +-- --@src/devices/bus/ql/exp.h,BUSES["QL"] = true --------------------------------------------------- diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua index ef9263c6485..a9dfe0ecd70 100644 --- a/scripts/src/cpu.lua +++ b/scripts/src/cpu.lua @@ -13,7 +13,7 @@ -- Dynamic recompiler objects -------------------------------------------------- -if (CPUS["SH2"]~=null or CPUS["MIPS"]~=null or CPUS["POWERPC"]~=null or CPUS["RSP"]~=null or CPUS["ARM7"]~=null) then +if (CPUS["SH2"]~=null or CPUS["MIPS"]~=null or CPUS["POWERPC"]~=null or CPUS["RSP"]~=null or CPUS["ARM7"]~=null or CPUS["ADSP21062"]~=null) then files { MAME_DIR .. "src/devices/cpu/drcbec.cpp", MAME_DIR .. "src/devices/cpu/drcbec.h", diff --git a/scripts/src/emu.lua b/scripts/src/emu.lua index a446a6ccaae..1f96f3b4e22 100644 --- a/scripts/src/emu.lua +++ b/scripts/src/emu.lua @@ -118,8 +118,6 @@ files { MAME_DIR .. "src/emu/emupal.h", MAME_DIR .. "src/emu/fileio.cpp", MAME_DIR .. "src/emu/fileio.h", - MAME_DIR .. "src/emu/hash.cpp", - MAME_DIR .. "src/emu/hash.h", MAME_DIR .. "src/emu/image.cpp", MAME_DIR .. "src/emu/image.h", MAME_DIR .. "src/emu/input.cpp", diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index 00bc51897d8..7353c87c1d9 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -56,6 +56,8 @@ project "utils" MAME_DIR .. "src/lib/util/flac.h", MAME_DIR .. "src/lib/util/harddisk.cpp", MAME_DIR .. "src/lib/util/harddisk.h", + MAME_DIR .. "src/lib/util/hash.cpp", + MAME_DIR .. "src/lib/util/hash.h", MAME_DIR .. "src/lib/util/hashing.cpp", MAME_DIR .. "src/lib/util/hashing.h", MAME_DIR .. "src/lib/util/huffman.cpp", diff --git a/scripts/src/machine.lua b/scripts/src/machine.lua index a4e3a9032cc..45753bf8bde 100644 --- a/scripts/src/machine.lua +++ b/scripts/src/machine.lua @@ -2914,3 +2914,14 @@ if (MACHINES["SCNXX562"]~=null) then MAME_DIR .. "src/devices/machine/scnxx562.h", } end + +--------------------------------------------------- +-- +--@src/devices/machine/input_merger.h,MACHINES["INPUT_MERGER"] = true +--------------------------------------------------- +if (MACHINES["INPUT_MERGER"]~=null) then + files { + MAME_DIR .. "src/devices/machine/input_merger.cpp", + MAME_DIR .. "src/devices/machine/input_merger.h", + } +end diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index c664b935524..27a224055b2 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -572,6 +572,7 @@ MACHINES["PCI9050"] = true MACHINES["GENPC"] = true MACHINES["GEN_LATCH"] = true MACHINES["WATCHDOG"] = true +MACHINES["INPUT_MERGER"] = true -------------------------------------------------- -- specify available bus cores @@ -647,6 +648,7 @@ BUSES["SMS_CTRL"] = true BUSES["SMS_EXP"] = true --BUSES["SNES"] = true --BUSES["SPC1000"] = true +BUSES["SUNKBD"] = true --BUSES["TI99PEB"] = true --BUSES["TVC"] = true --BUSES["VBOY"] = true diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 41b1659dca1..202cde39c35 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -586,6 +586,7 @@ MACHINES["APPLE_FDC"] = true MACHINES["SONY_DRIVE"] = true MACHINES["SCNXX562"] = true MACHINES["FGA002"] = true +MACHINES["INPUT_MERGER"] = true -------------------------------------------------- -- specify available bus cores @@ -677,6 +678,7 @@ BUSES["SMS_EXP"] = true BUSES["SNES"] = true BUSES["SNES_CTRL"] = true BUSES["SPC1000"] = true +BUSES["SUNKBD"] = true BUSES["SVI_EXPANDER"] = true BUSES["SVI_SLOT"] = true BUSES["TI99PEB"] = true @@ -3096,6 +3098,7 @@ files { MAME_DIR .. "src/mame/drivers/dim68k.cpp", MAME_DIR .. "src/mame/drivers/dm7000.cpp", MAME_DIR .. "src/mame/includes/dm7000.h", + MAME_DIR .. "src/mame/drivers/dmax8000.cpp", MAME_DIR .. "src/mame/drivers/dmv.cpp", MAME_DIR .. "src/mame/machine/dmv_keyb.cpp", MAME_DIR .. "src/mame/machine/dmv_keyb.h", diff --git a/src/devices/bus/a7800/a78_slot.cpp b/src/devices/bus/a7800/a78_slot.cpp index 825c0a6f5fd..c5170169ce4 100644 --- a/src/devices/bus/a7800/a78_slot.cpp +++ b/src/devices/bus/a7800/a78_slot.cpp @@ -22,7 +22,7 @@ even if not all carts use all of them (in particular no cart type seems to use access to the ranges $0500 to $0fff and $2800 to $2fff) - + ***********************************************************************************************************/ @@ -473,7 +473,7 @@ bool a78_cart_slot_device::call_load() } -void a78_partialhash(hash_collection &dest, const unsigned char *data, +void a78_partialhash(util::hash_collection &dest, const unsigned char *data, unsigned long length, const char *functions) { if (length <= 128) @@ -495,16 +495,6 @@ void a78_cart_slot_device::call_unload() /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool a78_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - -/*------------------------------------------------- verify_header - check the image (from fullpath) has an admissible header -------------------------------------------------*/ diff --git a/src/devices/bus/a7800/a78_slot.h b/src/devices/bus/a7800/a78_slot.h index b230c0913ba..88a758b8ce2 100644 --- a/src/devices/bus/a7800/a78_slot.h +++ b/src/devices/bus/a7800/a78_slot.h @@ -75,7 +75,7 @@ protected: }; -void a78_partialhash(hash_collection &dest, const unsigned char *data, unsigned long length, const char *functions); +void a78_partialhash(util::hash_collection &dest, const unsigned char *data, unsigned long length, const char *functions); // ======================> a78_cart_slot_device @@ -96,7 +96,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_cart_type() { return m_type; }; bool has_cart() { return m_cart != nullptr; } diff --git a/src/devices/bus/a800/a800_slot.cpp b/src/devices/bus/a800/a800_slot.cpp index a3e464df1f1..0e01bac62c8 100644 --- a/src/devices/bus/a800/a800_slot.cpp +++ b/src/devices/bus/a800/a800_slot.cpp @@ -304,16 +304,6 @@ void a800_cart_slot_device::call_unload() } /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool a800_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - -/*------------------------------------------------- identify_cart_type - code to detect cart type from fullpath -------------------------------------------------*/ diff --git a/src/devices/bus/a800/a800_slot.h b/src/devices/bus/a800/a800_slot.h index c55ff587311..4cf1ea52ebc 100644 --- a/src/devices/bus/a800/a800_slot.h +++ b/src/devices/bus/a800/a800_slot.h @@ -96,7 +96,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_cart_type() { return m_type; }; int identify_cart_type(UINT8 *header); diff --git a/src/devices/bus/adam/exp.cpp b/src/devices/bus/adam/exp.cpp index 3c43a400ff0..2035df0ef9b 100644 --- a/src/devices/bus/adam/exp.cpp +++ b/src/devices/bus/adam/exp.cpp @@ -109,18 +109,6 @@ bool adam_expansion_slot_device::call_load() //------------------------------------------------- -// call_softlist_load - -//------------------------------------------------- - -bool adam_expansion_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - - return true; -} - - -//------------------------------------------------- // get_default_card_software - //------------------------------------------------- diff --git a/src/devices/bus/adam/exp.h b/src/devices/bus/adam/exp.h index 270b96bfd44..28a1702dcf9 100644 --- a/src/devices/bus/adam/exp.h +++ b/src/devices/bus/adam/exp.h @@ -73,7 +73,7 @@ protected: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } diff --git a/src/devices/bus/apf/slot.cpp b/src/devices/bus/apf/slot.cpp index af872826ce3..4051ea5ce81 100644 --- a/src/devices/bus/apf/slot.cpp +++ b/src/devices/bus/apf/slot.cpp @@ -207,17 +207,6 @@ bool apf_cart_slot_device::call_load() /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool apf_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - - -/*------------------------------------------------- get default card software -------------------------------------------------*/ diff --git a/src/devices/bus/apf/slot.h b/src/devices/bus/apf/slot.h index cbfe11fb28c..823bc488904 100644 --- a/src/devices/bus/apf/slot.h +++ b/src/devices/bus/apf/slot.h @@ -67,7 +67,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override {} - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } diff --git a/src/devices/bus/arcadia/slot.cpp b/src/devices/bus/arcadia/slot.cpp index 3a6aee846ab..51dd9b1f870 100644 --- a/src/devices/bus/arcadia/slot.cpp +++ b/src/devices/bus/arcadia/slot.cpp @@ -215,18 +215,6 @@ bool arcadia_cart_slot_device::call_load() /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool arcadia_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - - - -/*------------------------------------------------- get default card software -------------------------------------------------*/ diff --git a/src/devices/bus/arcadia/slot.h b/src/devices/bus/arcadia/slot.h index 2fa5f0419be..af39afa9645 100644 --- a/src/devices/bus/arcadia/slot.h +++ b/src/devices/bus/arcadia/slot.h @@ -58,7 +58,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override {} - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } diff --git a/src/devices/bus/astrocde/slot.cpp b/src/devices/bus/astrocde/slot.cpp index 2cab9c3c285..cf4069603a4 100644 --- a/src/devices/bus/astrocde/slot.cpp +++ b/src/devices/bus/astrocde/slot.cpp @@ -184,17 +184,6 @@ bool astrocade_cart_slot_device::call_load() /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool astrocade_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - - -/*------------------------------------------------- get default card software -------------------------------------------------*/ diff --git a/src/devices/bus/astrocde/slot.h b/src/devices/bus/astrocde/slot.h index 7590c2acab6..3a9edfa2814 100644 --- a/src/devices/bus/astrocde/slot.h +++ b/src/devices/bus/astrocde/slot.h @@ -58,7 +58,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override {} - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } diff --git a/src/devices/bus/c64/exp.cpp b/src/devices/bus/c64/exp.cpp index 31263c5f927..ca0ed342343 100644 --- a/src/devices/bus/c64/exp.cpp +++ b/src/devices/bus/c64/exp.cpp @@ -202,18 +202,6 @@ bool c64_expansion_slot_device::call_load() //------------------------------------------------- -// call_softlist_load - -//------------------------------------------------- - -bool c64_expansion_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - - return true; -} - - -//------------------------------------------------- // get_default_card_software - //------------------------------------------------- diff --git a/src/devices/bus/c64/exp.h b/src/devices/bus/c64/exp.h index 0d8a6037d82..38bf3e7c3fc 100644 --- a/src/devices/bus/c64/exp.h +++ b/src/devices/bus/c64/exp.h @@ -135,7 +135,7 @@ protected: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } diff --git a/src/devices/bus/cbm2/exp.cpp b/src/devices/bus/cbm2/exp.cpp index fd4993760c3..dfba98a37db 100644 --- a/src/devices/bus/cbm2/exp.cpp +++ b/src/devices/bus/cbm2/exp.cpp @@ -140,18 +140,6 @@ bool cbm2_expansion_slot_device::call_load() //------------------------------------------------- -// call_softlist_load - -//------------------------------------------------- - -bool cbm2_expansion_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - - return true; -} - - -//------------------------------------------------- // get_default_card_software - //------------------------------------------------- diff --git a/src/devices/bus/cbm2/exp.h b/src/devices/bus/cbm2/exp.h index c1fd7b589ee..f38e7c669af 100644 --- a/src/devices/bus/cbm2/exp.h +++ b/src/devices/bus/cbm2/exp.h @@ -82,7 +82,7 @@ protected: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } diff --git a/src/devices/bus/chanf/slot.cpp b/src/devices/bus/chanf/slot.cpp index ea5b00b5348..cfe08b17896 100644 --- a/src/devices/bus/chanf/slot.cpp +++ b/src/devices/bus/chanf/slot.cpp @@ -202,18 +202,6 @@ bool channelf_cart_slot_device::call_load() /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool channelf_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - - - -/*------------------------------------------------- get default card software -------------------------------------------------*/ diff --git a/src/devices/bus/chanf/slot.h b/src/devices/bus/chanf/slot.h index e5ad8ab06bc..8b781c88632 100644 --- a/src/devices/bus/chanf/slot.h +++ b/src/devices/bus/chanf/slot.h @@ -70,7 +70,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override {} - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } diff --git a/src/devices/bus/coco/cococart.cpp b/src/devices/bus/coco/cococart.cpp index 3e6b2ee2c6f..904233550a5 100644 --- a/src/devices/bus/coco/cococart.cpp +++ b/src/devices/bus/coco/cococart.cpp @@ -348,18 +348,6 @@ bool cococart_slot_device::call_load() //------------------------------------------------- -// call_softlist_load -//------------------------------------------------- - -bool cococart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); - return TRUE; -} - - - -//------------------------------------------------- // get_default_card_software //------------------------------------------------- diff --git a/src/devices/bus/coco/cococart.h b/src/devices/bus/coco/cococart.h index 1c0d3137caa..c76a0febc56 100644 --- a/src/devices/bus/coco/cococart.h +++ b/src/devices/bus/coco/cococart.h @@ -88,7 +88,7 @@ public: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } diff --git a/src/devices/bus/coleco/exp.cpp b/src/devices/bus/coleco/exp.cpp index 2b2093f2b1d..80bd84f6e10 100644 --- a/src/devices/bus/coleco/exp.cpp +++ b/src/devices/bus/coleco/exp.cpp @@ -97,18 +97,6 @@ bool colecovision_cartridge_slot_device::call_load() //------------------------------------------------- -// call_softlist_load - -//------------------------------------------------- - -bool colecovision_cartridge_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - - return true; -} - - -//------------------------------------------------- // get_default_card_software - //------------------------------------------------- diff --git a/src/devices/bus/coleco/exp.h b/src/devices/bus/coleco/exp.h index 3d8091c215b..596eea0bf66 100644 --- a/src/devices/bus/coleco/exp.h +++ b/src/devices/bus/coleco/exp.h @@ -79,7 +79,7 @@ protected: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } diff --git a/src/devices/bus/crvision/slot.cpp b/src/devices/bus/crvision/slot.cpp index 22af6ced64c..e4fd9630e46 100644 --- a/src/devices/bus/crvision/slot.cpp +++ b/src/devices/bus/crvision/slot.cpp @@ -215,17 +215,6 @@ bool crvision_cart_slot_device::call_load() /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool crvision_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - - -/*------------------------------------------------- get default card software -------------------------------------------------*/ diff --git a/src/devices/bus/crvision/slot.h b/src/devices/bus/crvision/slot.h index 83819e6535b..43f74dd4181 100644 --- a/src/devices/bus/crvision/slot.h +++ b/src/devices/bus/crvision/slot.h @@ -63,7 +63,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override {} - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } diff --git a/src/devices/bus/econet/e01.cpp b/src/devices/bus/econet/e01.cpp index 0263b529e29..ab6e95fd6a7 100644 --- a/src/devices/bus/econet/e01.cpp +++ b/src/devices/bus/econet/e01.cpp @@ -127,6 +127,18 @@ const rom_entry *e01_device::device_rom_region() const //------------------------------------------------- +// MC146818_INTERFACE( rtc_intf ) +//------------------------------------------------- + +WRITE_LINE_MEMBER(e01_device::rtc_irq_w) +{ + m_rtc_irq = state; + + update_interrupts(); +} + + +//------------------------------------------------- // mc6854_interface adlc_intf //------------------------------------------------- @@ -142,6 +154,13 @@ WRITE_LINE_MEMBER( e01_device::econet_data_w ) m_econet->data_w(this, state); } +WRITE_LINE_MEMBER(e01_device::via_irq_w) +{ + m_via_irq = state; + + update_interrupts(); +} + WRITE_LINE_MEMBER( e01_device::clk_en_w ) { m_clk_en = state; @@ -225,12 +244,12 @@ static MACHINE_CONFIG_FRAGMENT( e01 ) MCFG_CPU_PROGRAM_MAP(e01_mem) MCFG_MC146818_ADD(HD146818_TAG, XTAL_32_768kHz) - MCFG_MC146818_IRQ_HANDLER(INPUTLINE(R65C102_TAG, M6502_IRQ_LINE)) + MCFG_MC146818_IRQ_HANDLER(WRITELINE(e01_device, rtc_irq_w)) // devices - MCFG_DEVICE_ADD(R6522_TAG, VIA6522, XTAL_8MHz/4) + MCFG_DEVICE_ADD(R6522_TAG, VIA6522, XTAL_8MHz / 4) MCFG_VIA6522_WRITEPA_HANDLER(DEVWRITE8("cent_data_out", output_latch_device, write)) - MCFG_VIA6522_IRQ_HANDLER(INPUTLINE(R65C102_TAG, M6502_IRQ_LINE)) + MCFG_VIA6522_IRQ_HANDLER(WRITELINE(e01_device, via_irq_w)) MCFG_DEVICE_ADD(MC6854_TAG, MC6854, 0) MCFG_MC6854_OUT_IRQ_CB(WRITELINE(e01_device, adlc_irq_w)) @@ -317,7 +336,7 @@ ioport_constructor e01_device::device_input_ports() const inline void e01_device::update_interrupts() { - int irq = (m_hdc_ie & m_hdc_irq) ? ASSERT_LINE : CLEAR_LINE; + int irq = (m_via_irq || (m_hdc_ie & m_hdc_irq) || m_rtc_irq) ? ASSERT_LINE : CLEAR_LINE; int nmi = (m_fdc_irq || m_fdc_drq || (m_adlc_ie & m_adlc_irq)) ? ASSERT_LINE : CLEAR_LINE; m_maincpu->set_input_line(M6502_IRQ_LINE, irq); @@ -376,6 +395,8 @@ e01_device::e01_device(const machine_config &mconfig, const char *tag, device_t m_centronics(*this, CENTRONICS_TAG), m_adlc_ie(0), m_hdc_ie(0), + m_rtc_irq(CLEAR_LINE), + m_via_irq(CLEAR_LINE), m_hdc_irq(CLEAR_LINE), m_fdc_irq(CLEAR_LINE), m_fdc_drq(CLEAR_LINE), @@ -404,6 +425,8 @@ e01_device::e01_device(const machine_config &mconfig, device_type type, const ch m_centronics(*this, CENTRONICS_TAG), m_adlc_ie(0), m_hdc_ie(0), + m_rtc_irq(CLEAR_LINE), + m_via_irq(CLEAR_LINE), m_hdc_irq(CLEAR_LINE), m_fdc_irq(CLEAR_LINE), m_fdc_drq(CLEAR_LINE), @@ -425,6 +448,8 @@ void e01_device::device_start() // register for state saving save_item(NAME(m_adlc_ie)); save_item(NAME(m_hdc_ie)); + save_item(NAME(m_rtc_irq)); + save_item(NAME(m_via_irq)); save_item(NAME(m_hdc_irq)); save_item(NAME(m_fdc_drq)); save_item(NAME(m_adlc_irq)); diff --git a/src/devices/bus/econet/e01.h b/src/devices/bus/econet/e01.h index 9a2adba8ce2..02a432c936d 100644 --- a/src/devices/bus/econet/e01.h +++ b/src/devices/bus/econet/e01.h @@ -56,8 +56,10 @@ public: DECLARE_WRITE8_MEMBER( rtc_address_w ); DECLARE_READ8_MEMBER( rtc_data_r ); DECLARE_WRITE8_MEMBER( rtc_data_w ); + DECLARE_WRITE_LINE_MEMBER( rtc_irq_w ); DECLARE_WRITE_LINE_MEMBER( adlc_irq_w ); DECLARE_WRITE_LINE_MEMBER( econet_data_w ); + DECLARE_WRITE_LINE_MEMBER( via_irq_w ); DECLARE_WRITE_LINE_MEMBER( clk_en_w ); DECLARE_WRITE_LINE_MEMBER( fdc_irq_w ); DECLARE_WRITE_LINE_MEMBER( fdc_drq_w ); @@ -100,6 +102,8 @@ protected: // interrupt state int m_adlc_ie; int m_hdc_ie; + int m_rtc_irq; + int m_via_irq; int m_hdc_irq; int m_fdc_irq; bool m_fdc_drq; diff --git a/src/devices/bus/gameboy/gb_slot.cpp b/src/devices/bus/gameboy/gb_slot.cpp index 0cc3832aa14..f65677b022e 100644 --- a/src/devices/bus/gameboy/gb_slot.cpp +++ b/src/devices/bus/gameboy/gb_slot.cpp @@ -451,16 +451,6 @@ void base_gb_cart_slot_device::setup_ram(UINT8 banks) -/*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool base_gb_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return true; -} - // This fails to catch Mani 4-in-1 carts... even when they match this, then they have MBC1/3 in the internal header instead of MMM01... bool base_gb_cart_slot_device::get_mmm01_candidate(UINT8 *ROM, UINT32 len) { diff --git a/src/devices/bus/gameboy/gb_slot.h b/src/devices/bus/gameboy/gb_slot.h index 49fefc591ea..d32e065672f 100644 --- a/src/devices/bus/gameboy/gb_slot.h +++ b/src/devices/bus/gameboy/gb_slot.h @@ -118,7 +118,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } int get_cart_type(UINT8 *ROM, UINT32 len); diff --git a/src/devices/bus/gba/gba_slot.cpp b/src/devices/bus/gba/gba_slot.cpp index 01c0194f67e..d5d15c1f86b 100644 --- a/src/devices/bus/gba/gba_slot.cpp +++ b/src/devices/bus/gba/gba_slot.cpp @@ -255,18 +255,6 @@ void gba_cart_slot_device::call_unload() /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool gba_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - - - -/*------------------------------------------------- get_cart_type - code to detect NVRAM type from fullpath -------------------------------------------------*/ diff --git a/src/devices/bus/gba/gba_slot.h b/src/devices/bus/gba/gba_slot.h index d9972f1813d..ddf2cb7ea2f 100644 --- a/src/devices/bus/gba/gba_slot.h +++ b/src/devices/bus/gba/gba_slot.h @@ -87,7 +87,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } int get_cart_type(UINT8 *ROM, UINT32 len); diff --git a/src/devices/bus/generic/slot.cpp b/src/devices/bus/generic/slot.cpp index 0002520ce04..3a0ee3b1476 100644 --- a/src/devices/bus/generic/slot.cpp +++ b/src/devices/bus/generic/slot.cpp @@ -165,18 +165,6 @@ void generic_slot_device::call_unload() /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool generic_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - - - -/*------------------------------------------------- get default card software -------------------------------------------------*/ diff --git a/src/devices/bus/generic/slot.h b/src/devices/bus/generic/slot.h index 3d6d2042b59..7f76ccbe301 100644 --- a/src/devices/bus/generic/slot.h +++ b/src/devices/bus/generic/slot.h @@ -114,7 +114,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } UINT32 common_get_size(const char *region); void common_load_rom(UINT8 *ROM, UINT32 len, const char *region); diff --git a/src/devices/bus/hp_optroms/hp_optrom.cpp b/src/devices/bus/hp_optroms/hp_optrom.cpp index ec2425c058c..2ff68288910 100644 --- a/src/devices/bus/hp_optroms/hp_optrom.cpp +++ b/src/devices/bus/hp_optroms/hp_optrom.cpp @@ -126,13 +126,6 @@ void hp_optrom_slot_device::call_unload() } } -bool hp_optrom_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - logerror("hp_optrom: call_softlist_load\n"); - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - std::string hp_optrom_slot_device::get_default_card_software() { return software_get_default_slot("rom"); diff --git a/src/devices/bus/hp_optroms/hp_optrom.h b/src/devices/bus/hp_optroms/hp_optrom.h index 3669b68ab06..980ca93ff4c 100644 --- a/src/devices/bus/hp_optroms/hp_optrom.h +++ b/src/devices/bus/hp_optroms/hp_optrom.h @@ -43,7 +43,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } virtual bool is_readable() const override { return true; } diff --git a/src/devices/bus/intv/slot.cpp b/src/devices/bus/intv/slot.cpp index 3716333cbf8..8344f60c0b7 100644 --- a/src/devices/bus/intv/slot.cpp +++ b/src/devices/bus/intv/slot.cpp @@ -445,17 +445,6 @@ bool intv_cart_slot_device::call_load() /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool intv_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - - -/*------------------------------------------------- get default card software -------------------------------------------------*/ diff --git a/src/devices/bus/intv/slot.h b/src/devices/bus/intv/slot.h index 0c1670f071c..5f22dff3eea 100644 --- a/src/devices/bus/intv/slot.h +++ b/src/devices/bus/intv/slot.h @@ -102,7 +102,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override {} - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } int load_fullpath(); diff --git a/src/devices/bus/iq151/iq151.cpp b/src/devices/bus/iq151/iq151.cpp index 16839150b5a..838e4d46e92 100644 --- a/src/devices/bus/iq151/iq151.cpp +++ b/src/devices/bus/iq151/iq151.cpp @@ -190,16 +190,6 @@ bool iq151cart_slot_device::call_load() } /*------------------------------------------------- - call softlist load --------------------------------------------------*/ - -bool iq151cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); - return TRUE; -} - -/*------------------------------------------------- get default card software -------------------------------------------------*/ diff --git a/src/devices/bus/iq151/iq151.h b/src/devices/bus/iq151/iq151.h index c0d72529870..03ffbad0321 100644 --- a/src/devices/bus/iq151/iq151.h +++ b/src/devices/bus/iq151/iq151.h @@ -93,7 +93,7 @@ public: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } virtual bool is_readable() const override { return 1; } diff --git a/src/devices/bus/isa/sc499.h b/src/devices/bus/isa/sc499.h index d868612f2a6..e94c8c3dc39 100644 --- a/src/devices/bus/isa/sc499.h +++ b/src/devices/bus/isa/sc499.h @@ -30,7 +30,7 @@ public: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override { return load_software(swlist, swname, start_entry); } + virtual const software_list_loader &get_software_list_loader() const override { return image_software_list_loader::instance(); } virtual void call_unload() override; virtual iodevice_t image_type() const override { return IO_MAGTAPE; } diff --git a/src/devices/bus/kc/kc.cpp b/src/devices/bus/kc/kc.cpp index 05afba8ed7a..6be7e9432df 100644 --- a/src/devices/bus/kc/kc.cpp +++ b/src/devices/bus/kc/kc.cpp @@ -356,16 +356,6 @@ bool kccart_slot_device::call_load() } /*------------------------------------------------- - call softlist load --------------------------------------------------*/ - -bool kccart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); - return TRUE; -} - -/*------------------------------------------------- get default card software -------------------------------------------------*/ diff --git a/src/devices/bus/kc/kc.h b/src/devices/bus/kc/kc.h index bc8160ebce6..1b4345f800a 100644 --- a/src/devices/bus/kc/kc.h +++ b/src/devices/bus/kc/kc.h @@ -91,7 +91,7 @@ public: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } virtual bool is_readable() const override { return 1; } diff --git a/src/devices/bus/m5/slot.cpp b/src/devices/bus/m5/slot.cpp index fdeba61463e..b554a0e448e 100644 --- a/src/devices/bus/m5/slot.cpp +++ b/src/devices/bus/m5/slot.cpp @@ -204,17 +204,6 @@ bool m5_cart_slot_device::call_load() /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool m5_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - - -/*------------------------------------------------- get default card software -------------------------------------------------*/ diff --git a/src/devices/bus/m5/slot.h b/src/devices/bus/m5/slot.h index c35384a0267..66b52db3eb9 100644 --- a/src/devices/bus/m5/slot.h +++ b/src/devices/bus/m5/slot.h @@ -70,7 +70,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override {} - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } diff --git a/src/devices/bus/megadrive/md_slot.cpp b/src/devices/bus/megadrive/md_slot.cpp index 55d80f8b64d..2bcd3da9d9d 100644 --- a/src/devices/bus/megadrive/md_slot.cpp +++ b/src/devices/bus/megadrive/md_slot.cpp @@ -683,16 +683,6 @@ void base_md_cart_slot_device::setup_nvram() -/*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool base_md_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - int base_md_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) { int type = SEGA_STD; diff --git a/src/devices/bus/megadrive/md_slot.h b/src/devices/bus/megadrive/md_slot.h index 09ae5a84111..fccec9586d7 100644 --- a/src/devices/bus/megadrive/md_slot.h +++ b/src/devices/bus/megadrive/md_slot.h @@ -153,7 +153,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } virtual bool is_readable() const override { return 1; } diff --git a/src/devices/bus/msx_slot/cartridge.cpp b/src/devices/bus/msx_slot/cartridge.cpp index ae806337359..17301489f3c 100644 --- a/src/devices/bus/msx_slot/cartridge.cpp +++ b/src/devices/bus/msx_slot/cartridge.cpp @@ -198,13 +198,6 @@ void msx_slot_cartridge_device::call_unload() } -bool msx_slot_cartridge_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return true; -} - - WRITE_LINE_MEMBER(msx_slot_cartridge_device::irq_out) { m_irq_handler(state); diff --git a/src/devices/bus/msx_slot/cartridge.h b/src/devices/bus/msx_slot/cartridge.h index e9519a90d48..33acf0f9f9d 100644 --- a/src/devices/bus/msx_slot/cartridge.h +++ b/src/devices/bus/msx_slot/cartridge.h @@ -43,7 +43,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } virtual bool is_readable() const override { return true; } virtual bool is_writeable() const override { return false; } diff --git a/src/devices/bus/neogeo/slot.cpp b/src/devices/bus/neogeo/slot.cpp index af2f151ee8d..84a34bc3b30 100644 --- a/src/devices/bus/neogeo/slot.cpp +++ b/src/devices/bus/neogeo/slot.cpp @@ -331,17 +331,6 @@ void neogeo_cart_slot_device::call_unload() } /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool neogeo_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); - return TRUE; -} - - -/*------------------------------------------------- get default card software -------------------------------------------------*/ diff --git a/src/devices/bus/neogeo/slot.h b/src/devices/bus/neogeo/slot.h index 2a47752c79d..1e681ac4684 100644 --- a/src/devices/bus/neogeo/slot.h +++ b/src/devices/bus/neogeo/slot.h @@ -195,7 +195,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } virtual bool is_readable() const override { return 1; } diff --git a/src/devices/bus/nes/aladdin.cpp b/src/devices/bus/nes/aladdin.cpp index bded198c5a7..0e30eaeb8ec 100644 --- a/src/devices/bus/nes/aladdin.cpp +++ b/src/devices/bus/nes/aladdin.cpp @@ -136,12 +136,6 @@ bool nes_aladdin_slot_device::call_load() } -bool nes_aladdin_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); - return TRUE; -} - std::string nes_aladdin_slot_device::get_default_card_software() { if (open_image_file(mconfig().options())) diff --git a/src/devices/bus/nes/aladdin.h b/src/devices/bus/nes/aladdin.h index 1f7800242ea..d00f473c655 100644 --- a/src/devices/bus/nes/aladdin.h +++ b/src/devices/bus/nes/aladdin.h @@ -52,7 +52,7 @@ public: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } virtual bool is_readable() const override { return 1; } diff --git a/src/devices/bus/nes/datach.cpp b/src/devices/bus/nes/datach.cpp index cdb41e16830..0ea144782d3 100644 --- a/src/devices/bus/nes/datach.cpp +++ b/src/devices/bus/nes/datach.cpp @@ -137,12 +137,6 @@ bool nes_datach_slot_device::call_load() } -bool nes_datach_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); - return TRUE; -} - std::string nes_datach_slot_device::get_default_card_software() { // any way to detect the game with X24C01? diff --git a/src/devices/bus/nes/datach.h b/src/devices/bus/nes/datach.h index e5d137357c2..44d2040d99a 100644 --- a/src/devices/bus/nes/datach.h +++ b/src/devices/bus/nes/datach.h @@ -54,7 +54,7 @@ public: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } virtual bool is_readable() const override { return 1; } diff --git a/src/devices/bus/nes/karastudio.cpp b/src/devices/bus/nes/karastudio.cpp index d9d0e26a2cf..e321033d700 100644 --- a/src/devices/bus/nes/karastudio.cpp +++ b/src/devices/bus/nes/karastudio.cpp @@ -126,12 +126,6 @@ bool nes_kstudio_slot_device::call_load() } -bool nes_kstudio_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); - return TRUE; -} - std::string nes_kstudio_slot_device::get_default_card_software() { return software_get_default_slot("ks_exp"); diff --git a/src/devices/bus/nes/karastudio.h b/src/devices/bus/nes/karastudio.h index 3aeb96c118a..e7bc33f38d2 100644 --- a/src/devices/bus/nes/karastudio.h +++ b/src/devices/bus/nes/karastudio.h @@ -51,7 +51,7 @@ public: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } virtual bool is_readable() const override { return 1; } diff --git a/src/devices/bus/nes/nes_slot.cpp b/src/devices/bus/nes/nes_slot.cpp index 1bcf8d6de6e..17fe28a1acb 100644 --- a/src/devices/bus/nes/nes_slot.cpp +++ b/src/devices/bus/nes/nes_slot.cpp @@ -899,16 +899,6 @@ void nes_cart_slot_device::call_unload() /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool nes_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - -/*------------------------------------------------- get default card software -------------------------------------------------*/ @@ -1044,7 +1034,7 @@ WRITE8_MEMBER(nes_cart_slot_device::write_ex) // device_image_partialhash_func //------------------------------------------------- -void nes_partialhash(hash_collection &dest, const unsigned char *data, +void nes_partialhash(util::hash_collection &dest, const unsigned char *data, unsigned long length, const char *functions) { if (length <= 16) diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index 3d843381d85..0171499f9d6 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -326,7 +326,7 @@ protected: std::vector<UINT16> m_prg_bank_map; }; -void nes_partialhash(hash_collection &dest, const unsigned char *data, unsigned long length, const char *functions); +void nes_partialhash(util::hash_collection &dest, const unsigned char *data, unsigned long length, const char *functions); // ======================> nes_cart_slot_device @@ -346,7 +346,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } void call_load_ines(); void call_load_unif(); diff --git a/src/devices/bus/nes/sunsoft_dcs.cpp b/src/devices/bus/nes/sunsoft_dcs.cpp index 25d1a1db623..356483a2c8b 100644 --- a/src/devices/bus/nes/sunsoft_dcs.cpp +++ b/src/devices/bus/nes/sunsoft_dcs.cpp @@ -105,12 +105,6 @@ bool nes_ntb_slot_device::call_load() } -bool nes_ntb_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); - return TRUE; -} - std::string nes_ntb_slot_device::get_default_card_software() { return software_get_default_slot("ntbrom"); diff --git a/src/devices/bus/nes/sunsoft_dcs.h b/src/devices/bus/nes/sunsoft_dcs.h index 94d89736cac..5734c9321d5 100644 --- a/src/devices/bus/nes/sunsoft_dcs.h +++ b/src/devices/bus/nes/sunsoft_dcs.h @@ -48,7 +48,7 @@ public: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } virtual bool is_readable() const override { return 1; } diff --git a/src/devices/bus/odyssey2/slot.cpp b/src/devices/bus/odyssey2/slot.cpp index 3d0f8714288..a8d61aa815a 100644 --- a/src/devices/bus/odyssey2/slot.cpp +++ b/src/devices/bus/odyssey2/slot.cpp @@ -195,17 +195,6 @@ bool o2_cart_slot_device::call_load() /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool o2_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - - -/*------------------------------------------------- get default card software -------------------------------------------------*/ diff --git a/src/devices/bus/odyssey2/slot.h b/src/devices/bus/odyssey2/slot.h index 9fb3594ce2a..169841f4d2d 100644 --- a/src/devices/bus/odyssey2/slot.h +++ b/src/devices/bus/odyssey2/slot.h @@ -69,7 +69,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override {} - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } diff --git a/src/devices/bus/pce/pce_slot.cpp b/src/devices/bus/pce/pce_slot.cpp index 6a1e5859f1f..202d5275360 100644 --- a/src/devices/bus/pce/pce_slot.cpp +++ b/src/devices/bus/pce/pce_slot.cpp @@ -295,18 +295,6 @@ void pce_cart_slot_device::call_unload() /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool pce_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - - - -/*------------------------------------------------- get_cart_type - code to detect NVRAM type from fullpath -------------------------------------------------*/ diff --git a/src/devices/bus/pce/pce_slot.h b/src/devices/bus/pce/pce_slot.h index 4838230d769..d0d0637b2e4 100644 --- a/src/devices/bus/pce/pce_slot.h +++ b/src/devices/bus/pce/pce_slot.h @@ -68,7 +68,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } int get_cart_type(UINT8 *ROM, UINT32 len); diff --git a/src/devices/bus/plus4/exp.cpp b/src/devices/bus/plus4/exp.cpp index 47f404cacf4..8a37a0fe448 100644 --- a/src/devices/bus/plus4/exp.cpp +++ b/src/devices/bus/plus4/exp.cpp @@ -142,18 +142,6 @@ bool plus4_expansion_slot_device::call_load() //------------------------------------------------- -// call_softlist_load - -//------------------------------------------------- - -bool plus4_expansion_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - - return true; -} - - -//------------------------------------------------- // get_default_card_software - //------------------------------------------------- diff --git a/src/devices/bus/plus4/exp.h b/src/devices/bus/plus4/exp.h index 84be90e4764..dbbdaba6e2a 100644 --- a/src/devices/bus/plus4/exp.h +++ b/src/devices/bus/plus4/exp.h @@ -121,7 +121,7 @@ protected: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } diff --git a/src/devices/bus/ql/rom.cpp b/src/devices/bus/ql/rom.cpp index bd17b2cb1b8..88e65e8b861 100644 --- a/src/devices/bus/ql/rom.cpp +++ b/src/devices/bus/ql/rom.cpp @@ -99,18 +99,6 @@ bool ql_rom_cartridge_slot_t::call_load() //------------------------------------------------- -// call_softlist_load - -//------------------------------------------------- - -bool ql_rom_cartridge_slot_t::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - - return true; -} - - -//------------------------------------------------- // get_default_card_software - //------------------------------------------------- diff --git a/src/devices/bus/ql/rom.h b/src/devices/bus/ql/rom.h index 244f3b02f1a..a80dc8bcfa5 100644 --- a/src/devices/bus/ql/rom.h +++ b/src/devices/bus/ql/rom.h @@ -96,7 +96,7 @@ protected: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } diff --git a/src/devices/bus/rs232/rs232.cpp b/src/devices/bus/rs232/rs232.cpp index 407df36207d..82712343439 100644 --- a/src/devices/bus/rs232/rs232.cpp +++ b/src/devices/bus/rs232/rs232.cpp @@ -112,8 +112,9 @@ device_rs232_port_interface::~device_rs232_port_interface() #include "loopback.h" #include "null_modem.h" #include "printer.h" -#include "terminal.h" #include "pty.h" +#include "sun_kbd.h" +#include "terminal.h" SLOT_INTERFACE_START( default_rs232_devices ) SLOT_INTERFACE("keyboard", SERIAL_KEYBOARD) @@ -122,4 +123,5 @@ SLOT_INTERFACE_START( default_rs232_devices ) SLOT_INTERFACE("printer", SERIAL_PRINTER) SLOT_INTERFACE("terminal", SERIAL_TERMINAL) SLOT_INTERFACE("pty", PSEUDO_TERMINAL) + SLOT_INTERFACE("sunkbd", SUN_KBD_ADAPTOR) SLOT_INTERFACE_END diff --git a/src/devices/bus/rs232/sparckbd.cpp b/src/devices/bus/rs232/sparckbd.cpp deleted file mode 100644 index 3df48ba3d61..00000000000 --- a/src/devices/bus/rs232/sparckbd.cpp +++ /dev/null @@ -1,590 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Vas Crabb -#include "sparckbd.h" - -#include <numeric> - - -/* - TODO: implement keyclick - TODO: determine default keyclick state on real keyboard - TODO: use 1,200 Baud properly once we work out what's going on with the SCC - - HLE SPARC serial keyboard compatible with Sun Type 4/5/6 - - messages from host to keyboard: - 0000 0001 reset (keyboard responds with self test pass/fail) - 0000 0010 bell on (480us period) - 0000 0011 bell off - 0000 1010 enable keyclick (5us duration 480us period on make) - 0000 1011 disable keyclick - 0000 1110 ---- lscn LED (1 = on, l = caps lock, s = scroll lock, c = compose, n = num lock) - 0000 1111 layout request (keyboard responds with layout response) - - message from keyboad to host: - 0xxx xxxx key make - 1xxx xxxx key break - 0111 1111 all keys up - 1111 1110 00dd dddd layout response (DIP switches 3 to 8 from MSB to LSB) - 1111 1111 0000 0100 reset response (self test pass, always followed by all keys up or key make) - 0111 1110 0000 0001 self test fal - - - Type 5 US PC layout: - - 76 1d 05 06 08 0a 0c 0e 10 11 12 07 09 0b 16 17 15 2d 02 04 30 - - 01 03 2a 1e 1f 20 21 22 23 24 25 26 27 28 29 2b 2c 34 60 62 2e 2f 47 - 19 1a 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 58 42 4a 7b 44 45 46 - 31 33 77 4d 4e 4f 50 51 52 53 54 55 56 57 59 5b 5c 5d 7d - 48 49 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 14 70 71 72 - 5f 61 4c 78 13 79 0d 43 7a 18 1b 1c 5e 32 5a - - Type 5 US UNIX layout: - - 76 xx 05 06 08 0a 0c 0e 10 11 12 07 09 0b 16 17 15 2d 02 04 30 - - 01 03 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 58 2a 2c 34 60 62 2e 2f 47 - 19 1a 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 2b 42 4a 7b 44 45 46 - 31 33 4c 4d 4e 4f 50 51 52 53 54 55 56 57 59 5b 5c 5d 7d - 48 49 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 14 70 71 72 - 5f 61 77 78 13 79 0d 43 7a 18 1b 1c 5e 32 5a - - xx is a blank key - 6f is assigned to linefeed, which is present on Type 4 keyboards, but absent on Type 5 -*/ - -namespace { -INPUT_PORTS_START( sparc_keyboard ) - PORT_START("DIP") - PORT_DIPNAME( 0x3f, 0x21, "Layout" ) PORT_DIPLOCATION("DIP:!8,!7,!6,!5,!4,!3") - PORT_DIPSETTING( 0x00, "U.S.A. (US4.kt)" ) - PORT_DIPSETTING( 0x01, "U.S.A. (US4.kt)" ) - PORT_DIPSETTING( 0x02, "Belgium (FranceBelg4.kt)" ) - PORT_DIPSETTING( 0x03, "Canada (Canada4.kt)" ) - PORT_DIPSETTING( 0x04, "Denmark (Denmakr4.kt)" ) - PORT_DIPSETTING( 0x05, "Germany (Germany4.kt)" ) - PORT_DIPSETTING( 0x06, "Italy (Italy4.kt)" ) - PORT_DIPSETTING( 0x07, "The Netherlands (Netherland4.kt)" ) - PORT_DIPSETTING( 0x08, "Norway (Norway4.kt)" ) - PORT_DIPSETTING( 0x09, "Portugal (Portugal4.kt)" ) - PORT_DIPSETTING( 0x0a, "Latin America/Spanish (SpainLatAm4.kt)" ) - PORT_DIPSETTING( 0x0b, "Sweden (SwedenFin4.kt)" ) - PORT_DIPSETTING( 0x0c, "Switzerland/French (Switzer_Fr4.kt)" ) - PORT_DIPSETTING( 0x0d, "Switzerland/German (Switzer_Ge4.kt)" ) - PORT_DIPSETTING( 0x0e, "Great Britain (UK4.kt)" ) - // 0x0f - PORT_DIPSETTING( 0x10, "Korea (Korea4.kt)" ) - PORT_DIPSETTING( 0x11, "Taiwan (Taiwan4.kt)" ) - // 0x12...0x20 - PORT_DIPSETTING( 0x21, "U.S.A. (US5.kt)" ) - PORT_DIPSETTING( 0x22, "U.S.A./UNIX (US_UNIX5.kt)" ) - PORT_DIPSETTING( 0x23, "France (France5.kt)" ) - PORT_DIPSETTING( 0x24, "Denmark (Denmark5.kt)" ) - PORT_DIPSETTING( 0x25, "Germany (Germany5.kt)" ) - PORT_DIPSETTING( 0x26, "Italy (Italy5.kt)" ) - PORT_DIPSETTING( 0x27, "The Netherlands (Netherland5.kt)" ) - PORT_DIPSETTING( 0x28, "Norway (Norway5.kt)" ) - PORT_DIPSETTING( 0x29, "Portugal (Portugal5.kt)" ) - PORT_DIPSETTING( 0x2a, "Spain (Spain5.kt)" ) - PORT_DIPSETTING( 0x2b, "Sweden (Sweden5.kt)" ) - PORT_DIPSETTING( 0x2c, "Switzerland/French (Switzer_Fr5.kt)" ) - PORT_DIPSETTING( 0x2d, "Switzerland/German (Switzer_Ge5.kt)" ) - PORT_DIPSETTING( 0x2e, "Great Britain (UK5.kt)" ) - PORT_DIPSETTING( 0x2f, "Korea (Korea5.kt)" ) - PORT_DIPSETTING( 0x30, "Taiwan (Taiwan5.kt)" ) - PORT_DIPSETTING( 0x31, "Japan (Japan5.kt)" ) - PORT_DIPSETTING( 0x32, "Canada/French (Canada_Fr5.kt)" ) - PORT_DIPSETTING( 0x33, "Hungary (Hungary5.kt)" ) - PORT_DIPSETTING( 0x34, "Poland (Poland5.kt)" ) - PORT_DIPSETTING( 0x35, "Czech (Czech5.kt)" ) - PORT_DIPSETTING( 0x36, "Russia (Russia5.kt)" ) - PORT_DIPSETTING( 0x37, "Latvia (Latvia5.kt)" ) - PORT_DIPSETTING( 0x38, "Turkey-Q5 (TurkeyQ5.kt)" ) - PORT_DIPSETTING( 0x39, "Greece (Greece5.kt)" ) - PORT_DIPSETTING( 0x3a, "Arabic (Arabic5.kt)" ) - PORT_DIPSETTING( 0x3b, "Lithuania (Lithuania5.kt)" ) - PORT_DIPSETTING( 0x3c, "Belgium (Belgium5.kt)" ) - // 0x3d - PORT_DIPSETTING( 0x3e, "Turkey-F5 (TurkeyF5.kt)" ) - PORT_DIPSETTING( 0x3f, "Canada/French (Canada_Fr5_TBITS5.kt)" ) - PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "DIP:!2" ) - PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "DIP:!1" ) - - PORT_START("ROW0") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Stop") - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Vol-") - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Again") - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Vol+") - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F1") PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F2") PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2)) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F10") PORT_CODE(KEYCODE_F10) PORT_CHAR(UCHAR_MAMEKEY(F10)) - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F3") PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3)) - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F11") PORT_CODE(KEYCODE_F11) PORT_CHAR(UCHAR_MAMEKEY(F11)) - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F4") PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4)) - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F12") PORT_CODE(KEYCODE_F12) PORT_CHAR(UCHAR_MAMEKEY(F12)) - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F5") PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5)) - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Alt Graph") PORT_CODE(KEYCODE_RALT) PORT_CHAR(UCHAR_MAMEKEY(RALT)) - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F6") PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6)) - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("ROW1") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F7") PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7)) - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F8") PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8)) - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F9") PORT_CODE(KEYCODE_F9) PORT_CHAR(UCHAR_MAMEKEY(F9)) - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Alt") PORT_CODE(KEYCODE_LALT) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Up") PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Pause") PORT_CODE(KEYCODE_PAUSE) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Print Screen") PORT_CODE(KEYCODE_PRTSCR) PORT_CHAR(UCHAR_MAMEKEY(PRTSCR)) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Scroll Lock") PORT_CODE(KEYCODE_SCRLOCK) PORT_CHAR(UCHAR_MAMEKEY(SCRLOCK)) - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Left") PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Props") - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Undo") - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Down") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Right") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') - - PORT_START("ROW2") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR('~') - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Backspace") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Insert") PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Mute") - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP /") PORT_CODE(KEYCODE_SLASH_PAD) - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP *") PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR(UCHAR_MAMEKEY(ASTERISK)) - - PORT_START("ROW3") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Pwr") - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Front") - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP .") PORT_CODE(KEYCODE_DEL_PAD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD)) - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Copy") - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Home") PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) PORT_CHAR(9) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') - - PORT_START("ROW4") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Del") PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL)) - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Compose") PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL)) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP 7") PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD)) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP 8") PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD)) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP 9") PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP -") PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD)) - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Open") - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Paste") - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("End") PORT_CODE(KEYCODE_END) PORT_CHAR(UCHAR_MAMEKEY(END)) - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Control") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') - - PORT_START("ROW5") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('"') - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Enter") PORT_CODE(KEYCODE_ENTER_PAD) - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP 4") PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP 5") PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP 6") PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP 0") PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Find") - - PORT_START("ROW6") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Page Up") PORT_CODE(KEYCODE_PGUP) PORT_CHAR(UCHAR_MAMEKEY(PGUP)) - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Cut") - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Num Lock") PORT_CODE(KEYCODE_NUMLOCK) PORT_CHAR(UCHAR_MAMEKEY(NUMLOCK)) - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("L Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_MAMEKEY(LSHIFT)) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('c') PORT_CHAR('C') - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('v') PORT_CHAR('V') - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('b') PORT_CHAR('B') - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('n') PORT_CHAR('N') - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('m') PORT_CHAR('M') - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("R Shift") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_MAMEKEY(RSHIFT)) - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Line Feed") PORT_CHAR(10) - - PORT_START("ROW7") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP 1") PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP 2") PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP 3") PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Help") - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) - PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("L Meta") PORT_CODE(KEYCODE_LWIN) PORT_CHAR(UCHAR_MAMEKEY(LWIN)) - PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') - PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("R Meta") PORT_CODE(KEYCODE_RWIN) PORT_CHAR(UCHAR_MAMEKEY(RWIN)) - PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Page Down") PORT_CODE(KEYCODE_PGDN) PORT_CHAR(UCHAR_MAMEKEY(PGDN)) - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP +") PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD)) - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED ) -INPUT_PORTS_END - - -MACHINE_CONFIG_FRAGMENT(sparc_keyboard) - MCFG_SPEAKER_STANDARD_MONO("bell") - MCFG_SOUND_ADD("beeper", BEEP, ATTOSECONDS_TO_HZ(480 * ATTOSECONDS_PER_MICROSECOND)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bell", 1.0) -MACHINE_CONFIG_END - -} // anonymous namespace - - -device_type const SPARC_KEYBOARD = &device_creator<sparc_keyboard_device>; - - -sparc_keyboard_device::sparc_keyboard_device( - machine_config const &mconfig, - char const *tag, - device_t *owner, - UINT32 clock) - : sparc_keyboard_device(mconfig, - SPARC_KEYBOARD, - "SPARC Keyboard", - tag, - owner, - clock, - "sparc_keyboard", - __FILE__) -{ -} - - -sparc_keyboard_device::sparc_keyboard_device( - machine_config const &mconfig, - device_type type, - char const *name, - char const *tag, - device_t *owner, - UINT32 clock, - char const *shortname, - char const *source) - : device_t(mconfig, type, name, tag, owner, clock, shortname, source) - , device_serial_interface(mconfig, *this) - , device_rs232_port_interface(mconfig, *this) - , m_scan_timer(nullptr) - , m_tx_delay_timer(nullptr) - , m_dips(*this, "DIP") - , m_key_inputs{ - { *this, "ROW0" }, { *this, "ROW1" }, - { *this, "ROW2" }, { *this, "ROW3" }, - { *this, "ROW4" }, { *this, "ROW5" }, - { *this, "ROW6" }, { *this, "ROW7" } } - , m_beeper(*this, "beeper") - , m_current_keys{ 0, 0, 0, 0, 0, 0, 0, 0 } - , m_next_row(0) - , m_fifo{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } - , m_head(0) - , m_tail(0) - , m_empty(0) - , m_rx_state(RX_IDLE) - , m_beeper_state(0) -{ -} - - -machine_config_constructor sparc_keyboard_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME(sparc_keyboard); -} - - -ioport_constructor sparc_keyboard_device::device_input_ports() const -{ - return INPUT_PORTS_NAME(sparc_keyboard); -} - -WRITE_LINE_MEMBER( sparc_keyboard_device::input_txd ) -{ - device_serial_interface::rx_w(state); -} - -void sparc_keyboard_device::device_start() -{ - device_serial_interface::register_save_state(machine().save(), this); - - m_scan_timer = timer_alloc(SCAN_TIMER_ID); - m_tx_delay_timer = timer_alloc(TX_DELAY_TIMER_ID); - - save_item(NAME(m_current_keys)); - save_item(NAME(m_next_row)); - save_item(NAME(m_fifo)); - save_item(NAME(m_head)); - save_item(NAME(m_tail)); - save_item(NAME(m_empty)); - save_item(NAME(m_rx_state)); - save_item(NAME(m_beeper_state)); -} - - -void sparc_keyboard_device::device_reset() -{ - // initialise state - std::fill(std::begin(m_current_keys), std::end(m_current_keys), 0x0000U); - m_next_row = 0; - std::fill(std::begin(m_fifo), std::end(m_fifo), 0); - m_head = m_tail = 0; - m_empty = 1; - m_rx_state = RX_IDLE; - m_beeper_state = 0; - - // configure device_serial_interface - set_data_frame(1, 8, PARITY_NONE, STOP_BITS_1); - set_rate(1200); - receive_register_reset(); - transmit_register_reset(); - - // set device_rs232_port_interface lines - note that only RxD is physically present - output_rxd(1); - output_dcd(0); - output_dsr(0); - output_ri(0); - output_cts(0); - - // send reset response - send_byte(0xffU); - send_byte(0x04U); - UINT16 const acc( - std::accumulate( - std::begin(m_key_inputs), - std::end(m_key_inputs), - UINT16(0), - [] (UINT16 a, auto const &b) { return a | b->read(); })); - if (!acc) - send_byte(0x7fU); - - // kick the scan timer - m_scan_timer->adjust(attotime::from_hz(1'200), 0, attotime::from_hz(1'200)); - m_tx_delay_timer->reset(); -} - - -void sparc_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) -{ - switch (id) - { - case SCAN_TIMER_ID: - scan_row(); - break; - - case TX_DELAY_TIMER_ID: - assert(is_transmit_register_empty()); - assert(!m_empty || (m_head == m_tail)); - assert(m_head < ARRAY_LENGTH(m_fifo)); - assert(m_tail < ARRAY_LENGTH(m_fifo)); - - if (!m_empty) - { - printf("SPARC keyboard: send queued: %02x\n", m_fifo[m_head]); - fflush(stdout); - transmit_register_setup(m_fifo[m_head]); - m_head = (m_head + 1) & 0x0fU; - m_empty = (m_head == m_tail) ? 1 : 0; - } - break; - - default: - device_serial_interface::device_timer(timer, id, param, ptr); - } -} - - -void sparc_keyboard_device::tra_callback() -{ - output_rxd(transmit_register_get_data_bit()); -} - - -void sparc_keyboard_device::tra_complete() -{ - m_tx_delay_timer->reset(attotime::from_hz(1'200 / 10)); -} - - -void sparc_keyboard_device::rcv_complete() -{ - receive_register_extract(); - UINT8 const code(get_received_char()); - printf("SPARC keyboard: received byte: %02x\n", code); - fflush(stdout); - switch (m_rx_state) - { - case RX_LED: - printf("SPARC keyboard: LED data: %02x\n", code); - fflush(stdout); - machine().output().set_led_value(LED_NUM, BIT(code, 0)); - machine().output().set_led_value(LED_COMPOSE, BIT(code, 1)); - machine().output().set_led_value(LED_SCROLL, BIT(code, 2)); - machine().output().set_led_value(LED_CAPS, BIT(code, 3)); - m_rx_state = RX_IDLE; - break; - - default: - assert(m_rx_state == RX_IDLE); - case RX_IDLE: - switch (code) - { - // Reset - case 0x01U: - printf("SPARC keyboard: reset\n"); - fflush(stdout); - device_reset(); - break; - - // Bell on - case 0x02U: - printf("SPARC keyboard: bell on\n"); - fflush(stdout); - m_beeper_state |= UINT8(BEEPER_BELL); - m_beeper->set_state(m_beeper_state ? 1 : 0); - m_rx_state = RX_IDLE; - break; - - // Bell off - case 0x03U: - printf("SPARC keyboard: bell off\n"); - fflush(stdout); - m_beeper_state &= ~UINT8(BEEPER_BELL); - m_beeper->set_state(m_beeper_state ? 1 : 0); - m_rx_state = RX_IDLE; - break; - - // Click on - case 0x0aU: - printf("SPARC keyboard: keyclick on\n"); - fflush(stdout); - logerror("Keyclick on"); - m_rx_state = RX_IDLE; - break; - - // Click off - case 0x0bU: - printf("SPARC keyboard: keyclick off\n"); - fflush(stdout); - logerror("Keyclick off"); - m_rx_state = RX_IDLE; - break; - - // LED command - case 0x0eU: - printf("SPARC keyboard: LED command\n"); - fflush(stdout); - m_rx_state = RX_LED; - break; - - // Layout command - case 0x0fU: - printf("SPARC keyboard: layout command\n"); - fflush(stdout); - send_byte(UINT8(m_dips->read() & 0x3fU)); - m_rx_state = RX_IDLE; - break; - - default: - logerror("Unknown command: 0x%02x", code); - m_rx_state = RX_IDLE; - } - } -} - - -void sparc_keyboard_device::scan_row() -{ - assert(m_next_row < ARRAY_LENGTH(m_key_inputs)); - assert(m_next_row < ARRAY_LENGTH(m_current_keys)); - - UINT16 const row(m_key_inputs[m_next_row]->read()); - UINT16 ¤t(m_current_keys[m_next_row]); - bool keyup(false); - - for (UINT8 bit = 0; (bit < 16) && (m_empty || (m_head != m_tail)); ++bit) - { - UINT16 const mask(UINT16(1) << bit); - if ((row ^ current) & mask) - { - UINT8 const make_break((row & mask) ? 0x00U : 0x80U); - keyup = keyup || bool(make_break); - current = (current & ~mask) | (row & mask); - send_byte(make_break | (m_next_row << 4) | bit); - } - } - - if (keyup) - { - UINT16 const acc( - std::accumulate( - std::begin(m_current_keys), - std::end(m_current_keys), - UINT16(0), - [] (UINT16 a, UINT16 b) { return a | b; })); - if (!acc) - send_byte(0x7fU); - } - - m_next_row = (m_next_row + 1) & 0x07U; -} - - -void sparc_keyboard_device::send_byte(UINT8 code) -{ - assert(!m_empty || (m_head == m_tail)); - assert(m_head < ARRAY_LENGTH(m_fifo)); - assert(m_tail < ARRAY_LENGTH(m_fifo)); - - if (m_empty && is_transmit_register_empty() && (m_tx_delay_timer->remaining() == attotime::never)) - { - printf("SPARC keyboard: send immediately: %02x\n", code); - fflush(stdout); - transmit_register_setup(code); - } - else if (m_empty || (m_head != m_tail)) - { - printf("SPARC keyboard: queue to send: %02x\n", code); - fflush(stdout); - m_fifo[m_tail] = code; - m_tail = (m_tail + 1) & 0x0fU; - m_empty = 0; - } - else - { - printf("SPARC keyboard: lost to overrun: %02x\n", code); - fflush(stdout); - logerror("FIFO overrun (code = 0x%02x)", code); - } -} diff --git a/src/devices/bus/rs232/sparckbd.h b/src/devices/bus/rs232/sparckbd.h deleted file mode 100644 index a5444415e4f..00000000000 --- a/src/devices/bus/rs232/sparckbd.h +++ /dev/null @@ -1,82 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Vas Crabb -#ifndef MAME_DEVICES_RS232_SPARCKBD_H -#define MAME_DEVICES_RS232_SPARCKBD_H - -#pragma once - -#include "rs232.h" -#include "sound/beep.h" - - -class sparc_keyboard_device : public device_t, public device_serial_interface, public device_rs232_port_interface -{ -public: - sparc_keyboard_device(machine_config const &mconfig, char const *tag, device_t *owner, UINT32 clock); - sparc_keyboard_device(machine_config const &mconfig, device_type type, char const *name, char const *tag, device_t *owner, UINT32 clock, char const *shortname, char const *source); - - virtual machine_config_constructor device_mconfig_additions() const override; - virtual ioport_constructor device_input_ports() const override; - - virtual DECLARE_WRITE_LINE_MEMBER( input_txd ) override; - -protected: - // device overrides - virtual void device_start() override; - virtual void device_reset() override; - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - - // device_serial_interface overrides - virtual void tra_callback() override; - virtual void tra_complete() override; - virtual void rcv_complete() override; - -private: - // device_serial_interface uses 10'000 range - enum { - SCAN_TIMER_ID = 20'000, - TX_DELAY_TIMER_ID - }; - - // TODO: ensure these don't clash with diagnostic LEDs on host computer - enum : int { - LED_NUM = 0, - LED_COMPOSE, - LED_SCROLL, - LED_CAPS - }; - - enum : UINT8 { - BEEPER_BELL = 0x01U, - BEEPER_CLICK = 0x02U - }; - - enum : UINT8 { - RX_IDLE, - RX_LED - }; - - void scan_row(); - void send_byte(UINT8 code); - - emu_timer *m_scan_timer; - emu_timer *m_tx_delay_timer; - required_ioport m_dips; - required_ioport m_key_inputs[8]; - required_device<beep_device> m_beeper; - - UINT16 m_current_keys[8]; - UINT8 m_next_row; - - UINT8 m_fifo[16]; - UINT8 m_head, m_tail; - UINT8 m_empty; - - UINT8 m_rx_state; - - UINT8 m_beeper_state; -}; - -extern const device_type SPARC_KEYBOARD; - -#endif // MAME_DEVICES_RS232_SPARCKBD_H diff --git a/src/devices/bus/rs232/sun_kbd.cpp b/src/devices/bus/rs232/sun_kbd.cpp new file mode 100644 index 00000000000..c0fa833897c --- /dev/null +++ b/src/devices/bus/rs232/sun_kbd.cpp @@ -0,0 +1,55 @@ +#include "sun_kbd.h" + + +device_type const SUN_KBD_ADAPTOR = &device_creator<sun_keyboard_adaptor_device>; + + +namespace { +MACHINE_CONFIG_FRAGMENT(sun_keyboard_adaptor) + MCFG_SUNKBD_PORT_ADD("keyboard", default_sun_keyboard_devices, nullptr) + MCFG_SUNKBD_RXD_HANDLER(WRITELINE(sun_keyboard_adaptor_device, output_rxd)) +MACHINE_CONFIG_END +} // anonymous namespace + + +sun_keyboard_adaptor_device::sun_keyboard_adaptor_device( + machine_config const &mconfig, + char const *tag, + device_t *owner, + UINT32 clock) + : device_t(mconfig, SUN_KBD_ADAPTOR, "Sun Keyboard Adaptor", tag, owner, clock, "sunkbd_adaptor", __FILE__) + , device_rs232_port_interface(mconfig, *this) + , m_keyboard_port(*this, "keyboard") +{ +} + + +sun_keyboard_adaptor_device::~sun_keyboard_adaptor_device() +{ +} + + +machine_config_constructor sun_keyboard_adaptor_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME(sun_keyboard_adaptor); +} + + +WRITE_LINE_MEMBER( sun_keyboard_adaptor_device::input_txd ) +{ + m_keyboard_port->write_txd(state); +} + + +void sun_keyboard_adaptor_device::device_start() +{ +} + + +void sun_keyboard_adaptor_device::device_reset() +{ + output_rxd(1); + output_dcd(0); + output_dsr(0); + output_cts(0); +} diff --git a/src/devices/bus/rs232/sun_kbd.h b/src/devices/bus/rs232/sun_kbd.h new file mode 100644 index 00000000000..3033b33ce2f --- /dev/null +++ b/src/devices/bus/rs232/sun_kbd.h @@ -0,0 +1,33 @@ +// license:BSD-3-Clause +// copyright-holders:Vas Crabb +#ifndef MAME_DEVICES_RS232_SUN_KBD_H +#define MAME_DEVICES_RS232_SUN_KBD_H + +#pragma once + +#include "rs232.h" +#include "bus/sunkbd/sunkbd.h" + + +extern device_type const SUN_KBD_ADAPTOR; + + +class sun_keyboard_adaptor_device : public device_t, public device_rs232_port_interface +{ +public: + sun_keyboard_adaptor_device(machine_config const &mconfig, char const *tag, device_t *owner, UINT32 clock); + virtual ~sun_keyboard_adaptor_device() override; + + virtual machine_config_constructor device_mconfig_additions() const override; + + virtual DECLARE_WRITE_LINE_MEMBER( input_txd ) override; + +protected: + virtual void device_start() override; + virtual void device_reset() override; + +private: + required_device<sun_keyboard_port_device> m_keyboard_port; +}; + +#endif // MAME_DEVICES_RS232_SUN_KBD_H diff --git a/src/devices/bus/saturn/sat_slot.cpp b/src/devices/bus/saturn/sat_slot.cpp index dba415c8a47..6f28cf5cb10 100644 --- a/src/devices/bus/saturn/sat_slot.cpp +++ b/src/devices/bus/saturn/sat_slot.cpp @@ -205,17 +205,6 @@ void sat_cart_slot_device::call_unload() /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool sat_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - - -/*------------------------------------------------- get default card software -------------------------------------------------*/ diff --git a/src/devices/bus/saturn/sat_slot.h b/src/devices/bus/saturn/sat_slot.h index c373a0eb857..0048c525f85 100644 --- a/src/devices/bus/saturn/sat_slot.h +++ b/src/devices/bus/saturn/sat_slot.h @@ -74,7 +74,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_cart_type(); diff --git a/src/devices/bus/scv/slot.cpp b/src/devices/bus/scv/slot.cpp index daf31a27885..3cd28b259b7 100644 --- a/src/devices/bus/scv/slot.cpp +++ b/src/devices/bus/scv/slot.cpp @@ -211,18 +211,6 @@ bool scv_cart_slot_device::call_load() /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool scv_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - - - -/*------------------------------------------------- get_cart_type - code to detect NVRAM type from fullpath -------------------------------------------------*/ diff --git a/src/devices/bus/scv/slot.h b/src/devices/bus/scv/slot.h index 250048c49c4..b08707dae4a 100644 --- a/src/devices/bus/scv/slot.h +++ b/src/devices/bus/scv/slot.h @@ -70,7 +70,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override {} - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } int get_cart_type(UINT8 *ROM, UINT32 len); diff --git a/src/devices/bus/sega8/sega8_slot.cpp b/src/devices/bus/sega8/sega8_slot.cpp index a3ebf09c463..2d5905e240c 100644 --- a/src/devices/bus/sega8/sega8_slot.cpp +++ b/src/devices/bus/sega8/sega8_slot.cpp @@ -415,17 +415,6 @@ void sega8_cart_slot_device::call_unload() } -/*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool sega8_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - - #ifdef UNUSED_FUNCTION // For the moment we switch to a different detection routine which allows to detect // in a single run Codemasters mapper, Korean mapper (including Jang Pung 3 which diff --git a/src/devices/bus/sega8/sega8_slot.h b/src/devices/bus/sega8/sega8_slot.h index 270fb421f58..b136f68ea99 100644 --- a/src/devices/bus/sega8/sega8_slot.h +++ b/src/devices/bus/sega8/sega8_slot.h @@ -110,7 +110,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } int get_cart_type(UINT8 *ROM, UINT32 len); diff --git a/src/devices/bus/snes/snes_slot.cpp b/src/devices/bus/snes/snes_slot.cpp index 38260a06e84..9c62a87ec57 100644 --- a/src/devices/bus/snes/snes_slot.cpp +++ b/src/devices/bus/snes/snes_slot.cpp @@ -880,16 +880,6 @@ void base_sns_cart_slot_device::setup_nvram() -/*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool base_sns_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); - return TRUE; -} - void base_sns_cart_slot_device::get_cart_type_addon(UINT8 *ROM, UINT32 len, int &type, int &addon) { // First, look if the cart is HiROM or LoROM (and set snes_cart accordingly) diff --git a/src/devices/bus/snes/snes_slot.h b/src/devices/bus/snes/snes_slot.h index 663ff71d6c6..f681e54327f 100644 --- a/src/devices/bus/snes/snes_slot.h +++ b/src/devices/bus/snes/snes_slot.h @@ -159,7 +159,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } void get_cart_type_addon(UINT8 *ROM, UINT32 len, int &type, int &addon); UINT32 snes_skip_header(UINT8 *ROM, UINT32 snes_rom_size); diff --git a/src/devices/bus/sunkbd/hlekbd.cpp b/src/devices/bus/sunkbd/hlekbd.cpp new file mode 100644 index 00000000000..87f5d799905 --- /dev/null +++ b/src/devices/bus/sunkbd/hlekbd.cpp @@ -0,0 +1,1370 @@ +// license:BSD-3-Clause +// copyright-holders:Vas Crabb +#include "hlekbd.h" + +#include <numeric> + + +/* + TODO: other international layouts + TODO: localised labels on Solaris group for Swedish layout + TODO: suppress LED command processing for Type 3 keyboard + TODO: work out what actually happens with DIPs on Type 3 keyboard + + HLE SPARC serial keyboard compatible with Sun Type 3/4/5/6 + + messages from host to keyboard: + 0000 0001 reset (keyboard responds with self test pass/fail) + 0000 0010 bell on (480us period) + 0000 0011 bell off + 0000 1010 enable keyclick (5ms duration 480us period on make) + 0000 1011 disable keyclick + 0000 1110 ---k lscn LED (1 = on, k = kana, l = caps lock, s = scroll lock, c = compose, n = num lock) + 0000 1111 layout request (keyboard responds with layout response) + + message from keyboad to host: + 0xxx xxxx key make + 1xxx xxxx key break + 0111 1111 all keys up + 1111 1110 00dd dddd layout response (DIP switches 3 to 8 from MSB to LSB) + 1111 1111 0000 0100 reset response (self test pass, always followed by all keys up or key make) + 0111 1110 0000 0001 self test fail + + + Type 3 layout: + + 01 03 05 06 08 0a 0c 0e 10 11 12 2b 15 16 17 + 19 1a 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 58 2a 2d 2e 2f + 31 33 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 44 45 46 + 48 49 4c 4d 4e 4f 50 51 52 53 54 55 56 57 59 5b 5c 5d + 5f 61 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 + 77 78 79 7a 13 + + no LEDs + top row function keys are F1-F9 and backspace + delete key is above return + meta keys labelled "Left" and "Right" + linefeed key to the right of right shift (removed for Type 5) + single control key (still the case on later Sun keyboards) + "Alternate" key at bottom right of main area (moved to left for Type 4) + left group of function keys labelled L1-L10 + right group of function keys labelled R1-R15 + cursor up/down/left/right on R8/R10/R12/R14 + + + Type 4 layout: + + 01 03 05 06 08 0a 0c 0e 10 11 12 07 09 0b 58 42 15 16 17 62 + 19 1a 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2b 2d 2e 2f 47 + 31 33 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 44 45 46 + 48 49 4c 4d 4e 4f 50 51 52 53 54 55 56 57 2a 59 5b 5c 5d 7d + 5f 61 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 + 76 77 13 78 79 7a 43 0d 5e 32 5a + + double-height return key, backspace above return + top row F1-F12, backslash and delete + dedicated labels for left function group with "Help" key added at bottom + meta keys labelled with diamonds, "Alt" on left, "Alt Graph" on right + "tenkey" keypad layout mostly re-using codes from R1-R15 on Type 3 + top row of keypad is Pause, PrSc, Scroll Lock/Break, Num Lock + 2d is = key on keypad (removed for Type 5 and scancode reused for mute) + introduces the "Compose" key + Caps Lock/Compose/Scroll Lock/Num Lock LEDs above keypad + + + Type 5 US PC layout: + + 76 1d 05 06 08 0a 0c 0e 10 11 12 07 09 0b 16 17 15 2d 02 04 30 + + 01 03 2a 1e 1f 20 21 22 23 24 25 26 27 28 29 2b 2c 34 60 62 2e 2f 47 + 19 1a 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 58 42 4a 7b 44 45 46 + 31 33 77 4d 4e 4f 50 51 52 53 54 55 56 57 59 5b 5c 5d 7d + 48 49 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 14 70 71 72 + 5f 61 4c 13 78 79 7a 43 0d 18 1b 1c 5e 32 5a + + + Type 5 US UNIX layout: + + 76 xx 05 06 08 0a 0c 0e 10 11 12 07 09 0b 16 17 15 2d 02 04 30 + + 01 03 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 58 2a 2c 34 60 62 2e 2f 47 + 19 1a 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 2b 42 4a 7b 44 45 46 + 31 33 4c 4d 4e 4f 50 51 52 53 54 55 56 57 59 5b 5c 5d 7d + 48 49 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 14 70 71 72 + 5f 61 77 13 78 79 7a 43 0d 18 1b 1c 5e 32 5a + + xx is a blank key + backspace immediately above return + backslash and backtick/tilde at top right of main area + control on home row, caps lock at bottom left corner of main area + + + Type 5 International layout: + + 76 1d 05 06 08 0a 0c 0e 10 11 12 07 09 0b 16 17 15 2d 02 04 30 + + 01 03 2a 1e 1f 20 21 22 23 24 25 26 27 28 29 2b 2c 34 60 62 2e 2f 47 + 19 1a 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 4a 7b 44 45 46 + 31 33 77 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5b 5c 5d 7d + 48 49 63 7c 64 65 66 67 68 69 6a 6b 6c 6d 6e 14 70 71 72 + 5f 61 4c 13 78 79 7a 43 0d 18 1b 1c 5e 32 5a + + double-height return key, 58 (US backslash) moved to home row, 7c added on left of bottom row + + + Type 5 Japanese layout: + + 76 1d 05 06 08 0a 0c 0e 10 11 12 07 09 0b 16 17 15 2d 02 04 30 + + 01 03 2a 1e 1f 20 21 22 23 24 25 26 27 28 29 2b 2c 34 60 62 2e 2f 47 + 19 1a 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 4a 7b 44 45 46 + 31 33 77 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5b 5c 5d 7d + 48 49 63 64 65 66 67 68 69 6a 6b 6c 6d 6f 6e 14 70 71 72 + 5f 61 4c 13 78 73 79 74 75 7a 43 0d 18 1b 1c 5e 32 5a + + double-height return key + yen/pipe replaces backtick/tilde at top left corner of main area + linefeed scancode repurposed for backslash/underscore + kana replaces alt graph (with LED window) + extra kakutei, henkan and nihongo on-off keys +*/ + + +/*************************************************************************** + DEVICE TYPE GLOBALS +***************************************************************************/ + +device_type const SUN_TYPE3_HLE_KEYBOARD = &device_creator<bus::sunkbd::hle_type3_device>; +device_type const SUN_TYPE4_HLE_KEYBOARD = &device_creator<bus::sunkbd::hle_type4_device>; +device_type const SUN_TYPE5_HLE_KEYBOARD = &device_creator<bus::sunkbd::hle_type5_device>; +device_type const SUN_TYPE5_GB_HLE_KEYBOARD = &device_creator<bus::sunkbd::hle_type5_gb_device>; +device_type const SUN_TYPE5_SE_HLE_KEYBOARD = &device_creator<bus::sunkbd::hle_type5_se_device>; +device_type const SUN_TYPE5_JP_HLE_KEYBOARD = &device_creator<bus::sunkbd::hle_type5_jp_device>; + + + +namespace bus { namespace sunkbd { +namespace { +/*************************************************************************** + INPUT PORT DEFINITIONS +***************************************************************************/ + +#define TYPE5_DIPS(dflt) \ + PORT_START("DIP") \ + PORT_DIPNAME( 0x1f, dflt, "Layout") PORT_DIPLOCATION("S:5,4,3,2,1") \ + /* 0x00 */ \ + PORT_DIPSETTING( 0x01, "U.S.A. (US5.kt)" ) \ + PORT_DIPSETTING( 0x02, "U.S.A./UNIX (US_UNIX5.kt)" ) \ + PORT_DIPSETTING( 0x03, "France (France5.kt)" ) \ + PORT_DIPSETTING( 0x04, "Denmark (Denmark5.kt)" ) \ + PORT_DIPSETTING( 0x05, "Germany (Germany5.kt)" ) \ + PORT_DIPSETTING( 0x06, "Italy (Italy5.kt)" ) \ + PORT_DIPSETTING( 0x07, "The Netherlands (Netherland5.kt)" ) \ + PORT_DIPSETTING( 0x08, "Norway (Norway5.kt)" ) \ + PORT_DIPSETTING( 0x09, "Portugal (Portugal5.kt)" ) \ + PORT_DIPSETTING( 0x0a, "Spain (Spain5.kt)" ) \ + PORT_DIPSETTING( 0x0b, "Sweden (Sweden5.kt)" ) \ + PORT_DIPSETTING( 0x0c, "Switzerland/French (Switzer_Fr5.kt)" ) \ + PORT_DIPSETTING( 0x0d, "Switzerland/German (Switzer_Ge5.kt)" ) \ + PORT_DIPSETTING( 0x0e, "Great Britain (UK5.kt)" ) \ + PORT_DIPSETTING( 0x0f, "Korea (Korea5.kt)" ) \ + PORT_DIPSETTING( 0x10, "Taiwan (Taiwan5.kt)" ) \ + PORT_DIPSETTING( 0x11, "Japan (Japan5.kt)" ) \ + PORT_DIPSETTING( 0x12, "Canada/French (Canada_Fr5.kt)" ) \ + PORT_DIPSETTING( 0x13, "Hungary (Hungary5.kt)" ) \ + PORT_DIPSETTING( 0x14, "Poland (Poland5.kt)" ) \ + PORT_DIPSETTING( 0x15, "Czech (Czech5.kt)" ) \ + PORT_DIPSETTING( 0x16, "Russia (Russia5.kt)" ) \ + PORT_DIPSETTING( 0x17, "Latvia (Latvia5.kt)" ) \ + PORT_DIPSETTING( 0x18, "Turkey-Q5 (TurkeyQ5.kt)" ) \ + PORT_DIPSETTING( 0x19, "Greece (Greece5.kt)" ) \ + PORT_DIPSETTING( 0x1a, "Arabic (Arabic5.kt)" ) \ + PORT_DIPSETTING( 0x1b, "Lithuania (Lithuania5.kt)" ) \ + PORT_DIPSETTING( 0x1c, "Belgium (Belgium5.kt)" ) \ + /* 0x1d */ \ + PORT_DIPSETTING( 0x1e, "Turkey-F5 (TurkeyF5.kt)" ) \ + PORT_DIPSETTING( 0x1f, "Canada/French (Canada_Fr5_TBITS5.kt)" ) \ + PORT_BIT( 0xe0, 0x20, IPT_UNUSED ) + + +INPUT_PORTS_START( basic ) + PORT_START("ROW0") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F1") PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F2") PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2)) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F3") PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3)) + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F4") PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4)) + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F5") PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5)) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F6") PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6)) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("ROW1") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F7") PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7)) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F8") PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8)) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F9") PORT_CODE(KEYCODE_F9) PORT_CHAR(UCHAR_MAMEKEY(F9)) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Alternate") PORT_CODE(KEYCODE_LALT) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') + + PORT_START("ROW2") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR('~') + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Backspace") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("ROW3") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) PORT_CHAR(9) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') + + PORT_START("ROW4") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Delete") PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL)) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Control") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') + + PORT_START("ROW5") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('"') + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("ROW6") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("L Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("R Shift") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_MAMEKEY(RSHIFT)) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("ROW7") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Left Meta") PORT_CODE(KEYCODE_LWIN) PORT_CHAR(UCHAR_MAMEKEY(LWIN)) + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Right Meta") PORT_CODE(KEYCODE_RWIN) PORT_CHAR(UCHAR_MAMEKEY(RWIN)) + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END + + +INPUT_PORTS_START( basic_gb ) + PORT_INCLUDE( basic ) + + PORT_MODIFY("ROW1") + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') + + PORT_MODIFY("ROW2") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR(0x00a3U) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR(0x00acU) PORT_CHAR(0x00a6) + + PORT_MODIFY("ROW5") + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('@') + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('#') PORT_CHAR('~') + + PORT_MODIFY("ROW7") + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR('\\') PORT_CHAR('|') +INPUT_PORTS_END + + +INPUT_PORTS_START( basic_se ) + PORT_INCLUDE( basic ) + + PORT_MODIFY("ROW1") + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') PORT_CHAR('@') + + PORT_MODIFY("ROW2") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') PORT_CHAR(0x00a3U) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR(0x00a4U) PORT_CHAR('$') + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('/') PORT_CHAR('{') + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') PORT_CHAR('[') + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') PORT_CHAR(']') + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR('=') PORT_CHAR('}') + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('+') PORT_CHAR('?') PORT_CHAR('\\') + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR(0x00b4U) PORT_CHAR('`') + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR(0x00a7U) PORT_CHAR(0x00bdU) + + PORT_MODIFY("ROW4") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR(0x00e5U) PORT_CHAR(0x00c5U) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(0x00a8U) PORT_CHAR('^') PORT_CHAR('~') + + PORT_MODIFY("ROW5") + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(0x00f6U) PORT_CHAR(0x00d6U) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(0x00e4U) PORT_CHAR(0x00c4U) + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\'') PORT_CHAR('*') PORT_CHAR('`') + + PORT_MODIFY("ROW6") + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR(';') + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR(':') + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('-') PORT_CHAR('_') + + PORT_MODIFY("ROW7") + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR('<') PORT_CHAR('>') PORT_CHAR('|') +INPUT_PORTS_END + + +INPUT_PORTS_START( basic_jp ) + PORT_INCLUDE( basic ) + + PORT_MODIFY("ROW1") + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') + + PORT_MODIFY("ROW2") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('^') PORT_CHAR('~') + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR(0x00a5U) PORT_CHAR('|') + + PORT_MODIFY("ROW4") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') PORT_CHAR('`') + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('[') PORT_CHAR('{') + + PORT_MODIFY("ROW5") + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+') + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') PORT_CHAR('*') + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(']') PORT_CHAR('}') + + PORT_MODIFY("ROW6") + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR('\\') PORT_CHAR('_') + + PORT_MODIFY("ROW7") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Kakutei") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Henkan") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Nihongo On-Off") PORT_CODE(KEYCODE_MENU) +INPUT_PORTS_END + + +INPUT_PORTS_START( tenkey ) + PORT_MODIFY("ROW2") + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP /") PORT_CODE(KEYCODE_SLASH_PAD) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP *") PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR(UCHAR_MAMEKEY(ASTERISK)) + + PORT_MODIFY("ROW3") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP .") PORT_CODE(KEYCODE_DEL_PAD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD)) + + PORT_MODIFY("ROW4") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP 7") PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD)) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP 8") PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD)) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP 9") PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP -") PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD)) + + PORT_MODIFY("ROW5") + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Enter") PORT_CODE(KEYCODE_ENTER_PAD) + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP 4") PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP 5") PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP 6") PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP 0") PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) + + PORT_MODIFY("ROW6") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Num Lock") PORT_CODE(KEYCODE_NUMLOCK) PORT_CHAR(UCHAR_MAMEKEY(NUMLOCK)) + + PORT_MODIFY("ROW7") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP 1") PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP 2") PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP 3") PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP +") PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD)) +INPUT_PORTS_END + + +INPUT_PORTS_START( l_group ) + PORT_MODIFY("ROW0") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("L1") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("L2") + + PORT_MODIFY("ROW1") + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("L3") + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("L4") + + PORT_MODIFY("ROW3") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("L5") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("L6") + + PORT_MODIFY("ROW4") + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("L7") + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("L8") + + PORT_MODIFY("ROW5") + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("L9") + + PORT_MODIFY("ROW6") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("L10") +INPUT_PORTS_END + + +INPUT_PORTS_START( r_group ) + PORT_MODIFY("ROW1") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("R1") PORT_CODE(KEYCODE_PAUSE) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("R2") PORT_CODE(KEYCODE_PRTSCR) PORT_CHAR(UCHAR_MAMEKEY(PRTSCR)) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("R3") PORT_CODE(KEYCODE_SCRLOCK) PORT_CHAR(UCHAR_MAMEKEY(SCRLOCK)) + + PORT_MODIFY("ROW2") + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("R4") PORT_CODE(KEYCODE_NUMLOCK) PORT_CHAR(UCHAR_MAMEKEY(NUMLOCK)) + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("R5") PORT_CODE(KEYCODE_SLASH_PAD) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("R6") PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR(UCHAR_MAMEKEY(ASTERISK)) + + PORT_MODIFY("ROW4") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("R7") PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD)) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("R8") PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD)) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("R9") PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) + + PORT_MODIFY("ROW5") + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("R10") PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("R11") PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("R12") PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) + + PORT_MODIFY("ROW7") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("R13") PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("R14") PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("R15") PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) +INPUT_PORTS_END + + +INPUT_PORTS_START( enhanced_function ) + PORT_MODIFY("ROW0") + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F10") PORT_CODE(KEYCODE_F10) PORT_CHAR(UCHAR_MAMEKEY(F10)) + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F11") PORT_CODE(KEYCODE_F11) PORT_CHAR(UCHAR_MAMEKEY(F11)) + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F12") PORT_CODE(KEYCODE_F12) PORT_CHAR(UCHAR_MAMEKEY(F12)) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Alt Graph") PORT_CODE(KEYCODE_RALT) PORT_CHAR(UCHAR_SHIFT_2) + + PORT_MODIFY("ROW1") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Alt") PORT_CODE(KEYCODE_LALT) PORT_CHAR(UCHAR_MAMEKEY(LALT)) + + PORT_MODIFY("ROW4") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Compose") PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL)) +INPUT_PORTS_END + + +INPUT_PORTS_START( cursor ) + PORT_MODIFY("ROW1") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Up") PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Left") PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Down") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Right") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) + + PORT_MODIFY("ROW2") + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Insert") PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) + + PORT_MODIFY("ROW3") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Home") PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) + + PORT_MODIFY("ROW4") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Del") PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL)) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("End") PORT_CODE(KEYCODE_END) PORT_CHAR(UCHAR_MAMEKEY(END)) + + PORT_MODIFY("ROW6") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Page Up") PORT_CODE(KEYCODE_PGUP) PORT_CHAR(UCHAR_MAMEKEY(PGUP)) + + PORT_MODIFY("ROW7") + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Page Down") PORT_CODE(KEYCODE_PGDN) PORT_CHAR(UCHAR_MAMEKEY(PGDN)) +INPUT_PORTS_END + + +INPUT_PORTS_START( solaris ) + PORT_MODIFY("ROW0") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Stop") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Again") + + PORT_MODIFY("ROW1") + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Props") + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Undo") + + PORT_MODIFY("ROW3") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Front") + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Copy") + + PORT_MODIFY("ROW4") + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Open") + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Paste") + + PORT_MODIFY("ROW5") + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Find") + + PORT_MODIFY("ROW6") + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Cut") + + PORT_MODIFY("ROW7") + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Help") +INPUT_PORTS_END + + +INPUT_PORTS_START( power ) + PORT_MODIFY("ROW0") + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Vol-") + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Vol+") + + PORT_MODIFY("ROW2") + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Mute") + + PORT_MODIFY("ROW3") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Pwr") +INPUT_PORTS_END + + +INPUT_PORTS_START( type5_ext ) + PORT_INCLUDE( enhanced_function ) + PORT_INCLUDE( tenkey ) + PORT_INCLUDE( cursor ) + PORT_INCLUDE( solaris ) + PORT_INCLUDE( power ) + + PORT_MODIFY("ROW1") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Pause") PORT_CODE(KEYCODE_PAUSE) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Print Screen") PORT_CODE(KEYCODE_PRTSCR) PORT_CHAR(UCHAR_MAMEKEY(PRTSCR)) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Scroll Lock") PORT_CODE(KEYCODE_SCRLOCK) PORT_CHAR(UCHAR_MAMEKEY(SCRLOCK)) +INPUT_PORTS_END + + +INPUT_PORTS_START( hle_type3_device ) + PORT_INCLUDE( basic ) + PORT_INCLUDE( l_group ) + PORT_INCLUDE( r_group ) + + PORT_MODIFY("ROW6") + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Line Feed") PORT_CHAR(10) + + PORT_START("DIP") + PORT_BIT( 0xff, 0x00, IPT_UNUSED ) +INPUT_PORTS_END + + +INPUT_PORTS_START( hle_type4_device ) + PORT_INCLUDE( basic ) + PORT_INCLUDE( enhanced_function ) + PORT_INCLUDE( tenkey ) + PORT_INCLUDE( solaris ) + + PORT_MODIFY("ROW1") + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Pause") PORT_CODE(KEYCODE_PAUSE) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("PrSc") PORT_CODE(KEYCODE_PRTSCR) PORT_CHAR(UCHAR_MAMEKEY(PRTSCR)) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Scroll Lock") PORT_CODE(KEYCODE_SCRLOCK) PORT_CHAR(UCHAR_MAMEKEY(SCRLOCK)) + + PORT_MODIFY("ROW2") + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("KP =") PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) + + PORT_MODIFY("ROW6") + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Line Feed") PORT_CHAR(10) + + PORT_START("DIP") + PORT_DIPNAME( 0x3f, 0x00, "Layout" ) PORT_DIPLOCATION("DIP:8,7,6,5,4,3") + PORT_DIPSETTING( 0x00, "U.S.A. (US4.kt)" ) + PORT_DIPSETTING( 0x01, "U.S.A. (US4.kt)" ) + PORT_DIPSETTING( 0x02, "Belgium (FranceBelg4.kt)" ) + PORT_DIPSETTING( 0x03, "Canada (Canada4.kt)" ) + PORT_DIPSETTING( 0x04, "Denmark (Denmakr4.kt)" ) + PORT_DIPSETTING( 0x05, "Germany (Germany4.kt)" ) + PORT_DIPSETTING( 0x06, "Italy (Italy4.kt)" ) + PORT_DIPSETTING( 0x07, "The Netherlands (Netherland4.kt)" ) + PORT_DIPSETTING( 0x08, "Norway (Norway4.kt)" ) + PORT_DIPSETTING( 0x09, "Portugal (Portugal4.kt)" ) + PORT_DIPSETTING( 0x0a, "Latin America/Spanish (SpainLatAm4.kt)" ) + PORT_DIPSETTING( 0x0b, "Sweden (SwedenFin4.kt)" ) + PORT_DIPSETTING( 0x0c, "Switzerland/French (Switzer_Fr4.kt)" ) + PORT_DIPSETTING( 0x0d, "Switzerland/German (Switzer_Ge4.kt)" ) + PORT_DIPSETTING( 0x0e, "Great Britain (UK4.kt)" ) + // 0x0f + PORT_DIPSETTING( 0x10, "Korea (Korea4.kt)" ) + PORT_DIPSETTING( 0x11, "Taiwan (Taiwan4.kt)" ) + // 0x12...0x20 + PORT_DIPSETTING( 0x21, "U.S.A. (US5.kt)" ) + PORT_DIPSETTING( 0x22, "U.S.A./UNIX (US_UNIX5.kt)" ) + PORT_DIPSETTING( 0x23, "France (France5.kt)" ) + PORT_DIPSETTING( 0x24, "Denmark (Denmark5.kt)" ) + PORT_DIPSETTING( 0x25, "Germany (Germany5.kt)" ) + PORT_DIPSETTING( 0x26, "Italy (Italy5.kt)" ) + PORT_DIPSETTING( 0x27, "The Netherlands (Netherland5.kt)" ) + PORT_DIPSETTING( 0x28, "Norway (Norway5.kt)" ) + PORT_DIPSETTING( 0x29, "Portugal (Portugal5.kt)" ) + PORT_DIPSETTING( 0x2a, "Spain (Spain5.kt)" ) + PORT_DIPSETTING( 0x2b, "Sweden (Sweden5.kt)" ) + PORT_DIPSETTING( 0x2c, "Switzerland/French (Switzer_Fr5.kt)" ) + PORT_DIPSETTING( 0x2d, "Switzerland/German (Switzer_Ge5.kt)" ) + PORT_DIPSETTING( 0x2e, "Great Britain (UK5.kt)" ) + PORT_DIPSETTING( 0x2f, "Korea (Korea5.kt)" ) + PORT_DIPSETTING( 0x30, "Taiwan (Taiwan5.kt)" ) + PORT_DIPSETTING( 0x31, "Japan (Japan5.kt)" ) + PORT_DIPSETTING( 0x32, "Canada/French (Canada_Fr5.kt)" ) + PORT_DIPSETTING( 0x33, "Hungary (Hungary5.kt)" ) + PORT_DIPSETTING( 0x34, "Poland (Poland5.kt)" ) + PORT_DIPSETTING( 0x35, "Czech (Czech5.kt)" ) + PORT_DIPSETTING( 0x36, "Russia (Russia5.kt)" ) + PORT_DIPSETTING( 0x37, "Latvia (Latvia5.kt)" ) + PORT_DIPSETTING( 0x38, "Turkey-Q5 (TurkeyQ5.kt)" ) + PORT_DIPSETTING( 0x39, "Greece (Greece5.kt)" ) + PORT_DIPSETTING( 0x3a, "Arabic (Arabic5.kt)" ) + PORT_DIPSETTING( 0x3b, "Lithuania (Lithuania5.kt)" ) + PORT_DIPSETTING( 0x3c, "Belgium (Belgium5.kt)" ) + // 0x3d + PORT_DIPSETTING( 0x3e, "Turkey-F5 (TurkeyF5.kt)" ) + PORT_DIPSETTING( 0x3f, "Canada/French (Canada_Fr5_TBITS5.kt)" ) + PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "DIP:2" ) + PORT_DIPNAME( 0x80, 0x00, "Identify as" ) PORT_DIPLOCATION("DIP:1") + PORT_DIPSETTING( 0x00, "Type 4" ) + PORT_DIPSETTING( 0x80, "Type 3" ) +INPUT_PORTS_END + + +INPUT_PORTS_START( hle_type5_device ) + PORT_INCLUDE(basic) + PORT_INCLUDE(type5_ext) + TYPE5_DIPS(0x01) +INPUT_PORTS_END + + +INPUT_PORTS_START( hle_type5_gb_device ) + PORT_INCLUDE(basic_gb) + PORT_INCLUDE(type5_ext) + TYPE5_DIPS(0x0e) +INPUT_PORTS_END + + +INPUT_PORTS_START( hle_type5_se_device ) + PORT_INCLUDE(basic_se) + PORT_INCLUDE(type5_ext) + TYPE5_DIPS(0x0b) +INPUT_PORTS_END + + +INPUT_PORTS_START( hle_type5_jp_device ) + PORT_INCLUDE(basic_jp) + PORT_INCLUDE(type5_ext) + TYPE5_DIPS(0x11) + + PORT_MODIFY("ROW0") + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Kana") PORT_CODE(KEYCODE_RALT) +INPUT_PORTS_END + + + +/*************************************************************************** + MACHINE CONFIGURATION FRAGMENTS +***************************************************************************/ + +MACHINE_CONFIG_FRAGMENT(sparc_keyboard) + MCFG_SPEAKER_STANDARD_MONO("bell") + MCFG_SOUND_ADD("beeper", BEEP, ATTOSECONDS_TO_HZ(480 * ATTOSECONDS_PER_MICROSECOND)) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bell", 1.0) +MACHINE_CONFIG_END + +} // anonymous namespace + + + +/*************************************************************************** + BASE HLE KEYBOARD DEVICE +***************************************************************************/ + +/*-------------------------------------------------- + hle_device_base::hle_device_base + designated device constructor +--------------------------------------------------*/ + +hle_device_base::hle_device_base( + machine_config const &mconfig, + device_type type, + char const *name, + char const *tag, + device_t *owner, + UINT32 clock, + char const *shortname, + char const *source) + : device_t(mconfig, type, name, tag, owner, clock, shortname, source) + , device_serial_interface(mconfig, *this) + , device_sun_keyboard_port_interface(mconfig, *this) + , m_dips(*this, "DIP") + , m_key_inputs{ + { *this, "ROW0" }, { *this, "ROW1" }, + { *this, "ROW2" }, { *this, "ROW3" }, + { *this, "ROW4" }, { *this, "ROW5" }, + { *this, "ROW6" }, { *this, "ROW7" } } + , m_scan_timer(nullptr) + , m_click_timer(nullptr) + , m_beeper(*this, "beeper") + , m_current_keys{ 0, 0, 0, 0, 0, 0, 0, 0 } + , m_next_row(0) + , m_fifo{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + , m_head(0) + , m_tail(0) + , m_empty(0) + , m_rx_state(RX_IDLE) + , m_keyclick(0) + , m_beeper_state(0) +{ +} + + +/*-------------------------------------------------- + hle_device_base::~hle_device_base + destructor +--------------------------------------------------*/ + +hle_device_base::~hle_device_base() +{ +} + + +/*-------------------------------------------------- + hle_device_base::device_mconfig_additions + get machine configuration additions +--------------------------------------------------*/ + +machine_config_constructor hle_device_base::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME(sparc_keyboard); +} + + +/*-------------------------------------------------- + hle_device_base::input_txd + handle serial input line changes +--------------------------------------------------*/ + +WRITE_LINE_MEMBER( hle_device_base::input_txd ) +{ + device_serial_interface::rx_w(state); +} + + +/*-------------------------------------------------- + hle_device_base::device_start + perform expensive initialisations, allocate + resources, register for save state +--------------------------------------------------*/ + +void hle_device_base::device_start() +{ + device_serial_interface::register_save_state(machine().save(), this); + + m_scan_timer = timer_alloc(SCAN_TIMER_ID); + m_click_timer = timer_alloc(CLICK_TIMER_ID); + + save_item(NAME(m_current_keys)); + save_item(NAME(m_next_row)); + save_item(NAME(m_fifo)); + save_item(NAME(m_head)); + save_item(NAME(m_tail)); + save_item(NAME(m_empty)); + save_item(NAME(m_rx_state)); + save_item(NAME(m_keyclick)); + save_item(NAME(m_beeper_state)); +} + + +/*-------------------------------------------------- + hle_device_base::device_reset + perform startup tasks, also used for host + requested reset +--------------------------------------------------*/ + +void hle_device_base::device_reset() +{ + // initialise state + std::fill(std::begin(m_current_keys), std::end(m_current_keys), 0x0000U); + m_next_row = 0; + std::fill(std::begin(m_fifo), std::end(m_fifo), 0); + m_head = m_tail = 0; + m_empty = 1; + m_rx_state = RX_IDLE; + m_keyclick = 0; + m_beeper_state = 0; + + // configure device_serial_interface + set_data_frame(START_BIT_COUNT, DATA_BIT_COUNT, PARITY, STOP_BITS); + set_rate(BAUD); + receive_register_reset(); + transmit_register_reset(); + + // set device_sun_keyboard_port_interface lines + output_rxd(1); + + // start with keyboard LEDs off + machine().output().set_led_value(LED_NUM, 0); + machine().output().set_led_value(LED_COMPOSE, 0); + machine().output().set_led_value(LED_SCROLL, 0); + machine().output().set_led_value(LED_CAPS, 0); + machine().output().set_led_value(LED_KANA, 0); + + // send reset response + send_byte(0xffU); + send_byte(ident_byte()); + UINT16 const acc( + std::accumulate( + std::begin(m_key_inputs), + std::end(m_key_inputs), + UINT16(0), + [] (UINT16 a, auto const &b) { return a | b->read(); })); + if (!acc) + send_byte(0x7fU); + + // kick the scan timer + m_scan_timer->adjust(attotime::from_hz(1'200), 0, attotime::from_hz(1'200)); + m_click_timer->reset(); +} + + +/*-------------------------------------------------- + hle_device_base::device_timer + handle timed events +--------------------------------------------------*/ + +void hle_device_base::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + switch (id) + { + case SCAN_TIMER_ID: + scan_row(); + break; + + case CLICK_TIMER_ID: + m_beeper_state &= ~UINT8(BEEPER_CLICK); + m_beeper->set_state(m_beeper_state ? 1 : 0); + break; + + default: + device_serial_interface::device_timer(timer, id, param, ptr); + } +} + + +/*-------------------------------------------------- + hle_device_base::tra_callback + send output of serial transmit shift register + to host +--------------------------------------------------*/ + +void hle_device_base::tra_callback() +{ + output_rxd(transmit_register_get_data_bit()); +} + + +/*-------------------------------------------------- + hle_device_base::tra_complete + handle end of transmitted byte frame +--------------------------------------------------*/ + +void hle_device_base::tra_complete() +{ + assert(!m_empty || (m_head == m_tail)); + assert(m_head < ARRAY_LENGTH(m_fifo)); + assert(m_tail < ARRAY_LENGTH(m_fifo)); + + if (!m_empty) + { + transmit_register_setup(m_fifo[m_head]); + m_head = (m_head + 1) & 0x0fU; + m_empty = (m_head == m_tail) ? 1 : 0; + } +} + + +/*-------------------------------------------------- + hle_device_base::rcv_complete + handle received byte frame +--------------------------------------------------*/ + +void hle_device_base::rcv_complete() +{ + receive_register_extract(); + UINT8 const code(get_received_char()); + switch (m_rx_state) + { + case RX_LED: + machine().output().set_led_value(LED_NUM, BIT(code, 0)); + machine().output().set_led_value(LED_COMPOSE, BIT(code, 1)); + machine().output().set_led_value(LED_SCROLL, BIT(code, 2)); + machine().output().set_led_value(LED_CAPS, BIT(code, 3)); + machine().output().set_led_value(LED_KANA, BIT(code, 4)); + m_rx_state = RX_IDLE; + break; + + default: + assert(m_rx_state == RX_IDLE); + case RX_IDLE: + switch (code) + { + case COMMAND_RESET: + device_reset(); + break; + + case COMMAND_BELL_ON: + m_beeper_state |= UINT8(BEEPER_BELL); + m_beeper->set_state(m_beeper_state ? 1 : 0); + m_rx_state = RX_IDLE; + break; + + case COMMAND_BELL_OFF: + m_beeper_state &= ~UINT8(BEEPER_BELL); + m_beeper->set_state(m_beeper_state ? 1 : 0); + m_rx_state = RX_IDLE; + break; + + case COMMAND_CLICK_ON: + m_keyclick = 1; + m_rx_state = RX_IDLE; + break; + + case COMMAND_CLICK_OFF: + m_keyclick = 0; + m_click_timer->reset(); + m_beeper_state &= ~UINT8(BEEPER_CLICK); + m_beeper->set_state(m_beeper_state ? 1 : 0); + m_rx_state = RX_IDLE; + break; + + case COMMAND_LED: + m_rx_state = RX_LED; + break; + + case COMMAND_LAYOUT: + send_byte(0xfeU); + send_byte(UINT8(m_dips->read() & 0x3fU)); + m_rx_state = RX_IDLE; + break; + + default: + logerror("Unknown command: 0x%02x", code); + m_rx_state = RX_IDLE; + } + } +} + + +/*-------------------------------------------------- + hle_device_base::scan_row + scan the next row in the keyboard matrix and + send update to host +--------------------------------------------------*/ + +void hle_device_base::scan_row() +{ + // ensure we aren't in a stupid state + assert(m_next_row < ARRAY_LENGTH(m_key_inputs)); + assert(m_next_row < ARRAY_LENGTH(m_current_keys)); + + // get last read state and new state of row + UINT16 const row(m_key_inputs[m_next_row]->read()); + UINT16 ¤t(m_current_keys[m_next_row]); + bool keydown(false), keyup(false); + + // while the buffer isn't full, look for changed keys in this row + for (UINT8 bit = 0; (bit < 16) && (m_empty || (m_head != m_tail)); ++bit) + { + UINT16 const mask(UINT16(1) << bit); + if ((row ^ current) & mask) + { + UINT8 const make_break((row & mask) ? 0x00U : 0x80U); + keydown = keydown || !bool(make_break); + keyup = keyup || bool(make_break); + current = (current & ~mask) | (row & mask); + send_byte(make_break | (m_next_row << 4) | bit); + } + } + + // if a key was pressed and keyclick is enabled, turn on the beeper + if (keydown && m_keyclick) + { + m_beeper_state |= UINT8(BEEPER_CLICK); + m_beeper->set_state(m_beeper_state ? 1 : 0); + m_click_timer->reset(attotime::from_msec(5)); + } + + // if a key was released and no keys are down, send all keys up code + if (keyup) + { + UINT16 const acc( + std::accumulate( + std::begin(m_current_keys), + std::end(m_current_keys), + UINT16(0), + [] (UINT16 a, UINT16 b) { return a | b; })); + if (!acc) + send_byte(0x7fU); + } + + // advance to the next row + m_next_row = (m_next_row + 1) & 0x07U; +} + + +/*-------------------------------------------------- + hle_device_base::send_byte + send a byte or queue it to send later +--------------------------------------------------*/ + +void hle_device_base::send_byte(UINT8 code) +{ + assert(!m_empty || (m_head == m_tail)); + assert(m_head < ARRAY_LENGTH(m_fifo)); + assert(m_tail < ARRAY_LENGTH(m_fifo)); + + if (m_empty && is_transmit_register_empty()) + { + transmit_register_setup(code); + } + else if (m_empty || (m_head != m_tail)) + { + m_fifo[m_tail] = code; + m_tail = (m_tail + 1) & 0x0fU; + m_empty = 0; + } + else + { + logerror("FIFO overrun (code = 0x%02x)", code); + } +} + + + +/*************************************************************************** + BASE TYPE 4/5/6 HLE KEYBOARD DEVICE +***************************************************************************/ + +/*-------------------------------------------------- + hle_type4_device_base::ident_byte + return identification byte for self test pass + response +--------------------------------------------------*/ + +UINT8 hle_type4_device_base::ident_byte() +{ + return (m_dips->read() & 0x80U) ? 0x03U : 0x04U; +} + + + +/*************************************************************************** + TYPE 3 HLE KEYBOARD DEVICE +***************************************************************************/ + +/*-------------------------------------------------- + hle_type3_device::hle_type3_device + abbreviated constructor +--------------------------------------------------*/ + +hle_type3_device::hle_type3_device( + machine_config const &mconfig, + char const *tag, + device_t *owner, + UINT32 clock) + : hle_device_base( + mconfig, + SUN_TYPE3_HLE_KEYBOARD, + "Sun Type 3 Keyboard (HLE)", + tag, + owner, + clock, + "type3_hle_kbd", + __FILE__) +{ +} + + +/*-------------------------------------------------- + hle_type3_device::device_input_ports + get input ports for this device +--------------------------------------------------*/ + +ioport_constructor hle_type3_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(hle_type3_device); +} + + +/*-------------------------------------------------- + hle_type3_device::ident_byte + return identification byte for self test pass + response +--------------------------------------------------*/ + +UINT8 hle_type3_device::ident_byte() +{ + return 0x03U; +} + + + +/*************************************************************************** + TYPE 4 HLE KEYBOARD DEVICE +***************************************************************************/ + +/*-------------------------------------------------- + hle_type4_device::hle_type4_device + abbreviated constructor +--------------------------------------------------*/ + +hle_type4_device::hle_type4_device( + machine_config const &mconfig, + char const *tag, + device_t *owner, + UINT32 clock) + : hle_type4_device_base( + mconfig, + SUN_TYPE4_HLE_KEYBOARD, + "Sun Type 4 Keyboard (HLE)", + tag, + owner, + clock, + "type4_hle_kbd", + __FILE__) +{ +} + + +/*-------------------------------------------------- + hle_type4_device::device_input_ports + get input ports for this device +--------------------------------------------------*/ + +ioport_constructor hle_type4_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(hle_type4_device); +} + + + +/*************************************************************************** + TYPE 5 HLE KEYBOARD DEVICE +***************************************************************************/ + +/*-------------------------------------------------- + hle_type5_device::hle_type5_device + abbreviated constructor +--------------------------------------------------*/ + +hle_type5_device::hle_type5_device( + machine_config const &mconfig, + char const *tag, + device_t *owner, + UINT32 clock) + : hle_type4_device_base( + mconfig, + SUN_TYPE5_HLE_KEYBOARD, + "Sun Type 5 Keyboard (U.S.A. - HLE)", + tag, + owner, + clock, + "type5_hle_kbd", + __FILE__) +{ +} + + +/*-------------------------------------------------- + hle_type5_device::device_input_ports + get input ports for this device +--------------------------------------------------*/ + +ioport_constructor hle_type5_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(hle_type5_device); +} + + + +/*************************************************************************** + TYPE 5 UK HLE KEYBOARD DEVICE +***************************************************************************/ + +/*-------------------------------------------------- + hle_type5_gb_device::hle_type5_gb_device + abbreviated constructor +--------------------------------------------------*/ + +hle_type5_gb_device::hle_type5_gb_device( + machine_config const &mconfig, + char const *tag, + device_t *owner, + UINT32 clock) + : hle_type4_device_base( + mconfig, + SUN_TYPE5_HLE_KEYBOARD, + "Sun Type 5 Keyboard (Great Britain - HLE)", + tag, + owner, + clock, + "type5_gb_hle_kbd", + __FILE__) +{ +} + + +/*-------------------------------------------------- + hle_type5_gb_device::device_input_ports + get input ports for this device +--------------------------------------------------*/ + +ioport_constructor hle_type5_gb_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(hle_type5_gb_device); +} + + + +/*************************************************************************** + TYPE 5 SWEDISH HLE KEYBOARD DEVICE +***************************************************************************/ + +/*-------------------------------------------------- + hle_type5_se_device::hle_type5_se_device + abbreviated constructor +--------------------------------------------------*/ + +hle_type5_se_device::hle_type5_se_device( + machine_config const &mconfig, + char const *tag, + device_t *owner, + UINT32 clock) + : hle_type4_device_base( + mconfig, + SUN_TYPE5_HLE_KEYBOARD, + "Sun Type 5 Keyboard (Sweden - HLE)", + tag, + owner, + clock, + "type5_se_hle_kbd", + __FILE__) +{ +} + + +/*-------------------------------------------------- + hle_type5_se_device::device_input_ports + get input ports for this device +--------------------------------------------------*/ + +ioport_constructor hle_type5_se_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(hle_type5_se_device); +} + + + +/*************************************************************************** + TYPE 5 JAPANESE HLE KEYBOARD DEVICE +***************************************************************************/ + +/*-------------------------------------------------- + hle_type5_jp_device::hle_type5_jp_device + abbreviated constructor +--------------------------------------------------*/ + +hle_type5_jp_device::hle_type5_jp_device( + machine_config const &mconfig, + char const *tag, + device_t *owner, + UINT32 clock) + : hle_type4_device_base( + mconfig, + SUN_TYPE5_HLE_KEYBOARD, + "Sun Type 5 Keyboard (Japan - HLE)", + tag, + owner, + clock, + "type5_jp_hle_kbd", + __FILE__) +{ +} + + +/*-------------------------------------------------- + hle_type5_jp_device::device_input_ports + get input ports for this device +--------------------------------------------------*/ + +ioport_constructor hle_type5_jp_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(hle_type5_jp_device); +} + +} } // namespace bus::sunkbd diff --git a/src/devices/bus/sunkbd/hlekbd.h b/src/devices/bus/sunkbd/hlekbd.h new file mode 100644 index 00000000000..545817783e5 --- /dev/null +++ b/src/devices/bus/sunkbd/hlekbd.h @@ -0,0 +1,204 @@ +// license:BSD-3-Clause +// copyright-holders:Vas Crabb +#ifndef MAME_DEVICES_SUNKBD_HLEKBD_H +#define MAME_DEVICES_SUNKBD_HLEKBD_H + +#pragma once + +#include "sunkbd.h" +#include "sound/beep.h" + + +extern device_type const SUN_TYPE3_HLE_KEYBOARD; +extern device_type const SUN_TYPE4_HLE_KEYBOARD; +extern device_type const SUN_TYPE5_HLE_KEYBOARD; +extern device_type const SUN_TYPE5_GB_HLE_KEYBOARD; +extern device_type const SUN_TYPE5_SE_HLE_KEYBOARD; +extern device_type const SUN_TYPE5_JP_HLE_KEYBOARD; + + +namespace bus { namespace sunkbd { +class hle_device_base : public device_t, public device_serial_interface, public device_sun_keyboard_port_interface +{ +public: + virtual machine_config_constructor device_mconfig_additions() const override; + + virtual DECLARE_WRITE_LINE_MEMBER( input_txd ) override; + +protected: + // constructor/destructor + hle_device_base( + machine_config const &mconfig, + device_type type, char const *name, + char const *tag, + device_t *owner, + UINT32 clock, + char const *shortname, + char const *source); + virtual ~hle_device_base() override; + + // device overrides + virtual void device_start() override; + virtual void device_reset() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + + // device_serial_interface overrides + virtual void tra_callback() override; + virtual void tra_complete() override; + virtual void rcv_complete() override; + + required_ioport m_dips; + required_ioport m_key_inputs[8]; + +private: + // device_serial_interface uses 10'000 range + enum { + SCAN_TIMER_ID = 20'000, + CLICK_TIMER_ID + }; + + // TODO: ensure these don't clash with diagnostic LEDs on host computer + enum : int { + LED_NUM = 0, + LED_COMPOSE, + LED_SCROLL, + LED_CAPS, + LED_KANA + }; + + enum : UINT8 { + BEEPER_BELL = 0x01U, + BEEPER_CLICK = 0x02U + }; + + enum : UINT8 { + RX_IDLE, + RX_LED + }; + + enum : UINT8 { + COMMAND_RESET = 0x01U, + COMMAND_BELL_ON = 0x02U, + COMMAND_BELL_OFF = 0x03U, + COMMAND_CLICK_ON = 0x0aU, + COMMAND_CLICK_OFF = 0x0bU, + COMMAND_LED = 0x0eU, + COMMAND_LAYOUT = 0x0fU + }; + + virtual UINT8 ident_byte() = 0; + + void scan_row(); + void send_byte(UINT8 code); + + emu_timer *m_scan_timer; + emu_timer *m_click_timer; + required_device<beep_device> m_beeper; + + UINT16 m_current_keys[8]; + UINT8 m_next_row; + + UINT8 m_fifo[16]; + UINT8 m_head, m_tail; + UINT8 m_empty; + + UINT8 m_rx_state; + + UINT8 m_keyclick; + UINT8 m_beeper_state; +}; + + +class hle_type4_device_base : public hle_device_base +{ +protected: + using hle_device_base::hle_device_base; + +private: + virtual UINT8 ident_byte() override; +}; + + +class hle_type3_device : public hle_device_base +{ +public: + hle_type3_device( + machine_config const &mconfig, + char const *tag, + device_t *owner, + UINT32 clock); + + virtual ioport_constructor device_input_ports() const override; + +private: + virtual UINT8 ident_byte() override; +}; + + +class hle_type4_device : public hle_type4_device_base +{ +public: + hle_type4_device( + machine_config const &mconfig, + char const *tag, + device_t *owner, + UINT32 clock); + + virtual ioport_constructor device_input_ports() const override; +}; + + +class hle_type5_device : public hle_type4_device_base +{ +public: + hle_type5_device( + machine_config const &mconfig, + char const *tag, + device_t *owner, + UINT32 clock); + + virtual ioport_constructor device_input_ports() const override; +}; + + +class hle_type5_gb_device : public hle_type4_device_base +{ +public: + hle_type5_gb_device( + machine_config const &mconfig, + char const *tag, + device_t *owner, + UINT32 clock); + + virtual ioport_constructor device_input_ports() const override; +}; + + +class hle_type5_se_device : public hle_type4_device_base +{ +public: + hle_type5_se_device( + machine_config const &mconfig, + char const *tag, + device_t *owner, + UINT32 clock); + + virtual ioport_constructor device_input_ports() const override; +}; + + +class hle_type5_jp_device : public hle_type4_device_base +{ +public: + hle_type5_jp_device( + machine_config const &mconfig, + char const *tag, + device_t *owner, + UINT32 clock); + + virtual ioport_constructor device_input_ports() const override; +}; + +} } // namespace bus::sunkbd + +#endif // MAME_DEVICES_SUNKBD_HLEKBD_H diff --git a/src/devices/bus/sunkbd/sunkbd.cpp b/src/devices/bus/sunkbd/sunkbd.cpp new file mode 100644 index 00000000000..23037d82904 --- /dev/null +++ b/src/devices/bus/sunkbd/sunkbd.cpp @@ -0,0 +1,99 @@ +// license:BSD-3-Clause +// copyright-holders:Vas Crabb + +#include "sunkbd.h" + + +device_type const SUNKBD_PORT = &device_creator<sun_keyboard_port_device>; + + +int const device_sun_keyboard_port_interface::START_BIT_COUNT; +int const device_sun_keyboard_port_interface::DATA_BIT_COUNT; +device_serial_interface::parity_t const device_sun_keyboard_port_interface::PARITY; +device_serial_interface::stop_bits_t const device_sun_keyboard_port_interface::STOP_BITS; +int const device_sun_keyboard_port_interface::BAUD; + + + +sun_keyboard_port_device::sun_keyboard_port_device( + machine_config const &mconfig, + char const *tag, + device_t *owner, + UINT32 clock) + : sun_keyboard_port_device(mconfig, SUNKBD_PORT, "Sun Keyboard Port", tag, owner, clock, "sunkbd", __FILE__) +{ +} + + +sun_keyboard_port_device::sun_keyboard_port_device( + machine_config const &mconfig, + device_type type, + char const *name, + char const *tag, + device_t *owner, + UINT32 clock, + char const *shortname, + char const *source) + : device_t(mconfig, type, name, tag, owner, clock, shortname, source) + , device_slot_interface(mconfig, *this) + , m_rxd(0) + , m_rxd_handler(*this) + , m_dev(nullptr) +{ +} + + +sun_keyboard_port_device::~sun_keyboard_port_device() +{ +} + + +void sun_keyboard_port_device::device_config_complete() +{ + m_dev = dynamic_cast<device_sun_keyboard_port_interface *>(get_card_device()); +} + + +void sun_keyboard_port_device::device_start() +{ + m_rxd_handler.resolve_safe(); + + save_item(NAME(m_rxd)); + + m_rxd = 1; + + m_rxd_handler(m_rxd); +} + + +WRITE_LINE_MEMBER( sun_keyboard_port_device::write_txd ) +{ + if(m_dev) + m_dev->input_txd(state); +} + + + +device_sun_keyboard_port_interface::device_sun_keyboard_port_interface(machine_config const &mconfig, device_t &device) + : device_slot_card_interface(mconfig, device) + , m_port(dynamic_cast<sun_keyboard_port_device *>(device.owner())) +{ +} + + +device_sun_keyboard_port_interface::~device_sun_keyboard_port_interface() +{ +} + + + +#include "hlekbd.h" + +SLOT_INTERFACE_START( default_sun_keyboard_devices ) + SLOT_INTERFACE("type3hle", SUN_TYPE3_HLE_KEYBOARD) + SLOT_INTERFACE("type4hle", SUN_TYPE4_HLE_KEYBOARD) + SLOT_INTERFACE("type5hle", SUN_TYPE5_HLE_KEYBOARD) + SLOT_INTERFACE("type5gbhle", SUN_TYPE5_GB_HLE_KEYBOARD) + SLOT_INTERFACE("type5sehle", SUN_TYPE5_SE_HLE_KEYBOARD) + SLOT_INTERFACE("type5jphle", SUN_TYPE5_JP_HLE_KEYBOARD) +SLOT_INTERFACE_END diff --git a/src/devices/bus/sunkbd/sunkbd.h b/src/devices/bus/sunkbd/sunkbd.h new file mode 100644 index 00000000000..006d914dff0 --- /dev/null +++ b/src/devices/bus/sunkbd/sunkbd.h @@ -0,0 +1,79 @@ +// license:BSD-3-Clause +// copyright-holders:Vas Crabb +#ifndef MAME_DEVICES_SUNKBD_SUNKBD_H +#define MAME_DEVICES_SUNKBD_SUNKBD_H + +#pragma once + +#include "emu.h" + + +#define MCFG_SUNKBD_PORT_ADD(tag, slot_intf, def_slot) \ + MCFG_DEVICE_ADD(tag, SUNKBD_PORT, 0) \ + MCFG_DEVICE_SLOT_INTERFACE(slot_intf, def_slot, false) + +#define MCFG_SUNKBD_RXD_HANDLER(cb) \ + devcb = &sun_keyboard_port_device::set_rxd_handler(*device, DEVCB_##cb); + + +class device_sun_keyboard_port_interface; + + +class sun_keyboard_port_device : public device_t, public device_slot_interface +{ + friend class device_sun_keyboard_port_interface; + +public: + sun_keyboard_port_device(machine_config const &mconfig, char const *tag, device_t *owner, UINT32 clock); + sun_keyboard_port_device(machine_config const &mconfig, device_type type, char const *name, char const *tag, device_t *owner, UINT32 clock, char const *shortname, char const *source); + virtual ~sun_keyboard_port_device(); + + // static configuration helpers + template <class Object> static devcb_base &set_rxd_handler(device_t &device, Object object) { return downcast<sun_keyboard_port_device &>(device).m_rxd_handler.set_callback(object); } + + DECLARE_WRITE_LINE_MEMBER( write_txd ); + + DECLARE_READ_LINE_MEMBER( rxd_r ) { return m_rxd; } + +protected: + virtual void device_start() override; + virtual void device_config_complete() override; + + int m_rxd; + + devcb_write_line m_rxd_handler; + +private: + device_sun_keyboard_port_interface *m_dev; +}; + + +class device_sun_keyboard_port_interface : public device_slot_card_interface +{ + friend class sun_keyboard_port_device; + +public: + device_sun_keyboard_port_interface(machine_config const &mconfig, device_t &device); + virtual ~device_sun_keyboard_port_interface() override; + + virtual DECLARE_WRITE_LINE_MEMBER( input_txd ) { } + + DECLARE_WRITE_LINE_MEMBER( output_rxd ) { m_port->m_rxd = state; m_port->m_rxd_handler(state); } + +protected: + sun_keyboard_port_device *m_port; + + static constexpr int START_BIT_COUNT = 1; + static constexpr int DATA_BIT_COUNT = 8; + static constexpr device_serial_interface::parity_t PARITY = device_serial_interface::PARITY_NONE; + static constexpr device_serial_interface::stop_bits_t STOP_BITS = device_serial_interface::STOP_BITS_1; + static constexpr int BAUD = 1'200; +}; + + +extern device_type const SUNKBD_PORT; + + +SLOT_INTERFACE_EXTERN( default_sun_keyboard_devices ); + +#endif // MAME_DEVICES_SUNKBD_SUNKBD_H diff --git a/src/devices/bus/ti99x/gromport.cpp b/src/devices/bus/ti99x/gromport.cpp index 4e9df13cdea..6cea8083119 100644 --- a/src/devices/bus/ti99x/gromport.cpp +++ b/src/devices/bus/ti99x/gromport.cpp @@ -1417,13 +1417,11 @@ void ti99_cartridge_device::set_slot(int i) m_slot = i; } -bool ti99_cartridge_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) +void ti99_cartridge_device::loaded_through_softlist() { - if (TRACE_CONFIG) logerror("swlist = %s, swname = %s\n", swlist.list_name(), swname); - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); + // TI99 cartridge seems to be the only reason we need loaded_through_softlist()... why? m_softlist = true; m_rpk = nullptr; - return true; } READ8Z_MEMBER(ti99_cartridge_device::readz) @@ -2601,11 +2599,11 @@ std::unique_ptr<rpk_socket> rpk_reader::load_rom_resource(util::archive_file &zi sha1 = xml_get_attribute_string(rom_resource_node, "sha1", nullptr); if (sha1 != nullptr) { - hash_collection actual_hashes; - actual_hashes.compute((const UINT8 *)contents, length, hash_collection::HASH_TYPES_CRC_SHA1); + util::hash_collection actual_hashes; + actual_hashes.compute((const UINT8 *)contents, length, util::hash_collection::HASH_TYPES_CRC_SHA1); - hash_collection expected_hashes; - expected_hashes.add_from_string(hash_collection::HASH_SHA1, sha1, strlen(sha1)); + util::hash_collection expected_hashes; + expected_hashes.add_from_string(util::hash_collection::HASH_SHA1, sha1, strlen(sha1)); if (actual_hashes != expected_hashes) throw rpk_exception(RPK_INVALID_FILE_REF, "SHA1 check failed"); } diff --git a/src/devices/bus/ti99x/gromport.h b/src/devices/bus/ti99x/gromport.h index 1473c7662d0..7afd9ab336b 100644 --- a/src/devices/bus/ti99x/gromport.h +++ b/src/devices/bus/ti99x/gromport.h @@ -108,7 +108,8 @@ protected: // Image handling: implementation of methods which are abstract in the parent bool call_load() override; void call_unload() override; - bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } + virtual void loaded_through_softlist() override; void prepare_cartridge(); diff --git a/src/devices/bus/vboy/slot.cpp b/src/devices/bus/vboy/slot.cpp index 4b8fc1bf4d2..133ef058980 100644 --- a/src/devices/bus/vboy/slot.cpp +++ b/src/devices/bus/vboy/slot.cpp @@ -218,18 +218,6 @@ void vboy_cart_slot_device::call_unload() } /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool vboy_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - - - -/*------------------------------------------------- get default card software -------------------------------------------------*/ diff --git a/src/devices/bus/vboy/slot.h b/src/devices/bus/vboy/slot.h index a0d90c68ab7..c25b4e00625 100644 --- a/src/devices/bus/vboy/slot.h +++ b/src/devices/bus/vboy/slot.h @@ -66,7 +66,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } diff --git a/src/devices/bus/vc4000/slot.cpp b/src/devices/bus/vc4000/slot.cpp index ba75cd67267..d626aa51fbf 100644 --- a/src/devices/bus/vc4000/slot.cpp +++ b/src/devices/bus/vc4000/slot.cpp @@ -221,17 +221,6 @@ bool vc4000_cart_slot_device::call_load() /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool vc4000_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - - -/*------------------------------------------------- get default card software -------------------------------------------------*/ diff --git a/src/devices/bus/vc4000/slot.h b/src/devices/bus/vc4000/slot.h index 01e587c62bf..d05e9c70d9e 100644 --- a/src/devices/bus/vc4000/slot.h +++ b/src/devices/bus/vc4000/slot.h @@ -68,7 +68,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override {} - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } diff --git a/src/devices/bus/vcs/vcs_slot.cpp b/src/devices/bus/vcs/vcs_slot.cpp index b8b25b864d4..410b4d16597 100644 --- a/src/devices/bus/vcs/vcs_slot.cpp +++ b/src/devices/bus/vcs/vcs_slot.cpp @@ -328,17 +328,6 @@ void vcs_cart_slot_device::call_unload() /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool vcs_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); - return TRUE; -} - - -/*------------------------------------------------- detection helper routines -------------------------------------------------*/ diff --git a/src/devices/bus/vcs/vcs_slot.h b/src/devices/bus/vcs/vcs_slot.h index 3f25a1ad737..a16cb20cf5d 100755 --- a/src/devices/bus/vcs/vcs_slot.h +++ b/src/devices/bus/vcs/vcs_slot.h @@ -96,7 +96,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_cart_type() { return m_type; }; int identify_cart_type(UINT8 *ROM, UINT32 len); diff --git a/src/devices/bus/vectrex/slot.cpp b/src/devices/bus/vectrex/slot.cpp index 14e531b8cd2..98f611cc89b 100644 --- a/src/devices/bus/vectrex/slot.cpp +++ b/src/devices/bus/vectrex/slot.cpp @@ -203,17 +203,6 @@ bool vectrex_cart_slot_device::call_load() /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool vectrex_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - - -/*------------------------------------------------- get default card software -------------------------------------------------*/ diff --git a/src/devices/bus/vectrex/slot.h b/src/devices/bus/vectrex/slot.h index cfd74b2b173..6c75e677a19 100644 --- a/src/devices/bus/vectrex/slot.h +++ b/src/devices/bus/vectrex/slot.h @@ -68,7 +68,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override {} - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } int get_vec3d() { return m_vec3d; } diff --git a/src/devices/bus/vic10/exp.cpp b/src/devices/bus/vic10/exp.cpp index 76c55ff7d79..d157c547c63 100644 --- a/src/devices/bus/vic10/exp.cpp +++ b/src/devices/bus/vic10/exp.cpp @@ -167,18 +167,6 @@ bool vic10_expansion_slot_device::call_load() //------------------------------------------------- -// call_softlist_load - -//------------------------------------------------- - -bool vic10_expansion_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - - return true; -} - - -//------------------------------------------------- // get_default_card_software - //------------------------------------------------- diff --git a/src/devices/bus/vic10/exp.h b/src/devices/bus/vic10/exp.h index 58fbaed0637..5723f0a67fd 100644 --- a/src/devices/bus/vic10/exp.h +++ b/src/devices/bus/vic10/exp.h @@ -120,7 +120,7 @@ protected: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } diff --git a/src/devices/bus/vic20/exp.cpp b/src/devices/bus/vic20/exp.cpp index 37761ab7d14..f96cff982aa 100644 --- a/src/devices/bus/vic20/exp.cpp +++ b/src/devices/bus/vic20/exp.cpp @@ -152,18 +152,6 @@ bool vic20_expansion_slot_device::call_load() //------------------------------------------------- -// call_softlist_load - -//------------------------------------------------- - -bool vic20_expansion_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - - return true; -} - - -//------------------------------------------------- // get_default_card_software - //------------------------------------------------- diff --git a/src/devices/bus/vic20/exp.h b/src/devices/bus/vic20/exp.h index 023cc861d9e..38cbad86fad 100644 --- a/src/devices/bus/vic20/exp.h +++ b/src/devices/bus/vic20/exp.h @@ -111,7 +111,7 @@ protected: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } diff --git a/src/devices/bus/vidbrain/exp.cpp b/src/devices/bus/vidbrain/exp.cpp index 2b4ac800ff3..ef7355fc103 100644 --- a/src/devices/bus/vidbrain/exp.cpp +++ b/src/devices/bus/vidbrain/exp.cpp @@ -139,18 +139,6 @@ bool videobrain_expansion_slot_device::call_load() //------------------------------------------------- -// call_softlist_load - -//------------------------------------------------- - -bool videobrain_expansion_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - - return true; -} - - -//------------------------------------------------- // get_default_card_software - //------------------------------------------------- diff --git a/src/devices/bus/vidbrain/exp.h b/src/devices/bus/vidbrain/exp.h index 9f1fd18ccf1..d7c126d788a 100644 --- a/src/devices/bus/vidbrain/exp.h +++ b/src/devices/bus/vidbrain/exp.h @@ -136,7 +136,7 @@ protected: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } diff --git a/src/devices/bus/wswan/slot.cpp b/src/devices/bus/wswan/slot.cpp index 256487bc8e1..e9dd3f899a3 100644 --- a/src/devices/bus/wswan/slot.cpp +++ b/src/devices/bus/wswan/slot.cpp @@ -238,17 +238,6 @@ void ws_cart_slot_device::call_unload() /*------------------------------------------------- - call softlist load - -------------------------------------------------*/ - -bool ws_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry); - return TRUE; -} - - -/*------------------------------------------------- get cart type from cart file -------------------------------------------------*/ diff --git a/src/devices/bus/wswan/slot.h b/src/devices/bus/wswan/slot.h index 9cae282da10..cb2f903ecc6 100644 --- a/src/devices/bus/wswan/slot.h +++ b/src/devices/bus/wswan/slot.h @@ -76,7 +76,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } int get_is_rotated() { return m_cart->get_is_rotated(); } diff --git a/src/devices/bus/z88/z88.cpp b/src/devices/bus/z88/z88.cpp index 062fdeade29..5dfccbf6832 100644 --- a/src/devices/bus/z88/z88.cpp +++ b/src/devices/bus/z88/z88.cpp @@ -172,16 +172,6 @@ void z88cart_slot_device::call_unload() /*------------------------------------------------- - call softlist load --------------------------------------------------*/ - -bool z88cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) -{ - machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); - return TRUE; -} - -/*------------------------------------------------- get default card software -------------------------------------------------*/ diff --git a/src/devices/bus/z88/z88.h b/src/devices/bus/z88/z88.h index cca92231fae..9f225c4a7a7 100644 --- a/src/devices/bus/z88/z88.h +++ b/src/devices/bus/z88/z88.h @@ -96,7 +96,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override; + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } virtual bool is_readable() const override { return 1; } diff --git a/src/devices/cpu/i86/i286.cpp b/src/devices/cpu/i86/i286.cpp index 7a7556deb8d..05fb35362df 100644 --- a/src/devices/cpu/i86/i286.cpp +++ b/src/devices/cpu/i86/i286.cpp @@ -1737,7 +1737,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } break; case 0xf4: // i_hlt - if(PM && (CPL > m_IOPL)) + if(PM && CPL) throw TRAP(FAULT_GP, 0); m_icount = 0; m_halt = true; diff --git a/src/devices/cpu/sparc/mb86901.cpp b/src/devices/cpu/sparc/mb86901.cpp index ee08106e260..8ed13db2778 100644 --- a/src/devices/cpu/sparc/mb86901.cpp +++ b/src/devices/cpu/sparc/mb86901.cpp @@ -641,6 +641,10 @@ void mb86901_device::execute_set_input(int inputnum, int state) case SPARC_MAE: m_mae = (state != 0) ? 1 : 0; break; + + case SPARC_RESET: + m_bp_reset_in = (state != 0) ? 1 : 0; + break; } } @@ -2558,7 +2562,6 @@ void mb86901_device::select_trap() if (m_reset_trap) { - m_reset_trap = 0; m_trap = 0; return; } @@ -2958,7 +2961,9 @@ void mb86901_device::execute_step() if (m_bp_reset_in) { m_execute_mode = 0; + m_error_mode = 0; m_reset_mode = 1; + printf("Entering reset mode\n"); return; } else if ((PSR & PSR_ET_MASK) && (m_bp_irl == 15 || m_bp_irl > ((PSR & PSR_PIL_MASK) >> PSR_PIL_SHIFT))) @@ -3045,6 +3050,7 @@ void mb86901_device::reset_step() m_execute_mode = 1; m_trap = 1; m_reset_trap = 1; + printf("m_bp_reset_in is false, resetting\n"); } } diff --git a/src/devices/cpu/sparc/sparc.h b/src/devices/cpu/sparc/sparc.h index d23f032fe9a..fa8b9dd234b 100644 --- a/src/devices/cpu/sparc/sparc.h +++ b/src/devices/cpu/sparc/sparc.h @@ -18,36 +18,6 @@ #include <map> #endif -#define SPARC_NO_TRAP 256 -#define SPARC_RESET 0 -#define SPARC_INSTRUCTION_ACCESS_EXCEPTION 1 -#define SPARC_ILLEGAL_INSTRUCTION 2 -#define SPARC_PRIVILEGED_INSTRUCTION 3 -#define SPARC_FP_DISABLED 4 -#define SPARC_WINDOW_OVERFLOW 5 -#define SPARC_WINDOW_UNDERFLOW 6 -#define SPARC_MEM_ADDRESS_NOT_ALIGNED 7 -#define SPARC_FLOATING_POINT_EXCEPTION 8 -#define SPARC_DATA_ACCESS_EXCEPTION 9 -#define SPARC_TAG_OVERFLOW 10 -#define SPARC_INT1 17 -#define SPARC_INT2 18 -#define SPARC_INT3 19 -#define SPARC_INT4 20 -#define SPARC_INT5 21 -#define SPARC_INT6 22 -#define SPARC_INT7 23 -#define SPARC_INT8 24 -#define SPARC_INT9 25 -#define SPARC_INT10 26 -#define SPARC_INT11 27 -#define SPARC_INT12 28 -#define SPARC_INT13 29 -#define SPARC_INT14 30 -#define SPARC_INT15 31 -#define SPARC_TRAP_INSTRUCTION 128 - -#define SPARC_FPU_SEQUENCE_ERROR // TODO: when there are more SPARC CPUs, move setter to a base class #define MCFG_SPARC_ADD_ASI_DESC(desc) \ mb86901_device::add_asi_desc(*device, desc); @@ -316,7 +286,8 @@ enum SPARC_IRQ13, SPARC_IRQ14, SPARC_NMI, - SPARC_MAE + SPARC_MAE, + SPARC_RESET }; #endif /* __SPARC_H__ */ diff --git a/src/devices/imagedev/cassette.h b/src/devices/imagedev/cassette.h index ab7441bfe17..bf0440f9b6a 100644 --- a/src/devices/imagedev/cassette.h +++ b/src/devices/imagedev/cassette.h @@ -59,7 +59,7 @@ public: virtual bool call_create(int format_type, util::option_resolution *format_options) override; virtual void call_unload() override; virtual std::string call_display() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override { return load_software(swlist, swname, start_entry); } + virtual const software_list_loader &get_software_list_loader() const override { return image_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CASSETTE; } diff --git a/src/devices/imagedev/chd_cd.h b/src/devices/imagedev/chd_cd.h index 5d229a471b4..5b64a0f4af8 100644 --- a/src/devices/imagedev/chd_cd.h +++ b/src/devices/imagedev/chd_cd.h @@ -33,7 +33,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override { machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); return TRUE; } + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CDROM; } diff --git a/src/devices/imagedev/diablo.h b/src/devices/imagedev/diablo.h index 99f5fb35cb3..16cd5bf65e6 100644 --- a/src/devices/imagedev/diablo.h +++ b/src/devices/imagedev/diablo.h @@ -33,7 +33,7 @@ public: virtual bool call_load() override; virtual bool call_create(int create_format, util::option_resolution *create_args) override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override { device().machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); return TRUE; } + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_HARDDISK; } diff --git a/src/devices/imagedev/flopdrv.h b/src/devices/imagedev/flopdrv.h index 0f337a76933..080093e1b17 100644 --- a/src/devices/imagedev/flopdrv.h +++ b/src/devices/imagedev/flopdrv.h @@ -100,7 +100,7 @@ public: template<class _Object> static devcb_base &set_out_idx_func(device_t &device, _Object object) { return downcast<legacy_floppy_image_device &>(device).m_out_idx_func.set_callback(object); } virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override { return load_software(swlist, swname, start_entry); } + virtual const software_list_loader &get_software_list_loader() const override { return image_software_list_loader::instance(); } virtual bool call_create(int format_type, util::option_resolution *format_options) override; virtual void call_unload() override; diff --git a/src/devices/imagedev/floppy.h b/src/devices/imagedev/floppy.h index 7beb4fbcee6..e0992b183a0 100644 --- a/src/devices/imagedev/floppy.h +++ b/src/devices/imagedev/floppy.h @@ -83,7 +83,7 @@ public: virtual bool call_load() override; virtual void call_unload() override; virtual bool call_create(int format_type, util::option_resolution *format_options) override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override { return load_software(swlist, swname, start_entry); } + virtual const software_list_loader &get_software_list_loader() const override { return image_software_list_loader::instance(); } virtual const char *image_interface() const override = 0; virtual iodevice_t image_type() const override { return IO_FLOPPY; } diff --git a/src/devices/imagedev/harddriv.h b/src/devices/imagedev/harddriv.h index 134f465e17b..ae68e9ac26d 100644 --- a/src/devices/imagedev/harddriv.h +++ b/src/devices/imagedev/harddriv.h @@ -35,7 +35,7 @@ public: virtual bool call_load() override; virtual bool call_create(int create_format, util::option_resolution *create_args) override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override { machine().rom_load().load_software_part_region(*this, swlist, swname, start_entry ); return TRUE; } + virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_HARDDISK; } diff --git a/src/devices/imagedev/snapquik.h b/src/devices/imagedev/snapquik.h index dbc3ac7dd8c..72ac145eba4 100644 --- a/src/devices/imagedev/snapquik.h +++ b/src/devices/imagedev/snapquik.h @@ -27,7 +27,7 @@ public: // image-level overrides virtual bool call_load() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override { return load_software(swlist, swname, start_entry); } + virtual const software_list_loader &get_software_list_loader() const override { return image_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_SNAPSHOT; } virtual bool is_readable() const override { return 1; } diff --git a/src/devices/machine/6850acia.cpp b/src/devices/machine/6850acia.cpp index 7c1fcc85178..82615fbaf32 100644 --- a/src/devices/machine/6850acia.cpp +++ b/src/devices/machine/6850acia.cpp @@ -158,7 +158,10 @@ void acia6850_device::device_start() save_item(NAME(m_rx_parity)); save_item(NAME(m_rx_counter)); save_item(NAME(m_rx_irq_enable)); +} +void acia6850_device::device_reset() +{ output_txd(1); output_rts(1); output_irq(1); diff --git a/src/devices/machine/6850acia.h b/src/devices/machine/6850acia.h index efaf153bc0c..df8c4a3bc29 100644 --- a/src/devices/machine/6850acia.h +++ b/src/devices/machine/6850acia.h @@ -51,6 +51,7 @@ protected: // device-level overrides virtual void device_start() override; + virtual void device_reset() override; virtual void update_irq(); int calculate_txirq(); diff --git a/src/devices/machine/input_merger.cpp b/src/devices/machine/input_merger.cpp new file mode 100644 index 00000000000..d75a3f994d2 --- /dev/null +++ b/src/devices/machine/input_merger.cpp @@ -0,0 +1,122 @@ +// license:BSD-3-Clause +// copyright-holders:Dirk Best +/*************************************************************************** + + Input Merger + + Used to connect multiple lines to a single device input while + keeping it pulled high or low + +***************************************************************************/ + +#include "input_merger.h" + +#include <algorithm> +#include <iterator> + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type INPUT_MERGER_ACTIVE_HIGH = &device_creator<input_merger_active_high_device>; +const device_type INPUT_MERGER_ACTIVE_LOW = &device_creator<input_merger_active_low_device>; + + +//************************************************************************** +// INPUT ADAPTER +//************************************************************************** + +//------------------------------------------------- +// input_merger_device - constructor +//------------------------------------------------- + +input_merger_device::input_merger_device(machine_config const &mconfig, device_type type, + char const *name, char const *tag, device_t *owner, UINT32 clock, char const *shortname, char const *source) + : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + m_output_handler(*this) +{ +} + +//------------------------------------------------- +// input_merger_device - destructor +//------------------------------------------------- + +input_merger_device::~input_merger_device() +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void input_merger_device::device_start() +{ + m_output_handler.resolve_safe(); +} + + +//************************************************************************** +// INPUT ADAPTER ACTIVE HIGH +//************************************************************************** + +//------------------------------------------------- +// input_merger_active_high_device - constructor +//------------------------------------------------- + +input_merger_active_high_device::input_merger_active_high_device(machine_config const &mconfig, char const *tag, device_t *owner, UINT32 clock) + : input_merger_device(mconfig, INPUT_MERGER_ACTIVE_HIGH, "Input Merger (Active High)", tag, owner, clock, "input_merger_hi", __FILE__) +{ +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void input_merger_active_high_device::device_reset() +{ + std::fill(std::begin(m_state), std::end(m_state), false); +} + +//------------------------------------------------- +// update_state - verify current input line state +//------------------------------------------------- + +void input_merger_active_high_device::update_state() +{ + bool state = std::any_of(std::begin(m_state), std::end(m_state), [&](bool state) { return state == true; }); + m_output_handler(state ? ASSERT_LINE : CLEAR_LINE); +} + + +//************************************************************************** +// INPUT ADAPTER ACTIVE LOW +//************************************************************************** + +//------------------------------------------------- +// input_merger_active_low_device - constructor +//------------------------------------------------- + +input_merger_active_low_device::input_merger_active_low_device(machine_config const &mconfig, char const *tag, device_t *owner, UINT32 clock) + : input_merger_device(mconfig, INPUT_MERGER_ACTIVE_LOW, "Input Merger (Active Low)", tag, owner, clock, "input_merger_lo", __FILE__) +{ +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void input_merger_active_low_device::device_reset() +{ + std::fill(std::begin(m_state), std::end(m_state), true); +} + +//------------------------------------------------- +// update_state - verify current input line state +//------------------------------------------------- + +void input_merger_active_low_device::update_state() +{ + bool state = std::any_of(std::begin(m_state), std::end(m_state), [&](bool state) { return state == false; }); + m_output_handler(state ? ASSERT_LINE : CLEAR_LINE); +} diff --git a/src/devices/machine/input_merger.h b/src/devices/machine/input_merger.h new file mode 100644 index 00000000000..9ede71f2ab8 --- /dev/null +++ b/src/devices/machine/input_merger.h @@ -0,0 +1,107 @@ +// license:BSD-3-Clause +// copyright-holders:Dirk Best +/*************************************************************************** + + Input Merger + + Used to connect multiple lines to a single device input while + keeping it pulled high or low + +***************************************************************************/ + +#pragma once + +#ifndef __INPUT_MERGER_H__ +#define __INPUT_MERGER_H__ + +#include "emu.h" + + +//************************************************************************** +// INTERFACE CONFIGURATION MACROS +//************************************************************************** + +#define MCFG_INPUT_MERGER_ACTIVE_HIGH(_tag) \ + MCFG_DEVICE_ADD(_tag, INPUT_MERGER_ACTIVE_HIGH, 0) + +#define MCFG_INPUT_MERGER_ACTIVE_LOW(_tag) \ + MCFG_DEVICE_ADD(_tag, INPUT_MERGER_ACTIVE_LOW, 0) + +#define MCFG_INPUT_MERGER_OUTPUT_HANDLER(_devcb) \ + devcb = &input_merger_device::set_output_handler(*device, DEVCB_##_devcb); + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> input_merger_device + +class input_merger_device : public device_t +{ +public: + // callback + template<class _Object> static devcb_base &set_output_handler(device_t &device, _Object object) + { return downcast<input_merger_device &>(device).m_output_handler.set_callback(object); } + + // input lines + DECLARE_WRITE_LINE_MEMBER( in0_w ) { m_state[0] = state; update_state(); }; + DECLARE_WRITE_LINE_MEMBER( in1_w ) { m_state[1] = state; update_state(); }; + DECLARE_WRITE_LINE_MEMBER( in2_w ) { m_state[2] = state; update_state(); }; + DECLARE_WRITE_LINE_MEMBER( in3_w ) { m_state[3] = state; update_state(); }; + DECLARE_WRITE_LINE_MEMBER( in4_w ) { m_state[4] = state; update_state(); }; + DECLARE_WRITE_LINE_MEMBER( in5_w ) { m_state[5] = state; update_state(); }; + DECLARE_WRITE_LINE_MEMBER( in6_w ) { m_state[6] = state; update_state(); }; + DECLARE_WRITE_LINE_MEMBER( in7_w ) { m_state[7] = state; update_state(); }; + +protected: + // constructor/destructor + input_merger_device(machine_config const &mconfig, device_type type, char const *name, char const *tag, device_t *owner, UINT32 clock, char const *shortname, char const *source); + virtual ~input_merger_device() override; + + // device-level overrides + virtual void device_start() override; + + virtual void update_state() = 0; + + devcb_write_line m_output_handler; + bool m_state[8]; +}; + +// ======================> input_merger_active_high_device + +class input_merger_active_high_device : public input_merger_device +{ +public: + input_merger_active_high_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + // device-level overrides + virtual void device_reset() override; + + // input_merger device overrides + virtual void update_state() override; +}; + +// ======================> input_merger_active_low_device + +class input_merger_active_low_device : public input_merger_device +{ +public: + input_merger_active_low_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + // device-level overrides + virtual void device_reset() override; + + // input_merger device overrides + virtual void update_state() override; +}; + + +// device type definition +extern const device_type INPUT_MERGER_ACTIVE_HIGH; +extern const device_type INPUT_MERGER_ACTIVE_LOW; + + +#endif /* __INPUT_MERGER_H__ */ diff --git a/src/devices/machine/netlist.cpp b/src/devices/machine/netlist.cpp index 0fa446aa897..c99b5ac9f18 100644 --- a/src/devices/machine/netlist.cpp +++ b/src/devices/machine/netlist.cpp @@ -503,7 +503,7 @@ void netlist_mame_cpu_device_t::device_start() for (int i=0; i < netlist().m_nets.size(); i++) { - netlist::net_t *n = netlist().m_nets[i].get(); + netlist::detail::net_t *n = netlist().m_nets[i].get(); if (n->is_logic()) { state_add(i*2, n->name().cstr(), downcast<netlist::logic_net_t *>(n)->Q_state_ptr()); @@ -604,7 +604,7 @@ void netlist_mame_sound_device_t::device_start() for (int i=0; i < MAX_OUT; i++) m_out[i] = nullptr; for (int i=0; i < m_num_outputs; i++) { - int chan = outdevs[i]->m_channel.Value(); + int chan = outdevs[i]->m_channel(); netlist().log().verbose("Output %d on channel %d", i, chan); diff --git a/src/devices/machine/netlist.h b/src/devices/machine/netlist.h index bc31b38dcdd..a7e3da059c2 100644 --- a/src/devices/machine/netlist.h +++ b/src/devices/machine/netlist.h @@ -429,7 +429,7 @@ public: inline void write(const UINT32 val) { const UINT32 v = (val >> m_shift) & m_mask; - if (v != m_param->Value()) + if (v != (*m_param)()) synchronize(0, v); } @@ -475,7 +475,7 @@ public: inline void write(const UINT32 val) { const UINT32 v = (val >> m_shift) & 1; - if (v != m_param->Value()) + if (v != (*m_param)()) synchronize(0, v); } @@ -577,7 +577,7 @@ public: NETLIB_UPDATEI() { - nl_double cur = INPANALOG(m_in); + nl_double cur = m_in(); // FIXME: make this a parameter // avoid calls due to noise @@ -637,7 +637,7 @@ public: NETLIB_UPDATEI() { - nl_double val = INPANALOG(m_in) * m_mult.Value() + m_offset.Value(); + nl_double val = m_in() * m_mult() + m_offset(); sound_update(netlist().time()); /* ignore spikes */ if (std::abs(val) < 32767.0) @@ -709,12 +709,12 @@ public: m_pos = 0; for (int i = 0; i < MAX_INPUT_CHANNELS; i++) { - if (m_param_name[i]->Value() != "") + if ((*m_param_name[i])() != pstring("")) { if (i != m_num_channel) netlist().log().fatal("sound input numbering has to be sequential!"); m_num_channel++; - m_param[i] = dynamic_cast<netlist::param_double_t *>(setup().find_param(m_param_name[i]->Value(), true)); + m_param[i] = dynamic_cast<netlist::param_double_t *>(setup().find_param((*m_param_name[i])(), true)); } } return m_num_channel; @@ -727,10 +727,10 @@ public: if (m_buffer[i] == nullptr) break; // stop, called outside of stream_update const nl_double v = m_buffer[i][m_pos]; - m_param[i]->setTo(v * m_param_mult[i]->Value() + m_param_offset[i]->Value()); + m_param[i]->setTo(v * (*m_param_mult[i])() + (*m_param_offset[i])()); } m_pos++; - OUTLOGIC(m_Q, !m_Q.net().new_Q(), m_inc ); + m_Q.push(!m_Q.net().new_Q(), m_inc ); } public: diff --git a/src/devices/machine/rtc4543.cpp b/src/devices/machine/rtc4543.cpp index 6079a663360..b068e44f882 100644 --- a/src/devices/machine/rtc4543.cpp +++ b/src/devices/machine/rtc4543.cpp @@ -20,7 +20,7 @@ // MACROS / CONSTANTS //************************************************************************** -#define VERBOSE 1 +#define VERBOSE 0 const char *rtc4543_device::s_reg_names[7] = { diff --git a/src/devices/machine/smartmed.h b/src/devices/machine/smartmed.h index b34ced7ff1d..84dd1a3bae1 100644 --- a/src/devices/machine/smartmed.h +++ b/src/devices/machine/smartmed.h @@ -216,7 +216,7 @@ public: virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override { return load_software(swlist, swname, start_entry); } + virtual const software_list_loader &get_software_list_loader() const override { return image_software_list_loader::instance(); } protected: // device-level overrides diff --git a/src/devices/machine/timekpr.cpp b/src/devices/machine/timekpr.cpp index 06aba0b7221..4b87d43ff69 100644 --- a/src/devices/machine/timekpr.cpp +++ b/src/devices/machine/timekpr.cpp @@ -10,6 +10,7 @@ - M48T37 - M48T58 - MK48T08 + - MK48T12 ***************************************************************************/ @@ -23,6 +24,7 @@ const device_type M48T35 = &device_creator<m48t35_device>; const device_type M48T37 = &device_creator<m48t37_device>; const device_type M48T58 = &device_creator<m48t58_device>; const device_type MK48T08 = &device_creator<mk48t08_device>; +const device_type MK48T12 = &device_creator<mk48t12_device>; /*************************************************************************** @@ -202,6 +204,20 @@ mk48t08_device::mk48t08_device(const machine_config &mconfig, const char *tag, d m_offset_flags = 0x1ff0; } +mk48t12_device::mk48t12_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : timekeeper_device(mconfig, MK48T12, "MK48T12 Timekeeper", tag, owner, clock, "m48t12", __FILE__, 0x2000) +{ + m_offset_control = 0x7f8; + m_offset_seconds = 0x7f9; + m_offset_minutes = 0x7fa; + m_offset_hours = 0x7fb; + m_offset_day = 0x7fc; + m_offset_date = 0x7fd; + m_offset_month = 0x7fe; + m_offset_year = 0x7ff; + m_offset_century = -1; +} + //------------------------------------------------- // device_start - device-specific startup diff --git a/src/devices/machine/timekpr.h b/src/devices/machine/timekpr.h index 3d96d2f394a..f6ecb8dcbfc 100644 --- a/src/devices/machine/timekpr.h +++ b/src/devices/machine/timekpr.h @@ -10,6 +10,7 @@ - M48T37 - M48T58 - MK48T08 + - MK48T12 ***************************************************************************/ @@ -41,6 +42,9 @@ #define MCFG_MK48T08_ADD(_tag) \ MCFG_DEVICE_ADD(_tag, MK48T08, 0) +#define MCFG_MK48T12_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, MK48T12, 0) + //************************************************************************** @@ -134,11 +138,18 @@ public: mk48t08_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; +class mk48t12_device : public timekeeper_device +{ +public: + mk48t12_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + // device type definition extern const device_type M48T02; extern const device_type M48T35; extern const device_type M48T37; extern const device_type M48T58; extern const device_type MK48T08; +extern const device_type MK48T12; #endif // __TIMEKPR_H__ diff --git a/src/devices/machine/z80scc.cpp b/src/devices/machine/z80scc.cpp index e78da06880c..5e1e7f984f9 100644 --- a/src/devices/machine/z80scc.cpp +++ b/src/devices/machine/z80scc.cpp @@ -250,7 +250,7 @@ void z80scc_device::device_start() // state saving save_item(NAME(m_int_state)); - + save_item(NAME(m_wr0_ptrbits)); LOG((" - SCC variant %02x\n", m_variant)); } @@ -508,7 +508,7 @@ void z80scc_device::trigger_interrupt(int index, int state) // trigger interrupt m_int_state[priority] |= Z80_DAISY_INT; - // Based on the fact that prio levels are aligned with the bitorder of rr3 we can do this... + // Based on the fact that prio levels are aligned with the bitorder of rr3 we can do this... TODO: field needs blanking? m_chanA->m_rr3 |= (prio_level << (index == CHANNEL_A ? 3 : 0 )); // check for interrupt @@ -680,6 +680,7 @@ z80scc_channel::z80scc_channel(const machine_config &mconfig, const char *tag, d #else m_brg_rate(0), #endif + m_delayed_tx_brg_change(0), m_brg_const(1), m_rx_error(0), m_rx_clock(0), @@ -930,6 +931,12 @@ void z80scc_channel::tra_callback() void z80scc_channel::tra_complete() { + if ( m_delayed_tx_brg_change == 1) + { + m_delayed_tx_brg_change = 0; + set_tra_rate(m_brg_rate); + LOG(("Delayed setup - Baud Rate Generator: %d mode: %dx\n", m_brg_rate, get_clock_mode() )); + } if ((m_wr5 & WR5_TX_ENABLE) && !(m_wr5 & WR5_SEND_BREAK) && !(m_rr0 & RR0_TX_BUFFER_EMPTY)) { LOG((LLFORMAT " %s() \"%s \"Channel %c Transmit Data Byte '%02x' m_wr5:%02x\n", machine().firstcpu->total_cycles(), FUNCNAME, m_owner->tag(), 'A' + m_index, m_tx_data, m_wr5)); @@ -1339,12 +1346,13 @@ UINT8 z80scc_channel::control_read() int reg = m_uart->m_wr0_ptrbits; //m_wr0; int regmask = (WR0_REGISTER_MASK | (m_uart->m_wr0_ptrbits & WR0_POINT_HIGH)); - // LOG(("%s(%02x) reg %02x, regmask %02x, WR0 %02x\n", FUNCNAME, data, reg, regmask, m_wr0)); + LOGR(("%s(%02x) reg %02x, regmask %02x, WR0 %02x\n", FUNCNAME, data, reg, regmask, m_wr0)); m_uart->m_wr0_ptrbits = 0; reg &= regmask; if (reg != 0) { + LOG(("%s(%02x) reg %02x, regmask %02x, WR0 %02x\n", FUNCNAME, data, reg, regmask, m_wr0)); // mask out register index m_wr0 &= ~regmask; } @@ -1488,6 +1496,7 @@ void z80scc_channel::do_sccreg_wr0(UINT8 data) if ( m_uart->m_variant & SET_Z85X3X) { + m_uart->m_wr0_ptrbits &= ~WR0_REGISTER_MASK; m_uart->m_wr0_ptrbits |= (m_wr0 & (WR0_REGISTER_MASK)); } else if ( m_uart->m_variant & SET_Z80X30) // TODO: Implement adress decoding for Z80X30 using the shift logic described below @@ -1865,20 +1874,15 @@ void z80scc_channel::do_sccreg_wr14(UINT8 data) if ( !(m_wr14 & WR14_BRG_ENABLE) && (data & WR14_BRG_ENABLE) ) // baud rate generator beeing enabled? { LOG(("\"%s\": %c : %s Mics Control Bits Baudrate generator enabled with ", m_owner->tag(), 'A' + m_index, FUNCNAME)); - m_brg_const = 2 + (m_wr13 << 8 | m_wr12); if (data & WR14_BRG_SOURCE) // Do we use the PCLK as baudrate source { - int rate = m_owner->clock() / (m_brg_const == 0 ? 1 : m_brg_const); - LOG(("PCLK as source, rate (%d) = PCLK (%d) / (%d)\n", rate, m_owner->clock(), m_brg_const)); + LOG((" - PCLK as source\n")); #if 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 -#else - m_brg_rate = rate / (2 * get_clock_mode()); - update_serial(); #endif } else @@ -1893,11 +1897,11 @@ void z80scc_channel::do_sccreg_wr14(UINT8 data) m_brg_counter = 0; #else m_brg_rate = 1; /* Signal update_serial() to disable BRG */ - update_serial(); #endif } // TODO: Add info on the other bits of this register m_wr14 = data; + update_serial(); } /* WR15 is the External/Status Source Control register. If the External/Status interrupts are enabled @@ -1958,7 +1962,7 @@ void z80scc_channel::control_write(UINT8 data) /* TODO. Sort out 80X30 & other SCC variants limitations in register access */ switch (reg) { - case REG_WR0_COMMAND_REGPT: do_sccreg_wr0(data); ;break; + case REG_WR0_COMMAND_REGPT: do_sccreg_wr0(data); break; case REG_WR1_INT_DMA_ENABLE: do_sccreg_wr1(data); m_uart->check_interrupts(); break; case REG_WR2_INT_VECTOR: do_sccreg_wr2(data); break; case REG_WR3_RX_CONTROL: do_sccreg_wr3(data); break; @@ -2418,12 +2422,29 @@ void z80scc_channel::update_serial() LOG((" - Transmit clock: %d mode: %d rate: %d/%xh\n", m_rxc, clocks, m_rxc / clocks, m_rxc / clocks)); } - if (m_brg_rate != 0) + if (m_brg_rate != 0 || m_wr14 & WR14_BRG_ENABLE) { - if (m_brg_rate == 1) m_brg_rate = 0; // BRG beeing disabled + if (m_brg_rate == 1) + { + m_brg_rate = 0; // BRG beeing disabled + } + else // or enabled + { + m_brg_const = 2 + (m_wr13 << 8 | m_wr12); + int rate = m_owner->clock() / (m_brg_const == 0 ? 1 : m_brg_const); + m_brg_rate = rate / (2 * get_clock_mode()); + LOG((" - Source bit rate (%d) = PCLK (%d) / (%d)\n", rate, m_owner->clock(), m_brg_const)); + } set_rcv_rate(m_brg_rate); - set_tra_rate(m_brg_rate); - LOG((" - Baud Rate Generator: %d mode: %dx\n", m_brg_rate, get_clock_mode() )); + if (is_transmit_register_empty()) + { + set_tra_rate(m_brg_rate); + LOG((" - Baud Rate Generator: %d mode: %dx\n", m_brg_rate, get_clock_mode() )); + } + else + { + m_delayed_tx_brg_change = 1; + } } } diff --git a/src/devices/machine/z80scc.h b/src/devices/machine/z80scc.h index e9f9e93e9d2..f68ad9760e6 100644 --- a/src/devices/machine/z80scc.h +++ b/src/devices/machine/z80scc.h @@ -523,6 +523,7 @@ protected: #else unsigned int m_brg_rate; #endif + unsigned int m_delayed_tx_brg_change; unsigned int m_brg_const; void update_serial(); diff --git a/src/emu/diimage.cpp b/src/emu/diimage.cpp index e3314bcaaf5..8b4f11ee3db 100644 --- a/src/emu/diimage.cpp +++ b/src/emu/diimage.cpp @@ -168,7 +168,7 @@ iodevice_t device_image_interface::device_typeid(const char *name) using this device's partial hash if appropriate -------------------------------------------------*/ -void device_image_interface::device_compute_hash(hash_collection &hashes, const void *data, size_t length, const char *types) const +void device_image_interface::device_compute_hash(util::hash_collection &hashes, const void *data, size_t length, const char *types) const { /* retrieve the partial hash func */ device_image_partialhash_func partialhash = get_partial_hash(); @@ -464,8 +464,8 @@ bool device_image_interface::load_software_region(const char *tag, optional_shar // to be loaded // **************************************************************************** -void device_image_interface::run_hash(void (*partialhash)(hash_collection &, const unsigned char *, unsigned long, const char *), - hash_collection &hashes, const char *types) +void device_image_interface::run_hash(void (*partialhash)(util::hash_collection &, const unsigned char *, unsigned long, const char *), + util::hash_collection &hashes, const char *types) { UINT32 size; dynamic_buffer buf; @@ -511,7 +511,7 @@ void device_image_interface::image_checkhash() // retrieve the partial hash func partialhash = get_partial_hash(); - run_hash(partialhash, m_hash, hash_collection::HASH_TYPES_ALL); + run_hash(partialhash, m_hash, util::hash_collection::HASH_TYPES_ALL); } return; } @@ -778,7 +778,7 @@ void device_image_interface::determine_open_plan(int is_create, UINT32 *open_pla // correct checksums for a given software item //------------------------------------------------- -static void dump_wrong_and_correct_checksums(const hash_collection &hashes, const hash_collection &acthashes) +static void dump_wrong_and_correct_checksums(const util::hash_collection &hashes, const util::hash_collection &acthashes) { osd_printf_error(" EXPECTED: %s\n", hashes.macro_string().c_str()); osd_printf_error(" FOUND: %s\n", acthashes.macro_string().c_str()); @@ -790,7 +790,7 @@ static void dump_wrong_and_correct_checksums(const hash_collection &hashes, cons // and hash signatures of a file //------------------------------------------------- -static int verify_length_and_hash(emu_file *file, const char *name, UINT32 explength, const hash_collection &hashes) +static int verify_length_and_hash(emu_file *file, const char *name, UINT32 explength, const util::hash_collection &hashes) { int retVal = 0; if (file==nullptr) return 0; @@ -804,8 +804,8 @@ static int verify_length_and_hash(emu_file *file, const char *name, UINT32 exple } // If there is no good dump known, write it - hash_collection &acthashes = file->hashes(hashes.hash_types().c_str()); - if (hashes.flag(hash_collection::FLAG_NO_DUMP)) + util::hash_collection &acthashes = file->hashes(hashes.hash_types().c_str()); + if (hashes.flag(util::hash_collection::FLAG_NO_DUMP)) { osd_printf_error("%s NO GOOD DUMP KNOWN\n", name); } @@ -818,7 +818,7 @@ static int verify_length_and_hash(emu_file *file, const char *name, UINT32 exple retVal++; } // If it matches, but it is actually a bad dump, write it - else if (hashes.flag(hash_collection::FLAG_BAD_DUMP)) + else if (hashes.flag(util::hash_collection::FLAG_BAD_DUMP)) { osd_printf_error("%s NEEDS REDUMP\n",name); } @@ -848,7 +848,7 @@ bool device_image_interface::load_software(software_list_device &swlist, const c osd_file::error filerr = osd_file::error::NOT_FOUND; UINT32 crc = 0; - bool has_crc = hash_collection(ROM_GETHASHDATA(romp)).crc(crc); + bool has_crc = util::hash_collection(ROM_GETHASHDATA(romp)).crc(crc); const software_info *swinfo = swlist.find(swname); if (swinfo == nullptr) @@ -867,8 +867,7 @@ bool device_image_interface::load_software(software_list_device &swlist, const c while (swinfo != nullptr) { locationtag.append(swinfo->shortname()).append(breakstr); - const char *parentname = swinfo->parentname(); - swinfo = (parentname != nullptr) ? swlist.find(parentname) : nullptr; + swinfo = !swinfo->parentname().empty() ? swlist.find(swinfo->parentname().c_str()) : nullptr; } // strip the final '%' locationtag.erase(locationtag.length() - 1, 1); @@ -912,7 +911,7 @@ bool device_image_interface::load_software(software_list_device &swlist, const c if ((m_mame_file == nullptr) && (tag5.c_str() != nullptr)) m_mame_file = common_process_file(device().machine().options(), tag5.c_str(), has_crc, crc, romp, filerr); - warningcount += verify_length_and_hash(m_mame_file.get(),ROM_GETNAME(romp),ROM_GETLENGTH(romp),hash_collection(ROM_GETHASHDATA(romp))); + warningcount += verify_length_and_hash(m_mame_file.get(),ROM_GETNAME(romp),ROM_GETLENGTH(romp), util::hash_collection(ROM_GETHASHDATA(romp))); if (filerr == osd_file::error::NONE) filerr = util::core_file::open_proxy(*m_mame_file, m_file); @@ -1008,7 +1007,7 @@ bool device_image_interface::load_internal(const char *path, bool is_create, int if ( m_software_info_ptr ) { // sanitize - if (m_software_info_ptr->longname() == nullptr || m_software_info_ptr->publisher() == nullptr || m_software_info_ptr->year() == nullptr) + if (m_software_info_ptr->longname().empty() || m_software_info_ptr->publisher().empty() || m_software_info_ptr->year().empty()) fatalerror("Each entry in an XML list must have all of the following fields: description, publisher, year!\n"); // store @@ -1328,6 +1327,23 @@ const software_part *device_image_interface::find_software_item(const char *path //------------------------------------------------- +// call_softlist_load +//------------------------------------------------- + +bool device_image_interface::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) +{ + const software_list_loader &loader = get_software_list_loader(); + bool result = loader.load_software(*this, swlist, swname, start_entry); + + // this is a hook that seems to only be used by TI99 + if (result) + loaded_through_softlist(); + + return result; +} + + +//------------------------------------------------- // load_software_part // // Load a software part for a device. The part to @@ -1352,7 +1368,7 @@ bool device_image_interface::load_software_part(const char *path, const software // Load the software part software_list_device &swlist = swpart->info().list(); - bool result = call_softlist_load(swlist, swpart->info().shortname(), swpart->romdata()); + bool result = call_softlist_load(swlist, swpart->info().shortname().c_str(), swpart->romdata()); // Tell the world which part we actually loaded std::string full_sw_name = string_format("%s:%s:%s", swlist.list_name(), swpart->info().shortname(), swpart->name()); diff --git a/src/emu/diimage.h b/src/emu/diimage.h index 692910e6060..75db14229e6 100644 --- a/src/emu/diimage.h +++ b/src/emu/diimage.h @@ -21,6 +21,8 @@ #include <string> #include <vector> +#include "softlist.h" + //************************************************************************** // TYPE DEFINITIONS @@ -102,7 +104,7 @@ class software_info; typedef delegate<int (device_image_interface &)> device_image_load_delegate; typedef delegate<void (device_image_interface &)> device_image_func_delegate; // legacy -typedef void (*device_image_partialhash_func)(hash_collection &, const unsigned char *, unsigned long, const char *); +typedef void (*device_image_partialhash_func)(util::hash_collection &, const unsigned char *, unsigned long, const char *); //************************************************************************** // MACROS @@ -145,10 +147,9 @@ public: static const char *device_brieftypename(iodevice_t type); static iodevice_t device_typeid(const char *name); - virtual void device_compute_hash(hash_collection &hashes, const void *data, size_t length, const char *types) const; + virtual void device_compute_hash(util::hash_collection &hashes, const void *data, size_t length, const char *types) const; virtual bool call_load() { return FALSE; } - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) { return FALSE; } virtual bool call_create(int format_type, util::option_resolution *format_options) { return FALSE; } virtual void call_unload() { } virtual std::string call_display() { return std::string(); } @@ -214,7 +215,7 @@ public: bool load_software_region(const char *tag, optional_shared_ptr<UINT8> &ptr); UINT32 crc(); - hash_collection& hash() { return m_hash; } + util::hash_collection& hash() { return m_hash; } void battery_load(void *buffer, int length, int fill); void battery_load(void *buffer, int length, void *def_buffer); @@ -247,6 +248,9 @@ public: bool user_loadable() const { return m_user_loadable; } protected: + virtual const software_list_loader &get_software_list_loader() const { return false_software_list_loader::instance(); } + virtual void loaded_through_softlist() { } + bool load_internal(const char *path, bool is_create, int create_format, util::option_resolution *create_args, bool just_load); void determine_open_plan(int is_create, UINT32 *open_plan); image_error_t load_image_by_path(UINT32 open_flags, const char *path); @@ -262,7 +266,7 @@ protected: void setup_working_directory(); bool try_change_working_directory(const char *subdir); - void run_hash(void (*partialhash)(hash_collection &, const unsigned char *, unsigned long, const char *), hash_collection &hashes, const char *types); + void run_hash(void (*partialhash)(util::hash_collection &, const unsigned char *, unsigned long, const char *), util::hash_collection &hashes, const char *types); void image_checkhash(); void update_names(const device_type device_type = nullptr, const char *inst = nullptr, const char *brief = nullptr); @@ -313,7 +317,7 @@ protected: int m_create_format; util::option_resolution *m_create_args; - hash_collection m_hash; + util::hash_collection m_hash; std::string m_brief_instance_name; std::string m_instance_name; @@ -326,6 +330,9 @@ protected: bool m_user_loadable; bool m_is_loading; + +private: + bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry); }; // iterator diff --git a/src/emu/fileio.cpp b/src/emu/fileio.cpp index 1fe26071acb..923ea427b3f 100644 --- a/src/emu/fileio.cpp +++ b/src/emu/fileio.cpp @@ -197,7 +197,7 @@ emu_file::operator util::core_file &() // hash - returns the hash for a file //------------------------------------------------- -hash_collection &emu_file::hashes(const char *types) +util::hash_collection &emu_file::hashes(const char *types) { // determine the hashes we already have std::string already_have = m_hashes.hash_types(); diff --git a/src/emu/fileio.h b/src/emu/fileio.h index 411e211d17b..7775854ec23 100644 --- a/src/emu/fileio.h +++ b/src/emu/fileio.h @@ -91,7 +91,7 @@ public: const char *filename() const { return m_filename.c_str(); } const char *fullpath() const { return m_fullpath.c_str(); } UINT32 openflags() const { return m_openflags; } - hash_collection &hashes(const char *types); + util::hash_collection &hashes(const char *types); bool restrict_to_mediapath() const { return m_restrict_to_mediapath; } bool part_of_mediapath(std::string path); @@ -155,7 +155,7 @@ private: path_iterator m_mediapaths; // media-path iterator UINT32 m_crc; // file's CRC UINT32 m_openflags; // flags we used for the open - hash_collection m_hashes; // collection of hashes + util::hash_collection m_hashes; // collection of hashes std::unique_ptr<util::archive_file> m_zipfile; // ZIP file pointer dynamic_buffer m_zipdata; // ZIP file data diff --git a/src/emu/render.cpp b/src/emu/render.cpp index 636cc3d2c6d..a335489ce11 100644 --- a/src/emu/render.cpp +++ b/src/emu/render.cpp @@ -458,6 +458,8 @@ void render_texture::get_scaled(UINT32 dwidth, UINT32 dheight, render_texinfo &t // are we scaler-free? if so, just return the source bitmap if (m_scaler == nullptr || (m_bitmap != nullptr && swidth == dwidth && sheight == dheight)) { + if (m_bitmap == nullptr) return; + // add a reference and set up the source bitmap primlist.add_reference(m_bitmap); texinfo.base = m_bitmap->raw_pixptr(m_sbounds.min_y, m_sbounds.min_x); diff --git a/src/emu/romload.cpp b/src/emu/romload.cpp index deb3ad6d8aa..7a4d420f205 100644 --- a/src/emu/romload.cpp +++ b/src/emu/romload.cpp @@ -380,7 +380,7 @@ void rom_load_manager::handle_missing_file(const rom_entry *romp, std::string tr } /* no good dumps are okay */ - else if (hash_collection(ROM_GETHASHDATA(romp)).flag(hash_collection::FLAG_NO_DUMP)) + else if (util::hash_collection(ROM_GETHASHDATA(romp)).flag(util::hash_collection::FLAG_NO_DUMP)) { if (!is_chd_error) m_errorstring.append(string_format("%s NOT FOUND (NO GOOD DUMP KNOWN)%s\n", name, tried_file_names)); @@ -403,7 +403,7 @@ void rom_load_manager::handle_missing_file(const rom_entry *romp, std::string tr correct checksums for a given ROM -------------------------------------------------*/ -void rom_load_manager::dump_wrong_and_correct_checksums(const hash_collection &hashes, const hash_collection &acthashes) +void rom_load_manager::dump_wrong_and_correct_checksums(const util::hash_collection &hashes, const util::hash_collection &acthashes) { m_errorstring.append(string_format(" EXPECTED: %s\n", hashes.macro_string().c_str())); m_errorstring.append(string_format(" FOUND: %s\n", acthashes.macro_string().c_str())); @@ -415,7 +415,7 @@ void rom_load_manager::dump_wrong_and_correct_checksums(const hash_collection &h and hash signatures of a file -------------------------------------------------*/ -void rom_load_manager::verify_length_and_hash(const char *name, UINT32 explength, const hash_collection &hashes) +void rom_load_manager::verify_length_and_hash(const char *name, UINT32 explength, const util::hash_collection &hashes) { /* we've already complained if there is no file */ if (m_file == nullptr) @@ -430,8 +430,8 @@ void rom_load_manager::verify_length_and_hash(const char *name, UINT32 explength } /* If there is no good dump known, write it */ - hash_collection &acthashes = m_file->hashes(hashes.hash_types().c_str()); - if (hashes.flag(hash_collection::FLAG_NO_DUMP)) + util::hash_collection &acthashes = m_file->hashes(hashes.hash_types().c_str()); + if (hashes.flag(util::hash_collection::FLAG_NO_DUMP)) { m_errorstring.append(string_format("%s NO GOOD DUMP KNOWN\n", name)); m_knownbad++; @@ -445,7 +445,7 @@ void rom_load_manager::verify_length_and_hash(const char *name, UINT32 explength m_warnings++; } /* If it matches, but it is actually a bad dump, write it */ - else if (hashes.flag(hash_collection::FLAG_BAD_DUMP)) + else if (hashes.flag(util::hash_collection::FLAG_BAD_DUMP)) { m_errorstring.append(string_format("%s ROM NEEDS REDUMP\n", name)); m_knownbad++; @@ -557,7 +557,7 @@ int rom_load_manager::open_rom_file(const char *regiontag, const rom_entry *romp /* extract CRC to use for searching */ UINT32 crc = 0; - bool has_crc = hash_collection(ROM_GETHASHDATA(romp)).crc(crc); + bool has_crc = util::hash_collection(ROM_GETHASHDATA(romp)).crc(crc); /* attempt reading up the chain through the parents. It automatically also attempts any kind of load by checksum supported by the archives. */ @@ -928,7 +928,7 @@ void rom_load_manager::process_rom_entries(const char *regiontag, const rom_entr if (baserom) { LOG(("Verifying length (%X) and checksums\n", explength)); - verify_length_and_hash(ROM_GETNAME(baserom), explength, hash_collection(ROM_GETHASHDATA(baserom))); + verify_length_and_hash(ROM_GETNAME(baserom), explength, util::hash_collection(ROM_GETHASHDATA(baserom))); LOG(("Verify finished\n")); } @@ -1064,7 +1064,7 @@ int open_disk_image(emu_options &options, const game_driver *gamedrv, const rom_ /* otherwise, look at our parents for a CHD with an identical checksum */ /* and try to open that */ - hash_collection romphashes(ROM_GETHASHDATA(romp)); + util::hash_collection romphashes(ROM_GETHASHDATA(romp)); for (int drv = driver_list::find(*gamedrv); drv != -1; drv = driver_list::clone(drv)) { machine_config config(driver_list::driver(drv), options); @@ -1075,7 +1075,7 @@ int open_disk_image(emu_options &options, const game_driver *gamedrv, const rom_ /* look for a differing name but with the same hash data */ if (strcmp(ROM_GETNAME(romp), ROM_GETNAME(rom)) != 0 && - romphashes == hash_collection(ROM_GETHASHDATA(rom))) + romphashes == util::hash_collection(ROM_GETHASHDATA(rom))) { /* attempt to open the properly named file, scanning up through parent directories */ filerr = osd_file::error::NOT_FOUND; @@ -1161,7 +1161,7 @@ void rom_load_manager::process_disk_entries(const char *regiontag, const rom_ent { auto chd = std::make_unique<open_chd>(regiontag); - hash_collection hashes(ROM_GETHASHDATA(romp)); + util::hash_collection hashes(ROM_GETHASHDATA(romp)); chd_error err; /* make the filename of the source */ @@ -1178,7 +1178,7 @@ void rom_load_manager::process_disk_entries(const char *regiontag, const rom_ent } /* get the header and extract the SHA1 */ - hash_collection acthashes; + util::hash_collection acthashes; acthashes.add_sha1(chd->orig_chd().sha1()); /* verify the hash */ @@ -1188,7 +1188,7 @@ void rom_load_manager::process_disk_entries(const char *regiontag, const rom_ent dump_wrong_and_correct_checksums(hashes, acthashes); m_warnings++; } - else if (hashes.flag(hash_collection::FLAG_BAD_DUMP)) + else if (hashes.flag(util::hash_collection::FLAG_BAD_DUMP)) { m_errorstring.append(string_format("%s CHD NEEDS REDUMP\n", filename)); m_knownbad++; @@ -1299,8 +1299,7 @@ void rom_load_manager::load_software_part_region(device_t &device, software_list while (swinfo != nullptr) { locationtag.append(swinfo->shortname()).append(breakstr); - const char *parentname = swinfo->parentname(); - swinfo = (parentname != nullptr) ? swlist.find(parentname) : nullptr; + swinfo = !swinfo->parentname().empty() ? swlist.find(swinfo->parentname().c_str()) : nullptr; } // strip the final '%' locationtag.erase(locationtag.length() - 1, 1); diff --git a/src/emu/romload.h b/src/emu/romload.h index 860f50cbe95..f60e14fdb55 100644 --- a/src/emu/romload.h +++ b/src/emu/romload.h @@ -310,8 +310,8 @@ private: void count_roms(); void fill_random(UINT8 *base, UINT32 length); void handle_missing_file(const rom_entry *romp, std::string tried_file_names, chd_error chderr); - void dump_wrong_and_correct_checksums(const hash_collection &hashes, const hash_collection &acthashes); - void verify_length_and_hash(const char *name, UINT32 explength, const hash_collection &hashes); + void dump_wrong_and_correct_checksums(const util::hash_collection &hashes, const util::hash_collection &acthashes); + void verify_length_and_hash(const char *name, UINT32 explength, const util::hash_collection &hashes); void display_loading_rom_message(const char *name, bool from_list); void display_rom_load_results(bool from_list); void region_post_process(const char *rgntag, bool invert); diff --git a/src/emu/softlist.cpp b/src/emu/softlist.cpp index b4dba456a4a..35639f57d2e 100644 --- a/src/emu/softlist.cpp +++ b/src/emu/softlist.cpp @@ -21,7 +21,7 @@ // TYPE DEFINITIONS //************************************************************************** -typedef std::unordered_map<std::string,software_info *> softlist_map; +typedef std::unordered_map<std::string,const software_info *> softlist_map; // ======================> softlist_parser @@ -44,7 +44,7 @@ private: // internal parsing helpers const char *filename() const { return m_list.filename(); } - const char *infoname() const { return (m_current_info != nullptr) ? m_current_info->shortname() : "???"; } + const char *infoname() const { return (m_current_info != nullptr) ? m_current_info->shortname().c_str() : "???"; } int line() const { return XML_GetCurrentLineNumber(m_parser); } int column() const { return XML_GetCurrentColumnNumber(m_parser); } const char *parser_error() const { return XML_ErrorString(XML_GetErrorCode(m_parser)); } @@ -55,7 +55,8 @@ private: void unknown_attribute(const char *attrname) { parse_error("Unknown attribute: %s", attrname); } // internal helpers - void parse_attributes(const char **attributes, int numattrs, const char *attrlist[], const char *outlist[]); + template <typename T> std::vector<std::string> parse_attributes(const char **attributes, const T &attrlist); + bool parse_name_and_value(const char **attributes, std::string &name, std::string &value); void add_rom_entry(const char *name, const char *hashdata, UINT32 offset, UINT32 length, UINT32 flags); // expat callbacks @@ -91,10 +92,76 @@ private: // device type definition const device_type SOFTWARE_LIST = &device_creator<software_list_device>; +false_software_list_loader false_software_list_loader::s_instance; +rom_software_list_loader rom_software_list_loader::s_instance; +image_software_list_loader image_software_list_loader::s_instance; //************************************************************************** +// SOFTWARE LIST LOADER +//************************************************************************** + +//------------------------------------------------- +// false_software_list_loader::load_software +//------------------------------------------------- + +bool false_software_list_loader::load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const +{ + return false; +} + + +//------------------------------------------------- +// rom_software_list_loader::load_software +//------------------------------------------------- + +bool rom_software_list_loader::load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const +{ + swlist.machine().rom_load().load_software_part_region(device, swlist, swname, start_entry); + return true; +} + + +//------------------------------------------------- +// image_software_list_loader::load_software +//------------------------------------------------- + +bool image_software_list_loader::load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const +{ + return device.load_software(swlist, swname, start_entry); +} + + +//************************************************************************** +// FEATURE LIST ITEM +//************************************************************************** + +//------------------------------------------------- +// feature_list_item - constructor +//------------------------------------------------- + +feature_list_item::feature_list_item(const std::string &name, const std::string &value) + : m_next(nullptr), + m_name(name), + m_value(value) +{ +} + + +//------------------------------------------------- +// feature_list_item - constructor +//------------------------------------------------- + +feature_list_item::feature_list_item(std::string &&name, std::string &&value) + : m_next(nullptr), + m_name(std::move(name)), + m_value(std::move(value)) +{ +} + + +//************************************************************************** // SOFTWARE PART //************************************************************************** @@ -102,15 +169,12 @@ const device_type SOFTWARE_LIST = &device_creator<software_list_device>; // software_part - constructor //------------------------------------------------- -software_part::software_part(software_info &info, const char *name, const char *interface) +software_part::software_part(software_info &info, std::string &&name, std::string &&interface) : m_next(nullptr), m_info(info), - m_name(name), - m_interface(interface) + m_name(std::move(name)), + m_interface(std::move(interface)) { - // ensure strings we are passed are in the string pool - assert(info.list().string_pool_contains(name)); - assert(info.list().string_pool_contains(interface)); } @@ -119,14 +183,12 @@ software_part::software_part(software_info &info, const char *name, const char * // feature, if specified //------------------------------------------------- -const char *software_part::feature(const char *feature_name) const +const char *software_part::feature(const std::string &feature_name) const { - assert(feature_name != nullptr); - // scan the feature list for an entry matching feature_name and return the value for (const feature_list_item &feature : m_featurelist) - if (strcmp(feature.name(), feature_name) == 0) - return feature.value(); + if (feature.name() == feature_name) + return feature.value().c_str(); return nullptr; } @@ -190,7 +252,7 @@ software_compatibility software_part::is_compatible(const software_list_device & bool software_part::matches_interface(const char *interface_list) const { // if we have no interface, then we match by default - if (m_interface == nullptr) + if (m_interface.empty()) return true; // copy the comma-delimited interface list and ensure it ends with a final comma @@ -239,20 +301,13 @@ device_image_interface *software_part::find_mountable_image(const machine_config // software_info - constructor //------------------------------------------------- -software_info::software_info(software_list_device &list, const char *name, const char *parent, const char *supported) +software_info::software_info(software_list_device &list, std::string &&name, std::string &&parent, const char *supported) : m_next(nullptr), m_list(list), m_supported(SOFTWARE_SUPPORTED_YES), - m_shortname(name), - m_longname(nullptr), - m_parentname(parent), - m_year(nullptr), - m_publisher(nullptr) + m_shortname(std::move(name)), + m_parentname(std::move(parent)) { - // ensure strings we are passed are in the string pool - assert(list.string_pool_contains(name)); - assert(list.string_pool_contains(parent)); - // handle the supported flag if provided if (supported != nullptr) { @@ -275,11 +330,11 @@ const software_part *software_info::find_part(const char *partname, const char * if (partname != nullptr && strlen(partname)==0) partname = nullptr; if (partname == nullptr && interface == nullptr) - return m_partdata.first(); + return &m_partdata.front(); // look for the part by name and match against the interface if provided for (const software_part &part : m_partdata) - if (partname != nullptr && strcmp(partname, part.name()) == 0) + if (partname != nullptr && (partname == part.name())) { if (interface == nullptr || part.matches_interface(interface)) return ∂ @@ -301,7 +356,7 @@ bool software_info::has_multiple_parts(const char *interface) const int count = 0; // increment the count for each match and stop if we hit more than 1 - for (software_part &part : m_partdata) + for (const software_part &part : m_partdata) if (part.matches_interface(interface)) if (++count > 1) return true; @@ -325,7 +380,7 @@ software_list_device::software_list_device(const machine_config &mconfig, const m_filter(nullptr), m_parsed(false), m_file(mconfig.options().hash_path(), OPEN_FLAG_READ), - m_description(nullptr) + m_description("") { } @@ -386,12 +441,12 @@ void software_list_device::find_approx_matches(const char *name, int matches, co // iterate over our info (will cause a parse if needed) for (const software_info &swinfo : get_info()) { - const software_part *part = swinfo.first_part(); - if ((interface == nullptr || part->matches_interface(interface)) && part->is_compatible(*this) == SOFTWARE_IS_COMPATIBLE) + const software_part &part = swinfo.parts().front(); + if ((interface == nullptr || part.matches_interface(interface)) && part.is_compatible(*this) == SOFTWARE_IS_COMPATIBLE) { // pick the best match between driver name and description - int longpenalty = driver_list::penalty_compare(name, swinfo.longname()); - int shortpenalty = driver_list::penalty_compare(name, swinfo.shortname()); + int longpenalty = driver_list::penalty_compare(name, swinfo.longname().c_str()); + int shortpenalty = driver_list::penalty_compare(name, swinfo.shortname().c_str()); int curpenalty = MIN(longpenalty, shortpenalty); // insert into the sorted table of matches @@ -423,10 +478,9 @@ void software_list_device::release() { osd_printf_verbose("Resetting %s\n", m_file.filename()); m_parsed = false; - m_description = nullptr; + m_description.clear(); m_errors.clear(); - m_infolist.reset(); - m_stringpool.reset(); + m_infolist.clear(); } @@ -476,9 +530,11 @@ void software_list_device::display_matches(const machine_config &config, const c osd_printf_error("* Compatible software list \"%s\" (%s) matches: \n", swlistdev.list_name(), swlistdev.description()); // print them out - for (auto & matche : matches) - if (matche != nullptr) - osd_printf_error("%-18s%s\n", matche->shortname(), matche->longname()); + for (auto &match : matches) + { + if (match != nullptr) + osd_printf_error("%-18s%s\n", match->shortname().c_str(), match->longname().c_str()); + } osd_printf_error("\n"); } @@ -492,7 +548,7 @@ void software_list_device::display_matches(const machine_config &config, const c // from an intermediate point //------------------------------------------------- -const software_info *software_list_device::find(const char *look_for, const software_info *prev) +const software_info *software_list_device::find(const char *look_for) { // nullptr search returns nothing if (look_for == nullptr) @@ -501,11 +557,20 @@ const software_info *software_list_device::find(const char *look_for, const soft bool iswild = strchr(look_for, '*') != nullptr || strchr(look_for, '?'); // find a match (will cause a parse if needed when calling get_info) - for (prev = (prev != nullptr) ? prev->next() : get_info().first(); prev != nullptr; prev = prev->next()) - if ((iswild && core_strwildcmp(look_for, prev->shortname()) == 0) || core_stricmp(look_for, prev->shortname()) == 0) - break; - - return prev; + const auto &info_list = get_info(); + auto iter = std::find_if( + info_list.begin(), + info_list.end(), + [&](const software_info &info) + { + const char *shortname = info.shortname().c_str(); + return (iswild && core_strwildcmp(look_for, shortname) == 0) + || core_stricmp(look_for, shortname) == 0; + }); + + return iter != info_list.end() + ? &*iter + : nullptr; } @@ -549,7 +614,7 @@ void software_list_device::device_validity_check(validity_checker &valid) const { // add to the global map whenever we check a list so we don't re-check // it in the future - if (valid.already_checked(std::string("softlist/").append(m_list_name.c_str()).c_str())) + if (valid.already_checked(std::string("softlist/").append(m_list_name).c_str())) return; // do device validation only in case of validate command @@ -572,7 +637,7 @@ void software_list_device::internal_validity_check(validity_checker &valid) softlist_map names; softlist_map descriptions; - for (software_info &swinfo : get_info()) + for (const software_info &swinfo : get_info()) { // first parse and output core errors if any if (m_errors.length() > 0) @@ -584,30 +649,30 @@ void software_list_device::internal_validity_check(validity_checker &valid) // Now check if the xml data is valid: // Did we lost any description? - if (swinfo.longname() == nullptr) + if (swinfo.longname().empty()) { - osd_printf_error("%s: %s has no description\n", filename(), swinfo.shortname()); + osd_printf_error("%s: %s has no description\n", filename(), swinfo.shortname().c_str()); break; } // Did we lost any year? - if (swinfo.year() == nullptr) + if (swinfo.year().empty()) { - osd_printf_error("%s: %s has no year\n", filename(), swinfo.shortname()); + osd_printf_error("%s: %s has no year\n", filename(), swinfo.shortname().c_str()); break; } // Did we lost any publisher? - if (swinfo.publisher() == nullptr) + if (swinfo.publisher().empty()) { - osd_printf_error("%s: %s has no publisher\n", filename(), swinfo.shortname()); + osd_printf_error("%s: %s has no publisher\n", filename(), swinfo.shortname().c_str()); break; } // Did we lost the software parts? if (swinfo.parts().empty()) { - osd_printf_error("%s: %s has no part\n", filename(), swinfo.shortname()); + osd_printf_error("%s: %s has no part\n", filename(), swinfo.shortname().c_str()); break; } @@ -616,66 +681,66 @@ void software_list_device::internal_validity_check(validity_checker &valid) // check for duplicate names if (!names.insert(std::make_pair(swinfo.shortname(), &swinfo)).second) { - software_info *match = names.find(swinfo.shortname())->second; - osd_printf_error("%s: %s is a duplicate name (%s)\n", filename(), swinfo.shortname(), match->shortname()); + const software_info *match = names.find(swinfo.shortname())->second; + osd_printf_error("%s: %s is a duplicate name (%s)\n", filename(), swinfo.shortname().c_str(), match->shortname().c_str()); } // check for duplicate descriptions std::string longname = std::string(swinfo.longname()); if (!descriptions.insert(std::make_pair(strmakelower(longname), &swinfo)).second) - osd_printf_error("%s: %s is a duplicate description (%s)\n", filename(), swinfo.longname(), swinfo.shortname()); + osd_printf_error("%s: %s is a duplicate description (%s)\n", filename(), swinfo.longname().c_str(), swinfo.shortname().c_str()); bool is_clone = false; - if (swinfo.parentname() != nullptr) + if (!swinfo.parentname().empty()) { is_clone = true; - if (strcmp(swinfo.parentname(), swinfo.shortname()) == 0) + if (swinfo.parentname() == swinfo.shortname()) { - osd_printf_error("%s: %s is set as a clone of itself\n", filename(), swinfo.shortname()); + osd_printf_error("%s: %s is set as a clone of itself\n", filename(), swinfo.shortname().c_str()); break; } // make sure the parent exists - const software_info *swinfo2 = find(swinfo.parentname()); + const software_info *swinfo2 = find(swinfo.parentname().c_str()); if (swinfo2 == nullptr) - osd_printf_error("%s: parent '%s' software for '%s' not found\n", filename(), swinfo.parentname(), swinfo.shortname()); - else if (swinfo2->parentname() != nullptr) - osd_printf_error("%s: %s is a clone of a clone\n", filename(), swinfo.shortname()); + osd_printf_error("%s: parent '%s' software for '%s' not found\n", filename(), swinfo.parentname().c_str(), swinfo.shortname().c_str()); + else if (!swinfo2->parentname().empty()) + osd_printf_error("%s: %s is a clone of a clone\n", filename(), swinfo.shortname().c_str()); } // make sure the driver name is 8 chars or less - if ((is_clone && strlen(swinfo.shortname()) > NAME_LEN_CLONE) || (!is_clone && strlen(swinfo.shortname()) > NAME_LEN_PARENT)) - osd_printf_error("%s: %s %s driver name must be %d characters or less\n", filename(), swinfo.shortname(), + if ((is_clone && swinfo.shortname().length() > NAME_LEN_CLONE) || (!is_clone && swinfo.shortname().length() > NAME_LEN_PARENT)) + osd_printf_error("%s: %s %s driver name must be %d characters or less\n", filename(), swinfo.shortname().c_str(), is_clone ? "clone" : "parent", is_clone ? NAME_LEN_CLONE : NAME_LEN_PARENT); // make sure the year is only digits, '?' or '+' - for (const char *s = swinfo.year(); *s != 0; s++) + for (const char *s = swinfo.year().c_str(); *s != 0; s++) if (!isdigit((UINT8)*s) && *s != '?' && *s != '+') { - osd_printf_error("%s: %s has an invalid year '%s'\n", filename(), swinfo.shortname(), swinfo.year()); + osd_printf_error("%s: %s has an invalid year '%s'\n", filename(), swinfo.shortname().c_str(), swinfo.year().c_str()); break; } softlist_map part_names; - for (software_part &part : swinfo.parts()) + for (const software_part &part : swinfo.parts()) { - if (part.interface() == nullptr) - osd_printf_error("%s: %s has a part (%s) without interface\n", filename(), swinfo.shortname(), part.name()); + if (part.interface().empty()) + osd_printf_error("%s: %s has a part (%s) without interface\n", filename(), swinfo.shortname().c_str(), part.name().c_str()); if (part.romdata() == nullptr) - osd_printf_error("%s: %s has a part (%s) with no data\n", filename(), swinfo.shortname(), part.name()); + osd_printf_error("%s: %s has a part (%s) with no data\n", filename(), swinfo.shortname().c_str(), part.name().c_str()); if (!part_names.insert(std::make_pair(part.name(), &swinfo)).second) - osd_printf_error("%s: %s has a part (%s) whose name is duplicate\n", filename(), swinfo.shortname(), part.name()); + osd_printf_error("%s: %s has a part (%s) whose name is duplicate\n", filename(), swinfo.shortname().c_str(), part.name().c_str()); for (const rom_entry *data = part.romdata(); data->_name != nullptr; data++) if (data->_hashdata != nullptr) { // make sure the hash is valid - hash_collection hashes; + util::hash_collection hashes; if (!hashes.from_internal_string(data->_hashdata)) - osd_printf_error("%s: %s has rom '%s' with an invalid hash string '%s'\n", filename(), swinfo.shortname(), data->_name, data->_hashdata); + osd_printf_error("%s: %s has rom '%s' with an invalid hash string '%s'\n", filename(), swinfo.shortname().c_str(), data->_name, data->_hashdata); } } } @@ -758,26 +823,67 @@ inline void softlist_parser::parse_error(Format &&fmt, Params &&... args) // attributes into a list of strings //------------------------------------------------- -void softlist_parser::parse_attributes(const char **attributes, int numattrs, const char *attrlist[], const char *outlist[]) +template <typename T> +std::vector<std::string> softlist_parser::parse_attributes(const char **attributes, const T &attrlist) { + std::vector<std::string> outlist(std::distance(std::begin(attrlist), std::end(attrlist))); + // iterate over attribute/value pairs for( ; attributes[0]; attributes += 2) { - int index; + auto iter = std::begin(attrlist); // look for a match among the attributes provided - for (index = 0; index < numattrs; index++) - if (strcmp(attributes[0], attrlist[index]) == 0) + for (std::size_t index = 0; iter != std::end(attrlist); ++index, ++iter) + { + if (strcmp(attributes[0], *iter) == 0) { // if found, set the corresponding output entry to the value outlist[index] = attributes[1]; break; } + } + + // if not found, report an unknown attribute + if (iter == std::end(attrlist)) + unknown_attribute(attributes[0]); + } + + return outlist; +} + + +//------------------------------------------------- +// parse_name_and_value - helper to parse "name" +// and "value" attribute pairs (allowing the +// latter to be defined as an empty string) +//------------------------------------------------- + +bool softlist_parser::parse_name_and_value(const char **attributes, std::string &name, std::string &value) +{ + bool found_value = false; + + // iterate over attribute/value pairs + for( ; attributes[0]; attributes += 2) + { + // if found, set the corresponding output entry to the value + if (strcmp(attributes[0], "name") == 0) + { + name = attributes[1]; + } + + else if (strcmp(attributes[0], "value") == 0) + { + value = attributes[1]; + found_value = true; + } // if not found, report an unknown attribute - if (index == numattrs) + else unknown_attribute(attributes[0]); } + + return !name.empty() && found_value; } @@ -797,7 +903,7 @@ void softlist_parser::add_rom_entry(const char *name, const char *hashdata, UINT // make sure we don't add duplicate regions if (name != nullptr && (flags & ROMENTRY_TYPEMASK) == ROMENTRYTYPE_REGION) - for (auto & elem : m_current_part->m_romdata) + for (auto &elem : m_current_part->m_romdata) if (elem._name != nullptr && strcmp(elem._name, name) == 0) parse_error("Duplicated dataarea %s in software %s", name, infoname()); @@ -920,11 +1026,10 @@ void softlist_parser::parse_root_start(const char *tagname, const char **attribu if (strcmp(tagname, "softwarelist") == 0) { static const char *attrnames[] = { "name", "description" }; - const char *attrvalues[ARRAY_LENGTH(attrnames)] = { nullptr }; - parse_attributes(attributes, ARRAY_LENGTH(attrnames), attrnames, attrvalues); + const auto attrvalues = parse_attributes(attributes, attrnames); - if (attrvalues[1] != nullptr) - m_list.m_description = m_list.add_string(attrvalues[1]); + if (!attrvalues[1].empty()) + m_list.m_description = attrvalues[1]; } else unknown_tag(tagname); @@ -942,11 +1047,13 @@ void softlist_parser::parse_main_start(const char *tagname, const char **attribu if (strcmp(tagname, "software") == 0) { static const char *attrnames[] = { "name", "cloneof", "supported" }; - const char *attrvalues[ARRAY_LENGTH(attrnames)] = { nullptr }; - parse_attributes(attributes, ARRAY_LENGTH(attrnames), attrnames, attrvalues); + auto attrvalues = parse_attributes(attributes, attrnames); - if (attrvalues[0] != nullptr) - m_current_info = &m_list.m_infolist.append(*global_alloc(software_info(m_list, m_list.add_string(attrvalues[0]), m_list.add_string(attrvalues[1]), attrvalues[2]))); + if (!attrvalues[0].empty()) + { + m_list.m_infolist.emplace_back(m_list, std::move(attrvalues[0]), std::move(attrvalues[1]), attrvalues[2].c_str()); + m_current_info = &m_list.m_infolist.back(); + } else parse_error("No name defined for item"); } @@ -984,12 +1091,10 @@ void softlist_parser::parse_soft_start(const char *tagname, const char **attribu // <info name='' value=''> else if (strcmp(tagname, "info") == 0) { - static const char *attrnames[] = { "name", "value" }; - const char *attrvalues[ARRAY_LENGTH(attrnames)] = { nullptr }; - parse_attributes(attributes, ARRAY_LENGTH(attrnames), attrnames, attrvalues); + std::string infoname, infovalue; - if (attrvalues[0] != nullptr && attrvalues[1] != nullptr) - m_current_info->m_other_info.append(*global_alloc(feature_list_item(m_list.add_string(attrvalues[0]), m_list.add_string(attrvalues[1])))); + if (parse_name_and_value(attributes, infoname, infovalue)) + m_current_info->m_other_info.emplace_back(std::move(infoname), std::move(infovalue)); else parse_error("Incomplete other_info definition"); } @@ -997,12 +1102,10 @@ void softlist_parser::parse_soft_start(const char *tagname, const char **attribu // <sharedfeat name='' value=''> else if (strcmp(tagname, "sharedfeat") == 0) { - static const char *attrnames[] = { "name", "value" }; - const char *attrvalues[ARRAY_LENGTH(attrnames)] = { nullptr }; - parse_attributes(attributes, ARRAY_LENGTH(attrnames), attrnames, attrvalues); + std::string featname, featvalue; - if (attrvalues[0] != nullptr && attrvalues[1] != nullptr) - m_current_info->m_shared_info.append(*global_alloc(feature_list_item(m_list.add_string(attrvalues[0]), m_list.add_string(attrvalues[1])))); + if (parse_name_and_value(attributes, featname, featvalue)) + m_current_info->m_shared_info.emplace_back(std::move(featname), std::move(featvalue)); else parse_error("Incomplete sharedfeat definition"); } @@ -1011,11 +1114,13 @@ void softlist_parser::parse_soft_start(const char *tagname, const char **attribu else if (strcmp(tagname, "part" ) == 0) { static const char *attrnames[] = { "name", "interface" }; - const char *attrvalues[ARRAY_LENGTH(attrnames)] = { nullptr }; - parse_attributes(attributes, ARRAY_LENGTH(attrnames), attrnames, attrvalues); + auto attrvalues = parse_attributes(attributes, attrnames); - if (attrvalues[0] != nullptr && attrvalues[1] != nullptr && strcmp(attrvalues[0], "") != 0 && strcmp(attrvalues[1], "") != 0) - m_current_part = &m_current_info->m_partdata.append(*global_alloc(software_part(*m_current_info, m_list.add_string(attrvalues[0]), m_list.add_string(attrvalues[1])))); + if (!attrvalues[0].empty() && !attrvalues[1].empty()) + { + m_current_info->m_partdata.emplace_back(*m_current_info, std::move(attrvalues[0]), std::move(attrvalues[1])); + m_current_part = &m_current_info->m_partdata.back(); + } else parse_error("Incomplete part definition"); } @@ -1042,40 +1147,39 @@ void softlist_parser::parse_part_start(const char *tagname, const char **attribu if (strcmp(tagname, "dataarea") == 0) { static const char *attrnames[] = { "name", "size", "width", "endianness" }; - const char *attrvalues[ARRAY_LENGTH(attrnames)] = { nullptr }; - parse_attributes(attributes, ARRAY_LENGTH(attrnames), attrnames, attrvalues); + const auto attrvalues = parse_attributes(attributes, attrnames); - if (attrvalues[0] != nullptr && attrvalues[1] != nullptr && strcmp(attrvalues[0], "") != 0 && strcmp(attrvalues[1], "") != 0) + if (!attrvalues[0].empty() && !attrvalues[1].empty()) { // handle region attributes - const char *width = attrvalues[2]; - const char *endianness = attrvalues[3]; + const std::string &width = attrvalues[2]; + const std::string &endianness = attrvalues[3]; UINT32 regionflags = ROMENTRYTYPE_REGION; - if (width != nullptr) + if (!width.empty()) { - if (strcmp(width, "8") == 0) + if (width == "8") regionflags |= ROMREGION_8BIT; - else if (strcmp(width, "16") == 0) + else if (width == "16") regionflags |= ROMREGION_16BIT; - else if (strcmp(width, "32") == 0) + else if (width == "32") regionflags |= ROMREGION_32BIT; - else if (strcmp(width, "64") == 0) + else if (width == "64") regionflags |= ROMREGION_64BIT; else parse_error("Invalid dataarea width"); } - if (endianness != nullptr) + if (!endianness.empty()) { - if (strcmp(endianness, "little") == 0) + if (endianness == "little") regionflags |= ROMREGION_LE; - else if (strcmp(endianness, "big") == 0) + else if (endianness == "big") regionflags |= ROMREGION_BE; else parse_error("Invalid dataarea endianness"); } - add_rom_entry(attrvalues[0], nullptr, 0, strtol(attrvalues[1], nullptr, 0), regionflags); + add_rom_entry(attrvalues[0].c_str(), nullptr, 0, strtol(attrvalues[1].c_str(), nullptr, 0), regionflags); } else parse_error("Incomplete dataarea definition"); @@ -1085,11 +1189,10 @@ void softlist_parser::parse_part_start(const char *tagname, const char **attribu else if (strcmp(tagname, "diskarea") == 0) { static const char *attrnames[] = { "name" }; - const char *attrvalues[ARRAY_LENGTH(attrnames)] = { nullptr }; - parse_attributes(attributes, ARRAY_LENGTH(attrnames), attrnames, attrvalues); + const auto attrvalues = parse_attributes(attributes, attrnames); - if (attrvalues[0] != nullptr) - add_rom_entry(attrvalues[0], nullptr, 0, 1, ROMENTRYTYPE_REGION | ROMREGION_DATATYPEDISK); + if (!attrvalues[0].empty()) + add_rom_entry(attrvalues[0].c_str(), nullptr, 0, 1, ROMENTRYTYPE_REGION | ROMREGION_DATATYPEDISK); else parse_error("Incomplete diskarea definition"); } @@ -1097,12 +1200,10 @@ void softlist_parser::parse_part_start(const char *tagname, const char **attribu // <feature name='' value=''> else if (strcmp(tagname, "feature") == 0) { - static const char *attrnames[] = { "name", "value" }; - const char *attrvalues[ARRAY_LENGTH(attrnames)] = { nullptr }; - parse_attributes(attributes, ARRAY_LENGTH(attrnames), attrnames, attrvalues); + std::string featname, featvalue; - if (attrvalues[0] != nullptr) - m_current_part->m_featurelist.append(*global_alloc(feature_list_item(m_list.add_string(attrvalues[0]), m_list.add_string(attrvalues[1])))); + if (parse_name_and_value(attributes, featname, featvalue)) + m_current_part->m_featurelist.emplace_back(std::move(featname), std::move(featvalue)); else parse_error("Incomplete feature definition"); } @@ -1133,71 +1234,70 @@ void softlist_parser::parse_data_start(const char *tagname, const char **attribu if (strcmp(tagname, "rom") == 0) { static const char *attrnames[] = { "name", "size", "crc", "sha1", "offset", "value", "status", "loadflag" }; - const char *attrvalues[ARRAY_LENGTH(attrnames)] = { nullptr }; - parse_attributes(attributes, ARRAY_LENGTH(attrnames), attrnames, attrvalues); - - const char *name = attrvalues[0]; - const char *sizestr = attrvalues[1]; - const char *crc = attrvalues[2]; - const char *sha1 = attrvalues[3]; - const char *offsetstr = attrvalues[4]; - const char *value = attrvalues[5]; - const char *status = attrvalues[6]; - const char *loadflag = attrvalues[7]; - if (sizestr != nullptr && offsetstr != nullptr) + const auto attrvalues = parse_attributes(attributes, attrnames); + + const std::string &name = attrvalues[0]; + const std::string &sizestr = attrvalues[1]; + const std::string &crc = attrvalues[2]; + const std::string &sha1 = attrvalues[3]; + const std::string &offsetstr = attrvalues[4]; + const std::string &value = attrvalues[5]; + const std::string &status = attrvalues[6]; + const std::string &loadflag = attrvalues[7]; + if (!sizestr.empty() && !offsetstr.empty()) { - UINT32 length = strtol(sizestr, nullptr, 0); - UINT32 offset = strtol(offsetstr, nullptr, 0); + UINT32 length = strtol(sizestr.c_str(), nullptr, 0); + UINT32 offset = strtol(offsetstr.c_str(), nullptr, 0); - if (loadflag != nullptr && strcmp(loadflag, "reload") == 0) + if (loadflag == "reload") add_rom_entry(nullptr, nullptr, offset, length, ROMENTRYTYPE_RELOAD | ROM_INHERITFLAGS); - else if (loadflag != nullptr && strcmp(loadflag, "reload_plain") == 0) + else if (loadflag == "reload_plain") add_rom_entry(nullptr, nullptr, offset, length, ROMENTRYTYPE_RELOAD); - else if (loadflag != nullptr && strcmp(loadflag, "continue") == 0) + else if (loadflag == "continue") add_rom_entry(nullptr, nullptr, offset, length, ROMENTRYTYPE_CONTINUE | ROM_INHERITFLAGS); - else if (loadflag != nullptr && strcmp(loadflag, "fill") == 0) - add_rom_entry(nullptr, (const char *)(FPTR)(strtol(value, nullptr, 0) & 0xff), offset, length, ROMENTRYTYPE_FILL); - else if (name != nullptr) + else if (loadflag == "fill") + add_rom_entry(nullptr, (const char *)(FPTR)(strtol(value.c_str(), nullptr, 0) & 0xff), offset, length, ROMENTRYTYPE_FILL); + else if (!name.empty()) { - bool baddump = (status != nullptr && strcmp(status, "baddump") == 0); - bool nodump = (status != nullptr && strcmp(status, "nodump") == 0); + bool baddump = (status == "baddump"); + bool nodump = (status == "nodump"); std::string hashdata; if (nodump) { hashdata = string_format("%s", NO_DUMP); - if (crc != nullptr && sha1 != nullptr) + if (!crc.empty() && !sha1.empty()) parse_error("No need for hash definition"); } else { - if (crc != nullptr && sha1 != nullptr) - hashdata = string_format("%c%s%c%s%s", hash_collection::HASH_CRC, crc, hash_collection::HASH_SHA1, sha1, (baddump ? BAD_DUMP : "")); + if (!crc.empty() && !sha1.empty()) + hashdata = string_format("%c%s%c%s%s", util::hash_collection::HASH_CRC, crc, util::hash_collection::HASH_SHA1, sha1, (baddump ? BAD_DUMP : "")); else parse_error("Incomplete rom hash definition"); } // Handle loadflag attribute int romflags = 0; - if (loadflag != nullptr && strcmp(loadflag, "load16_word_swap") == 0) + if (loadflag == "load16_word_swap") romflags = ROM_GROUPWORD | ROM_REVERSE; - else if (loadflag != nullptr && strcmp(loadflag, "load16_byte") == 0) + else if (loadflag == "load16_byte") romflags = ROM_SKIP(1); - else if (loadflag != nullptr && strcmp(loadflag, "load32_word_swap") == 0) + else if (loadflag == "load32_word_swap") romflags = ROM_GROUPWORD | ROM_REVERSE | ROM_SKIP(2); - else if (loadflag != nullptr && strcmp(loadflag, "load32_word") == 0) + else if (loadflag == "load32_word") romflags = ROM_GROUPWORD | ROM_SKIP(2); - else if (loadflag != nullptr && strcmp(loadflag, "load32_byte") == 0) + else if (loadflag == "load32_byte") romflags = ROM_SKIP(3); - add_rom_entry(name, hashdata.c_str(), offset, length, ROMENTRYTYPE_ROM | romflags); + add_rom_entry(name.c_str(), hashdata.c_str(), offset, length, ROMENTRYTYPE_ROM | romflags); } else parse_error("Rom name missing"); } - else if (sizestr != nullptr && loadflag != nullptr && strcmp(loadflag, "ignore") == 0) + else if (!sizestr.empty() && !loadflag.empty() && loadflag == "ignore") { - UINT32 length = strtol(sizestr, nullptr, 0); + UINT32 length = strtol(sizestr.c_str(), nullptr, 0); add_rom_entry(nullptr, nullptr, 0, length, ROMENTRYTYPE_IGNORE | ROM_INHERITFLAGS); } else @@ -1208,23 +1308,22 @@ void softlist_parser::parse_data_start(const char *tagname, const char **attribu else if (strcmp(tagname, "disk") == 0) { static const char *attrnames[] = { "name", "sha1", "status", "writeable" }; - const char *attrvalues[ARRAY_LENGTH(attrnames)] = { nullptr }; - parse_attributes(attributes, ARRAY_LENGTH(attrnames), attrnames, attrvalues); - - const char *name = attrvalues[0]; - const char *sha1 = attrvalues[1]; - const char *status = attrvalues[2]; - const char *writeablestr = attrvalues[3]; - if (name != nullptr && sha1 != nullptr) + const auto attrvalues = parse_attributes(attributes, attrnames); + + const std::string &name = attrvalues[0]; + const std::string &sha1 = attrvalues[1]; + const std::string &status = attrvalues[2]; + const std::string &writeablestr = attrvalues[3]; + if (!name.empty() && !sha1.empty()) { - bool baddump = (status != nullptr && strcmp(status, "baddump") == 0); - bool nodump = (status != nullptr && strcmp(status, "nodump" ) == 0); - bool writeable = (writeablestr != nullptr && strcmp(writeablestr, "yes") == 0); - std::string hashdata = string_format("%c%s%s", hash_collection::HASH_SHA1, sha1, (nodump ? NO_DUMP : (baddump ? BAD_DUMP : ""))); + const bool baddump = (status == "baddump"); + const bool nodump = (status == "nodump" ); + const bool writeable = (writeablestr == "yes"); + std::string hashdata = string_format("%c%s%s", util::hash_collection::HASH_SHA1, sha1, (nodump ? NO_DUMP : (baddump ? BAD_DUMP : ""))); - add_rom_entry(name, hashdata.c_str(), 0, 0, ROMENTRYTYPE_ROM | (writeable ? DISK_READWRITE : DISK_READONLY)); + add_rom_entry(name.c_str(), hashdata.c_str(), 0, 0, ROMENTRYTYPE_ROM | (writeable ? DISK_READWRITE : DISK_READONLY)); } - else if (status == nullptr || !strcmp(status, "nodump")) // a no_dump chd is not an incomplete entry + else if (status.empty() || (status == "nodump")) // a no_dump chd is not an incomplete entry parse_error("Incomplete disk definition"); } @@ -1247,15 +1346,15 @@ void softlist_parser::parse_soft_end(const char *tagname) // <description> if (strcmp(tagname, "description") == 0) - m_current_info->m_longname = m_list.add_string(m_data_accum.c_str()); + m_current_info->m_longname = m_data_accum; // <year> else if (strcmp(tagname, "year") == 0) - m_current_info->m_year = m_list.add_string(m_data_accum.c_str()); + m_current_info->m_year = m_data_accum; // <publisher> else if (strcmp(tagname, "publisher") == 0) - m_current_info->m_publisher = m_list.add_string(m_data_accum.c_str()); + m_current_info->m_publisher = m_data_accum; // </part> else if (strcmp(tagname, "part") == 0) @@ -1272,7 +1371,7 @@ void softlist_parser::parse_soft_end(const char *tagname) // get the info; if present, copy shared data (we assume name/value strings live // in the string pool and don't need to be reallocated) if (m_current_info != nullptr) - for (feature_list_item &item : m_current_info->shared_info()) - m_current_part->m_featurelist.append(*global_alloc(feature_list_item(item.name(), item.value()))); + for (const feature_list_item &item : m_current_info->shared_info()) + m_current_part->m_featurelist.emplace_back(item.name(), item.value()); } } diff --git a/src/emu/softlist.h b/src/emu/softlist.h index c5082e16903..72a8381f929 100644 --- a/src/emu/softlist.h +++ b/src/emu/softlist.h @@ -73,30 +73,83 @@ enum software_compatibility // TYPE DEFINITIONS //************************************************************************** +struct rom_entry; +class software_info; +class device_image_interface; +class software_list_device; + +// ======================> software_list_loader + +class software_list_loader +{ +public: + virtual bool load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const = 0; +}; + + +// ======================> false_software_list_loader + +class false_software_list_loader : public software_list_loader +{ +public: + virtual bool load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const override; + static const software_list_loader &instance() { return s_instance; } + +private: + static false_software_list_loader s_instance; +}; + + +// ======================> rom_software_list_loader + +class rom_software_list_loader : public software_list_loader +{ +public: + virtual bool load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const override; + static const software_list_loader &instance() { return s_instance; } + +private: + static rom_software_list_loader s_instance; +}; + + +// ======================> image_software_list_loader + +class image_software_list_loader : public software_list_loader +{ +public: + virtual bool load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const override; + static const software_list_loader &instance() { return s_instance; } + +private: + static image_software_list_loader s_instance; +}; + + // ======================> feature_list_item // an item in a list of name/value pairs class feature_list_item { - friend class simple_list<feature_list_item>; - public: // construction/destruction - feature_list_item(const char *name = nullptr, const char *value = nullptr) - : m_next(nullptr), - m_name(name), - m_value(value) { } + feature_list_item(std::string &&name, std::string &&value); + feature_list_item(const std::string &name, const std::string &value); + feature_list_item(feature_list_item const &) = delete; + feature_list_item(feature_list_item &&) = delete; + feature_list_item& operator=(feature_list_item const &) = delete; + feature_list_item& operator=(feature_list_item &&) = delete; // getters feature_list_item *next() const { return m_next; } - const char *name() const { return m_name; } - const char *value() const { return m_value; } + const std::string &name() const { return m_name; } + const std::string &value() const { return m_value; } private: // internal state feature_list_item * m_next; - const char * m_name; - const char * m_value; + std::string m_name; + std::string m_value; }; @@ -106,34 +159,37 @@ private: class software_part { friend class softlist_parser; - friend class simple_list<software_part>; public: // construction/destruction - software_part(software_info &info, const char *name = nullptr, const char *interface = nullptr); + software_part(software_info &info, std::string &&name, std::string &&interface); + software_part(software_part const &) = delete; + software_part(software_part &&) = delete; + software_part& operator=(software_part const &) = delete; + software_part& operator=(software_part &&) = delete; // getters software_part *next() const { return m_next; } software_info &info() const { return m_info; } - const char *name() const { return m_name; } - const char *interface() const { return m_interface; } - const simple_list<feature_list_item> &featurelist() const { return m_featurelist; } + const std::string &name() const { return m_name; } + const std::string &interface() const { return m_interface; } + const std::list<feature_list_item> &featurelist() const { return m_featurelist; } const rom_entry *romdata(unsigned int index = 0) const { return (index < m_romdata.size()) ? &m_romdata[index] : nullptr; } // helpers software_compatibility is_compatible(const software_list_device &swlist) const; bool matches_interface(const char *interface) const; - const char *feature(const char *feature_name) const; + const char *feature(const std::string &feature_name) const; device_image_interface *find_mountable_image(const machine_config &mconfig) const; private: // internal state - software_part * m_next; - software_info & m_info; - const char * m_name; - const char * m_interface; - simple_list<feature_list_item> m_featurelist; - std::vector<rom_entry> m_romdata; + software_part * m_next; + software_info & m_info; + std::string m_name; + std::string m_interface; + std::list<feature_list_item> m_featurelist; + std::vector<rom_entry> m_romdata; }; @@ -143,25 +199,27 @@ private: class software_info { friend class softlist_parser; - friend class simple_list<software_info>; public: // construction/destruction - software_info(software_list_device &list, const char *name, const char *parent, const char *supported); + software_info(software_list_device &list, std::string &&name, std::string &&parent, const char *supported); + software_info(software_info const &) = delete; + software_info(software_info &&) = delete; + software_info& operator=(software_info const &) = delete; + software_info& operator=(software_info &&) = delete; // getters software_info *next() const { return m_next; } software_list_device &list() const { return m_list; } - const char *shortname() const { return m_shortname; } - const char *longname() const { return m_longname; } - const char *parentname() const { return m_parentname; } - const char *year() const { return m_year; } - const char *publisher() const { return m_publisher; } - const simple_list<feature_list_item> &other_info() const { return m_other_info; } - const simple_list<feature_list_item> &shared_info() const { return m_shared_info; } + const std::string &shortname() const { return m_shortname; } + const std::string &longname() const { return m_longname; } + const std::string &parentname() const { return m_parentname; } + const std::string &year() const { return m_year; } + const std::string &publisher() const { return m_publisher; } + const std::list<feature_list_item> &other_info() const { return m_other_info; } + const std::list<feature_list_item> &shared_info() const { return m_shared_info; } UINT32 supported() const { return m_supported; } - const simple_list<software_part> &parts() const { return m_partdata; } - const software_part *first_part() const { return m_partdata.first(); } + const std::list<software_part> &parts() const { return m_partdata; } // additional operations const software_part *find_part(const char *partname, const char *interface = nullptr) const; @@ -172,15 +230,15 @@ private: software_info * m_next; software_list_device & m_list; UINT32 m_supported; - const char * m_shortname; - const char * m_longname; - const char * m_parentname; - const char * m_year; // Copyright year on title screen, actual release dates can be tracked in external resources - const char * m_publisher; - simple_list<feature_list_item> m_other_info; // Here we store info like developer, serial #, etc. which belong to the software entry as a whole - simple_list<feature_list_item> m_shared_info; // Here we store info like TV standard compatibility, or add-on requirements, etc. which get inherited + std::string m_shortname; + std::string m_longname; + std::string m_parentname; + std::string m_year; // Copyright year on title screen, actual release dates can be tracked in external resources + std::string m_publisher; + std::list<feature_list_item> m_other_info; // Here we store info like developer, serial #, etc. which belong to the software entry as a whole + std::list<feature_list_item> m_shared_info; // Here we store info like TV standard compatibility, or add-on requirements, etc. which get inherited // by each part of this software entry (after loading these are stored in partdata->featurelist) - simple_list<software_part> m_partdata; + std::list<software_part> m_partdata; }; @@ -206,19 +264,18 @@ public: const char *filename() { return m_file.filename(); } // getters that may trigger a parse - const char *description() { if (!m_parsed) parse(); return m_description; } - bool valid() { if (!m_parsed) parse(); return m_infolist.count() > 0; } + const char *description() { if (!m_parsed) parse(); return m_description.c_str(); } + bool valid() { if (!m_parsed) parse(); return !m_infolist.empty(); } const char *errors_string() { if (!m_parsed) parse(); return m_errors.c_str(); } - const simple_list<software_info> &get_info() { if (!m_parsed) parse(); return m_infolist; } + const std::list<software_info> &get_info() { if (!m_parsed) parse(); return m_infolist; } // operations - const software_info *find(const char *look_for, const software_info *prev = nullptr); + const software_info *find(const char *look_for); void find_approx_matches(const char *name, int matches, const software_info **list, const char *interface); void release(); // string pool helpers const char *add_string(const char *string) { return m_stringpool.add(string); } - bool string_pool_contains(const char *string) { return m_stringpool.contains(string); } // static helpers static software_list_device *find_by_name(const machine_config &mconfig, const char *name); @@ -241,9 +298,9 @@ protected: // internal state bool m_parsed; emu_file m_file; - const char * m_description; + std::string m_description; std::string m_errors; - simple_list<software_info> m_infolist; + std::list<software_info> m_infolist; const_string_pool m_stringpool; }; diff --git a/src/emu/validity.cpp b/src/emu/validity.cpp index b6a90b396fb..f4c80a8f205 100644 --- a/src/emu/validity.cpp +++ b/src/emu/validity.cpp @@ -1477,7 +1477,7 @@ void validity_checker::validate_roms() total_files++; // make sure the hash is valid - hash_collection hashes; + util::hash_collection hashes; if (!hashes.from_internal_string(ROM_GETHASHDATA(romp))) osd_printf_error("ROM '%s' has an invalid hash string '%s'\n", last_name, ROM_GETHASHDATA(romp)); } diff --git a/src/frontend/mame/audit.cpp b/src/frontend/mame/audit.cpp index fb1199812e7..9dfc99940f2 100644 --- a/src/frontend/mame/audit.cpp +++ b/src/frontend/mame/audit.cpp @@ -72,11 +72,11 @@ m_searchpath = combinedpath.c_str(); for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom)) { char const *const name(ROM_GETNAME(rom)); - hash_collection const hashes(ROM_GETHASHDATA(rom)); + util::hash_collection const hashes(ROM_GETHASHDATA(rom)); device_t *const shared_device(find_shared_device(device, name, hashes, ROM_GETLENGTH(rom))); // count the number of files with hashes - if (!hashes.flag(hash_collection::FLAG_NO_DUMP) && !ROM_ISOPTIONAL(rom)) + if (!hashes.flag(util::hash_collection::FLAG_NO_DUMP) && !ROM_ISOPTIONAL(rom)) { required++; if (shared_device) @@ -159,7 +159,7 @@ media_auditor::summary media_auditor::audit_software(const char *list_name, cons std::string combinedpath(util::string_format("%s;%s%s%s", swinfo->shortname(), list_name, PATH_SEPARATOR, swinfo->shortname())); std::string locationtag(util::string_format("%s%%%s%%", list_name, swinfo->shortname())); - if (swinfo->parentname() != nullptr) + if (!swinfo->parentname().empty()) { locationtag.append(swinfo->parentname()); combinedpath.append(util::string_format(";%s;%s%s%s", swinfo->parentname(), list_name, PATH_SEPARATOR, swinfo->parentname())); @@ -170,7 +170,7 @@ media_auditor::summary media_auditor::audit_software(const char *list_name, cons std::size_t required = 0; // now iterate over software parts - for (software_part &part : swinfo->parts()) + for (const software_part &part : swinfo->parts()) audit_regions(part.romdata(), locationtag.c_str(), found, required); if ((found == 0) && (required > 0)) @@ -349,10 +349,10 @@ void media_auditor::audit_regions(const rom_entry *region, const char *locationt // now iterate over rom definitions for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom)) { - hash_collection const hashes(ROM_GETHASHDATA(rom)); + util::hash_collection const hashes(ROM_GETHASHDATA(rom)); // count the number of files with hashes - if (!hashes.flag(hash_collection::FLAG_NO_DUMP) && !ROM_ISOPTIONAL(rom)) + if (!hashes.flag(util::hash_collection::FLAG_NO_DUMP) && !ROM_ISOPTIONAL(rom)) required++; audit_record const *record = nullptr; @@ -426,10 +426,10 @@ media_auditor::audit_record &media_auditor::audit_one_disk(const rom_entry *rom, // if we succeeded, get the hashes if (err == CHDERR_NONE) { - hash_collection hashes; + util::hash_collection hashes; // if there's a SHA1 hash, add them to the output hash - if (source.sha1() != sha1_t::null) + if (source.sha1() != util::sha1_t::null) hashes.add_sha1(source.sha1()); // update the actual values @@ -452,7 +452,7 @@ void media_auditor::compute_status(audit_record &record, const rom_entry *rom, b // if not found, provide more details if (!found) { - if (record.expected_hashes().flag(hash_collection::FLAG_NO_DUMP)) + if (record.expected_hashes().flag(util::hash_collection::FLAG_NO_DUMP)) record.set_status(audit_status::NOT_FOUND, audit_substatus::NOT_FOUND_NODUMP); else if (ROM_ISOPTIONAL(rom)) record.set_status(audit_status::NOT_FOUND, audit_substatus::NOT_FOUND_OPTIONAL); @@ -463,11 +463,11 @@ void media_auditor::compute_status(audit_record &record, const rom_entry *rom, b { if (record.expected_length() != record.actual_length()) record.set_status(audit_status::FOUND_INVALID, audit_substatus::FOUND_WRONG_LENGTH); - else if (record.expected_hashes().flag(hash_collection::FLAG_NO_DUMP)) + else if (record.expected_hashes().flag(util::hash_collection::FLAG_NO_DUMP)) record.set_status(audit_status::GOOD, audit_substatus::FOUND_NODUMP); else if (record.expected_hashes() != record.actual_hashes()) record.set_status(audit_status::FOUND_INVALID, audit_substatus::FOUND_BAD_CHECKSUM); - else if (record.expected_hashes().flag(hash_collection::FLAG_BAD_DUMP)) + else if (record.expected_hashes().flag(util::hash_collection::FLAG_BAD_DUMP)) record.set_status(audit_status::GOOD, audit_substatus::GOOD_NEEDS_REDUMP); else record.set_status(audit_status::GOOD, audit_substatus::GOOD); @@ -480,9 +480,9 @@ void media_auditor::compute_status(audit_record &record, const rom_entry *rom, b // shares a media entry with the same hashes //------------------------------------------------- -device_t *media_auditor::find_shared_device(device_t &device, const char *name, const hash_collection &romhashes, UINT64 romlength) +device_t *media_auditor::find_shared_device(device_t &device, const char *name, const util::hash_collection &romhashes, UINT64 romlength) { - bool const dumped = !romhashes.flag(hash_collection::FLAG_NO_DUMP); + bool const dumped = !romhashes.flag(util::hash_collection::FLAG_NO_DUMP); // special case for non-root devices device_t *highest_device = nullptr; @@ -494,7 +494,7 @@ device_t *media_auditor::find_shared_device(device_t &device, const char *name, { if (ROM_GETLENGTH(rom) == romlength) { - hash_collection hashes(ROM_GETHASHDATA(rom)); + util::hash_collection hashes(ROM_GETHASHDATA(rom)); if ((dumped && hashes == romhashes) || (!dumped && ROM_GETNAME(rom) == name)) highest_device = &device; } @@ -514,7 +514,7 @@ device_t *media_auditor::find_shared_device(device_t &device, const char *name, { if (ROM_GETLENGTH(rom) == romlength) { - hash_collection hashes(ROM_GETHASHDATA(rom)); + util::hash_collection hashes(ROM_GETHASHDATA(rom)); if ((dumped && hashes == romhashes) || (!dumped && ROM_GETNAME(rom) == name)) highest_device = &scandevice; } diff --git a/src/frontend/mame/audit.h b/src/frontend/mame/audit.h index a9e3933083c..1999fb229fa 100644 --- a/src/frontend/mame/audit.h +++ b/src/frontend/mame/audit.h @@ -107,8 +107,8 @@ public: const char *name() const { return m_name; } UINT64 expected_length() const { return m_explength; } UINT64 actual_length() const { return m_length; } - const hash_collection &expected_hashes() const { return m_exphashes; } - const hash_collection &actual_hashes() const { return m_hashes; } + const util::hash_collection &expected_hashes() const { return m_exphashes; } + const util::hash_collection &actual_hashes() const { return m_hashes; } device_t *shared_device() const { return m_shared_device; } // setters @@ -118,13 +118,13 @@ public: m_substatus = substatus; } - void set_actual(const hash_collection &hashes, UINT64 length = 0) + void set_actual(const util::hash_collection &hashes, UINT64 length = 0) { m_hashes = hashes; m_length = length; } - void set_actual(hash_collection &&hashes, UINT64 length = 0) + void set_actual(util::hash_collection &&hashes, UINT64 length = 0) { m_hashes = std::move(hashes); m_length = length; @@ -143,8 +143,8 @@ public: const char * m_name; // name of item UINT64 m_explength; // expected length of item UINT64 m_length; // actual length of item - hash_collection m_exphashes; // expected hash data - hash_collection m_hashes; // actual hash information + util::hash_collection m_exphashes; // expected hash data + util::hash_collection m_hashes; // actual hash information device_t * m_shared_device; // device that shares the rom }; using record_list = std::list<audit_record>; @@ -168,7 +168,7 @@ private: audit_record &audit_one_rom(const rom_entry *rom); audit_record &audit_one_disk(const rom_entry *rom, const char *locationtag); void compute_status(audit_record &record, const rom_entry *rom, bool found); - device_t *find_shared_device(device_t &device, const char *name, const hash_collection &romhashes, UINT64 romlength); + device_t *find_shared_device(device_t &device, const char *name, const util::hash_collection &romhashes, UINT64 romlength); // internal state record_list m_record_list; diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp index 059748b2cfc..0dfaa4c97dd 100644 --- a/src/frontend/mame/clifront.cpp +++ b/src/frontend/mame/clifront.cpp @@ -129,7 +129,7 @@ public: void identify(const char *name); void identify_file(const char *name); void identify_data(const char *name, const UINT8 *data, int length); - int find_by_hash(const hash_collection &hashes, int length); + int find_by_hash(const util::hash_collection &hashes, int length); private: // internal state @@ -260,8 +260,8 @@ void media_identifier::identify_file(const char *name) } // otherwise, get the hash collection for this CHD - hash_collection hashes; - if (chd.sha1() != sha1_t::null) + util::hash_collection hashes; + if (chd.sha1() != util::sha1_t::null) hashes.add_sha1(chd.sha1()); // determine whether this file exists @@ -309,8 +309,8 @@ void media_identifier::identify_data(const char *name, const UINT8 *data, int le } // compute the hash of the data - hash_collection hashes; - hashes.compute(data, length, hash_collection::HASH_TYPES_CRC_SHA1); + util::hash_collection hashes; + hashes.compute(data, length, util::hash_collection::HASH_TYPES_CRC_SHA1); // output the name m_total++; @@ -334,7 +334,7 @@ void media_identifier::identify_data(const char *name, const UINT8 *data, int le // of drivers by hash //------------------------------------------------- -int media_identifier::find_by_hash(const hash_collection &hashes, int length) +int media_identifier::find_by_hash(const util::hash_collection &hashes, int length) { int found = 0; std::unordered_set<std::string> listnames; @@ -352,10 +352,10 @@ int media_identifier::find_by_hash(const hash_collection &hashes, int length) for (const rom_entry *region = rom_first_region(device); region != nullptr; region = rom_next_region(region)) for (const rom_entry *rom = rom_first_file(region); rom != nullptr; rom = rom_next_file(rom)) { - hash_collection romhashes(ROM_GETHASHDATA(rom)); - if (!romhashes.flag(hash_collection::FLAG_NO_DUMP) && hashes == romhashes) + util::hash_collection romhashes(ROM_GETHASHDATA(rom)); + if (!romhashes.flag(util::hash_collection::FLAG_NO_DUMP) && hashes == romhashes) { - bool baddump = romhashes.flag(hash_collection::FLAG_BAD_DUMP); + bool baddump = romhashes.flag(util::hash_collection::FLAG_BAD_DUMP); // output information about the match if (found) @@ -372,20 +372,20 @@ int media_identifier::find_by_hash(const hash_collection &hashes, int length) { if (listnames.insert(swlistdev.list_name()).second) { - for (software_info &swinfo : swlistdev.get_info()) - for (software_part &part : swinfo.parts()) + for (const software_info &swinfo : swlistdev.get_info()) + for (const software_part &part : swinfo.parts()) for (const rom_entry *region = part.romdata(); region != nullptr; region = rom_next_region(region)) for (const rom_entry *rom = rom_first_file(region); rom != nullptr; rom = rom_next_file(rom)) { - hash_collection romhashes(ROM_GETHASHDATA(rom)); + util::hash_collection romhashes(ROM_GETHASHDATA(rom)); if (hashes == romhashes) { - bool baddump = romhashes.flag(hash_collection::FLAG_BAD_DUMP); + bool baddump = romhashes.flag(util::hash_collection::FLAG_BAD_DUMP); // output information about the match if (found) osd_printf_info(" "); - osd_printf_info("= %s%-20s %s:%s %s\n", baddump ? "(BAD) " : "", ROM_GETNAME(rom), swlistdev.list_name(), swinfo.shortname(), swinfo.longname()); + osd_printf_info("= %s%-20s %s:%s %s\n", baddump ? "(BAD) " : "", ROM_GETNAME(rom), swlistdev.list_name(), swinfo.shortname().c_str(), swinfo.longname().c_str()); found++; } } @@ -524,7 +524,7 @@ int cli_frontend::execute(int argc, char **argv) if (swinfo != nullptr) { // loop through all parts - for (software_part &swpart : swinfo->parts()) + for (const software_part &swpart : swinfo->parts()) { // only load compatible software this way if (swpart.is_compatible(swlistdev) == SOFTWARE_IS_COMPATIBLE) @@ -821,7 +821,7 @@ void cli_frontend::listcrc(const char *gamename) { // if we have a CRC, display it UINT32 crc; - if (hash_collection(ROM_GETHASHDATA(rom)).crc(crc)) + if (util::hash_collection(ROM_GETHASHDATA(rom)).crc(crc)) osd_printf_info("%08x %-16s \t %-8s \t %s\n", crc, ROM_GETNAME(rom), device.shortname(), device.name()); } } @@ -872,10 +872,10 @@ void cli_frontend::listroms(const char *gamename) osd_printf_info(" "); // output the hash data - hash_collection hashes(ROM_GETHASHDATA(rom)); - if (!hashes.flag(hash_collection::FLAG_NO_DUMP)) + util::hash_collection hashes(ROM_GETHASHDATA(rom)); + if (!hashes.flag(util::hash_collection::FLAG_NO_DUMP)) { - if (hashes.flag(hash_collection::FLAG_BAD_DUMP)) + if (hashes.flag(util::hash_collection::FLAG_BAD_DUMP)) osd_printf_info(" BAD"); osd_printf_info(" %s", hashes.macro_string().c_str()); } @@ -1388,33 +1388,33 @@ void cli_frontend::verifysamples(const char *gamename) void cli_frontend::output_single_softlist(FILE *out, software_list_device &swlistdev) { fprintf(out, "\t<softwarelist name=\"%s\" description=\"%s\">\n", swlistdev.list_name(), xml_normalize_string(swlistdev.description())); - for (software_info &swinfo : swlistdev.get_info()) + for (const software_info &swinfo : swlistdev.get_info()) { - fprintf(out, "\t\t<software name=\"%s\"", swinfo.shortname()); - if (swinfo.parentname() != nullptr) - fprintf(out, " cloneof=\"%s\"", swinfo.parentname()); + fprintf(out, "\t\t<software name=\"%s\"", swinfo.shortname().c_str()); + if (!swinfo.parentname().empty()) + fprintf(out, " cloneof=\"%s\"", swinfo.parentname().c_str()); if (swinfo.supported() == SOFTWARE_SUPPORTED_PARTIAL) fprintf(out, " supported=\"partial\""); if (swinfo.supported() == SOFTWARE_SUPPORTED_NO) fprintf(out, " supported=\"no\""); fprintf(out, ">\n" ); - fprintf(out, "\t\t\t<description>%s</description>\n", xml_normalize_string(swinfo.longname())); - fprintf(out, "\t\t\t<year>%s</year>\n", xml_normalize_string(swinfo.year())); - fprintf(out, "\t\t\t<publisher>%s</publisher>\n", xml_normalize_string(swinfo.publisher())); + fprintf(out, "\t\t\t<description>%s</description>\n", xml_normalize_string(swinfo.longname().c_str())); + fprintf(out, "\t\t\t<year>%s</year>\n", xml_normalize_string(swinfo.year().c_str())); + fprintf(out, "\t\t\t<publisher>%s</publisher>\n", xml_normalize_string(swinfo.publisher().c_str())); - for (feature_list_item &flist : swinfo.other_info()) - fprintf( out, "\t\t\t<info name=\"%s\" value=\"%s\"/>\n", flist.name(), xml_normalize_string( flist.value() ) ); + for (const feature_list_item &flist : swinfo.other_info()) + fprintf( out, "\t\t\t<info name=\"%s\" value=\"%s\"/>\n", flist.name().c_str(), xml_normalize_string( flist.value().c_str()) ); - for (software_part &part : swinfo.parts()) + for (const software_part &part : swinfo.parts()) { - fprintf(out, "\t\t\t<part name=\"%s\"", part.name()); - if (part.interface() != nullptr) - fprintf(out, " interface=\"%s\"", part.interface()); + fprintf(out, "\t\t\t<part name=\"%s\"", part.name().c_str()); + if (!part.interface().empty()) + fprintf(out, " interface=\"%s\"", part.interface().c_str()); fprintf(out, ">\n"); - for (feature_list_item &flist : part.featurelist()) - fprintf(out, "\t\t\t\t<feature name=\"%s\" value=\"%s\" />\n", flist.name(), xml_normalize_string(flist.value())); + for (const feature_list_item &flist : part.featurelist()) + fprintf(out, "\t\t\t\t<feature name=\"%s\" value=\"%s\" />\n", flist.name().c_str(), xml_normalize_string(flist.value().c_str())); /* TODO: display rom region information */ for (const rom_entry *region = part.romdata(); region; region = rom_next_region(region)) @@ -1436,8 +1436,8 @@ void cli_frontend::output_single_softlist(FILE *out, software_list_device &swlis fprintf( out, "\t\t\t\t\t<disk name=\"%s\"", xml_normalize_string(ROM_GETNAME(rom)) ); /* dump checksum information only if there is a known dump */ - hash_collection hashes(ROM_GETHASHDATA(rom)); - if ( !hashes.flag(hash_collection::FLAG_NO_DUMP) ) + util::hash_collection hashes(ROM_GETHASHDATA(rom)); + if ( !hashes.flag(util::hash_collection::FLAG_NO_DUMP) ) fprintf( out, " %s", hashes.attribute_string().c_str() ); else fprintf( out, " status=\"nodump\"" ); @@ -1574,7 +1574,7 @@ void cli_frontend::verifysoftware(const char *gamename) if (!swlistdev.get_info().empty()) { nrlists++; - for (software_info &swinfo : swlistdev.get_info()) + for (const software_info &swinfo : swlistdev.get_info()) { media_auditor::summary summary = auditor.audit_software(swlistdev.list_name(), &swinfo, AUDIT_VALIDATE_FAST); @@ -1667,7 +1667,7 @@ void cli_frontend::verifysoftlist(const char *gamename) matched++; // Get the actual software list contents - for (software_info &swinfo : swlistdev.get_info()) + for (const software_info &swinfo : swlistdev.get_info()) { media_auditor::summary summary = auditor.audit_software(swlistdev.list_name(), &swinfo, AUDIT_VALIDATE_FAST); diff --git a/src/frontend/mame/info.cpp b/src/frontend/mame/info.cpp index db9f003f09d..ef7b4bcf61f 100644 --- a/src/frontend/mame/info.cpp +++ b/src/frontend/mame/info.cpp @@ -567,8 +567,8 @@ void info_xml_creator::output_rom(device_t &device) continue; // if we have a valid ROM and we are a clone, see if we can find the parent ROM - hash_collection hashes(ROM_GETHASHDATA(rom)); - if (!hashes.flag(hash_collection::FLAG_NO_DUMP)) + util::hash_collection hashes(ROM_GETHASHDATA(rom)); + if (!hashes.flag(util::hash_collection::FLAG_NO_DUMP)) merge_name = get_merge_name(hashes); if (&device != &m_drivlist.config().root_device()) merge_name = nullptr; @@ -604,7 +604,7 @@ void info_xml_creator::output_rom(device_t &device) util::stream_format(output, " size=\"%d\"", rom_file_size(rom)); // dump checksum information only if there is a known dump - if (!hashes.flag(hash_collection::FLAG_NO_DUMP)) + if (!hashes.flag(util::hash_collection::FLAG_NO_DUMP)) { // iterate over hash function types and print m_output their values output << " " << hashes.attribute_string(); @@ -1603,7 +1603,7 @@ void info_xml_creator::output_ramoptions() // parent set //------------------------------------------------- -const char *info_xml_creator::get_merge_name(const hash_collection &romhashes) +const char *info_xml_creator::get_merge_name(const util::hash_collection &romhashes) { // walk the parent chain const char *merge_name = nullptr; @@ -1614,8 +1614,8 @@ const char *info_xml_creator::get_merge_name(const hash_collection &romhashes) for (const rom_entry *pregion = rom_first_region(*device); pregion != nullptr; pregion = rom_next_region(pregion)) for (const rom_entry *prom = rom_first_file(pregion); prom != nullptr; prom = rom_next_file(prom)) { - hash_collection phashes(ROM_GETHASHDATA(prom)); - if (!phashes.flag(hash_collection::FLAG_NO_DUMP) && romhashes == phashes) + util::hash_collection phashes(ROM_GETHASHDATA(prom)); + if (!phashes.flag(util::hash_collection::FLAG_NO_DUMP) && romhashes == phashes) { // stop when we find a match merge_name = ROM_GETNAME(prom); diff --git a/src/frontend/mame/info.h b/src/frontend/mame/info.h index 4ba53f885ac..29f931b5c4a 100644 --- a/src/frontend/mame/info.h +++ b/src/frontend/mame/info.h @@ -54,7 +54,7 @@ private: void output_one_device(device_t &device, const char *devtag); void output_devices(); - const char *get_merge_name(const hash_collection &romhashes); + const char *get_merge_name(const util::hash_collection &romhashes); // internal state FILE * m_output; diff --git a/src/frontend/mame/ui/datmenu.cpp b/src/frontend/mame/ui/datmenu.cpp index c4d7b809266..427f3187661 100644 --- a/src/frontend/mame/ui/datmenu.cpp +++ b/src/frontend/mame/ui/datmenu.cpp @@ -40,9 +40,9 @@ menu_dats_view::menu_dats_view(mame_ui_manager &mui, render_container &container if (image.filename()) { m_list = strensure(image.software_list_name()); - m_short = strensure(image.software_entry()->shortname()); - m_long = strensure(image.software_entry()->longname()); - m_parent = strensure(image.software_entry()->parentname()); + m_short = image.software_entry()->shortname(); + m_long = image.software_entry()->longname(); + m_parent = image.software_entry()->parentname(); } } diff --git a/src/frontend/mame/ui/filemngr.cpp b/src/frontend/mame/ui/filemngr.cpp index 38e7faa0d78..87fa7ff0a60 100644 --- a/src/frontend/mame/ui/filemngr.cpp +++ b/src/frontend/mame/ui/filemngr.cpp @@ -81,7 +81,7 @@ void menu_file_manager::fill_image_line(device_image_interface *img, std::string if (img->part_entry() != nullptr) { const software_part *tmp = img->part_entry(); - if (tmp->name() != nullptr) + if (!tmp->name().empty()) { filename.append(" ("); filename.append(tmp->name()); diff --git a/src/frontend/mame/ui/imgcntrl.cpp b/src/frontend/mame/ui/imgcntrl.cpp index 227d520044d..ee93381d52a 100644 --- a/src/frontend/mame/ui/imgcntrl.cpp +++ b/src/frontend/mame/ui/imgcntrl.cpp @@ -192,7 +192,7 @@ void menu_control_device_image::handle() case START_OTHER_PART: m_submenu_result.swparts = menu_software_parts::result::INVALID; - menu::stack_push<menu_software_parts>(ui(), container(), m_swi, m_swp->interface(), &m_swp, true, m_submenu_result.swparts); + menu::stack_push<menu_software_parts>(ui(), container(), m_swi, m_swp->interface().c_str(), &m_swp, true, m_submenu_result.swparts); m_state = SELECT_OTHER_PART; break; @@ -220,7 +220,7 @@ void menu_control_device_image::handle() } else { - m_swp = m_swi->first_part(); + m_swp = &m_swi->parts().front(); load_software_part(); } break; diff --git a/src/frontend/mame/ui/inifile.cpp b/src/frontend/mame/ui/inifile.cpp index f0f6adbfc38..fd93bb6d1f7 100644 --- a/src/frontend/mame/ui/inifile.cpp +++ b/src/frontend/mame/ui/inifile.cpp @@ -194,23 +194,23 @@ void favorite_manager::add_favorite_game() auto swinfo = image.software_entry(); auto part = image.part_entry(); ui_software_info tmpmatches; - tmpmatches.shortname = strensure(swinfo->shortname()); + tmpmatches.shortname = swinfo->shortname(); tmpmatches.longname = strensure(image.longname()); - tmpmatches.parentname = strensure(swinfo->parentname()); + tmpmatches.parentname = swinfo->parentname(); tmpmatches.year = strensure(image.year()); tmpmatches.publisher = strensure(image.manufacturer()); tmpmatches.supported = image.supported(); - tmpmatches.part = strensure(part->name()); + tmpmatches.part = part->name(); tmpmatches.driver = &machine().system(); tmpmatches.listname = strensure(image.software_list_name()); - tmpmatches.interface = strensure(part->interface()); + tmpmatches.interface = part->interface(); tmpmatches.instance = strensure(image.instance_name()); tmpmatches.startempty = 0; tmpmatches.parentlongname.clear(); - if (swinfo->parentname()) + if (!swinfo->parentname().empty()) { auto swlist = software_list_device::find_by_name(machine().config(), image.software_list_name()); - for (software_info &c_swinfo : swlist->get_info()) + for (const software_info &c_swinfo : swlist->get_info()) { std::string c_parent(c_swinfo.parentname()); if (!c_parent.empty() && c_parent == swinfo->shortname()) @@ -222,8 +222,8 @@ void favorite_manager::add_favorite_game() } tmpmatches.usage.clear(); - for (feature_list_item &flist : swinfo->other_info()) - if (!strcmp(flist.name(), "usage")) + for (const feature_list_item &flist : swinfo->other_info()) + if (!strcmp(flist.name().c_str(), "usage")) tmpmatches.usage = flist.value(); tmpmatches.devicetype = strensure(image.image_type_name()); diff --git a/src/frontend/mame/ui/selgame.cpp b/src/frontend/mame/ui/selgame.cpp index 6bb2cf9d1f9..4af579d0c62 100644 --- a/src/frontend/mame/ui/selgame.cpp +++ b/src/frontend/mame/ui/selgame.cpp @@ -687,8 +687,8 @@ void menu_select_game::build_available_list() for (; !ROMENTRY_ISEND(rom) && noroms == true; ++rom) if (ROMENTRY_ISFILE(rom)) { - hash_collection hashes(ROM_GETHASHDATA(rom)); - if (!hashes.flag(hash_collection::FLAG_NO_DUMP) && !ROM_ISOPTIONAL(rom)) + util::hash_collection hashes(ROM_GETHASHDATA(rom)); + if (!hashes.flag(util::hash_collection::FLAG_NO_DUMP) && !ROM_ISOPTIONAL(rom)) noroms = false; } @@ -711,8 +711,8 @@ void menu_select_game::build_available_list() { if (ROMENTRY_ISFILE(rom)) { - hash_collection hashes(ROM_GETHASHDATA(rom)); - if (hashes.flag(hash_collection::FLAG_NO_DUMP) || ROM_ISOPTIONAL(rom)) + util::hash_collection hashes(ROM_GETHASHDATA(rom)); + if (hashes.flag(util::hash_collection::FLAG_NO_DUMP) || ROM_ISOPTIONAL(rom)) continue; UINT64 lenght = ROM_GETLENGTH(rom); @@ -721,8 +721,8 @@ void menu_select_game::build_available_list() { if (ROMENTRY_ISFILE(parentrom) && ROM_GETLENGTH(parentrom) == lenght) { - hash_collection parenthashes(ROM_GETHASHDATA(parentrom)); - if (parenthashes.flag(hash_collection::FLAG_NO_DUMP) || ROM_ISOPTIONAL(parentrom)) + util::hash_collection parenthashes(ROM_GETHASHDATA(parentrom)); + if (parenthashes.flag(util::hash_collection::FLAG_NO_DUMP) || ROM_ISOPTIONAL(parentrom)) continue; if (hashes == parenthashes) diff --git a/src/frontend/mame/ui/selsoft.cpp b/src/frontend/mame/ui/selsoft.cpp index 1b6468579ab..dfb97546fe7 100644 --- a/src/frontend/mame/ui/selsoft.cpp +++ b/src/frontend/mame/ui/selsoft.cpp @@ -527,8 +527,8 @@ void menu_select_software::build_software_list() m_filter.swlist.description.push_back(swlist.description()); for (const software_info &swinfo : swlist.get_info()) { - const software_part *part = swinfo.first_part(); - if (part->is_compatible(swlist) == SOFTWARE_IS_COMPATIBLE) + const software_part &part = swinfo.parts().front(); + if (part.is_compatible(swlist) == SOFTWARE_IS_COMPATIBLE) { const char *instance_name = nullptr; const char *type_name = nullptr; @@ -536,7 +536,7 @@ void menu_select_software::build_software_list() for (device_image_interface &image : image_interface_iterator(config.root_device())) { const char *interface = image.image_interface(); - if (interface != nullptr && part->matches_interface(interface)) + if (interface != nullptr && part.matches_interface(interface)) { instance_name = image.instance_name(); if (instance_name != nullptr) @@ -552,23 +552,23 @@ void menu_select_software::build_software_list() if (instance_name == nullptr || type_name == nullptr) continue; - tmpmatches.shortname = strensure(swinfo.shortname()); - tmpmatches.longname = strensure(swinfo.longname()); - tmpmatches.parentname = strensure(swinfo.parentname()); - tmpmatches.year = strensure(swinfo.year()); - tmpmatches.publisher = strensure(swinfo.publisher()); + tmpmatches.shortname = swinfo.shortname(); + tmpmatches.longname = swinfo.longname(); + tmpmatches.parentname = swinfo.parentname(); + tmpmatches.year = swinfo.year(); + tmpmatches.publisher = swinfo.publisher(); tmpmatches.supported = swinfo.supported(); - tmpmatches.part = strensure(part->name()); + tmpmatches.part = part.name(); tmpmatches.driver = m_driver; tmpmatches.listname = strensure(swlist.list_name()); - tmpmatches.interface = strensure(part->interface()); + tmpmatches.interface = part.interface(); tmpmatches.startempty = 0; tmpmatches.parentlongname.clear(); tmpmatches.usage.clear(); tmpmatches.available = false; - for (feature_list_item &flist : swinfo.other_info()) - if (!strcmp(flist.name(), "usage")) + for (const feature_list_item &flist : swinfo.other_info()) + if (!strcmp(flist.name().c_str(), "usage")) tmpmatches.usage = flist.value(); m_swinfo.push_back(tmpmatches); diff --git a/src/frontend/mame/ui/swlist.cpp b/src/frontend/mame/ui/swlist.cpp index 0aad599864b..b9a25a18535 100644 --- a/src/frontend/mame/ui/swlist.cpp +++ b/src/frontend/mame/ui/swlist.cpp @@ -364,7 +364,7 @@ void menu_software::populate() { bool found = false; for (const software_info &swinfo : swlistdev.get_info()) - if (swinfo.first_part()->matches_interface(m_interface)) + if (swinfo.parts().front().matches_interface(m_interface)) found = true; if (found) item_append(swlistdev.description(), "", 0, (void *)&swlistdev); @@ -377,7 +377,7 @@ void menu_software::populate() { bool found = false; for (const software_info &swinfo : swlistdev.get_info()) - if (swinfo.first_part()->matches_interface(m_interface)) + if (swinfo.parts().front().matches_interface(m_interface)) found = true; if (found) { diff --git a/src/lib/netlist/analog/nld_bjt.cpp b/src/lib/netlist/analog/nld_bjt.cpp index 8d587c1b80d..1889a88c9aa 100644 --- a/src/lib/netlist/analog/nld_bjt.cpp +++ b/src/lib/netlist/analog/nld_bjt.cpp @@ -113,7 +113,7 @@ NETLIB_UPDATE_TERMINALS(QBJT_switch) { const nl_double m = (is_qtype( BJT_NPN) ? 1 : -1); - const int new_state = (m_RB.deltaV() * m > m_V ) ? 1 : 0; + const unsigned new_state = (m_RB.deltaV() * m > m_V ) ? 1 : 0; if (m_state_on ^ new_state) { const nl_double gb = new_state ? m_gB : netlist().gmin(); diff --git a/src/lib/netlist/analog/nld_fourterm.cpp b/src/lib/netlist/analog/nld_fourterm.cpp index a077e8d3bcc..31ea09339cf 100644 --- a/src/lib/netlist/analog/nld_fourterm.cpp +++ b/src/lib/netlist/analog/nld_fourterm.cpp @@ -19,8 +19,8 @@ namespace netlist NETLIB_RESET(VCCS) { - const nl_double m_mult = m_G.Value() * m_gfac; // 1.0 ==> 1V ==> 1A - const nl_double GI = NL_FCONST(1.0) / m_RI.Value(); + const nl_double m_mult = m_G() * m_gfac; // 1.0 ==> 1V ==> 1A + const nl_double GI = NL_FCONST(1.0) / m_RI(); m_IP.set(GI); m_IN.set(GI); @@ -66,19 +66,19 @@ NETLIB_UPDATE(LVCCS) NETLIB_UPDATE_TERMINALS(LVCCS) { - const nl_double m_mult = m_G.Value() * m_gfac; // 1.0 ==> 1V ==> 1A + const nl_double m_mult = m_G() * m_gfac; // 1.0 ==> 1V ==> 1A const nl_double vi = m_IP.net().Q_Analog() - m_IN.net().Q_Analog(); - if (std::abs(m_mult / m_cur_limit * vi) > 0.5) + if (std::abs(m_mult / m_cur_limit() * vi) > 0.5) m_vi = m_vi + 0.2*std::tanh((vi - m_vi)/0.2); else m_vi = vi; - const nl_double x = m_mult / m_cur_limit * m_vi; + const nl_double x = m_mult / m_cur_limit() * m_vi; const nl_double X = std::tanh(x); const nl_double beta = m_mult * (1.0 - X*X); - const nl_double I = m_cur_limit * X - beta * m_vi; + const nl_double I = m_cur_limit() * X - beta * m_vi; m_OP.set(beta, NL_FCONST(0.0), I); m_OP1.set(-beta, NL_FCONST(0.0)); @@ -112,11 +112,11 @@ NETLIB_UPDATE(CCCS) NETLIB_RESET(VCVS) { - m_gfac = NL_FCONST(1.0) / m_RO.Value(); + m_gfac = NL_FCONST(1.0) / m_RO(); NETLIB_NAME(VCCS)::reset(); - m_OP2.set(NL_FCONST(1.0) / m_RO.Value()); - m_ON2.set(NL_FCONST(1.0) / m_RO.Value()); + m_OP2.set(NL_FCONST(1.0) / m_RO()); + m_ON2.set(NL_FCONST(1.0) / m_RO()); } } //namespace devices diff --git a/src/lib/netlist/analog/nld_fourterm.h b/src/lib/netlist/analog/nld_fourterm.h index 5beba564ee2..7792607cf7a 100644 --- a/src/lib/netlist/analog/nld_fourterm.h +++ b/src/lib/netlist/analog/nld_fourterm.h @@ -157,7 +157,7 @@ public: NETLIB_CONSTRUCTOR_DERIVED(CCCS, VCCS) , m_gfac(1.0) { - m_gfac = NL_FCONST(1.0) / m_RI.Value(); + m_gfac = NL_FCONST(1.0) / m_RI(); } protected: diff --git a/src/lib/netlist/analog/nld_opamps.cpp b/src/lib/netlist/analog/nld_opamps.cpp index 48a28dfe87c..57d6f6a76f3 100644 --- a/src/lib/netlist/analog/nld_opamps.cpp +++ b/src/lib/netlist/analog/nld_opamps.cpp @@ -60,9 +60,9 @@ NETLIB_UPDATE(OPAMP) const double cVt = 0.0258 * 1.0; // * m_n; const double cId = m_model.model_value("DAB"); // 3 mA const double cVd = cVt * std::log(cId / 1e-15 + 1.0); - m_VH.set_Q(INPANALOG(m_VCC) - m_model.model_value("VLH") - cVd); - m_VL.set_Q(INPANALOG(m_GND) + m_model.model_value("VLL") + cVd); - m_VREF.set_Q((INPANALOG(m_VCC) + INPANALOG(m_GND)) / 2.0); + m_VH.push(m_VCC() - m_model.model_value("VLH") - cVd); + m_VL.push(m_GND() + m_model.model_value("VLL") + cVd); + m_VREF.push((m_VCC() + m_GND()) / 2.0); } NETLIB_RESET(OPAMP) diff --git a/src/lib/netlist/analog/nld_opamps.h b/src/lib/netlist/analog/nld_opamps.h index 60e9a6fbe52..5d9825d4b21 100644 --- a/src/lib/netlist/analog/nld_opamps.h +++ b/src/lib/netlist/analog/nld_opamps.h @@ -19,11 +19,11 @@ // Macros // ---------------------------------------------------------------------------------------- -#define OPAMP(name, model) \ - NET_REGISTER_DEV(OPAMP, name) \ +#define OPAMP(name, model) \ + NET_REGISTER_DEV(OPAMP, name) \ NETDEV_PARAMI(name, MODEL, model) -#define LM3900(name) \ +#define LM3900(name) \ SUBMODEL(opamp_lm3900, name) // ---------------------------------------------------------------------------------------- @@ -48,7 +48,7 @@ NETLIB_OBJECT(OPAMP) , m_VL(*this, "VL") , m_VREF(*this, "VREF") { - m_type = m_model.model_value("TYPE"); + m_type = static_cast<int>(m_model.model_value("TYPE")); if (m_type == 1) { @@ -117,7 +117,7 @@ private: analog_output_t m_VREF; /* state */ - unsigned m_type; + int m_type; }; } //namespace devices diff --git a/src/lib/netlist/analog/nld_switches.cpp b/src/lib/netlist/analog/nld_switches.cpp index 639d608dbf2..0bfc4b50512 100644 --- a/src/lib/netlist/analog/nld_switches.cpp +++ b/src/lib/netlist/analog/nld_switches.cpp @@ -26,7 +26,7 @@ NETLIB_RESET(switch1) NETLIB_UPDATE(switch1) { - if (!m_POS.Value()) + if (!m_POS()) { m_R.set_R(R_OFF); } @@ -56,7 +56,7 @@ NETLIB_RESET(switch2) NETLIB_UPDATE(switch2) { - if (!m_POS.Value()) + if (!m_POS()) { m_R1.set_R(R_ON); m_R2.set_R(R_OFF); diff --git a/src/lib/netlist/analog/nld_twoterm.cpp b/src/lib/netlist/analog/nld_twoterm.cpp index b834180eae8..3ddff27557d 100644 --- a/src/lib/netlist/analog/nld_twoterm.cpp +++ b/src/lib/netlist/analog/nld_twoterm.cpp @@ -65,15 +65,15 @@ NETLIB_UPDATE(twoterm) NETLIB_UPDATE_PARAM(POT) { - nl_double v = m_Dial.Value(); - if (m_DialIsLog.Value()) + nl_double v = m_Dial(); + if (m_DialIsLog()) v = (std::exp(v) - 1.0) / (std::exp(1.0) - 1.0); m_R1.update_dev(); m_R2.update_dev(); - m_R1.set_R(std::max(m_R.Value() * v, netlist().gmin())); - m_R2.set_R(std::max(m_R.Value() * (NL_FCONST(1.0) - v), netlist().gmin())); + m_R1.set_R(std::max(m_R() * v, netlist().gmin())); + m_R2.set_R(std::max(m_R() * (NL_FCONST(1.0) - v), netlist().gmin())); } @@ -83,16 +83,16 @@ NETLIB_UPDATE_PARAM(POT) NETLIB_UPDATE_PARAM(POT2) { - nl_double v = m_Dial.Value(); + nl_double v = m_Dial(); - if (m_DialIsLog.Value()) + if (m_DialIsLog()) v = (std::exp(v) - 1.0) / (std::exp(1.0) - 1.0); - if (m_Reverse.Value()) + if (m_Reverse()) v = 1.0 - v; m_R1.update_dev(); - m_R1.set_R(std::max(m_R.Value() * v, netlist().gmin())); + m_R1.set_R(std::max(m_R() * v, netlist().gmin())); } // ---------------------------------------------------------------------------------------- @@ -108,7 +108,7 @@ NETLIB_RESET(C) NETLIB_UPDATE_PARAM(C) { //step_time(1.0/48000.0); - m_GParallel = netlist().gmin() * m_C.Value(); + m_GParallel = netlist().gmin() * m_C(); } NETLIB_UPDATE(C) @@ -146,7 +146,7 @@ NETLIB_UPDATE_TERMINALS(D) NETLIB_RESET(VS) { NETLIB_NAME(twoterm)::reset(); - this->set(1.0 / m_R, m_V, 0.0); + this->set(1.0 / m_R(), m_V(), 0.0); } NETLIB_UPDATE(VS) @@ -161,7 +161,7 @@ NETLIB_UPDATE(VS) NETLIB_RESET(CS) { NETLIB_NAME(twoterm)::reset(); - this->set(0.0, 0.0, m_I); + this->set(0.0, 0.0, m_I()); } NETLIB_UPDATE(CS) diff --git a/src/lib/netlist/analog/nld_twoterm.h b/src/lib/netlist/analog/nld_twoterm.h index 279bd0d1bf3..b5de48ae1d8 100644 --- a/src/lib/netlist/analog/nld_twoterm.h +++ b/src/lib/netlist/analog/nld_twoterm.h @@ -79,16 +79,17 @@ // FIXME: avoid compile fails // #warning "Do not include rescap.h in a netlist environment" #endif - -#define RES_R(res) ((double)(res)) -#define RES_K(res) ((double)(res) * 1e3) -#define RES_M(res) ((double)(res) * 1e6) -#define CAP_U(cap) ((double)(cap) * 1e-6) -#define CAP_N(cap) ((double)(cap) * 1e-9) -#define CAP_P(cap) ((double)(cap) * 1e-12) -#define IND_U(ind) ((double)(ind) * 1e-6) -#define IND_N(ind) ((double)(ind) * 1e-9) -#define IND_P(ind) ((double)(ind) * 1e-12) +#ifndef RES_R +#define RES_R(res) (static_cast<double>(res)) +#define RES_K(res) (static_cast<double>(res) * 1e3) +#define RES_M(res) (static_cast<double>(res) * 1e6) +#define CAP_U(cap) (static_cast<double>(cap) * 1e-6) +#define CAP_N(cap) (static_cast<double>(cap) * 1e-9) +#define CAP_P(cap) (static_cast<double>(cap) * 1e-12) +#define IND_U(ind) (static_cast<double>(ind) * 1e-6) +#define IND_N(ind) (static_cast<double>(ind) * 1e-9) +#define IND_P(ind) (static_cast<double>(ind) * 1e-12) +#endif // ----------------------------------------------------------------------------- // Implementation @@ -196,8 +197,8 @@ protected: NETLIB_UPDATE_PARAMI() { update_dev(); - if (m_R.Value() > 1e-9) - set_R(m_R.Value()); + if (m_R() > 1e-9) + set_R(m_R()); else set_R(1e-9); } @@ -284,7 +285,7 @@ public: NETLIB_TIMESTEP() { /* Gpar should support convergence */ - const nl_double G = m_C.Value() / step + m_GParallel; + const nl_double G = m_C() / step + m_GParallel; const nl_double I = -G * deltaV(); set(G, 0.0, I); } diff --git a/src/lib/netlist/build/doxygen.conf b/src/lib/netlist/build/doxygen.conf new file mode 100644 index 00000000000..9f0ff127793 --- /dev/null +++ b/src/lib/netlist/build/doxygen.conf @@ -0,0 +1,2427 @@ +# Doxyfile 1.8.11 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = "My Project" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = doxy + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = ../.. + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = YES + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO, these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if <section_label> ... \endif and \cond <section_label> +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = ".." "../documentation" + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl, +# *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js. + +FILE_PATTERNS = *.h *.cpp + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = "../documentation" + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# <filter> <input-file> +# +# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse-libclang=ON option for CMake. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = "../documentation/doc.css" + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = YES + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use <access key> + S +# (what the <access key> is depends on the OS and browser, but it is typically +# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down +# key> to jump into the search results window, the results can be navigated +# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel +# the search. The filter options can be selected when the cursor is inside the +# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys> +# to select a filter and <Enter> or <escape> to activate or cancel the filter +# option. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +SEARCHENGINE = YES + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a web server instead of a web client using Javascript. There +# are two flavors of web server based searching depending on the EXTERNAL_SEARCH +# setting. When disabled, doxygen will generate a PHP script for searching and +# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing +# and searching needs to be provided by external tools. See the section +# "External Indexing and Searching" for details. +# The default value is: NO. +# This tag requires that the tag SEARCHENGINE is set to YES. + +SERVER_BASED_SEARCH = NO + +# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP +# script for searching. Instead the search results are written to an XML file +# which needs to be processed by an external indexer. Doxygen will invoke an +# external search engine pointed to by the SEARCHENGINE_URL option to obtain the +# search results. +# +# Doxygen ships with an example indexer (doxyindexer) and search engine +# (doxysearch.cgi) which are based on the open source search engine library +# Xapian (see: http://xapian.org/). +# +# See the section "External Indexing and Searching" for details. +# The default value is: NO. +# This tag requires that the tag SEARCHENGINE is set to YES. + +EXTERNAL_SEARCH = NO + +# The SEARCHENGINE_URL should point to a search engine hosted by a web server +# which will return the search results when EXTERNAL_SEARCH is enabled. +# +# Doxygen ships with an example indexer (doxyindexer) and search engine +# (doxysearch.cgi) which are based on the open source search engine library +# Xapian (see: http://xapian.org/). See the section "External Indexing and +# Searching" for details. +# This tag requires that the tag SEARCHENGINE is set to YES. + +SEARCHENGINE_URL = + +# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed +# search data is written to a file for indexing by an external tool. With the +# SEARCHDATA_FILE tag the name of this file can be specified. +# The default file is: searchdata.xml. +# This tag requires that the tag SEARCHENGINE is set to YES. + +SEARCHDATA_FILE = searchdata.xml + +# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the +# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is +# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple +# projects and redirect the results back to the right project. +# This tag requires that the tag SEARCHENGINE is set to YES. + +EXTERNAL_SEARCH_ID = + +# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen +# projects other than the one defined by this configuration file, but that are +# all added to the same external search index. Each project needs to have a +# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of +# to a relative location where the documentation can be found. The format is: +# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... +# This tag requires that the tag SEARCHENGINE is set to YES. + +EXTRA_SEARCH_MAPPINGS = + +#--------------------------------------------------------------------------- +# Configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. +# The default value is: YES. + +GENERATE_LATEX = YES + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: latex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. +# +# Note that when enabling USE_PDFLATEX this option is only used for generating +# bitmaps for formulas in the HTML output, but not in the Makefile that is +# written to the output directory. +# The default file is: latex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate +# index for LaTeX. +# The default file is: makeindex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX +# documents. This may be useful for small projects and may help to save some +# trees in general. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used by the +# printer. +# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x +# 14 inches) and executive (7.25 x 10.5 inches). +# The default value is: a4. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +PAPER_TYPE = a4 + +# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names +# that should be included in the LaTeX output. The package can be specified just +# by its name or with the correct syntax as to be used with the LaTeX +# \usepackage command. To get the times font for instance you can specify : +# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times} +# To use the option intlimits with the amsmath package you can specify: +# EXTRA_PACKAGES=[intlimits]{amsmath} +# If left blank no extra packages will be included. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the +# generated LaTeX document. The header should contain everything until the first +# chapter. If it is left blank doxygen will generate a standard header. See +# section "Doxygen usage" for information on how to let doxygen write the +# default header to a separate file. +# +# Note: Only use a user-defined header if you know what you are doing! The +# following commands have a special meaning inside the header: $title, +# $datetime, $date, $doxygenversion, $projectname, $projectnumber, +# $projectbrief, $projectlogo. Doxygen will replace $title with the empty +# string, for the replacement values of the other commands the user is referred +# to HTML_HEADER. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the +# generated LaTeX document. The footer should contain everything after the last +# chapter. If it is left blank doxygen will generate a standard footer. See +# LATEX_HEADER for more information on how to generate a default footer and what +# special commands can be used inside the footer. +# +# Note: Only use a user-defined footer if you know what you are doing! +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_FOOTER = + +# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# LaTeX style sheets that are included after the standard style sheets created +# by doxygen. Using this option one can overrule certain style aspects. Doxygen +# will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EXTRA_STYLESHEET = + +# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the LATEX_OUTPUT output +# directory. Note that the files will be copied as-is; there are no commands or +# markers available. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EXTRA_FILES = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is +# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will +# contain links (just like the HTML output) instead of page references. This +# makes the output suitable for online browsing using a PDF viewer. +# The default value is: YES. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate +# the PDF file directly from the LaTeX files. Set this option to YES, to get a +# higher quality PDF documentation. +# The default value is: YES. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode +# command to the generated LaTeX files. This will instruct LaTeX to keep running +# if errors occur, instead of asking the user for help. This option is also used +# when generating formulas in HTML. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_BATCHMODE = NO + +# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the +# index chapters (such as File Index, Compound Index, etc.) in the output. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_HIDE_INDICES = NO + +# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source +# code with syntax highlighting in the LaTeX output. +# +# Note that which sources are shown also depends on other settings such as +# SOURCE_BROWSER. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_SOURCE_CODE = NO + +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the +# bibliography, e.g. plainnat, or ieeetr. See +# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# The default value is: plain. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_BIB_STYLE = plain + +# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_TIMESTAMP = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The +# RTF output is optimized for Word 97 and may not look too pretty with other RTF +# readers/editors. +# The default value is: NO. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: rtf. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF +# documents. This may be useful for small projects and may help to save some +# trees in general. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will +# contain hyperlink fields. The RTF file will contain links (just like the HTML +# output) instead of page references. This makes the output suitable for online +# browsing using Word or some other Word compatible readers that support those +# fields. +# +# Note: WordPad (write) and others do not support links. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's config +# file, i.e. a series of assignments. You only have to provide replacements, +# missing definitions are set to their default value. +# +# See also section "Doxygen usage" for information on how to generate the +# default style sheet that doxygen normally uses. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an RTF document. Syntax is +# similar to doxygen's config file. A template extensions file can be generated +# using doxygen -e rtf extensionFile. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_EXTENSIONS_FILE = + +# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code +# with syntax highlighting in the RTF output. +# +# Note that which sources are shown also depends on other settings such as +# SOURCE_BROWSER. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for +# classes and files. +# The default value is: NO. + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. A directory man3 will be created inside the directory specified by +# MAN_OUTPUT. +# The default directory is: man. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to the generated +# man pages. In case the manual section does not start with a number, the number +# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is +# optional. +# The default value is: .3. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_EXTENSION = .3 + +# The MAN_SUBDIR tag determines the name of the directory created within +# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by +# MAN_EXTENSION with the initial . removed. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_SUBDIR = + +# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it +# will generate one additional man file for each entity documented in the real +# man page(s). These additional files only source the real man page, but without +# them the man command would be unable to find the correct page. +# The default value is: NO. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that +# captures the structure of the code including all documentation. +# The default value is: NO. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: xml. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_OUTPUT = xml + +# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program +# listings (including syntax highlighting and cross-referencing information) to +# the XML output. Note that enabling this will significantly increase the size +# of the XML output. +# The default value is: YES. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the DOCBOOK output +#--------------------------------------------------------------------------- + +# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files +# that can be used to generate PDF. +# The default value is: NO. + +GENERATE_DOCBOOK = NO + +# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in +# front of it. +# The default directory is: docbook. +# This tag requires that the tag GENERATE_DOCBOOK is set to YES. + +DOCBOOK_OUTPUT = docbook + +# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the +# program listings (including syntax highlighting and cross-referencing +# information) to the DOCBOOK output. Note that enabling this will significantly +# increase the size of the DOCBOOK output. +# The default value is: NO. +# This tag requires that the tag GENERATE_DOCBOOK is set to YES. + +DOCBOOK_PROGRAMLISTING = NO + +#--------------------------------------------------------------------------- +# Configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an +# AutoGen Definitions (see http://autogen.sf.net) file that captures the +# structure of the code including all documentation. Note that this feature is +# still experimental and incomplete at the moment. +# The default value is: NO. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module +# file that captures the structure of the code including all documentation. +# +# Note that this feature is still experimental and incomplete at the moment. +# The default value is: NO. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary +# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI +# output from the Perl module output. +# The default value is: NO. +# This tag requires that the tag GENERATE_PERLMOD is set to YES. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely +# formatted so it can be parsed by a human reader. This is useful if you want to +# understand what is going on. On the other hand, if this tag is set to NO, the +# size of the Perl module output will be much smaller and Perl will parse it +# just the same. +# The default value is: YES. +# This tag requires that the tag GENERATE_PERLMOD is set to YES. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file are +# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful +# so different doxyrules.make files included by the same Makefile don't +# overwrite each other's variables. +# This tag requires that the tag GENERATE_PERLMOD is set to YES. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all +# C-preprocessor directives found in the sources and include files. +# The default value is: YES. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names +# in the source code. If set to NO, only conditional compilation will be +# performed. Macro expansion can be done in a controlled way by setting +# EXPAND_ONLY_PREDEF to YES. +# The default value is: NO. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then +# the macro expansion is limited to the macros specified with the PREDEFINED and +# EXPAND_AS_DEFINED tags. +# The default value is: NO. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES, the include files in the +# INCLUDE_PATH will be searched if a #include is found. +# The default value is: YES. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by the +# preprocessor. +# This tag requires that the tag SEARCH_INCLUDES is set to YES. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will be +# used. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that are +# defined before the preprocessor is started (similar to the -D option of e.g. +# gcc). The argument of the tag is a list of macros of the form: name or +# name=definition (no spaces). If the definition and the "=" are omitted, "=1" +# is assumed. To prevent a macro definition from being undefined via #undef or +# recursively expanded use the := operator instead of the = operator. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this +# tag can be used to specify a list of macro names that should be expanded. The +# macro definition that is found in the sources will be used. Use the PREDEFINED +# tag if you want to use a different macro definition that overrules the +# definition found in the source code. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will +# remove all references to function-like macros that are alone on a line, have +# an all uppercase name, and do not end with a semicolon. Such function macros +# are typically used for boiler-plate code, and will confuse the parser if not +# removed. +# The default value is: YES. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES tag can be used to specify one or more tag files. For each tag +# file the location of the external documentation should be added. The format of +# a tag file without this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where loc1 and loc2 can be relative or absolute paths or URLs. See the +# section "Linking to external documentation" for more information about the use +# of tag files. +# Note: Each tag file must have a unique name (where the name does NOT include +# the path). If a tag file is not located in the directory in which doxygen is +# run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create a +# tag file that is based on the input files it reads. See section "Linking to +# external documentation" for more information about the usage of tag files. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES, all external class will be listed in +# the class index. If set to NO, only the inherited external classes will be +# listed. +# The default value is: NO. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will be +# listed. +# The default value is: YES. + +EXTERNAL_GROUPS = YES + +# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in +# the related pages index. If set to NO, only the current project's pages will +# be listed. +# The default value is: YES. + +EXTERNAL_PAGES = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of 'which perl'). +# The default file (with absolute path) is: /usr/bin/perl. + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram +# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to +# NO turns the diagrams off. Note that this option also works with HAVE_DOT +# disabled, but it is recommended to install and use dot, since it yields more +# powerful graphs. +# The default value is: YES. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see: +# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# You can include diagrams made with dia in doxygen documentation. Doxygen will +# then run dia to produce the diagram and insert it in the documentation. The +# DIA_PATH tag allows you to specify the directory where the dia binary resides. +# If left empty dia is assumed to be found in the default search path. + +DIA_PATH = + +# If set to YES the inheritance and collaboration graphs will hide inheritance +# and usage relations if the target is undocumented or is not a class. +# The default value is: YES. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz (see: +# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent +# Bell Labs. The other options in this section have no effect if this option is +# set to NO +# The default value is: YES. + +HAVE_DOT = YES + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed +# to run in parallel. When set to 0 doxygen will base this on the number of +# processors available in the system. You can set it explicitly to a value +# larger than 0 to get control over the balance between CPU load and processing +# speed. +# Minimum value: 0, maximum value: 32, default value: 0. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_NUM_THREADS = 0 + +# When you want a differently looking font in the dot files that doxygen +# generates you can specify the font name using DOT_FONTNAME. You need to make +# sure dot is able to find the font, which can be done by putting it in a +# standard location or by setting the DOTFONTPATH environment variable or by +# setting DOT_FONTPATH to the directory containing the font. +# The default value is: Helvetica. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of +# dot graphs. +# Minimum value: 4, maximum value: 24, default value: 10. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the default font as specified with +# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set +# the path where dot can find it using this tag. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_FONTPATH = + +# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for +# each documented class showing the direct and indirect inheritance relations. +# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a +# graph for each documented class showing the direct and indirect implementation +# dependencies (inheritance, containment, and class references variables) of the +# class with other documented classes. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for +# groups, showing the direct groups dependencies. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +UML_LOOK = NO + +# If the UML_LOOK tag is enabled, the fields and methods are shown inside the +# class node. If there are many fields or methods and many nodes the graph may +# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the +# number of items for each type to make the size more manageable. Set this to 0 +# for no limit. Note that the threshold may be exceeded by 50% before the limit +# is enforced. So when you set the threshold to 10, up to 15 fields may appear, +# but if the number exceeds 15, the total amount of fields shown is limited to +# 10. +# Minimum value: 0, maximum value: 100, default value: 10. +# This tag requires that the tag HAVE_DOT is set to YES. + +UML_LIMIT_NUM_FIELDS = 10 + +# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and +# collaboration graphs will show the relations between templates and their +# instances. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +TEMPLATE_RELATIONS = NO + +# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to +# YES then doxygen will generate a graph for each documented file showing the +# direct and indirect include dependencies of the file with other documented +# files. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +INCLUDE_GRAPH = YES + +# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are +# set to YES then doxygen will generate a graph for each documented file showing +# the direct and indirect include dependencies of the file with other documented +# files. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH tag is set to YES then doxygen will generate a call +# dependency graph for every global function or class method. +# +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. Disabling a call graph can be +# accomplished by means of the command \hidecallgraph. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller +# dependency graph for every global function or class method. +# +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable caller graphs for selected +# functions only using the \callergraph command. Disabling a caller graph can be +# accomplished by means of the command \hidecallergraph. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical +# hierarchy of all classes instead of a textual one. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the +# dependencies a directory has on other directories in a graphical way. The +# dependency relations are determined by the #include relations between the +# files in the directories. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. For an explanation of the image formats see the section +# output formats in the documentation of the dot tool (Graphviz (see: +# http://www.graphviz.org/)). +# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order +# to make the SVG files visible in IE 9+ (other browsers do not have this +# requirement). +# Possible values are: png, png:cairo, png:cairo:cairo, png:cairo:gd, png:gd, +# png:gd:gd, jpg, jpg:cairo, jpg:cairo:gd, jpg:gd, jpg:gd:gd, gif, gif:cairo, +# gif:cairo:gd, gif:gd, gif:gd:gd, svg, png:gd, png:gd:gd, png:cairo, +# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and +# png:gdiplus:gdiplus. +# The default value is: png. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_IMAGE_FORMAT = png + +# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to +# enable generation of interactive SVG images that allow zooming and panning. +# +# Note that this requires a modern browser other than Internet Explorer. Tested +# and working are Firefox, Chrome, Safari, and Opera. +# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make +# the SVG files visible. Older versions of IE do not have SVG support. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +INTERACTIVE_SVG = NO + +# The DOT_PATH tag can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the \dotfile +# command). +# This tag requires that the tag HAVE_DOT is set to YES. + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the \mscfile +# command). + +MSCFILE_DIRS = + +# The DIAFILE_DIRS tag can be used to specify one or more directories that +# contain dia files that are included in the documentation (see the \diafile +# command). + +DIAFILE_DIRS = + +# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the +# path where java can find the plantuml.jar file. If left blank, it is assumed +# PlantUML is not used or called during a preprocessing step. Doxygen will +# generate a warning when it encounters a \startuml command in this case and +# will not generate output for the diagram. + +PLANTUML_JAR_PATH = + +# When using plantuml, the specified paths are searched for files specified by +# the !include statement in a plantuml block. + +PLANTUML_INCLUDE_PATH = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes +# that will be shown in the graph. If the number of nodes in a graph becomes +# larger than this value, doxygen will truncate the graph, which is visualized +# by representing a node as a red box. Note that doxygen if the number of direct +# children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that +# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. +# Minimum value: 0, maximum value: 10000, default value: 50. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs +# generated by dot. A depth value of 3 means that only nodes reachable from the +# root by following a path via at most 3 edges will be shown. Nodes that lay +# further from the root node will be omitted. Note that setting this option to 1 +# or 2 may greatly reduce the computation time needed for large code bases. Also +# note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. +# Minimum value: 0, maximum value: 1000, default value: 0. +# This tag requires that the tag HAVE_DOT is set to YES. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not seem +# to support this out of the box. +# +# Warning: Depending on the platform used, enabling this option may lead to +# badly anti-aliased labels on the edges of a graph (i.e. they become hard to +# read). +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) support +# this, this feature is disabled by default. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page +# explaining the meaning of the various boxes and arrows in the dot generated +# graphs. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot +# files that are used to generate the various graphs. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_CLEANUP = YES diff --git a/src/lib/netlist/build/makefile b/src/lib/netlist/build/makefile index 8b7bc4b2c12..e017e8ef35d 100644 --- a/src/lib/netlist/build/makefile +++ b/src/lib/netlist/build/makefile @@ -162,10 +162,11 @@ depend: .depend .PHONY: clang clang: - $(MAKE) CC=clang++ LD=clang++ CEXTRAFLAGS="-Weverything -Werror -Wno-padded -Wno-weak-vtables -Wno-missing-variable-declarations -Wno-conversion -Wno-c++98-compat -Wno-float-equal -Wno-cast-align -Wno-global-constructors -Wno-c++98-compat-pedantic -Wno-exit-time-destructors -Wno-format-nonliteral -Wno-weak-template-vtables" + $(MAKE) CC=clang++ LD=clang++ CEXTRAFLAGS="-Weverything -Werror -Wno-padded -Wno-weak-vtables -Wno-missing-variable-declarations -Wconversion -Wno-c++98-compat -Wno-float-equal -Wno-cast-align -Wno-global-constructors -Wno-c++98-compat-pedantic -Wno-exit-time-destructors -Wno-format-nonliteral -Wno-weak-template-vtables" -# -Wno-old-style-cast -# FIX: -Wno-weak-vtables -Wno-missing-variable-declarations -Wno-conversion -Wno-old-style-cast -Wno-exit-time-destructors +# +# FIX: -Wno-weak-vtables -Wno-missing-variable-declarations -Wno-conversion -Wno-exit-time-destructors +# #------------------------------------------------- # generic rules diff --git a/src/lib/netlist/devices/net_lib.cpp b/src/lib/netlist/devices/net_lib.cpp index 3f41d6b9daf..f70e229ddff 100644 --- a/src/lib/netlist/devices/net_lib.cpp +++ b/src/lib/netlist/devices/net_lib.cpp @@ -71,7 +71,6 @@ namespace netlist { namespace devices { - static void initialize_factory(factory_list_t &factory) { ENTRY(R, RES, "R") diff --git a/src/lib/netlist/devices/nld_4020.cpp b/src/lib/netlist/devices/nld_4020.cpp index 3f7dac5e742..a147cf3f58f 100644 --- a/src/lib/netlist/devices/nld_4020.cpp +++ b/src/lib/netlist/devices/nld_4020.cpp @@ -83,14 +83,14 @@ namespace netlist NETLIB_UPDATE(CD4020) { - if (INPLOGIC(m_RESET)) + if (m_RESET()) { m_sub.m_cnt = 0; m_sub.m_IP.inactivate(); /* static */ const netlist_time reset_time = netlist_time::from_nsec(140); - OUTLOGIC(m_sub.m_Q[0], 0, reset_time); - for (int i=3; i<14; i++) - OUTLOGIC(m_sub.m_Q[i], 0, reset_time); + m_sub.m_Q[0].push(0, reset_time); + for (std::size_t i=3; i<14; i++) + m_sub.m_Q[i].push(0, reset_time); } else m_sub.m_IP.activate_hl(); @@ -108,9 +108,9 @@ namespace netlist NLTIME_FROM_NS(1380), NLTIME_FROM_NS(1480), }; - OUTLOGIC(m_Q[0], cnt & 1, out_delayQn[0]); - for (int i=3; i<14; i++) - OUTLOGIC(m_Q[i], (cnt >> i) & 1, out_delayQn[i]); + m_Q[0].push(cnt & 1, out_delayQn[0]); + for (std::size_t i=3; i<14; i++) + m_Q[i].push((cnt >> i) & 1, out_delayQn[i]); } NETLIB_DEVICE_IMPL(CD4020) diff --git a/src/lib/netlist/devices/nld_4066.cpp b/src/lib/netlist/devices/nld_4066.cpp index 33b78ddf1b7..a9d82b1e041 100644 --- a/src/lib/netlist/devices/nld_4066.cpp +++ b/src/lib/netlist/devices/nld_4066.cpp @@ -40,8 +40,8 @@ namespace netlist nl_double sup = (m_supply.vdd() - m_supply.vss()); nl_double low = NL_FCONST(0.45) * sup; nl_double high = NL_FCONST(0.55) * sup; - nl_double in = INPANALOG(m_control) - m_supply.vss(); - nl_double rON = m_base_r * NL_FCONST(5.0) / sup; + nl_double in = m_control() - m_supply.vss(); + nl_double rON = m_base_r() * NL_FCONST(5.0) / sup; nl_double R = -1.0; if (in < low) diff --git a/src/lib/netlist/devices/nld_74107.cpp b/src/lib/netlist/devices/nld_74107.cpp index 2bdd4653b48..a0ffcfc3fdd 100644 --- a/src/lib/netlist/devices/nld_74107.cpp +++ b/src/lib/netlist/devices/nld_74107.cpp @@ -121,8 +121,8 @@ namespace netlist { const netlist_time delay[2] = { NLTIME_FROM_NS(25), NLTIME_FROM_NS(40) }; - OUTLOGIC(m_Q, state, delay[state]); - OUTLOGIC(m_QQ, state ^ 1, delay[state ^ 1]); + m_Q.push(state, delay[state]); + m_QQ.push(state ^ 1, delay[state ^ 1]); } NETLIB_UPDATE(74107Asub) @@ -135,7 +135,7 @@ namespace netlist NETLIB_UPDATE(74107A) { - const auto JK = (INPLOGIC(m_J) << 1) | INPLOGIC(m_K); + const auto JK = (m_J() << 1) | m_K(); switch (JK) { @@ -145,17 +145,17 @@ namespace netlist m_sub.m_F = 0; m_sub.m_clk.inactivate(); break; - case 1: // (!INPLOGIC(m_J) & INPLOGIC(m_K)) + case 1: // (!m_J) & m_K)) m_sub.m_Q1 = 0; m_sub.m_Q2 = 0; m_sub.m_F = 0; break; - case 2: // (INPLOGIC(m_J) & !INPLOGIC(m_K)) + case 2: // (m_J) & !m_K)) m_sub.m_Q1 = 0; m_sub.m_Q2 = 0; m_sub.m_F = 1; break; - case 3: // (INPLOGIC(m_J) & INPLOGIC(m_K)) + case 3: // (m_J) & m_K)) m_sub.m_Q1 = 1; m_sub.m_Q2 = 0; m_sub.m_F = 0; @@ -164,7 +164,7 @@ namespace netlist break; } - if (!INPLOGIC(m_clrQ)) + if (!m_clrQ()) { m_sub.m_clk.inactivate(); m_sub.newstate(0); diff --git a/src/lib/netlist/devices/nld_74123.cpp b/src/lib/netlist/devices/nld_74123.cpp index 5f45b330b61..0e36e2ed487 100644 --- a/src/lib/netlist/devices/nld_74123.cpp +++ b/src/lib/netlist/devices/nld_74123.cpp @@ -181,47 +181,47 @@ namespace netlist NETLIB_UPDATE(74123) { netlist_sig_t m_trig; - netlist_sig_t res = !INPLOGIC(m_CLRQ); + netlist_sig_t res = !m_CLRQ(); netlist_time t_AB_to_Q = NLTIME_FROM_NS(10); netlist_time t_C_to_Q = NLTIME_FROM_NS(10); if (m_dev_type == 74123) { - m_trig = (INPLOGIC(m_A) ^ 1) & INPLOGIC(m_B) & INPLOGIC(m_CLRQ); + m_trig = (m_A() ^ 1) & m_B() & m_CLRQ(); } else if (m_dev_type == 9602) { - m_trig = (INPLOGIC(m_A) ^ 1) | INPLOGIC(m_B); + m_trig = (m_A() ^ 1) | m_B(); } else // 4538 { - m_trig = (INPLOGIC(m_B) ^ 1) | INPLOGIC(m_A); + m_trig = (m_B() ^ 1) | m_A(); // The line below is from the datasheet truthtable ... doesn't make sense at all - //res = res | INPLOGIC(m_A) | (INPLOGIC(m_B) ^ 1); + //res = res | m_A) | (m_B) ^ 1); t_AB_to_Q = NLTIME_FROM_NS(300); t_C_to_Q = NLTIME_FROM_NS(250); } if (res) { - OUTLOGIC(m_Q, 0, t_C_to_Q); - OUTLOGIC(m_QQ, 1, t_C_to_Q); + m_Q.push(0, t_C_to_Q); + m_QQ.push(1, t_C_to_Q); /* quick charge until trigger */ /* FIXME: SGS datasheet shows quick charge to 5V, * though schematics indicate quick charge to Vhigh only. */ - OUTLOGIC(m_RP_Q, 1, t_C_to_Q); // R_ON - OUTLOGIC(m_RN_Q, 0, t_C_to_Q); // R_OFF + m_RP_Q.push(1, t_C_to_Q); // R_ON + m_RN_Q.push(0, t_C_to_Q); // R_OFF m_state = 2; //charging (quick) } else if (!m_last_trig && m_trig) { // FIXME: Timing! - OUTLOGIC(m_Q, 1, t_AB_to_Q); - OUTLOGIC(m_QQ, 0,t_AB_to_Q); + m_Q.push(1, t_AB_to_Q); + m_QQ.push(0,t_AB_to_Q); - OUTLOGIC(m_RN_Q, 1, t_AB_to_Q); // R_ON - OUTLOGIC(m_RP_Q, 0, t_AB_to_Q); // R_OFF + m_RN_Q.push(1, t_AB_to_Q); // R_ON + m_RP_Q.push(0, t_AB_to_Q); // R_OFF m_state = 1; // discharging } @@ -230,22 +230,22 @@ namespace netlist if (m_state == 1) { - const nl_double vLow = m_KP * TERMANALOG(m_RP.m_R.m_P); - if (INPANALOG(m_CV) < vLow) + const nl_double vLow = m_KP * m_RP.m_R.m_P(); + if (m_CV() < vLow) { - OUTLOGIC(m_RN_Q, 0, NLTIME_FROM_NS(10)); // R_OFF + m_RN_Q.push(0, NLTIME_FROM_NS(10)); // R_OFF m_state = 2; // charging } } if (m_state == 2) { - const nl_double vHigh = TERMANALOG(m_RP.m_R.m_P) * (1.0 - m_KP); - if (INPANALOG(m_CV) > vHigh) + const nl_double vHigh = m_RP.m_R.m_P() * (1.0 - m_KP); + if (m_CV() > vHigh) { - OUTLOGIC(m_RP_Q, 0, NLTIME_FROM_NS(10)); // R_OFF + m_RP_Q.push(0, NLTIME_FROM_NS(10)); // R_OFF - OUTLOGIC(m_Q, 0, NLTIME_FROM_NS(10)); - OUTLOGIC(m_QQ, 1, NLTIME_FROM_NS(10)); + m_Q.push(0, NLTIME_FROM_NS(10)); + m_QQ.push(1, NLTIME_FROM_NS(10)); m_state = 0; // waiting } } @@ -253,7 +253,7 @@ namespace netlist NETLIB_RESET(74123) { - m_KP = 1.0 / (1.0 + exp(m_K.Value())); + m_KP = 1.0 / (1.0 + exp(m_K())); m_RP.do_reset(); m_RN.do_reset(); diff --git a/src/lib/netlist/devices/nld_74153.cpp b/src/lib/netlist/devices/nld_74153.cpp index 5f9df45dfdb..f6ab482d332 100644 --- a/src/lib/netlist/devices/nld_74153.cpp +++ b/src/lib/netlist/devices/nld_74153.cpp @@ -104,28 +104,28 @@ namespace netlist NETLIB_UPDATE(74153sub) { const netlist_time delay[2] = { NLTIME_FROM_NS(23), NLTIME_FROM_NS(18) }; - if (!INPLOGIC(m_G)) + if (!m_G()) { - uint_fast8_t t = INPLOGIC(m_C[m_chan]); - OUTLOGIC(m_Y, t, delay[t] ); + auto t = m_C[m_chan](); + m_Y.push(t, delay[t]); } else { - OUTLOGIC(m_Y, 0, delay[0]); + m_Y.push(0, delay[0]); } } NETLIB_UPDATE(74153) { - m_sub.m_chan = (INPLOGIC(m_A) | (INPLOGIC(m_B)<<1)); + m_sub.m_chan = (m_A() | (m_B()<<1)); m_sub.do_update(); } NETLIB_UPDATE(74153_dip) { - m_2.m_chan = m_1.m_chan = (INPLOGIC(m_A) | (INPLOGIC(m_B)<<1)); + m_2.m_chan = m_1.m_chan = (m_A() | (m_B()<<1)); m_1.do_update(); m_2.do_update(); } diff --git a/src/lib/netlist/devices/nld_74175.cpp b/src/lib/netlist/devices/nld_74175.cpp index e927c485e20..4d8e3608ee8 100644 --- a/src/lib/netlist/devices/nld_74175.cpp +++ b/src/lib/netlist/devices/nld_74175.cpp @@ -105,11 +105,11 @@ namespace netlist { if (m_clrq) { - for (int i=0; i<4; i++) + for (std::size_t i=0; i<4; i++) { netlist_sig_t d = (m_data >> i) & 1; - OUTLOGIC(m_Q[i], d, delay[d]); - OUTLOGIC(m_QQ[i], d ^ 1, delay[d ^ 1]); + m_Q[i].push(d, delay[d]); + m_QQ[i].push(d ^ 1, delay[d ^ 1]); } m_CLK.inactivate(); } @@ -118,17 +118,17 @@ namespace netlist NETLIB_UPDATE(74175) { uint_fast8_t d = 0; - for (int i=0; i<4; i++) + for (std::size_t i=0; i<4; i++) { - d |= (INPLOGIC(m_D[i]) << i); + d |= (m_D[i]() << i); } - m_sub.m_clrq = INPLOGIC(m_CLRQ); + m_sub.m_clrq = m_CLRQ(); if (!m_sub.m_clrq) { - for (int i=0; i<4; i++) + for (std::size_t i=0; i<4; i++) { - OUTLOGIC(m_sub.m_Q[i], 0, delay_clear[0]); - OUTLOGIC(m_sub.m_QQ[i], 1, delay_clear[1]); + m_sub.m_Q[i].push(0, delay_clear[0]); + m_sub.m_QQ[i].push(1, delay_clear[1]); } m_sub.m_data = 0; } else if (d != m_sub.m_data) diff --git a/src/lib/netlist/devices/nld_74192.cpp b/src/lib/netlist/devices/nld_74192.cpp index d3f657b93ae..80e1853b7f7 100644 --- a/src/lib/netlist/devices/nld_74192.cpp +++ b/src/lib/netlist/devices/nld_74192.cpp @@ -32,10 +32,9 @@ namespace netlist logic_input_t m_C; logic_input_t m_D; - uint_fast8_t read_ABCD() const + unsigned read_ABCD() const { - //return (INPLOGIC_PASSIVE(m_D) << 3) | (INPLOGIC_PASSIVE(m_C) << 2) | (INPLOGIC_PASSIVE(m_B) << 1) | (INPLOGIC_PASSIVE(m_A) << 0); - return (INPLOGIC(m_D) << 3) | (INPLOGIC(m_C) << 2) | (INPLOGIC(m_B) << 1) | (INPLOGIC(m_A) << 0); + return (m_D() << 3) | (m_C() << 2) | (m_B() << 1) | (m_A() << 0); } }; @@ -70,7 +69,7 @@ namespace netlist logic_input_t m_CU; logic_input_t m_CD; - state_var<int> m_cnt; + state_var<unsigned> m_cnt; state_var<unsigned> m_last_CU; state_var<unsigned> m_last_CD; @@ -119,25 +118,25 @@ namespace netlist NETLIB_UPDATE(74192) { - int tCarry = 1; - int tBorrow = 1; - if (INPLOGIC(m_CLEAR)) + netlist_sig_t tCarry = 1; + netlist_sig_t tBorrow = 1; + if (m_CLEAR()) { m_cnt = 0; } - else if (!INPLOGIC(m_LOADQ)) + else if (!m_LOADQ()) { m_cnt = m_ABCD.read_ABCD(); } else { - if (INPLOGIC(m_CD) && !m_last_CU && INPLOGIC(m_CU)) + if (m_CD() && !m_last_CU && m_CU()) { m_cnt++; if (m_cnt > MAXCNT) m_cnt = 0; } - if (INPLOGIC(m_CU) && !m_last_CD && INPLOGIC(m_CD)) + if (m_CU() && !m_last_CD && m_CD()) { if (m_cnt > 0) m_cnt--; @@ -146,20 +145,20 @@ namespace netlist } } - if (!INPLOGIC(m_CU) && (m_cnt == MAXCNT)) + if (!m_CU() && (m_cnt == MAXCNT)) tCarry = 0; - if (!INPLOGIC(m_CD) && (m_cnt == 0)) + if (!m_CD() && (m_cnt == 0)) tBorrow = 0; - m_last_CD = INPLOGIC(m_CD); - m_last_CU = INPLOGIC(m_CU); + m_last_CD = m_CD(); + m_last_CU = m_CU(); - for (int i=0; i<4; i++) - OUTLOGIC(m_Q[i], (m_cnt >> i) & 1, delay[i]); + for (std::size_t i=0; i<4; i++) + m_Q[i].push((m_cnt >> i) & 1, delay[i]); - OUTLOGIC(m_BORROWQ, tBorrow, NLTIME_FROM_NS(20)); //FIXME - OUTLOGIC(m_CARRYQ, tCarry, NLTIME_FROM_NS(20)); //FIXME + m_BORROWQ.push(tBorrow, NLTIME_FROM_NS(20)); //FIXME + m_CARRYQ.push(tCarry, NLTIME_FROM_NS(20)); //FIXME } NETLIB_DEVICE_IMPL(74192) diff --git a/src/lib/netlist/devices/nld_74193.cpp b/src/lib/netlist/devices/nld_74193.cpp index b6f414a3cba..3d32596dbee 100644 --- a/src/lib/netlist/devices/nld_74193.cpp +++ b/src/lib/netlist/devices/nld_74193.cpp @@ -46,7 +46,7 @@ namespace netlist logic_input_t m_CU; logic_input_t m_CD; - state_var<int> m_cnt; + state_var<unsigned> m_cnt; state_var<unsigned> m_last_CU; state_var<unsigned> m_last_CD; @@ -96,26 +96,26 @@ namespace netlist NETLIB_UPDATE(74193) { - int tCarry = 1; - int tBorrow = 1; - if (INPLOGIC(m_CLEAR)) + netlist_sig_t tCarry = 1; + netlist_sig_t tBorrow = 1; + if (m_CLEAR()) { m_cnt = 0; } - else if (!INPLOGIC(m_LOADQ)) + else if (!m_LOADQ()) { - m_cnt = (INPLOGIC(m_D) << 3) | (INPLOGIC(m_C) << 2) - | (INPLOGIC(m_B) << 1) | (INPLOGIC(m_A) << 0); + m_cnt = (m_D() << 3) | (m_C() << 2) + | (m_B() << 1) | (m_A() << 0); } else { - if (INPLOGIC(m_CD) && !m_last_CU && INPLOGIC(m_CU)) + if (m_CD() && !m_last_CU && m_CU()) { m_cnt++; if (m_cnt > MAXCNT) m_cnt = 0; } - if (INPLOGIC(m_CU) && !m_last_CD && INPLOGIC(m_CD)) + if (m_CU() && !m_last_CD && m_CD()) { if (m_cnt > 0) m_cnt--; @@ -124,20 +124,20 @@ namespace netlist } } - if (!INPLOGIC(m_CU) && (m_cnt == MAXCNT)) + if (!m_CU() && (m_cnt == MAXCNT)) tCarry = 0; - if (!INPLOGIC(m_CD) && (m_cnt == 0)) + if (!m_CD() && (m_cnt == 0)) tBorrow = 0; - m_last_CD = INPLOGIC(m_CD); - m_last_CU = INPLOGIC(m_CU); + m_last_CD = m_CD(); + m_last_CU = m_CU(); - for (int i=0; i<4; i++) - OUTLOGIC(m_Q[i], (m_cnt >> i) & 1, delay[i]); + for (std::size_t i=0; i<4; i++) + m_Q[i].push((m_cnt >> i) & 1, delay[i]); - OUTLOGIC(m_BORROWQ, tBorrow, NLTIME_FROM_NS(20)); //FIXME - OUTLOGIC(m_CARRYQ, tCarry, NLTIME_FROM_NS(20)); //FIXME + m_BORROWQ.push(tBorrow, NLTIME_FROM_NS(20)); //FIXME + m_CARRYQ.push(tCarry, NLTIME_FROM_NS(20)); //FIXME } NETLIB_DEVICE_IMPL(74193) diff --git a/src/lib/netlist/devices/nld_7448.cpp b/src/lib/netlist/devices/nld_7448.cpp index 6b29786bf70..56b322dbc2f 100644 --- a/src/lib/netlist/devices/nld_7448.cpp +++ b/src/lib/netlist/devices/nld_7448.cpp @@ -37,7 +37,7 @@ namespace netlist NETLIB_UPDATEI(); public: - void update_outputs(uint_fast8_t v); + void update_outputs(unsigned v); static const uint_fast8_t tab7448[16][7]; logic_input_t m_A; @@ -136,18 +136,18 @@ namespace netlist NETLIB_UPDATE(7448) { - if (!INPLOGIC(m_BIQ) || (INPLOGIC(m_BIQ) && !INPLOGIC(m_LTQ))) + if (!m_BIQ() || (m_BIQ() && !m_LTQ())) { m_A.inactivate(); m_B.inactivate(); m_C.inactivate(); m_D.inactivate(); m_RBIQ.inactivate(); - if (INPLOGIC(m_BIQ) && !INPLOGIC(m_LTQ)) + if (m_BIQ() && !m_LTQ()) { update_outputs(8); } - else if (!INPLOGIC(m_BIQ)) + else if (!m_BIQ()) { update_outputs(15); } @@ -157,10 +157,10 @@ namespace netlist m_C.activate(); m_B.activate(); m_A.activate(); - uint_fast8_t v; + unsigned v; - v = (INPLOGIC(m_A) << 0) | (INPLOGIC(m_B) << 1) | (INPLOGIC(m_C) << 2) | (INPLOGIC(m_D) << 3); - if ((!INPLOGIC(m_RBIQ) && (v==0))) + v = (m_A() << 0) | (m_B() << 1) | (m_C() << 2) | (m_D() << 3); + if ((!m_RBIQ() && (v==0))) v = 15; update_outputs(v); } @@ -176,15 +176,15 @@ namespace netlist m_RBIQ.inactivate(); } - NETLIB_FUNC_VOID(7448, update_outputs, (uint_fast8_t v)) + NETLIB_FUNC_VOID(7448, update_outputs, (unsigned v)) { nl_assert(v<16); if (v != m_state) { // max transfer time is 100 NS */ - for (int i=0; i<7; i++) - OUTLOGIC(m_Q[i], tab7448[v][i], NLTIME_FROM_NS(100)); + for (std::size_t i=0; i<7; i++) + m_Q[i].push(tab7448[v][i], NLTIME_FROM_NS(100)); m_state = v; } } diff --git a/src/lib/netlist/devices/nld_7450.cpp b/src/lib/netlist/devices/nld_7450.cpp index 8039014a781..007f899a5f9 100644 --- a/src/lib/netlist/devices/nld_7450.cpp +++ b/src/lib/netlist/devices/nld_7450.cpp @@ -1,4 +1,4 @@ -// license:GPL-2.0+ + // license:GPL-2.0+ // copyright-holders:Couriersud /* * nld_7450.c @@ -67,8 +67,8 @@ namespace netlist m_B.activate(); m_C.activate(); m_D.activate(); - uint_fast8_t t1 = INPLOGIC(m_A) & INPLOGIC(m_B); - uint_fast8_t t2 = INPLOGIC(m_C) & INPLOGIC(m_D); + unsigned t1 = m_A() & m_B(); + unsigned t2 = m_C() & m_D(); const netlist_time times[2] = { NLTIME_FROM_NS(22), NLTIME_FROM_NS(15) }; @@ -91,7 +91,7 @@ namespace netlist m_D.inactivate(); } } - OUTLOGIC(m_Q, res, times[1 - res]);// ? 22000 : 15000); + m_Q.push(res, times[1 - res]);// ? 22000 : 15000); } NETLIB_DEVICE_IMPL(7450) diff --git a/src/lib/netlist/devices/nld_7474.cpp b/src/lib/netlist/devices/nld_7474.cpp index 41339ebfa4a..f11ccbd2164 100644 --- a/src/lib/netlist/devices/nld_7474.cpp +++ b/src/lib/netlist/devices/nld_7474.cpp @@ -95,8 +95,8 @@ namespace netlist { // 0: High-to-low 40 ns, 1: Low-to-high 25 ns const netlist_time delay[2] = { NLTIME_FROM_NS(40), NLTIME_FROM_NS(25) }; - OUTLOGIC(m_Q, stateQ, delay[stateQ]); - OUTLOGIC(m_QQ, stateQQ, delay[stateQQ]); + m_Q.push(stateQ, delay[stateQ]); + m_QQ.push(stateQQ, delay[stateQQ]); } NETLIB_UPDATE(7474sub) @@ -110,19 +110,19 @@ namespace netlist NETLIB_UPDATE(7474) { - if (INPLOGIC(m_PREQ) && INPLOGIC(m_CLRQ)) + if (m_PREQ() && m_CLRQ()) { m_D.activate(); - sub.m_nextD = INPLOGIC(m_D); + sub.m_nextD = m_D(); sub.m_CLK.activate_lh(); } - else if (!INPLOGIC(m_PREQ)) + else if (!m_PREQ()) { sub.newstate(1, 0); sub.m_CLK.inactivate(); m_D.inactivate(); } - else if (!INPLOGIC(m_CLRQ)) + else if (!m_CLRQ()) { sub.newstate(0, 1); sub.m_CLK.inactivate(); diff --git a/src/lib/netlist/devices/nld_7483.cpp b/src/lib/netlist/devices/nld_7483.cpp index a3c7a3ca973..a11f36c1540 100644 --- a/src/lib/netlist/devices/nld_7483.cpp +++ b/src/lib/netlist/devices/nld_7483.cpp @@ -88,19 +88,19 @@ namespace netlist NETLIB_UPDATE(7483) { - uint_fast8_t a = (INPLOGIC(m_A1) << 0) | (INPLOGIC(m_A2) << 1) | (INPLOGIC(m_A3) << 2) | (INPLOGIC(m_A4) << 3); - uint_fast8_t b = (INPLOGIC(m_B1) << 0) | (INPLOGIC(m_B2) << 1) | (INPLOGIC(m_B3) << 2) | (INPLOGIC(m_B4) << 3); + netlist_sig_t a = (m_A1() << 0) | (m_A2() << 1) | (m_A3() << 2) | (m_A4() << 3); + netlist_sig_t b = (m_B1() << 0) | (m_B2() << 1) | (m_B3() << 2) | (m_B4() << 3); - uint_fast8_t r = a + b + INPLOGIC(m_C0); + unsigned r = a + b + m_C0(); if (r != m_lastr) { m_lastr = r; - OUTLOGIC(m_S1, (r >> 0) & 1, NLTIME_FROM_NS(23)); - OUTLOGIC(m_S2, (r >> 1) & 1, NLTIME_FROM_NS(23)); - OUTLOGIC(m_S3, (r >> 2) & 1, NLTIME_FROM_NS(23)); - OUTLOGIC(m_S4, (r >> 3) & 1, NLTIME_FROM_NS(23)); - OUTLOGIC(m_C4, (r >> 4) & 1, NLTIME_FROM_NS(23)); + m_S1.push((r >> 0) & 1, NLTIME_FROM_NS(23)); + m_S2.push((r >> 1) & 1, NLTIME_FROM_NS(23)); + m_S3.push((r >> 2) & 1, NLTIME_FROM_NS(23)); + m_S4.push((r >> 3) & 1, NLTIME_FROM_NS(23)); + m_C4.push((r >> 4) & 1, NLTIME_FROM_NS(23)); } } diff --git a/src/lib/netlist/devices/nld_7490.cpp b/src/lib/netlist/devices/nld_7490.cpp index f2dd6ff5455..e395c64120e 100644 --- a/src/lib/netlist/devices/nld_7490.cpp +++ b/src/lib/netlist/devices/nld_7490.cpp @@ -41,8 +41,8 @@ namespace netlist logic_input_t m_R92; state_var_u8 m_cnt; - state_var_u8 m_last_A; - state_var_u8 m_last_B; + state_var<netlist_sig_t> m_last_A; + state_var<netlist_sig_t> m_last_B; object_array_t<logic_output_t, 4> m_Q; }; @@ -86,15 +86,15 @@ namespace netlist NETLIB_UPDATE(7490) { - const netlist_sig_t new_A = INPLOGIC(m_A); - const netlist_sig_t new_B = INPLOGIC(m_B); + const netlist_sig_t new_A = m_A(); + const netlist_sig_t new_B = m_B(); - if (INPLOGIC(m_R91) & INPLOGIC(m_R92)) + if (m_R91() & m_R92()) { m_cnt = 9; update_outputs(); } - else if (INPLOGIC(m_R1) & INPLOGIC(m_R2)) + else if (m_R1() & m_R2()) { m_cnt = 0; update_outputs(); @@ -104,7 +104,7 @@ namespace netlist if (m_last_A && !new_A) // High - Low { m_cnt ^= 1; - OUTLOGIC(m_Q[0], m_cnt & 1, delay[0]); + m_Q[0].push(m_cnt & 1, delay[0]); } if (m_last_B && !new_B) // High - Low { @@ -120,8 +120,8 @@ namespace netlist NETLIB_FUNC_VOID(7490, update_outputs, (void)) { - for (int i=0; i<4; i++) - OUTLOGIC(m_Q[i], (m_cnt >> i) & 1, delay[i]); + for (std::size_t i=0; i<4; i++) + m_Q[i].push((m_cnt >> i) & 1, delay[i]); } NETLIB_DEVICE_IMPL(7490) diff --git a/src/lib/netlist/devices/nld_7493.cpp b/src/lib/netlist/devices/nld_7493.cpp index 46aec6921af..6e96facabae 100644 --- a/src/lib/netlist/devices/nld_7493.cpp +++ b/src/lib/netlist/devices/nld_7493.cpp @@ -103,22 +103,22 @@ namespace netlist if (m_reset) { m_state ^= 1; - OUTLOGIC(m_Q, m_state, out_delay); + m_Q.push(m_state, out_delay); } } NETLIB_UPDATE(7493) { - const netlist_sig_t r = INPLOGIC(m_R1) & INPLOGIC(m_R2); + const netlist_sig_t r = m_R1() & m_R2(); if (r) { A.m_I.inactivate(); B.m_I.inactivate(); - OUTLOGIC(A.m_Q, 0, NLTIME_FROM_NS(40)); - OUTLOGIC(B.m_Q, 0, NLTIME_FROM_NS(40)); - OUTLOGIC(C.m_Q, 0, NLTIME_FROM_NS(40)); - OUTLOGIC(D.m_Q, 0, NLTIME_FROM_NS(40)); + A.m_Q.push(0, NLTIME_FROM_NS(40)); + B.m_Q.push(0, NLTIME_FROM_NS(40)); + C.m_Q.push(0, NLTIME_FROM_NS(40)); + D.m_Q.push(0, NLTIME_FROM_NS(40)); A.m_reset = B.m_reset = C.m_reset = D.m_reset = 0; A.m_state = B.m_state = C.m_state = D.m_state = 0; } diff --git a/src/lib/netlist/devices/nld_74ls629.cpp b/src/lib/netlist/devices/nld_74ls629.cpp index 41f81f3cfea..3d35f90eba6 100644 --- a/src/lib/netlist/devices/nld_74ls629.cpp +++ b/src/lib/netlist/devices/nld_74ls629.cpp @@ -160,11 +160,11 @@ namespace netlist if (!m_enableq) { m_out = m_out ^ 1; - OUTLOGIC(m_Y, m_out, m_inc); + m_Y.push(m_out, m_inc); } else { - OUTLOGIC(m_Y, 1, m_inc); + m_Y.push(1, m_inc); } } @@ -174,8 +174,8 @@ namespace netlist // recompute nl_double freq; nl_double v_freq_2, v_freq_3, v_freq_4; - nl_double v_freq = INPANALOG(m_FC); - nl_double v_rng = INPANALOG(m_RNG); + nl_double v_freq = m_FC(); + nl_double v_rng = m_RNG(); /* coefficients */ const nl_double k1 = 1.9904769024796283E+03; @@ -207,27 +207,27 @@ namespace netlist freq += k9 * v_rng * v_freq_3; freq += k10 * v_rng * v_freq_4; - freq *= NL_FCONST(0.1e-6) / m_CAP; + freq *= NL_FCONST(0.1e-6) / m_CAP(); // FIXME: we need a possibility to remove entries from queue ... // or an exact model ... - m_clock.m_inc = netlist_time::from_double(0.5 / (double) freq); + m_clock.m_inc = netlist_time::from_double(0.5 / freq); //m_clock.update(); //NL_VERBOSE_OUT(("{1} {2} {3} {4}\n", name(), v_freq, v_rng, freq)); } - if (!m_clock.m_enableq && INPLOGIC(m_ENQ)) + if (!m_clock.m_enableq && m_ENQ()) { m_clock.m_enableq = 1; m_clock.m_out = m_clock.m_out ^ 1; - OUTLOGIC(m_clock.m_Y, m_clock.m_out, netlist_time::from_nsec(1)); + m_clock.m_Y.push(m_clock.m_out, netlist_time::from_nsec(1)); } - else if (m_clock.m_enableq && !INPLOGIC(m_ENQ)) + else if (m_clock.m_enableq && !m_ENQ()) { m_clock.m_enableq = 0; m_clock.m_out = m_clock.m_out ^ 1; - OUTLOGIC(m_clock.m_Y, m_clock.m_out, netlist_time::from_nsec(1)); + m_clock.m_Y.push(m_clock.m_out, netlist_time::from_nsec(1)); } } diff --git a/src/lib/netlist/devices/nld_82S16.cpp b/src/lib/netlist/devices/nld_82S16.cpp index 2f685e37aba..051fcd18ebe 100644 --- a/src/lib/netlist/devices/nld_82S16.cpp +++ b/src/lib/netlist/devices/nld_82S16.cpp @@ -68,33 +68,35 @@ namespace netlist // FIXME: optimize device (separate address decoder!) NETLIB_UPDATE(82S16) { - if (INPLOGIC(m_CE1Q) || INPLOGIC(m_CE2Q) || INPLOGIC(m_CE3Q)) + if (m_CE1Q() || m_CE2Q() || m_CE3Q()) { // FIXME: Outputs are tristate. This needs to be properly implemented - OUTLOGIC(m_DOUTQ, 1, NLTIME_FROM_NS(20)); + m_DOUTQ.push(1, NLTIME_FROM_NS(20)); //for (int i=0; i<8; i++) //m_A[i].inactivate(); } else { unsigned int adr = 0; - for (int i=0; i<8; i++) + for (std::size_t i=0; i<8; i++) { //m_A[i].activate(); - adr |= (INPLOGIC(m_A[i]) << i); + adr |= (m_A[i]() << i); } - if (!INPLOGIC(m_WEQ)) + if (!m_WEQ()) { - m_ram[adr >> 6] = (m_ram[adr >> 6] & ~((uint_fast64_t) 1 << (adr & 0x3f))) | ((uint_fast64_t) INPLOGIC(m_DIN) << (adr & 0x3f)); + m_ram[adr >> 6] = (m_ram[adr >> 6] + & ~(static_cast<uint_fast64_t>(1) << (adr & 0x3f))) + | (static_cast<uint_fast64_t>(m_DIN()) << (adr & 0x3f)); } - OUTLOGIC(m_DOUTQ, ((m_ram[adr >> 6] >> (adr & 0x3f)) & 1) ^ 1, NLTIME_FROM_NS(20)); + m_DOUTQ.push(((m_ram[adr >> 6] >> (adr & 0x3f)) & 1) ^ 1, NLTIME_FROM_NS(20)); } } NETLIB_RESET(82S16) { - for (int i=0; i<4; i++) + for (std::size_t i=0; i<4; i++) { m_ram[i] = 0; } diff --git a/src/lib/netlist/devices/nld_9310.cpp b/src/lib/netlist/devices/nld_9310.cpp index e7b95549d47..4ddb62af519 100644 --- a/src/lib/netlist/devices/nld_9310.cpp +++ b/src/lib/netlist/devices/nld_9310.cpp @@ -32,10 +32,9 @@ namespace netlist logic_input_t m_C; logic_input_t m_D; - uint_fast8_t read_ABCD() const + unsigned read_ABCD() const { - //return (INPLOGIC_PASSIVE(m_D) << 3) | (INPLOGIC_PASSIVE(m_C) << 2) | (INPLOGIC_PASSIVE(m_B) << 1) | (INPLOGIC_PASSIVE(m_A) << 0); - return (INPLOGIC(m_D) << 3) | (INPLOGIC(m_C) << 2) | (INPLOGIC(m_B) << 1) | (INPLOGIC(m_A) << 0); + return (m_D() << 3) | (m_C() << 2) | (m_B() << 1) | (m_A() << 0); } }; @@ -57,8 +56,8 @@ namespace netlist NETLIB_RESETI(); NETLIB_UPDATEI(); public: - inline void update_outputs_all(const uint_fast8_t cnt, const netlist_time out_delay); - inline void update_outputs(const uint_fast8_t cnt); + inline void update_outputs_all(const unsigned cnt, const netlist_time out_delay); + inline void update_outputs(const unsigned cnt); logic_input_t m_CLK; @@ -70,9 +69,9 @@ namespace netlist logic_output_t m_QD; logic_output_t m_RC; - state_var_u8 m_cnt; - state_var_u8 m_loadq; - state_var_u8 m_ent; + state_var<unsigned> m_cnt; + state_var<netlist_sig_t> m_loadq; + state_var<netlist_sig_t> m_ent; }; NETLIB_OBJECT(9310) @@ -163,11 +162,11 @@ namespace netlist { case MAXCNT - 1: m_cnt = MAXCNT; - OUTLOGIC(m_RC, m_ent, NLTIME_FROM_NS(20)); - OUTLOGIC(m_QA, 1, NLTIME_FROM_NS(20)); + m_RC.push(m_ent, NLTIME_FROM_NS(20)); + m_QA.push(1, NLTIME_FROM_NS(20)); break; case MAXCNT: - OUTLOGIC(m_RC, 0, NLTIME_FROM_NS(20)); + m_RC.push(0, NLTIME_FROM_NS(20)); m_cnt = 0; update_outputs_all(m_cnt, NLTIME_FROM_NS(20)); break; @@ -180,20 +179,20 @@ namespace netlist { m_cnt = m_ABCD->read_ABCD(); update_outputs_all(m_cnt, NLTIME_FROM_NS(22)); - OUTLOGIC(m_RC, m_ent & (m_cnt == MAXCNT), NLTIME_FROM_NS(27)); + m_RC.push(m_ent & (m_cnt == MAXCNT), NLTIME_FROM_NS(27)); } } NETLIB_UPDATE(9310) { - sub.m_loadq = INPLOGIC(m_LOADQ); - sub.m_ent = INPLOGIC(m_ENT); - const netlist_sig_t clrq = INPLOGIC(m_CLRQ); + sub.m_loadq = m_LOADQ(); + sub.m_ent = m_ENT(); + const netlist_sig_t clrq = m_CLRQ(); - if ((!sub.m_loadq || (sub.m_ent & INPLOGIC(m_ENP))) && clrq) + if ((!sub.m_loadq || (sub.m_ent & m_ENP())) && clrq) { sub.m_CLK.activate_lh(); - OUTLOGIC(sub.m_RC, sub.m_ent & (sub.m_cnt == MAXCNT), NLTIME_FROM_NS(27)); + sub.m_RC.push(sub.m_ent & (sub.m_cnt == MAXCNT), NLTIME_FROM_NS(27)); } else { @@ -204,56 +203,56 @@ namespace netlist sub.m_cnt = 0; //return; } - OUTLOGIC(sub.m_RC, sub.m_ent & (sub.m_cnt == MAXCNT), NLTIME_FROM_NS(27)); + sub.m_RC.push(sub.m_ent & (sub.m_cnt == MAXCNT), NLTIME_FROM_NS(27)); } } - inline NETLIB_FUNC_VOID(9310_sub, update_outputs_all, (const uint_fast8_t cnt, const netlist_time out_delay)) + inline NETLIB_FUNC_VOID(9310_sub, update_outputs_all, (const unsigned cnt, const netlist_time out_delay)) { - OUTLOGIC(m_QA, (cnt >> 0) & 1, out_delay); - OUTLOGIC(m_QB, (cnt >> 1) & 1, out_delay); - OUTLOGIC(m_QC, (cnt >> 2) & 1, out_delay); - OUTLOGIC(m_QD, (cnt >> 3) & 1, out_delay); + m_QA.push((cnt >> 0) & 1, out_delay); + m_QB.push((cnt >> 1) & 1, out_delay); + m_QC.push((cnt >> 2) & 1, out_delay); + m_QD.push((cnt >> 3) & 1, out_delay); } - inline NETLIB_FUNC_VOID(9310_sub, update_outputs, (const uint_fast8_t cnt)) + inline NETLIB_FUNC_VOID(9310_sub, update_outputs, (const unsigned cnt)) { /* static */ const netlist_time out_delay = NLTIME_FROM_NS(20); #if 0 // for (int i=0; i<4; i++) - // OUTLOGIC(m_Q[i], (cnt >> i) & 1, delay[i]); - OUTLOGIC(m_QA, (cnt >> 0) & 1, out_delay); - OUTLOGIC(m_QB, (cnt >> 1) & 1, out_delay); - OUTLOGIC(m_QC, (cnt >> 2) & 1, out_delay); - OUTLOGIC(m_QD, (cnt >> 3) & 1, out_delay); + // m_Q[i], (cnt >> i) & 1, delay[i]); + m_QA, (cnt >> 0) & 1, out_delay); + m_QB, (cnt >> 1) & 1, out_delay); + m_QC, (cnt >> 2) & 1, out_delay); + m_QD, (cnt >> 3) & 1, out_delay); #else if ((cnt & 1) == 1) - OUTLOGIC(m_QA, 1, out_delay); + m_QA.push(1, out_delay); else { - OUTLOGIC(m_QA, 0, out_delay); + m_QA.push(0, out_delay); switch (cnt) { case 0x00: - OUTLOGIC(m_QB, 0, out_delay); - OUTLOGIC(m_QC, 0, out_delay); - OUTLOGIC(m_QD, 0, out_delay); + m_QB.push(0, out_delay); + m_QC.push(0, out_delay); + m_QD.push(0, out_delay); break; case 0x02: case 0x06: case 0x0A: case 0x0E: - OUTLOGIC(m_QB, 1, out_delay); + m_QB.push(1, out_delay); break; case 0x04: case 0x0C: - OUTLOGIC(m_QB, 0, out_delay); - OUTLOGIC(m_QC, 1, out_delay); + m_QB.push(0, out_delay); + m_QC.push(1, out_delay); break; case 0x08: - OUTLOGIC(m_QB, 0, out_delay); - OUTLOGIC(m_QC, 0, out_delay); - OUTLOGIC(m_QD, 1, out_delay); + m_QB.push(0, out_delay); + m_QC.push(0, out_delay); + m_QD.push(1, out_delay); break; } diff --git a/src/lib/netlist/devices/nld_9316.cpp b/src/lib/netlist/devices/nld_9316.cpp index 6af7ef2eda9..ea7ca9fc45c 100644 --- a/src/lib/netlist/devices/nld_9316.cpp +++ b/src/lib/netlist/devices/nld_9316.cpp @@ -32,10 +32,9 @@ namespace netlist logic_input_t m_C; logic_input_t m_D; - uint_fast8_t read_ABCD() const + unsigned read_ABCD() const { - //return (INPLOGIC_PASSIVE(m_D) << 3) | (INPLOGIC_PASSIVE(m_C) << 2) | (INPLOGIC_PASSIVE(m_B) << 1) | (INPLOGIC_PASSIVE(m_A) << 0); - return (INPLOGIC(m_D) << 3) | (INPLOGIC(m_C) << 2) | (INPLOGIC(m_B) << 1) | (INPLOGIC(m_A) << 0); + return (m_D() << 3) | (m_C() << 2) | (m_B() << 1) | (m_A() << 0); } }; @@ -59,19 +58,19 @@ namespace netlist NETLIB_UPDATEI(); public: - void update_outputs_all(const uint_fast8_t cnt, const netlist_time out_delay) + void update_outputs_all(const unsigned cnt, const netlist_time out_delay) { - OUTLOGIC(m_QA, (cnt >> 0) & 1, out_delay); - OUTLOGIC(m_QB, (cnt >> 1) & 1, out_delay); - OUTLOGIC(m_QC, (cnt >> 2) & 1, out_delay); - OUTLOGIC(m_QD, (cnt >> 3) & 1, out_delay); + m_QA.push((cnt >> 0) & 1, out_delay); + m_QB.push((cnt >> 1) & 1, out_delay); + m_QC.push((cnt >> 2) & 1, out_delay); + m_QD.push((cnt >> 3) & 1, out_delay); } logic_input_t m_CLK; - state_var_u8 m_cnt; - state_var_u8 m_loadq; - state_var_u8 m_ent; + state_var<unsigned> m_cnt; + state_var<netlist_sig_t> m_loadq; + state_var<netlist_sig_t> m_ent; logic_output_t m_QA; logic_output_t m_QB; @@ -166,11 +165,11 @@ namespace netlist { case MAXCNT - 1: m_cnt = MAXCNT; - OUTLOGIC(m_RC, m_ent, NLTIME_FROM_NS(27)); - OUTLOGIC(m_QA, 1, NLTIME_FROM_NS(20)); + m_RC.push(m_ent, NLTIME_FROM_NS(27)); + m_QA.push(1, NLTIME_FROM_NS(20)); break; case MAXCNT: - OUTLOGIC(m_RC, 0, NLTIME_FROM_NS(27)); + m_RC.push(0, NLTIME_FROM_NS(27)); m_cnt = 0; update_outputs_all(m_cnt, NLTIME_FROM_NS(20)); break; @@ -183,21 +182,21 @@ namespace netlist else { m_cnt = m_ABCD->read_ABCD(); - OUTLOGIC(m_RC, m_ent & (m_cnt == MAXCNT), NLTIME_FROM_NS(27)); + m_RC.push(m_ent & (m_cnt == MAXCNT), NLTIME_FROM_NS(27)); update_outputs_all(m_cnt, NLTIME_FROM_NS(22)); } } NETLIB_UPDATE(9316) { - sub.m_loadq = INPLOGIC(m_LOADQ); - sub.m_ent = INPLOGIC(m_ENT); - const netlist_sig_t clrq = INPLOGIC(m_CLRQ); + sub.m_loadq = m_LOADQ(); + sub.m_ent = m_ENT(); + const netlist_sig_t clrq = m_CLRQ(); - if (((sub.m_loadq ^ 1) | (sub.m_ent & INPLOGIC(m_ENP))) & clrq) + if (((sub.m_loadq ^ 1) | (sub.m_ent & m_ENP())) & clrq) { sub.m_CLK.activate_lh(); - OUTLOGIC(sub.m_RC, sub.m_ent & (sub.m_cnt == MAXCNT), NLTIME_FROM_NS(27)); + sub.m_RC.push(sub.m_ent & (sub.m_cnt == MAXCNT), NLTIME_FROM_NS(27)); } else { @@ -208,7 +207,7 @@ namespace netlist sub.m_cnt = 0; //return; } - OUTLOGIC(sub.m_RC, sub.m_ent & (sub.m_cnt == MAXCNT), NLTIME_FROM_NS(27)); + sub.m_RC.push(sub.m_ent & (sub.m_cnt == MAXCNT), NLTIME_FROM_NS(27)); } } diff --git a/src/lib/netlist/devices/nld_legacy.cpp b/src/lib/netlist/devices/nld_legacy.cpp index e199a2fd371..3a063094b72 100644 --- a/src/lib/netlist/devices/nld_legacy.cpp +++ b/src/lib/netlist/devices/nld_legacy.cpp @@ -56,7 +56,7 @@ namespace netlist param_int_t m_L_to_H; param_int_t m_H_to_L; - state_var_u8 m_last; + state_var<netlist_sig_t> m_last; }; NETLIB_RESET(nicRSFF) @@ -67,15 +67,15 @@ namespace netlist NETLIB_UPDATE(nicRSFF) { - if (!INPLOGIC(m_S)) + if (!m_S()) { - OUTLOGIC(m_Q, 1, NLTIME_FROM_NS(20)); - OUTLOGIC(m_QQ, 0, NLTIME_FROM_NS(20)); + m_Q.push(1, NLTIME_FROM_NS(20)); + m_QQ.push(0, NLTIME_FROM_NS(20)); } - else if (!INPLOGIC(m_R)) + else if (!m_R()) { - OUTLOGIC(m_Q, 0, NLTIME_FROM_NS(20)); - OUTLOGIC(m_QQ, 1, NLTIME_FROM_NS(20)); + m_Q.push(0, NLTIME_FROM_NS(20)); + m_QQ.push(1, NLTIME_FROM_NS(20)); } } @@ -86,16 +86,16 @@ namespace netlist NETLIB_UPDATE(nicDelay) { - netlist_sig_t nval = INPLOGIC(m_I); + netlist_sig_t nval = m_I(); if (nval && !m_last) { // L_to_H - OUTLOGIC(m_Q, 1, NLTIME_FROM_NS(m_L_to_H.Value())); + m_Q.push(1, NLTIME_FROM_NS(static_cast<unsigned>(m_L_to_H()))); } else if (!nval && m_last) { // H_to_L - OUTLOGIC(m_Q, 0, NLTIME_FROM_NS(m_H_to_L.Value())); + m_Q.push(0, NLTIME_FROM_NS(static_cast<unsigned>(m_H_to_L()))); } m_last = nval; } diff --git a/src/lib/netlist/devices/nld_log.cpp b/src/lib/netlist/devices/nld_log.cpp index b483263a00c..17661de803d 100644 --- a/src/lib/netlist/devices/nld_log.cpp +++ b/src/lib/netlist/devices/nld_log.cpp @@ -28,7 +28,7 @@ namespace netlist NETLIB_UPDATEI() { /* use pstring::sprintf, it is a LOT faster */ - m_strm->writeline(plib::pfmt("{1} {2}").e(netlist().time().as_double(),".9").e((nl_double) INPANALOG(m_I))); + m_strm->writeline(plib::pfmt("{1} {2}").e(netlist().time().as_double(),".9").e(static_cast<double>(m_I()))); } NETLIB_RESETI() { } @@ -46,7 +46,7 @@ namespace netlist NETLIB_UPDATEI() { - m_strm->writeline(plib::pfmt("{1} {2}").e(netlist().time().as_double(),".9").e((nl_double) (INPANALOG(m_I) - INPANALOG(m_I2)))); + m_strm->writeline(plib::pfmt("{1} {2}").e(netlist().time().as_double(),".9").e(static_cast<double>(m_I() - m_I2()))); } NETLIB_RESETI() { } @@ -79,7 +79,7 @@ namespace netlist NETLIB_UPDATE(wav) { - fprintf(m_file, "%e %e\n", netlist().time().as_double(), INPANALOG(m_I)); + fprintf(m_file, "%e %e\n", netlist().time().as_double(), m_I()); } NETLIB_NAME(log)::~NETLIB_NAME(wav)() diff --git a/src/lib/netlist/devices/nld_mm5837.cpp b/src/lib/netlist/devices/nld_mm5837.cpp index 20239c5e7ea..41d2fea9e34 100644 --- a/src/lib/netlist/devices/nld_mm5837.cpp +++ b/src/lib/netlist/devices/nld_mm5837.cpp @@ -78,7 +78,7 @@ namespace netlist NETLIB_UPDATE(MM5837_dip) { - OUTLOGIC(m_Q, !m_Q.net().new_Q(), m_inc ); + m_Q.push(!m_Q.net().new_Q(), m_inc); /* shift register * @@ -94,7 +94,7 @@ namespace netlist if (state != last_state) { const nl_double R = state ? R_HIGH : R_LOW; - const nl_double V = state ? INPANALOG(m_VDD) : INPANALOG(m_VSS); + const nl_double V = state ? m_VDD() : m_VSS(); // We only need to update the net first if this is a time stepping net if (m_is_timestep) diff --git a/src/lib/netlist/devices/nld_ne555.cpp b/src/lib/netlist/devices/nld_ne555.cpp index 31b5f091fa4..840dafeb5be 100644 --- a/src/lib/netlist/devices/nld_ne555.cpp +++ b/src/lib/netlist/devices/nld_ne555.cpp @@ -80,7 +80,7 @@ namespace netlist inline nl_double NETLIB_NAME(NE555)::clamp(const nl_double v, const nl_double a, const nl_double b) { nl_double ret = v; - nl_double vcc = TERMANALOG(m_R1.m_P); + nl_double vcc = m_R1.m_P(); if (ret > vcc - a) ret = vcc - a; @@ -108,9 +108,9 @@ namespace netlist { // FIXME: assumes GND is connected to 0V. - nl_double vt = clamp(TERMANALOG(m_R2.m_P), 0.7, 1.4); - bool bthresh = (INPANALOG(m_THRES) > vt); - bool btrig = (INPANALOG(m_TRIG) > clamp(TERMANALOG(m_R2.m_N), 0.7, 1.4)); + nl_double vt = clamp(m_R2.m_P(), 0.7, 1.4); + bool bthresh = (m_THRES() > vt); + bool btrig = (m_TRIG() > clamp(m_R2.m_N(), 0.7, 1.4)); if (!btrig) { @@ -121,19 +121,19 @@ namespace netlist m_ff = false; } - bool out = (!INPLOGIC(m_RESET) ? false : m_ff); + bool out = (!m_RESET() ? false : m_ff); if (m_last_out && !out) { m_RDIS.update_dev(); - OUTANALOG(m_OUT, TERMANALOG(m_R3.m_N)); + m_OUT.push(m_R3.m_N()); m_RDIS.set_R(R_ON); } else if (!m_last_out && out) { m_RDIS.update_dev(); // FIXME: Should be delayed by 100ns - OUTANALOG(m_OUT, TERMANALOG(m_R1.m_P)); + m_OUT.push(m_R1.m_P()); m_RDIS.set_R(R_OFF); } m_last_out = out; diff --git a/src/lib/netlist/devices/nld_r2r_dac.cpp b/src/lib/netlist/devices/nld_r2r_dac.cpp index f1aee1ba45d..fa5b89fff46 100644 --- a/src/lib/netlist/devices/nld_r2r_dac.cpp +++ b/src/lib/netlist/devices/nld_r2r_dac.cpp @@ -40,9 +40,10 @@ namespace netlist { update_dev(); - nl_double V = m_VIN.Value() / (nl_double) (1 << m_num.Value()) * (nl_double) m_val.Value(); + double V = m_VIN() / static_cast<double>(1 << m_num()) + * static_cast<double>(m_val()); - this->set(1.0 / m_R.Value(), V, 0.0); + this->set(1.0 / m_R(), V, 0.0); } NETLIB_DEVICE_IMPL(r2r_dac) diff --git a/src/lib/netlist/devices/nld_system.cpp b/src/lib/netlist/devices/nld_system.cpp index b692b60506a..e3369e514e5 100644 --- a/src/lib/netlist/devices/nld_system.cpp +++ b/src/lib/netlist/devices/nld_system.cpp @@ -24,12 +24,12 @@ namespace netlist NETLIB_UPDATE_PARAM(clock) { - m_inc = netlist_time::from_hz(m_freq.Value()*2); + m_inc = netlist_time::from_double(1.0 / (m_freq() * 2.0)); } NETLIB_UPDATE(clock) { - OUTLOGIC(m_Q, !INPLOGIC(m_feedback), m_inc ); + m_Q.push(!m_feedback(), m_inc); } // ---------------------------------------------------------------------------------------- @@ -39,13 +39,13 @@ namespace netlist NETLIB_RESET(extclock) { m_cnt = 0; - m_off = netlist_time::from_double(m_offset.Value()); + m_off = netlist_time::from_double(m_offset()); //m_Q.initial(0); } NETLIB_UPDATE(extclock) { - OUTLOGIC(m_Q, (m_cnt & 1) ^ 1, m_inc[m_cnt] + m_off); + m_Q.push((m_cnt & 1) ^ 1, m_inc[m_cnt] + m_off); m_cnt = (m_cnt + 1) % m_size; m_off = netlist_time::zero(); } @@ -61,7 +61,7 @@ namespace netlist NETLIB_UPDATE(logic_input) { - OUTLOGIC(m_Q, m_IN.Value() & 1, netlist_time::from_nsec(1)); + m_Q.push(m_IN() & 1, netlist_time::from_nsec(1)); } NETLIB_UPDATE_PARAM(logic_input) @@ -79,7 +79,7 @@ namespace netlist NETLIB_UPDATE(analog_input) { - OUTANALOG(m_Q, m_IN.Value()); + m_Q.push(m_IN()); } NETLIB_UPDATE_PARAM(analog_input) @@ -101,7 +101,7 @@ namespace netlist NETLIB_UPDATE(d_to_a_proxy) { - const int state = INPLOGIC(m_I); + const int state = static_cast<int>(m_I()); if (state != m_last_state) { m_last_state = state; @@ -126,11 +126,11 @@ namespace netlist NETLIB_UPDATE(res_sw) { - const int state = INPLOGIC(m_I); + const netlist_sig_t state = m_I(); if (state != m_last_state) { m_last_state = state; - const nl_double R = state ? m_RON.Value() : m_ROFF.Value(); + const nl_double R = state ? m_RON() : m_ROFF(); // We only need to update the net first if this is a time stepping net if ((0)) // m_R->m_P.net().as_analog().solver()->is_timestep()) @@ -163,8 +163,8 @@ namespace netlist //OUTANALOG(m_Q, val); nl_double stack[20]; unsigned ptr = 0; - unsigned e = m_precompiled.size(); - for (unsigned i = 0; i<e; i++) + std::size_t e = m_precompiled.size(); + for (std::size_t i = 0; i<e; i++) { rpn_inst &rc = m_precompiled[i]; switch (rc.m_cmd) @@ -186,14 +186,14 @@ namespace netlist stack[ptr-1] = stack[ptr-1] / stack[ptr]; break; case PUSH_INPUT: - stack[ptr++] = INPANALOG((*m_I[(int) rc.m_param])); + stack[ptr++] = (*m_I[static_cast<unsigned>(rc.m_param)])(); break; case PUSH_CONST: stack[ptr++] = rc.m_param; break; } } - OUTANALOG(m_Q, stack[ptr-1]); + m_Q.push(stack[ptr-1]); } diff --git a/src/lib/netlist/devices/nld_truthtable.cpp b/src/lib/netlist/devices/nld_truthtable.cpp index d885ae3b1ca..c133a29df79 100644 --- a/src/lib/netlist/devices/nld_truthtable.cpp +++ b/src/lib/netlist/devices/nld_truthtable.cpp @@ -32,11 +32,11 @@ namespace netlist typename nld_truthtable_t<m_NI, m_NO>::truthtable_t m_ttbl; }; - static const uint_least64_t all_set = ~((uint_least64_t) 0); + static const uint_least64_t all_set = ~(static_cast<uint_least64_t>(0)); unsigned truthtable_desc_t::count_bits(uint_least64_t v) { - uint_least64_t ret = 0; + unsigned ret = 0; for (; v != 0; v = v >> 1) { ret += (v & 1); @@ -124,8 +124,8 @@ void truthtable_desc_t::help(unsigned cur, plib::pstring_vector_t list, uint_least64_t state, uint_least64_t val, std::vector<uint_least8_t> &timing_index) { pstring elem = list[cur].trim(); - int start = 0; - int end = 0; + uint_least64_t start = 0; + uint_least64_t end = 0; if (elem.equals("0")) { @@ -144,7 +144,7 @@ void truthtable_desc_t::help(unsigned cur, plib::pstring_vector_t list, } else nl_assert_always(false, "unknown input value (not 0, 1, or X)"); - for (int i = start; i <= end; i++) + for (uint_least64_t i = start; i <= end; i++) { const uint_least64_t nstate = state | (i << cur); @@ -205,8 +205,8 @@ void truthtable_desc_t::setup(const plib::pstring_vector_t &truthtable, uint_lea val = val | (1 << j); else nl_assert_always(outs.equals("0"), "Unknown value (not 0 or 1"); - netlist_time t = netlist_time::from_nsec(times[j].trim().as_long()); - int k=0; + netlist_time t = netlist_time::from_nsec(static_cast<unsigned long>(times[j].trim().as_long())); + uint_least8_t k=0; while (m_timing_nt[k] != netlist_time::zero() && m_timing_nt[k] != t) k++; m_timing_nt[k] = t; @@ -228,7 +228,7 @@ void truthtable_desc_t::setup(const plib::pstring_vector_t &truthtable, uint_lea { if (ign[i] == all_set) { - int tign; + uint_least64_t tign; if ((0)) { tign = get_ignored_simple(i); diff --git a/src/lib/netlist/devices/nld_truthtable.h b/src/lib/netlist/devices/nld_truthtable.h index a252dbe3bbe..2d3c04e1536 100644 --- a/src/lib/netlist/devices/nld_truthtable.h +++ b/src/lib/netlist/devices/nld_truthtable.h @@ -63,10 +63,10 @@ namespace netlist { switch (m_size) { - case 1: ((uint_least8_t *) m_data)[pos] = val; break; - case 2: ((uint_least16_t *) m_data)[pos] = val; break; - case 4: ((uint_least32_t *) m_data)[pos] = val; break; - case 8: ((uint_least64_t *) m_data)[pos] = val; break; + case 1: static_cast<uint_least8_t *>(m_data)[pos] = static_cast<uint_least8_t>(val); break; + case 2: static_cast<uint_least16_t *>(m_data)[pos] = static_cast<uint_least16_t>(val); break; + case 4: static_cast<uint_least32_t *>(m_data)[pos] = static_cast<uint_least32_t>(val); break; + case 8: static_cast<uint_least64_t *>(m_data)[pos] = static_cast<uint_least64_t>(val); break; default: { } } } @@ -75,10 +75,10 @@ namespace netlist { switch (m_size) { - case 1: return ((uint_least8_t *) m_data)[pos]; break; - case 2: return ((uint_least16_t *) m_data)[pos]; break; - case 4: return ((uint_least32_t *) m_data)[pos]; break; - case 8: return ((uint_least64_t *) m_data)[pos]; break; + case 1: return static_cast<uint_least8_t *>(m_data)[pos]; break; + case 2: return static_cast<uint_least16_t *>(m_data)[pos]; break; + case 4: return static_cast<uint_least32_t *>(m_data)[pos]; break; + case 8: return static_cast<uint_least64_t *>(m_data)[pos]; break; default: return 0; //should never happen } @@ -88,10 +88,10 @@ namespace netlist { switch (m_size) { - case 1: return ((uint_least8_t) val); break; - case 2: return ((uint_least16_t) val); break; - case 4: return ((uint_least32_t) val); break; - case 8: return ((uint_least64_t) val); break; + case 1: return static_cast<uint_least8_t >(val); break; + case 2: return static_cast<uint_least16_t>(val); break; + case 4: return static_cast<uint_least32_t>(val); break; + case 8: return static_cast<uint_least64_t>(val); break; default: return 0; //should never happen } @@ -103,7 +103,7 @@ namespace netlist struct truthtable_desc_t { - truthtable_desc_t(int NO, int NI, bool *initialized, + truthtable_desc_t(unsigned NO, unsigned NI, bool *initialized, packed_int outs, uint_least8_t *timing, netlist_time *timing_nt) : m_NO(NO), m_NI(NI), m_initialized(initialized), m_outs(outs), m_timing(timing), m_timing_nt(timing_nt), @@ -140,7 +140,7 @@ namespace netlist NETLIB_OBJECT(truthtable_t) { private: - family_setter_t m_fam; + detail::family_setter_t m_fam; public: static constexpr int m_num_bits = m_NI; @@ -217,8 +217,8 @@ namespace netlist for (std::size_t i=0; i < m_NO; i++) { pstring tmp = "_" + out[i]; - const int idx = plib::container::indexof(inout, tmp); - if (idx>=0) + const std::size_t idx = plib::container::indexof(inout, tmp); + if (idx != plib::container::npos) { connect_late(m_Q[i], m_I[idx]); // disable ignore for this inputs altogether. @@ -309,7 +309,7 @@ namespace netlist for (std::size_t i = 0; i < m_NI; i++) { m_I[i].activate(); - state |= (INPLOGIC(m_I[i]) << i); + state |= (m_I[i]() << i); mt = std::max(this->m_I[i].net().time(), mt); } else @@ -317,7 +317,7 @@ namespace netlist { if ((ign & 1)) m_I[i].activate(); - state |= (INPLOGIC(m_I[i]) << i); + state |= (m_I[i]() << i); } } else @@ -325,12 +325,12 @@ namespace netlist if (!doOUT) for (std::size_t i = 0; i < m_NI; i++) { - state |= (INPLOGIC(m_I[i]) << i); + state |= (m_I[i]() << i); mt = std::max(this->m_I[i].net().time(), mt); } else for (std::size_t i = 0; i < m_NI; i++) - state |= (INPLOGIC(m_I[i]) << i); + state |= (m_I[i]() << i); } auto nstate = state; @@ -344,7 +344,7 @@ namespace netlist if (doOUT) { for (std::size_t i = 0; i < m_NO; i++) - OUTLOGIC(m_Q[i], (out >> i) & 1, m_ttp->m_timing_nt[m_ttp->m_timing[timebase + i]]); + m_Q[i].push((out >> i) & 1, m_ttp->m_timing_nt[m_ttp->m_timing[timebase + i]]); } else for (std::size_t i = 0; i < m_NO; i++) diff --git a/src/lib/netlist/devices/nlid_cmos.h b/src/lib/netlist/devices/nlid_cmos.h index 758cafa3029..4770eac2164 100644 --- a/src/lib/netlist/devices/nlid_cmos.h +++ b/src/lib/netlist/devices/nlid_cmos.h @@ -26,8 +26,8 @@ namespace netlist NETLIB_RESETI() {} public: - inline nl_double vdd() { return INPANALOG(m_vdd); } - inline nl_double vss() { return INPANALOG(m_vss); } + nl_double vdd() { return m_vdd(); } + nl_double vss() { return m_vss(); } analog_input_t m_vdd; analog_input_t m_vss; diff --git a/src/lib/netlist/devices/nlid_system.h b/src/lib/netlist/devices/nlid_system.h index 9adf43c2234..f16dc42b298 100644 --- a/src/lib/netlist/devices/nlid_system.h +++ b/src/lib/netlist/devices/nlid_system.h @@ -49,7 +49,7 @@ namespace netlist , m_Q(*this, "Q") , m_freq(*this, "FREQ", 7159000.0 * 5) { - m_inc = netlist_time::from_hz(m_freq.Value()*2); + m_inc = netlist_time::from_double(1.0 / (m_freq()*2.0)); } NETLIB_RESETI() @@ -59,7 +59,7 @@ namespace netlist NETLIB_UPDATE_PARAMI() { - m_inc = netlist_time::from_hz(m_freq.Value()*2); + m_inc = netlist_time::from_double(1.0 / (m_freq()*2.0)); } NETLIB_UPDATEI() @@ -90,7 +90,7 @@ namespace netlist , m_Q(*this, "Q") , m_freq(*this, "FREQ", 7159000.0 * 5.0) { - m_inc = netlist_time::from_hz(m_freq.Value()*2); + m_inc = netlist_time::from_double(1.0 / (m_freq()*2.0)); connect_late(m_feedback, m_Q); } @@ -121,20 +121,20 @@ namespace netlist , m_cnt(*this, "m_cnt", 0) , m_off(*this, "m_off", netlist_time::zero()) { - m_inc[0] = netlist_time::from_hz(m_freq.Value()*2); + m_inc[0] = netlist_time::from_double(1.0 / (m_freq()*2.0)); connect_late(m_feedback, m_Q); { - netlist_time base = netlist_time::from_hz(m_freq.Value()*2); - plib::pstring_vector_t pat(m_pattern.Value(),","); - m_off = netlist_time::from_double(m_offset.Value()); + netlist_time base = netlist_time::from_double(1.0 / (m_freq()*2.0)); + plib::pstring_vector_t pat(m_pattern(),","); + m_off = netlist_time::from_double(m_offset()); - int pati[256]; + unsigned long pati[256]; m_size = pat.size(); - int total = 0; + unsigned long total = 0; for (unsigned i=0; i<m_size; i++) { - pati[i] = pat[i].as_long(); + pati[i] = static_cast<unsigned long>(pat[i].as_long()); total += pati[i]; } netlist_time ttotal = netlist_time::zero(); @@ -160,7 +160,7 @@ namespace netlist netlist_time m_inc[32]; state_var<unsigned> m_cnt; state_var<netlist_time> m_off; - unsigned m_size; + std::size_t m_size; }; // ----------------------------------------------------------------------------- @@ -175,7 +175,7 @@ namespace netlist /* make sure we get the family first */ , m_FAMILY(*this, "FAMILY", "FAMILY(TYPE=TTL)") { - set_logic_family(netlist().setup().family_from_model(m_FAMILY.Value())); + set_logic_family(netlist().setup().family_from_model(m_FAMILY())); } NETLIB_UPDATE_AFTER_PARAM_CHANGE() @@ -220,7 +220,7 @@ namespace netlist } NETLIB_UPDATEI() { - OUTANALOG(m_Q, 0.0); + m_Q.push(0.0); } NETLIB_RESETI() { } protected: @@ -276,13 +276,13 @@ namespace netlist NETLIB_RESETI() { - m_RIN.set(1.0 / m_p_RIN.Value(),0,0); - m_ROUT.set(1.0 / m_p_ROUT.Value(),0,0); + m_RIN.set(1.0 / m_p_RIN(),0,0); + m_ROUT.set(1.0 / m_p_ROUT(),0,0); } NETLIB_UPDATEI() { - OUTANALOG(m_Q, INPANALOG(m_I)); + m_Q.push(m_I()); } private: @@ -309,10 +309,10 @@ namespace netlist , m_func(*this, "FUNC", "") , m_Q(*this, "Q") { - for (int i=0; i < m_N; i++) + for (int i=0; i < m_N(); i++) m_I.push_back(plib::make_unique<analog_input_t>(*this, plib::pfmt("A{1}")(i))); - plib::pstring_vector_t cmds(m_func.Value(), " "); + plib::pstring_vector_t cmds(m_func(), " "); m_precompiled.clear(); for (std::size_t i=0; i < cmds.size(); i++) @@ -338,7 +338,7 @@ namespace netlist rc.m_cmd = PUSH_CONST; rc.m_param = cmd.as_double(&err); if (err) - netlist().log().fatal("nld_function: unknown/misformatted token <{1}> in <{2}>", cmd, m_func.Value()); + netlist().log().fatal("nld_function: unknown/misformatted token <{1}> in <{2}>", cmd, m_func()); } m_precompiled.push_back(rc); } @@ -404,13 +404,13 @@ namespace netlist NETLIB_RESETI() { m_last_state = 0; - m_R.set_R(m_ROFF.Value()); + m_R.set_R(m_ROFF()); } //NETLIB_UPDATE_PARAMI(); NETLIB_UPDATEI(); private: - state_var_u8 m_last_state; + state_var<netlist_sig_t> m_last_state; }; // ----------------------------------------------------------------------------- @@ -420,7 +420,8 @@ namespace netlist NETLIB_OBJECT(base_proxy) { public: - nld_base_proxy(netlist_t &anetlist, const pstring &name, logic_t *inout_proxied, core_terminal_t *proxy_inout) + nld_base_proxy(netlist_t &anetlist, const pstring &name, + logic_t *inout_proxied, detail::core_terminal_t *proxy_inout) : device_t(anetlist, name) { m_logic_family = inout_proxied->logic_family(); @@ -431,7 +432,7 @@ namespace netlist virtual ~nld_base_proxy() {} logic_t &term_proxied() const { return *m_term_proxied; } - core_terminal_t &proxy_term() const { return *m_proxy_term; } + detail::core_terminal_t &proxy_term() const { return *m_proxy_term; } protected: @@ -443,7 +444,7 @@ namespace netlist private: const logic_family_desc_t *m_logic_family; logic_t *m_term_proxied; - core_terminal_t *m_proxy_term; + detail::core_terminal_t *m_proxy_term; }; // ----------------------------------------------------------------------------- @@ -472,9 +473,9 @@ namespace netlist NETLIB_UPDATEI() { if (m_I.Q_Analog() > logic_family().m_high_thresh_V) - OUTLOGIC(m_Q, 1, NLTIME_FROM_NS(1)); + m_Q.push(1, NLTIME_FROM_NS(1)); else if (m_I.Q_Analog() < logic_family().m_low_thresh_V) - OUTLOGIC(m_Q, 0, NLTIME_FROM_NS(1)); + m_Q.push(0, NLTIME_FROM_NS(1)); else { // do nothing @@ -495,7 +496,8 @@ namespace netlist virtual logic_input_t &in() { return m_I; } protected: - nld_base_d_to_a_proxy(netlist_t &anetlist, const pstring &name, logic_output_t *out_proxied, core_terminal_t &proxy_out) + nld_base_d_to_a_proxy(netlist_t &anetlist, const pstring &name, + logic_output_t *out_proxied, detail::core_terminal_t &proxy_out) : nld_base_proxy(anetlist, name, out_proxied, &proxy_out) , m_I(*this, "I") { diff --git a/src/lib/netlist/documentation/doc.css b/src/lib/netlist/documentation/doc.css new file mode 100644 index 00000000000..fa415f1d252 --- /dev/null +++ b/src/lib/netlist/documentation/doc.css @@ -0,0 +1,14 @@ +img[alt*="-50r."] +{ + width: 30%; + display: block; + float: right; +} +.fragment +{ + clear: both; +} +.footer +{ + clear: both; +} diff --git a/src/lib/netlist/documentation/mainpage.dox.h b/src/lib/netlist/documentation/mainpage.dox.h new file mode 100644 index 00000000000..75df1a18065 --- /dev/null +++ b/src/lib/netlist/documentation/mainpage.dox.h @@ -0,0 +1,165 @@ + +/*! \mainpage notitle + +##Netlist + +###A mixed signal circuit simulation. + +- D: Device +- O: Rail output (output) +- I: Infinite impedance input (input) +- T: Terminal (finite impedance) + +The following example shows a typical connection between several devices: + + +---+ +---+ +---+ +---+ +---+ + | | | | | | | | | | + | D | | D | | D | | D | | D | + | | | | | | | | | | + +-O-+ +-I-+ +-I-+ +-T-+ +-T-+ + | | | | | + +-+---------+---------+---------+---------+-+ + | rail net | + +-------------------------------------------+ + +A rail net is a net which is driven by exactly one output with an +(idealized) internal resistance of zero. +Ideally, it can deliver infinite current. + +A infinite resistance input does not source or sink current. + +Terminals source or sink finite (but never zero) current. + +The system differentiates between analog and logic input and outputs and +analog terminals. Analog and logic devices can not be connected to the +same net. Instead, proxy devices are inserted automatically: + + +---+ +---+ + | | | | + | D1| | D2| + | A | | L | + +-O-+ +-I-+ + | | + +-+---------+---+ + | rail net | + +---------------+ + +is converted into + + +----------+ + | | + +---+ +-+-+ | +---+ + | | | L | A-L | | | + | D1| | D | Proxy | | D2| + | A | | A | | | | + +-O-+ +-I-+ | +-I-+ + | | | | + +-+---------+--+ +-+-----+-------+ + | rail net (A) | | rail net (L) | + +--------------| +---------------+ + +This works both analog to logic as well as logic to analog. + +The above is an advanced implementation of the existing discrete +subsystem in MAME. Instead of relying on a fixed time-step, analog devices +could either connect to fixed time-step clock or use an internal clock +to update them. This would however introduce macro devices for RC, diodes +and transistors again. + +Instead, the following approach in case of a pure terminal/input network +is taken: + + +---+ +---+ +---+ +---+ +---+ + | | | | | | | | | | + | D | | D | | D | | D | | D | + | | | | | | | | | | + +-T-+ +-I-+ +-I-+ +-T-+ +-T-+ + | | | | | + '+' | | '-' '-' + +-+---------+---------+---------+---------+-+ + | Calculated net | + +-------------------------------------------+ + +Netlist uses the following basic two terminal device: + + (k) + +-----T-----+ + | | | + | +--+--+ | + | | | | + | R | | + | R | | + | R I | + | | I | Device n + | V+ I | + | V | | + | V- | | + | | | | + | +--+--+ | + | | | + +-----T-----+ + (l) + +This is a resistance in series to a voltage source and paralleled by a +current source. This is suitable to model voltage sources, current sources, +resistors, capacitors, inductances and diodes. + +\f[ + I_{n,l} = - I_{n,k} = ( V_k - V^N - V_l ) \frac{1}{R^n} + I^n +\f] + +Now, the sum of all currents for a given net must be 0: + +\f[ + \sum_n I_{n,l} = 0 = \sum_{n,k} (V_k - V^n - V_l ) \frac{1}{R^n} + I^n +\f] + +With \f$ G^n = \frac{1}{R^n} \f$ and \f$ \sum_n G^n = G^{tot} \f$ and \f$k=k(n)\f$ + +\f[ + 0 = - V_l G^{tot} + \sum_n (V_{k(n)} - V^n) G^n + I^n) +\f] + +and with \f$ l=l(n)\f$ and fixed \f$ k\f$ + +\f[ + 0 = -V_k G^{tot} + sum_n( V_{l(n)} + V^n ) G^n - I^n) +\f] + +These equations represent a linear Matrix equation (with more math). + +In the end the solution of the analog subsystem boils down to + +\f[ + \mathbf{\it{(G - D) v = i}} +\f] + +with G being the conductance matrix, D a diagonal matrix with the total +conductance on the diagonal elements, V the net voltage vector and I the +current vector. + +By using solely two terminal devices, we can simplify the whole calculation +significantly. A BJT now is a four terminal device with two terminals being +connected internally. + +The system is solved using an iterative approach: + +G V - D V = I + +assuming V=Vn=Vo + +Vn = D-1 (I - G Vo) + +Each terminal thus has three properties: + +a) Resistance +b) Voltage source +c) Current source/sink + +Going forward, the approach can be extended e.g. to use a linear +equation solver. + +The formal representation of the circuit will stay the same, thus scales. + + +*/ diff --git a/src/lib/netlist/documentation/primer_1.dox.h b/src/lib/netlist/documentation/primer_1.dox.h new file mode 100644 index 00000000000..8df612e242d --- /dev/null +++ b/src/lib/netlist/documentation/primer_1.dox.h @@ -0,0 +1,62 @@ +/*! \page primer_1 nltool primer + +## First example + +Let's start with a simple charge/discharge circuit. I denotes the input, +O denotes the output. + + I >----RRR----+-----> O + | + C + C + C + | + GND + +Now in netlist syntax this looks like: + +~~~{.cpp} +NETLIST_START(charge_discharge) + SOLVER(solver, 48000) // Fixed frequency solver + CLOCK(I, 200) // 200 Hz clock as input, TTL logic output + RES(R, RES_K(1)) + CAP(C, CAP_U(1)) + + NET_C(I.Q, R.1) + NET_C(R.2, C.1) + NET_C(C.2, GND) + + ALIAS(O, R.2) // Output O == C.1 == R.2 +NETLIST_END() +~~~ + +Save this example as e.g. test1.cpp. Now that's a c++ extension. The background +is simple. You can also compile netlists. Thats a feature which is used by MAME. +That's something we will cover later. + +Now, to test this, run the following: + +~~~ +> nltool --cmd=run -f test1.cpp -t 0.05 -l O -l I +~~~ + +This will run the circuit for 50 ms and log input "I" to file log_I.log and +output "O" to log_O.log . The log files will be located in the current folder. + +Next, run + +~~~ +> plot_nl I O +~~~ + + + +and enjoy the results. + +##Recap + +We have created our first netlist fragment. nltool was used to model the +periodically forced charge/discharge circuit for 50ms. Finally we plotted both input +and output voltages using the plot_nl command using the log files we generated. + +*/ diff --git a/src/lib/netlist/documentation/structure.dox.h b/src/lib/netlist/documentation/structure.dox.h new file mode 100644 index 00000000000..41dd9507717 --- /dev/null +++ b/src/lib/netlist/documentation/structure.dox.h @@ -0,0 +1,21 @@ + +/*! The netlist namespace. + * All netlist related code is contained in the netlist namespace + */ +namespace netlist +{ + /*! The netlist::devices namespace. + * All netlist devices are contained in the netlist::devices namespace. + */ + namespace devices + { + } + + /*! Internal support classes you should not use in code using netlist api. + * This namespace contains all internal support classes not intended + * to be used outside of the core. + */ + namespace detail + { + } +} diff --git a/src/lib/netlist/documentation/test1-50r.svg b/src/lib/netlist/documentation/test1-50r.svg new file mode 100644 index 00000000000..ea4f70f6efe --- /dev/null +++ b/src/lib/netlist/documentation/test1-50r.svg @@ -0,0 +1,720 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg + width="600" height="480" + viewBox="0 0 600 480" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" +> + +<title>Gnuplot</title> +<desc>Produced by GNUPLOT 4.6 patchlevel 6 </desc> + +<g id="gnuplot_canvas"> + +<rect x="0" y="0" width="600" height="480" fill="none"/> +<defs> + + <circle id='gpDot' r='0.5' stroke-width='0.5'/> + <path id='gpPt0' stroke-width='0.222' stroke='currentColor' d='M-1,0 h2 M0,-1 v2'/> + <path id='gpPt1' stroke-width='0.222' stroke='currentColor' d='M-1,-1 L1,1 M1,-1 L-1,1'/> + <path id='gpPt2' stroke-width='0.222' stroke='currentColor' d='M-1,0 L1,0 M0,-1 L0,1 M-1,-1 L1,1 M-1,1 L1,-1'/> + <rect id='gpPt3' stroke-width='0.222' stroke='currentColor' x='-1' y='-1' width='2' height='2'/> + <rect id='gpPt4' stroke-width='0.222' stroke='currentColor' fill='currentColor' x='-1' y='-1' width='2' height='2'/> + <circle id='gpPt5' stroke-width='0.222' stroke='currentColor' cx='0' cy='0' r='1'/> + <use xlink:href='#gpPt5' id='gpPt6' fill='currentColor' stroke='none'/> + <path id='gpPt7' stroke-width='0.222' stroke='currentColor' d='M0,-1.33 L-1.33,0.67 L1.33,0.67 z'/> + <use xlink:href='#gpPt7' id='gpPt8' fill='currentColor' stroke='none'/> + <use xlink:href='#gpPt7' id='gpPt9' stroke='currentColor' transform='rotate(180)'/> + <use xlink:href='#gpPt9' id='gpPt10' fill='currentColor' stroke='none'/> + <use xlink:href='#gpPt3' id='gpPt11' stroke='currentColor' transform='rotate(45)'/> + <use xlink:href='#gpPt11' id='gpPt12' fill='currentColor' stroke='none'/> + <filter id='greybox' filterUnits='objectBoundingBox' x='0' y='0' height='1' width='1'> + <feFlood flood-color='lightgrey' flood-opacity='1' result='grey'/> + <feComposite in='SourceGraphic' in2='grey' operator='atop'/> + </filter> +</defs> +<g style="fill:none; color:white; stroke:currentColor; stroke-width:1.00; stroke-linecap:butt; stroke-linejoin:miter"> +</g> +<g style="fill:none; color:black; stroke:currentColor; stroke-width:1.00; stroke-linecap:butt; stroke-linejoin:miter"> + <path stroke='black' d='M53.9,444.0 L62.9,444.0 M575.0,444.0 L566.0,444.0 '/> <g transform="translate(45.6,448.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:end"> + <text> 0</text> + </g> + <path stroke='black' d='M53.9,390.6 L62.9,390.6 M575.0,390.6 L566.0,390.6 '/> <g transform="translate(45.6,395.1)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:end"> + <text> 0.5</text> + </g> + <path stroke='black' d='M53.9,337.2 L62.9,337.2 M575.0,337.2 L566.0,337.2 '/> <g transform="translate(45.6,341.7)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:end"> + <text> 1</text> + </g> + <path stroke='black' d='M53.9,283.8 L62.9,283.8 M575.0,283.8 L566.0,283.8 '/> <g transform="translate(45.6,288.3)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:end"> + <text> 1.5</text> + </g> + <path stroke='black' d='M53.9,230.3 L62.9,230.3 M575.0,230.3 L566.0,230.3 '/> <g transform="translate(45.6,234.8)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:end"> + <text> 2</text> + </g> + <path stroke='black' d='M53.9,176.9 L62.9,176.9 M575.0,176.9 L566.0,176.9 '/> <g transform="translate(45.6,181.4)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:end"> + <text> 2.5</text> + </g> + <path stroke='black' d='M53.9,123.5 L62.9,123.5 M575.0,123.5 L566.0,123.5 '/> <g transform="translate(45.6,128.0)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:end"> + <text> 3</text> + </g> + <path stroke='black' d='M53.9,70.1 L62.9,70.1 M575.0,70.1 L566.0,70.1 '/> <g transform="translate(45.6,74.6)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:end"> + <text> 3.5</text> + </g> + <path stroke='black' d='M53.9,16.7 L62.9,16.7 M575.0,16.7 L566.0,16.7 '/> <g transform="translate(45.6,21.2)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:end"> + <text> 4</text> + </g> + <path stroke='black' d='M53.9,444.0 L53.9,435.0 M53.9,16.7 L53.9,25.7 '/> <g transform="translate(53.9,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> + <text>0 </text> + </g> + <path stroke='black' d='M106.0,444.0 L106.0,435.0 M106.0,16.7 L106.0,25.7 '/> <g transform="translate(106.0,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> + <text>5m</text> + </g> + <path stroke='black' d='M158.1,444.0 L158.1,435.0 M158.1,16.7 L158.1,25.7 '/> <g transform="translate(158.1,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> + <text>10m</text> + </g> + <path stroke='black' d='M210.2,444.0 L210.2,435.0 M210.2,16.7 L210.2,25.7 '/> <g transform="translate(210.2,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> + <text>15m</text> + </g> + <path stroke='black' d='M262.3,444.0 L262.3,435.0 M262.3,16.7 L262.3,25.7 '/> <g transform="translate(262.3,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> + <text>20m</text> + </g> + <path stroke='black' d='M314.5,444.0 L314.5,435.0 M314.5,16.7 L314.5,25.7 '/> <g transform="translate(314.5,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> + <text>25m</text> + </g> + <path stroke='black' d='M366.6,444.0 L366.6,435.0 M366.6,16.7 L366.6,25.7 '/> <g transform="translate(366.6,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> + <text>30m</text> + </g> + <path stroke='black' d='M418.7,444.0 L418.7,435.0 M418.7,16.7 L418.7,25.7 '/> <g transform="translate(418.7,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> + <text>35m</text> + </g> + <path stroke='black' d='M470.8,444.0 L470.8,435.0 M470.8,16.7 L470.8,25.7 '/> <g transform="translate(470.8,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> + <text>40m</text> + </g> + <path stroke='black' d='M522.9,444.0 L522.9,435.0 M522.9,16.7 L522.9,25.7 '/> <g transform="translate(522.9,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> + <text>45m</text> + </g> + <path stroke='black' d='M575.0,444.0 L575.0,435.0 M575.0,16.7 L575.0,25.7 '/> <g transform="translate(575.0,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> + <text>50m</text> + </g> + <path stroke='black' d='M53.9,16.7 L53.9,444.0 L575.0,444.0 L575.0,16.7 L53.9,16.7 Z '/></g> + <g id="gnuplot_plot_1" ><title>gnuplot_plot_1</title> +<g style="fill:none; color:red; stroke:currentColor; stroke-width:1.00; stroke-linecap:butt; stroke-linejoin:miter"> + <g transform="translate(507.9,39.2)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:end"> + <text>O</text> + </g> + <path d='M516.2,34.7 L558.4,34.7 M53.9,444.0 L54.1,444.0 L54.1,443.8 L54.3,443.8 L54.3,443.6 L54.6,443.6 + L54.6,443.4 L54.8,443.4 L54.8,443.2 L55.0,443.2 L55.0,443.0 L55.2,443.0 L55.2,442.8 L55.4,442.8 + L55.4,442.6 L55.6,442.6 L55.6,442.4 L55.9,442.4 L55.9,442.2 L56.1,442.2 L56.1,442.0 L56.3,442.0 + L56.3,441.8 L56.5,441.8 L56.5,441.7 L56.7,441.7 L56.7,441.5 L56.9,441.5 L56.9,441.3 L57.2,441.3 + L57.2,441.2 L57.4,441.2 L57.4,441.0 L57.6,441.0 L57.6,440.8 L57.8,440.8 L57.8,440.7 L58.0,440.7 + L58.0,440.5 L58.2,440.5 L58.2,440.4 L58.5,440.4 L58.5,440.2 L58.7,440.2 L58.7,440.1 L58.9,440.1 + L58.9,440.0 L59.1,440.0 L59.1,439.8 L59.3,439.8 L59.3,439.7 L59.5,439.7 L59.5,439.6 L59.8,439.6 + L59.8,439.4 L60.0,439.4 L60.0,439.3 L60.2,439.3 L60.2,439.2 L60.4,439.2 L60.4,439.1 L60.6,439.1 + L60.6,439.0 L60.8,439.0 L60.8,438.8 L61.1,438.8 L61.1,438.7 L61.3,438.7 L61.3,438.6 L61.5,438.6 + L61.5,438.5 L61.7,438.5 L61.7,438.4 L61.9,438.4 L61.9,438.3 L62.2,438.3 L62.2,438.2 L62.4,438.2 + L62.4,438.1 L62.6,438.1 L62.6,438.0 L62.8,438.0 L62.8,437.9 L63.0,437.9 L63.0,437.8 L63.2,437.8 + L63.2,437.7 L63.5,437.7 L63.5,437.6 L63.7,437.6 L63.7,437.5 L63.9,437.5 L64.1,437.5 L64.1,437.4 + L64.3,437.4 L64.3,437.3 L64.5,437.3 L64.5,437.2 L64.8,437.2 L64.8,437.1 L65.0,437.1 L65.2,437.1 + L65.2,437.0 L65.4,437.0 L65.4,436.9 L65.6,436.9 L65.6,436.8 L65.8,436.8 L66.1,436.8 L66.1,436.7 + L66.3,436.7 L66.3,436.6 L66.5,436.6 L66.7,436.6 L66.7,436.5 L66.9,436.5 L66.9,436.4 L67.1,436.4 + L67.4,436.4 L67.4,436.3 L67.6,436.3 L67.6,436.2 L67.8,436.2 L68.0,436.2 L68.0,436.1 L68.2,436.1 + L68.4,436.1 L68.4,436.0 L68.7,436.0 L68.7,435.9 L68.9,435.9 L69.1,435.9 L69.1,435.8 L69.3,435.8 + L69.5,435.8 L69.5,435.7 L69.7,435.7 L70.0,435.7 L70.0,435.6 L70.2,435.6 L70.4,435.6 L70.4,435.5 + L70.6,435.5 L70.8,435.5 L71.1,435.5 L71.1,435.4 L71.3,435.4 L71.5,435.4 L71.5,435.3 L71.7,435.3 + L71.9,435.3 L72.1,435.3 L72.1,435.2 L72.4,435.2 L72.6,435.2 L72.6,435.1 L72.8,435.1 L73.0,435.1 + L73.2,435.1 L73.2,435.0 L73.4,435.0 L73.7,435.0 L73.9,435.0 L73.9,434.9 L74.1,434.9 L74.3,434.9 + L74.5,434.9 L74.5,434.8 L74.7,434.8 L75.0,434.8 L75.2,434.8 L75.2,434.7 L75.4,434.7 L75.6,434.7 + L75.8,434.7 L76.0,434.7 L76.0,434.6 L76.3,434.6 L76.5,434.6 L76.7,434.6 L76.7,434.5 L76.9,434.5 + L77.1,434.5 L77.3,434.5 L77.6,434.5 L77.6,434.4 L77.8,434.4 L78.0,434.4 L78.2,434.4 L78.4,434.4 + L78.7,434.4 L78.7,434.3 L78.9,434.3 L79.1,434.3 L79.3,434.3 L79.5,434.3 L79.7,434.3 L79.7,434.2 + L80.0,434.2 L80.2,434.2 L80.2,426.7 L80.4,426.7 L80.4,419.3 L80.6,419.3 L80.6,412.0 L80.8,412.0 + L80.8,404.8 L81.0,404.8 L81.0,397.8 L81.3,397.8 L81.3,390.9 L81.5,390.9 L81.5,384.1 L81.7,384.1 + L81.7,377.5 L81.9,377.5 L81.9,370.9 L82.1,370.9 L82.1,364.5 L82.3,364.5 L82.3,358.2 L82.6,358.2 + L82.6,352.0 L82.8,352.0 L82.8,346.0 L83.0,346.0 L83.0,340.0 L83.2,340.0 L83.2,334.2 L83.4,334.2 + L83.4,328.4 L83.6,328.4 L83.6,322.8 L83.9,322.8 L83.9,317.2 L84.1,317.2 L84.1,311.8 L84.3,311.8 + L84.3,306.4 L84.5,306.4 L84.5,301.2 L84.7,301.2 L84.7,296.0 L84.9,296.0 L84.9,291.0 L85.2,291.0 + L85.2,286.0 L85.4,286.0 L85.4,281.2 L85.6,281.2 L85.6,276.4 L85.8,276.4 L85.8,271.7 L86.0,271.7 + L86.0,267.0 L86.3,267.0 L86.3,262.5 L86.5,262.5 L86.5,258.1 L86.7,258.1 L86.7,253.7 L86.9,253.7 + L86.9,249.4 L87.1,249.4 L87.1,245.2 L87.3,245.2 L87.3,241.1 L87.6,241.1 L87.6,237.0 L87.8,237.0 + L87.8,233.0 L88.0,233.0 L88.0,229.1 L88.2,229.1 L88.2,225.2 L88.4,225.2 L88.4,221.5 L88.6,221.5 + L88.6,217.8 L88.9,217.8 L88.9,214.1 L89.1,214.1 L89.1,210.6 L89.3,210.6 L89.3,207.0 L89.5,207.0 + L89.5,203.6 L89.7,203.6 L89.7,200.2 L89.9,200.2 L89.9,196.9 L90.2,196.9 L90.2,193.6 L90.4,193.6 + L90.4,190.4 L90.6,190.4 L90.6,187.3 L90.8,187.3 L90.8,184.2 L91.0,184.2 L91.0,181.2 L91.2,181.2 + L91.2,178.2 L91.5,178.2 L91.5,175.3 L91.7,175.3 L91.7,172.4 L91.9,172.4 L91.9,169.6 L92.1,169.6 + L92.1,166.8 L92.3,166.8 L92.3,164.1 L92.5,164.1 L92.5,161.4 L92.8,161.4 L92.8,158.8 L93.0,158.8 + L93.0,156.2 L93.2,156.2 L93.2,153.7 L93.4,153.7 L93.4,151.2 L93.6,151.2 L93.6,148.8 L93.9,148.8 + L93.9,146.4 L94.1,146.4 L94.1,144.0 L94.3,144.0 L94.3,141.7 L94.5,141.7 L94.5,139.5 L94.7,139.5 + L94.7,137.3 L94.9,137.3 L94.9,135.1 L95.2,135.1 L95.2,132.9 L95.4,132.9 L95.4,130.8 L95.6,130.8 + L95.6,128.8 L95.8,128.8 L95.8,126.7 L96.0,126.7 L96.0,124.7 L96.2,124.7 L96.2,122.8 L96.5,122.8 + L96.5,120.9 L96.7,120.9 L96.7,119.0 L96.9,119.0 L96.9,117.1 L97.1,117.1 L97.1,115.3 L97.3,115.3 + L97.3,113.5 L97.5,113.5 L97.5,111.8 L97.8,111.8 L97.8,110.1 L98.0,110.1 L98.0,108.4 L98.2,108.4 + L98.2,106.7 L98.4,106.7 L98.4,105.1 L98.6,105.1 L98.6,103.5 L98.8,103.5 L98.8,101.9 L99.1,101.9 + L99.1,100.4 L99.3,100.4 L99.3,98.8 L99.5,98.8 L99.5,97.4 L99.7,97.4 L99.7,95.9 L99.9,95.9 + L99.9,94.5 L100.1,94.5 L100.1,93.1 L100.4,93.1 L100.4,91.7 L100.6,91.7 L100.6,90.3 L100.8,90.3 + L100.8,89.0 L101.0,89.0 L101.0,87.7 L101.2,87.7 L101.2,86.4 L101.4,86.4 L101.4,85.1 L101.7,85.1 + L101.7,83.9 L101.9,83.9 L101.9,82.7 L102.1,82.7 L102.1,81.5 L102.3,81.5 L102.3,80.3 L102.5,80.3 + L102.5,79.2 L102.8,79.2 L102.8,78.0 L103.0,78.0 L103.0,76.9 L103.2,76.9 L103.2,75.8 L103.4,75.8 + L103.4,74.8 L103.6,74.8 L103.6,73.7 L103.8,73.7 L103.8,72.7 L104.1,72.7 L104.1,71.7 L104.3,71.7 + L104.3,70.7 L104.5,70.7 L104.5,69.7 L104.7,69.7 L104.7,68.7 L104.9,68.7 L104.9,67.8 L105.1,67.8 + L105.1,66.9 L105.4,66.9 L105.4,66.0 L105.6,66.0 L105.6,65.1 L105.8,65.1 L105.8,64.2 L106.0,64.2 + L106.0,63.3 L106.2,63.3 L106.2,70.8 L106.4,70.8 L106.4,78.2 L106.7,78.2 L106.7,85.5 L106.9,85.5 + L106.9,92.6 L107.1,92.6 L107.1,99.5 L107.3,99.5 L107.3,106.3 L107.5,106.3 L107.5,113.0 L107.7,113.0 + L107.7,119.5 L108.0,119.5 L108.0,125.9 L108.2,125.9 L108.2,132.2 L108.4,132.2 L108.4,138.3 L108.6,138.3 + L108.6,144.3 L108.8,144.3 L108.8,150.2 L109.0,150.2 L109.0,156.0 L109.3,156.0 L109.3,161.6 L109.5,161.6 + L109.5,167.2 L109.7,167.2 L109.7,172.6 L109.9,172.6 L109.9,177.9 L110.1,177.9 L110.1,183.1 L110.4,183.1 + L110.4,188.2 L110.6,188.2 L110.6,193.2 L110.8,193.2 L110.8,198.1 L111.0,198.1 L111.0,202.9 L111.2,202.9 + L111.2,207.6 L111.4,207.6 L111.4,212.2 L111.7,212.2 L111.7,216.7 L111.9,216.7 L111.9,221.1 L112.1,221.1 + L112.1,225.5 L112.3,225.5 L112.3,229.7 L112.5,229.7 L112.5,233.9 L112.7,233.9 L112.7,237.9 L113.0,237.9 + L113.0,241.9 L113.2,241.9 L113.2,245.8 L113.4,245.8 L113.4,249.6 L113.6,249.6 L113.6,253.4 L113.8,253.4 + L113.8,257.0 L114.0,257.0 L114.0,260.6 L114.3,260.6 L114.3,264.2 L114.5,264.2 L114.5,267.6 L114.7,267.6 + L114.7,271.0 L114.9,271.0 L114.9,274.3 L115.1,274.3 L115.1,277.5 L115.3,277.5 L115.3,280.7 L115.6,280.7 + L115.6,283.8 L115.8,283.8 L115.8,286.9 L116.0,286.9 L116.0,289.9 L116.2,289.9 L116.2,292.8 L116.4,292.8 + L116.4,295.7 L116.6,295.7 L116.6,298.5 L116.9,298.5 L116.9,301.2 L117.1,301.2 L117.1,303.9 L117.3,303.9 + L117.3,306.5 L117.5,306.5 L117.5,309.1 L117.7,309.1 L117.7,311.7 L118.0,311.7 L118.0,314.1 L118.2,314.1 + L118.2,316.6 L118.4,316.6 L118.4,318.9 L118.6,318.9 L118.6,321.3 L118.8,321.3 L118.8,323.6 L119.0,323.6 + L119.0,325.8 L119.3,325.8 L119.3,328.0 L119.5,328.0 L119.5,330.1 L119.7,330.1 L119.7,332.2 L119.9,332.2 + L119.9,334.3 L120.1,334.3 L120.1,336.3 L120.3,336.3 L120.3,338.3 L120.6,338.3 L120.6,340.2 L120.8,340.2 + L120.8,342.1 L121.0,342.1 L121.0,344.0 L121.2,344.0 L121.2,345.8 L121.4,345.8 L121.4,347.6 L121.6,347.6 + L121.6,349.3 L121.9,349.3 L121.9,351.1 L122.1,351.1 L122.1,352.7 L122.3,352.7 L122.3,354.4 L122.5,354.4 + L122.5,356.0 L122.7,356.0 L122.7,357.6 L122.9,357.6 L122.9,359.1 L123.2,359.1 L123.2,360.6 L123.4,360.6 + L123.4,362.1 L123.6,362.1 L123.6,363.6 L123.8,363.6 L123.8,365.0 L124.0,365.0 L124.0,366.4 L124.2,366.4 + L124.2,367.7 L124.5,367.7 L124.5,369.1 L124.7,369.1 L124.7,370.4 L124.9,370.4 L124.9,371.7 L125.1,371.7 + L125.1,372.9 L125.3,372.9 L125.3,374.2 L125.6,374.2 L125.6,375.4 L125.8,375.4 L125.8,376.5 L126.0,376.5 + L126.0,377.7 L126.2,377.7 L126.2,378.8 L126.4,378.8 L126.4,379.9 L126.6,379.9 L126.6,381.0 L126.9,381.0 + L126.9,382.1 L127.1,382.1 L127.1,383.1 L127.3,383.1 L127.3,384.2 L127.5,384.2 L127.5,385.2 L127.7,385.2 + L127.7,386.1 L127.9,386.1 L127.9,387.1 L128.2,387.1 L128.2,388.1 L128.4,388.1 L128.4,389.0 L128.6,389.0 + L128.6,389.9 L128.8,389.9 L128.8,390.8 L129.0,390.8 L129.0,391.6 L129.2,391.6 L129.2,392.5 L129.5,392.5 + L129.5,393.3 L129.7,393.3 L129.7,394.1 L129.9,394.1 L129.9,394.9 L130.1,394.9 L130.1,395.7 L130.3,395.7 + L130.3,396.5 L130.5,396.5 L130.5,397.2 L130.8,397.2 L130.8,398.0 L131.0,398.0 L131.0,398.7 L131.2,398.7 + L131.2,399.4 L131.4,399.4 L131.4,400.1 L131.6,400.1 L131.6,400.8 L131.8,400.8 L131.8,401.4 L132.1,401.4 + L132.1,402.1 L132.3,402.1 L132.3,395.1 L132.5,395.1 L132.5,388.3 L132.7,388.3 L132.7,381.6 L132.9,381.6 + L132.9,375.0 L133.1,375.0 L133.1,368.5 L133.4,368.5 L133.4,362.1 L133.6,362.1 L133.6,355.9 L133.8,355.9 + L133.8,349.7 L134.0,349.7 L134.0,343.7 L134.2,343.7 L134.2,337.8 L134.5,337.8 L134.5,332.0 L134.7,332.0 + L134.7,326.2 L134.9,326.2 L134.9,320.6 L135.1,320.6 L135.1,315.1 L135.3,315.1 L135.3,309.7 L135.5,309.7 + L135.5,304.4 L135.8,304.4 L135.8,299.2 L136.0,299.2 L136.0,294.1 L136.2,294.1 L136.2,289.1 L136.4,289.1 + L136.4,284.2 L136.6,284.2 L136.6,279.3 L136.8,279.3 L136.8,274.6 L137.1,274.6 L137.1,269.9 L137.3,269.9 + L137.3,265.3 L137.5,265.3 L137.5,260.8 L137.7,260.8 L137.7,256.4 L137.9,256.4 L137.9,252.1 L138.1,252.1 + L138.1,247.8 L138.4,247.8 L138.4,243.6 L138.6,243.6 L138.6,239.5 L138.8,239.5 L138.8,235.5 L139.0,235.5 + L139.0,231.5 L139.2,231.5 L139.2,227.6 L139.4,227.6 L139.4,223.8 L139.7,223.8 L139.7,220.1 L139.9,220.1 + L139.9,216.4 L140.1,216.4 L140.1,212.8 L140.3,212.8 L140.3,209.2 L140.5,209.2 L140.5,205.7 L140.7,205.7 + L140.7,202.3 L141.0,202.3 L141.0,198.9 L141.2,198.9 L141.2,195.6 L141.4,195.6 L141.4,192.4 L141.6,192.4 + L141.6,189.2 L141.8,189.2 L141.8,186.1 L142.1,186.1 L142.1,183.0 L142.3,183.0 L142.3,180.0 L142.5,180.0 + L142.5,177.1 L142.7,177.1 L142.7,174.2 L142.9,174.2 L142.9,171.3 L143.1,171.3 L143.1,168.5 L143.4,168.5 + L143.4,165.8 L143.6,165.8 L143.6,163.1 L143.8,163.1 L143.8,160.4 L144.0,160.4 L144.0,157.8 L144.2,157.8 + L144.2,155.3 L144.4,155.3 L144.4,152.8 L144.7,152.8 L144.7,150.3 L144.9,150.3 L144.9,147.9 L145.1,147.9 + L145.1,145.5 L145.3,145.5 L145.3,143.2 L145.5,143.2 L145.5,140.9 L145.7,140.9 L145.7,138.6 L146.0,138.6 + L146.0,136.4 L146.2,136.4 L146.2,134.3 L146.4,134.3 L146.4,132.1 L146.6,132.1 L146.6,130.0 L146.8,130.0 + L146.8,128.0 L147.0,128.0 L147.0,126.0 L147.3,126.0 L147.3,124.0 L147.5,124.0 L147.5,122.0 L147.7,122.0 + L147.7,120.1 L147.9,120.1 L147.9,118.3 L148.1,118.3 L148.1,116.4 L148.3,116.4 L148.3,114.6 L148.6,114.6 + L148.6,112.9 L148.8,112.9 L148.8,111.1 L149.0,111.1 L149.0,109.4 L149.2,109.4 L149.2,107.7 L149.4,107.7 + L149.4,106.1 L149.7,106.1 L149.7,104.5 L149.9,104.5 L149.9,102.9 L150.1,102.9 L150.1,101.3 L150.3,101.3 + L150.3,99.8 L150.5,99.8 L150.5,98.3 L150.7,98.3 L150.7,96.8 L151.0,96.8 L151.0,95.3 L151.2,95.3 + L151.2,93.9 L151.4,93.9 L151.4,92.5 L151.6,92.5 L151.6,91.2 L151.8,91.2 L151.8,89.8 L152.0,89.8 + L152.0,88.5 L152.3,88.5 L152.3,87.2 L152.5,87.2 L152.5,85.9 L152.7,85.9 L152.7,84.7 L152.9,84.7 + L152.9,83.4 L153.1,83.4 L153.1,82.2 L153.3,82.2 L153.3,81.0 L153.6,81.0 L153.6,79.9 L153.8,79.9 + L153.8,78.7 L154.0,78.7 L154.0,77.6 L154.2,77.6 L154.2,76.5 L154.4,76.5 L154.4,75.4 L154.6,75.4 + L154.6,74.4 L154.9,74.4 L154.9,73.3 L155.1,73.3 L155.1,72.3 L155.3,72.3 L155.3,71.3 L155.5,71.3 + L155.5,70.3 L155.7,70.3 L155.7,69.3 L155.9,69.3 L155.9,68.4 L156.2,68.4 L156.2,67.4 L156.4,67.4 + L156.4,66.5 L156.6,66.5 L156.6,65.6 L156.8,65.6 L156.8,64.7 L157.0,64.7 L157.0,63.9 L157.2,63.9 + L157.2,63.0 L157.5,63.0 L157.5,62.2 L157.7,62.2 L157.7,61.3 L157.9,61.3 L157.9,60.5 L158.1,60.5 + L158.1,59.7 L158.3,59.7 L158.3,67.3 L158.6,67.3 L158.6,74.8 L158.8,74.8 L158.8,82.1 L159.0,82.1 + L159.0,89.2 L159.2,89.2 L159.2,96.2 L159.4,96.2 L159.4,103.1 L159.6,103.1 L159.6,109.8 L159.9,109.8 + L159.9,116.4 L160.1,116.4 L160.1,122.9 L160.3,122.9 L160.3,129.2 L160.5,129.2 L160.5,135.4 L160.7,135.4 + L160.7,141.5 L160.9,141.5 L160.9,147.5 L161.2,147.5 L161.2,153.3 L161.4,153.3 L161.4,159.0 L161.6,159.0 + L161.6,164.6 L161.8,164.6 L161.8,170.1 L162.0,170.1 L162.0,175.4 L162.2,175.4 L162.2,180.7 L162.5,180.7 + L162.5,185.8 L162.7,185.8 L162.7,190.9 L162.9,190.9 L162.9,195.8 L163.1,195.8 L163.1,200.7 L163.3,200.7 + L163.3,205.4 L163.5,205.4 L163.5,210.1 L163.8,210.1 L163.8,214.6 L164.0,214.6 L164.0,219.1 L164.2,219.1 + L164.2,223.4 L164.4,223.4 L164.4,227.7 L164.6,227.7 L164.6,231.9 L164.8,231.9 L164.8,236.0 L165.1,236.0 + L165.1,240.0 L165.3,240.0 L165.3,244.0 L165.5,244.0 L165.5,247.8 L165.7,247.8 L165.7,251.6 L165.9,251.6 + L165.9,255.3 L166.2,255.3 L166.2,259.0 L166.4,259.0 L166.4,262.5 L166.6,262.5 L166.6,266.0 L166.8,266.0 + L166.8,269.4 L167.0,269.4 L167.0,272.7 L167.2,272.7 L167.2,276.0 L167.5,276.0 L167.5,279.2 L167.7,279.2 + L167.7,282.4 L167.9,282.4 L167.9,285.4 L168.1,285.4 L168.1,288.5 L168.3,288.5 L168.3,291.4 L168.5,291.4 + L168.5,294.3 L168.8,294.3 L168.8,297.1 L169.0,297.1 L169.0,299.9 L169.2,299.9 L169.2,302.6 L169.4,302.6 + L169.4,305.3 L169.6,305.3 L169.6,307.9 L169.8,307.9 L169.8,310.5 L170.1,310.5 L170.1,313.0 L170.3,313.0 + L170.3,315.4 L170.5,315.4 L170.5,317.8 L170.7,317.8 L170.7,320.2 L170.9,320.2 L170.9,322.5 L171.1,322.5 + L171.1,324.7 L171.4,324.7 L171.4,327.0 L171.6,327.0 L171.6,329.1 L171.8,329.1 L171.8,331.3 L172.0,331.3 + L172.0,333.3 L172.2,333.3 L172.2,335.4 L172.4,335.4 L172.4,337.4 L172.7,337.4 L172.7,339.3 L172.9,339.3 + L172.9,341.2 L173.1,341.2 L173.1,343.1 L173.3,343.1 L173.3,345.0 L173.5,345.0 L173.5,346.8 L173.8,346.8 + L173.8,348.5 L174.0,348.5 L174.0,350.3 L174.2,350.3 L174.2,351.9 L174.4,351.9 L174.4,353.6 L174.6,353.6 + L174.6,355.2 L174.8,355.2 L174.8,356.8 L175.1,356.8 L175.1,358.4 L175.3,358.4 L175.3,359.9 L175.5,359.9 + L175.5,361.4 L175.7,361.4 L175.7,362.9 L175.9,362.9 L175.9,364.3 L176.1,364.3 L176.1,365.7 L176.4,365.7 + L176.4,367.1 L176.6,367.1 L176.6,368.4 L176.8,368.4 L176.8,369.8 L177.0,369.8 L177.0,371.1 L177.2,371.1 + L177.2,372.3 L177.4,372.3 L177.4,373.6 L177.7,373.6 L177.7,374.8 L177.9,374.8 L177.9,376.0 L178.1,376.0 + L178.1,377.2 L178.3,377.2 L178.3,378.3 L178.5,378.3 L178.5,379.4 L178.7,379.4 L178.7,380.5 L179.0,380.5 + L179.0,381.6 L179.2,381.6 L179.2,382.7 L179.4,382.7 L179.4,383.7 L179.6,383.7 L179.6,384.7 L179.8,384.7 + L179.8,385.7 L180.0,385.7 L180.0,386.7 L180.3,386.7 L180.3,387.6 L180.5,387.6 L180.5,388.5 L180.7,388.5 + L180.7,389.5 L180.9,389.5 L180.9,390.3 L181.1,390.3 L181.1,391.2 L181.4,391.2 L181.4,392.1 L181.6,392.1 + L181.6,392.9 L181.8,392.9 L181.8,393.7 L182.0,393.7 L182.0,394.6 L182.2,394.6 L182.2,395.3 L182.4,395.3 + L182.4,396.1 L182.7,396.1 L182.7,396.9 L182.9,396.9 L182.9,397.6 L183.1,397.6 L183.1,398.3 L183.3,398.3 + L183.3,399.1 L183.5,399.1 L183.5,399.8 L183.7,399.8 L183.7,400.4 L184.0,400.4 L184.0,401.1 L184.2,401.1 + L184.2,401.8 L184.4,401.8 L184.4,394.9 L184.6,394.9 L184.6,388.0 L184.8,388.0 L184.8,381.3 L185.0,381.3 + L185.0,374.7 L185.3,374.7 L185.3,368.2 L185.5,368.2 L185.5,361.9 L185.7,361.9 L185.7,355.6 L185.9,355.6 + L185.9,349.5 L186.1,349.5 L186.1,343.5 L186.3,343.5 L186.3,337.5 L186.6,337.5 L186.6,331.7 L186.8,331.7 + L186.8,326.0 L187.0,326.0 L187.0,320.4 L187.2,320.4 L187.2,314.9 L187.4,314.9 L187.4,309.5 L187.6,309.5 + L187.6,304.2 L187.9,304.2 L187.9,299.0 L188.1,299.0 L188.1,293.9 L188.3,293.9 L188.3,288.9 L188.5,288.9 + L188.5,284.0 L188.7,284.0 L188.7,279.1 L188.9,279.1 L188.9,274.4 L189.2,274.4 L189.2,269.7 L189.4,269.7 + L189.4,265.1 L189.6,265.1 L189.6,260.6 L189.8,260.6 L189.8,256.2 L190.0,256.2 L190.0,251.9 L190.3,251.9 + L190.3,247.6 L190.5,247.6 L190.5,243.4 L190.7,243.4 L190.7,239.3 L190.9,239.3 L190.9,235.3 L191.1,235.3 + L191.1,231.4 L191.3,231.4 L191.3,227.5 L191.6,227.5 L191.6,223.7 L191.8,223.7 L191.8,219.9 L192.0,219.9 + L192.0,216.2 L192.2,216.2 L192.2,212.6 L192.4,212.6 L192.4,209.1 L192.6,209.1 L192.6,205.6 L192.9,205.6 + L192.9,202.2 L193.1,202.2 L193.1,198.8 L193.3,198.8 L193.3,195.5 L193.5,195.5 L193.5,192.3 L193.7,192.3 + L193.7,189.1 L193.9,189.1 L193.9,186.0 L194.2,186.0 L194.2,182.9 L194.4,182.9 L194.4,179.9 L194.6,179.9 + L194.6,177.0 L194.8,177.0 L194.8,174.0 L195.0,174.0 L195.0,171.2 L195.2,171.2 L195.2,168.4 L195.5,168.4 + L195.5,165.7 L195.7,165.7 L195.7,163.0 L195.9,163.0 L195.9,160.3 L196.1,160.3 L196.1,157.7 L196.3,157.7 + L196.3,155.2 L196.5,155.2 L196.5,152.7 L196.8,152.7 L196.8,150.2 L197.0,150.2 L197.0,147.8 L197.2,147.8 + L197.2,145.4 L197.4,145.4 L197.4,143.1 L197.6,143.1 L197.6,140.8 L197.9,140.8 L197.9,138.5 L198.1,138.5 + L198.1,136.3 L198.3,136.3 L198.3,134.2 L198.5,134.2 L198.5,132.0 L198.7,132.0 L198.7,130.0 L198.9,130.0 + L198.9,127.9 L199.2,127.9 L199.2,125.9 L199.4,125.9 L199.4,123.9 L199.6,123.9 L199.6,122.0 L199.8,122.0 + L199.8,120.1 L200.0,120.1 L200.0,118.2 L200.2,118.2 L200.2,116.4 L200.5,116.4 L200.5,114.6 L200.7,114.6 + L200.7,112.8 L200.9,112.8 L200.9,111.0 L201.1,111.0 L201.1,109.3 L201.3,109.3 L201.3,107.7 L201.5,107.7 + L201.5,106.0 L201.8,106.0 L201.8,104.4 L202.0,104.4 L202.0,102.8 L202.2,102.8 L202.2,101.2 L202.4,101.2 + L202.4,99.7 L202.6,99.7 L202.6,98.2 L202.8,98.2 L202.8,96.7 L203.1,96.7 L203.1,95.3 L203.3,95.3 + L203.3,93.9 L203.5,93.9 L203.5,92.5 L203.7,92.5 L203.7,91.1 L203.9,91.1 L203.9,89.8 L204.1,89.8 + L204.1,88.4 L204.4,88.4 L204.4,87.1 L204.6,87.1 L204.6,85.9 L204.8,85.9 L204.8,84.6 L205.0,84.6 + L205.0,83.4 L205.2,83.4 L205.2,82.2 L205.5,82.2 L205.5,81.0 L205.7,81.0 L205.7,79.8 L205.9,79.8 + L205.9,78.7 L206.1,78.7 L206.1,77.6 L206.3,77.6 L206.3,76.5 L206.5,76.5 L206.5,75.4 L206.8,75.4 + L206.8,74.3 L207.0,74.3 L207.0,73.3 L207.2,73.3 L207.2,72.2 L207.4,72.2 L207.4,71.2 L207.6,71.2 + L207.6,70.3 L207.8,70.3 L207.8,69.3 L208.1,69.3 L208.1,68.3 L208.3,68.3 L208.3,67.4 L208.5,67.4 + L208.5,66.5 L208.7,66.5 L208.7,65.6 L208.9,65.6 L208.9,64.7 L209.1,64.7 L209.1,63.8 L209.4,63.8 + L209.4,63.0 L209.6,63.0 L209.6,62.1 L209.8,62.1 L209.8,61.3 L210.0,61.3 L210.0,60.5 L210.2,60.5 + L210.2,59.7 L210.4,59.7 L210.4,67.2 L210.7,67.2 L210.7,74.7 L210.9,74.7 L210.9,82.0 L211.1,82.0 + L211.1,89.2 L211.3,89.2 L211.3,96.2 L211.5,96.2 L211.5,103.1 L211.7,103.1 L211.7,109.8 L212.0,109.8 + L212.0,116.4 L212.2,116.4 L212.2,122.8 L212.4,122.8 L212.4,129.2 L212.6,129.2 L212.6,135.4 L212.8,135.4 + L212.8,141.5 L213.1,141.5 L213.1,147.4 L213.3,147.4 L213.3,153.2 L213.5,153.2 L213.5,158.9 L213.7,158.9 + L213.7,164.5 L213.9,164.5 L213.9,170.0 L214.1,170.0 L214.1,175.4 L214.4,175.4 L214.4,180.6 L214.6,180.6 + L214.6,185.8 L214.8,185.8 L214.8,190.8 L215.0,190.8 L215.0,195.8 L215.2,195.8 L215.2,200.6 L215.4,200.6 + L215.4,205.4 L215.7,205.4 L215.7,210.0 L215.9,210.0 L215.9,214.6 L216.1,214.6 L216.1,219.0 L216.3,219.0 + L216.3,223.4 L216.5,223.4 L216.5,227.7 L216.7,227.7 L216.7,231.9 L217.0,231.9 L217.0,236.0 L217.2,236.0 + L217.2,240.0 L217.4,240.0 L217.4,243.9 L217.6,243.9 L217.6,247.8 L217.8,247.8 L217.8,251.6 L218.0,251.6 + L218.0,255.3 L218.3,255.3 L218.3,258.9 L218.5,258.9 L218.5,262.5 L218.7,262.5 L218.7,266.0 L218.9,266.0 + L218.9,269.4 L219.1,269.4 L219.1,272.7 L219.3,272.7 L219.3,276.0 L219.6,276.0 L219.6,279.2 L219.8,279.2 + L219.8,282.3 L220.0,282.3 L220.0,285.4 L220.2,285.4 L220.2,288.4 L220.4,288.4 L220.4,291.4 L220.6,291.4 + L220.6,294.3 L220.9,294.3 L220.9,297.1 L221.1,297.1 L221.1,299.9 L221.3,299.9 L221.3,302.6 L221.5,302.6 + L221.5,305.3 L221.7,305.3 L221.7,307.9 L222.0,307.9 L222.0,310.4 L222.2,310.4 L222.2,313.0 L222.4,313.0 + L222.4,315.4 L222.6,315.4 L222.6,317.8 L222.8,317.8 L222.8,320.2 L223.0,320.2 L223.0,322.5 L223.3,322.5 + L223.3,324.7 L223.5,324.7 L223.5,326.9 L223.7,326.9 L223.7,329.1 L223.9,329.1 L223.9,331.2 L224.1,331.2 + L224.1,333.3 L224.3,333.3 L224.3,335.4 L224.6,335.4 L224.6,337.4 L224.8,337.4 L224.8,339.3 L225.0,339.3 + L225.0,341.2 L225.2,341.2 L225.2,343.1 L225.4,343.1 L225.4,344.9 L225.6,344.9 L225.6,346.7 L225.9,346.7 + L225.9,348.5 L226.1,348.5 L226.1,350.2 L226.3,350.2 L226.3,351.9 L226.5,351.9 L226.5,353.6 L226.7,353.6 + L226.7,355.2 L226.9,355.2 L226.9,356.8 L227.2,356.8 L227.2,358.4 L227.4,358.4 L227.4,359.9 L227.6,359.9 + L227.6,361.4 L227.8,361.4 L227.8,362.9 L228.0,362.9 L228.0,364.3 L228.2,364.3 L228.2,365.7 L228.5,365.7 + L228.5,367.1 L228.7,367.1 L228.7,368.4 L228.9,368.4 L228.9,369.8 L229.1,369.8 L229.1,371.1 L229.3,371.1 + L229.3,372.3 L229.6,372.3 L229.6,373.6 L229.8,373.6 L229.8,374.8 L230.0,374.8 L230.0,376.0 L230.2,376.0 + L230.2,377.1 L230.4,377.1 L230.4,378.3 L230.6,378.3 L230.6,379.4 L230.9,379.4 L230.9,380.5 L231.1,380.5 + L231.1,381.6 L231.3,381.6 L231.3,382.6 L231.5,382.6 L231.5,383.7 L231.7,383.7 L231.7,384.7 L231.9,384.7 + L231.9,385.7 L232.2,385.7 L232.2,386.7 L232.4,386.7 L232.4,387.6 L232.6,387.6 L232.6,388.5 L232.8,388.5 + L232.8,389.4 L233.0,389.4 L233.0,390.3 L233.2,390.3 L233.2,391.2 L233.5,391.2 L233.5,392.1 L233.7,392.1 + L233.7,392.9 L233.9,392.9 L233.9,393.7 L234.1,393.7 L234.1,394.5 L234.3,394.5 L234.3,395.3 L234.5,395.3 + L234.5,396.1 L234.8,396.1 L234.8,396.9 L235.0,396.9 L235.0,397.6 L235.2,397.6 L235.2,398.3 L235.4,398.3 + L235.4,399.1 L235.6,399.1 L235.6,399.8 L235.8,399.8 L235.8,400.4 L236.1,400.4 L236.1,401.1 L236.3,401.1 + L236.3,401.8 L236.5,401.8 L236.5,394.9 L236.7,394.9 L236.7,388.1 L236.9,388.1 L236.9,381.3 L237.2,381.3 + L237.2,374.7 L237.4,374.7 L237.4,368.2 L237.6,368.2 L237.6,361.9 L237.8,361.9 L237.8,355.6 L238.0,355.6 + L238.0,349.5 L238.2,349.5 L238.2,343.5 L238.5,343.5 L238.5,337.6 L238.7,337.6 L238.7,331.7 L238.9,331.7 + L238.9,326.0 L239.1,326.0 L239.1,320.4 L239.3,320.4 L239.3,314.9 L239.5,314.9 L239.5,309.5 L239.8,309.5 + L239.8,304.2 L240.0,304.2 L240.0,299.0 L240.2,299.0 L240.2,293.9 L240.4,293.9 L240.4,288.9 L240.6,288.9 + L240.6,284.0 L240.8,284.0 L240.8,279.1 L241.1,279.1 L241.1,274.4 L241.3,274.4 L241.3,269.7 L241.5,269.7 + L241.5,265.1 L241.7,265.1 L241.7,260.7 L241.9,260.7 L241.9,256.2 L242.1,256.2 L242.1,251.9 L242.4,251.9 + L242.4,247.6 L242.6,247.6 L242.6,243.5 L242.8,243.5 L242.8,239.4 L243.0,239.4 L243.0,235.3 L243.2,235.3 + L243.2,231.4 L243.4,231.4 L243.4,227.5 L243.7,227.5 L243.7,223.7 L243.9,223.7 L243.9,219.9 L244.1,219.9 + L244.1,216.2 L244.3,216.2 L244.3,212.6 L244.5,212.6 L244.5,209.1 L244.7,209.1 L244.7,205.6 L245.0,205.6 + L245.0,202.2 L245.2,202.2 L245.2,198.8 L245.4,198.8 L245.4,195.5 L245.6,195.5 L245.6,192.3 L245.8,192.3 + L245.8,189.1 L246.1,189.1 L246.1,186.0 L246.3,186.0 L246.3,182.9 L246.5,182.9 L246.5,179.9 L246.7,179.9 + L246.7,177.0 L246.9,177.0 L246.9,174.1 L247.1,174.1 L247.1,171.2 L247.4,171.2 L247.4,168.4 L247.6,168.4 + L247.6,165.7 L247.8,165.7 L247.8,163.0 L248.0,163.0 L248.0,160.3 L248.2,160.3 L248.2,157.7 L248.4,157.7 + L248.4,155.2 L248.7,155.2 L248.7,152.7 L248.9,152.7 L248.9,150.2 L249.1,150.2 L249.1,147.8 L249.3,147.8 + L249.3,145.4 L249.5,145.4 L249.5,143.1 L249.7,143.1 L249.7,140.8 L250.0,140.8 L250.0,138.5 L250.2,138.5 + L250.2,136.3 L250.4,136.3 L250.4,134.2 L250.6,134.2 L250.6,132.0 L250.8,132.0 L250.8,130.0 L251.0,130.0 + L251.0,127.9 L251.3,127.9 L251.3,125.9 L251.5,125.9 L251.5,123.9 L251.7,123.9 L251.7,122.0 L251.9,122.0 + L251.9,120.1 L252.1,120.1 L252.1,118.2 L252.3,118.2 L252.3,116.4 L252.6,116.4 L252.6,114.6 L252.8,114.6 + L252.8,112.8 L253.0,112.8 L253.0,111.1 L253.2,111.1 L253.2,109.3 L253.4,109.3 L253.4,107.7 L253.7,107.7 + L253.7,106.0 L253.9,106.0 L253.9,104.4 L254.1,104.4 L254.1,102.8 L254.3,102.8 L254.3,101.3 L254.5,101.3 + L254.5,99.7 L254.7,99.7 L254.7,98.2 L255.0,98.2 L255.0,96.7 L255.2,96.7 L255.2,95.3 L255.4,95.3 + L255.4,93.9 L255.6,93.9 L255.6,92.5 L255.8,92.5 L255.8,91.1 L256.0,91.1 L256.0,89.8 L256.3,89.8 + L256.3,88.4 L256.5,88.4 L256.5,87.1 L256.7,87.1 L256.7,85.9 L256.9,85.9 L256.9,84.6 L257.1,84.6 + L257.1,83.4 L257.3,83.4 L257.3,82.2 L257.6,82.2 L257.6,81.0 L257.8,81.0 L257.8,79.8 L258.0,79.8 + L258.0,78.7 L258.2,78.7 L258.2,77.6 L258.4,77.6 L258.4,76.5 L258.6,76.5 L258.6,75.4 L258.9,75.4 + L258.9,74.3 L259.1,74.3 L259.1,73.3 L259.3,73.3 L259.3,72.2 L259.5,72.2 L259.5,71.2 L259.7,71.2 + L259.7,70.3 L259.9,70.3 L259.9,69.3 L260.2,69.3 L260.2,68.3 L260.4,68.3 L260.4,67.4 L260.6,67.4 + L260.6,66.5 L260.8,66.5 L260.8,65.6 L261.0,65.6 L261.0,64.7 L261.3,64.7 L261.3,63.8 L261.5,63.8 + L261.5,63.0 L261.7,63.0 L261.7,62.1 L261.9,62.1 L261.9,61.3 L262.1,61.3 L262.1,60.5 L262.3,60.5 + L262.3,59.7 L262.6,59.7 L262.6,67.2 L262.8,67.2 L262.8,74.7 L263.0,74.7 L263.0,82.0 L263.2,82.0 + L263.2,89.1 L263.4,89.1 L263.4,96.2 L263.6,96.2 L263.6,103.0 L263.9,103.0 L263.9,109.8 L264.1,109.8 + L264.1,116.4 L264.3,116.4 L264.3,122.8 L264.5,122.8 L264.5,129.2 L264.7,129.2 L264.7,135.4 L264.9,135.4 + L264.9,141.4 L265.2,141.4 L265.2,147.4 L265.4,147.4 L265.4,153.2 L265.6,153.2 L265.6,158.9 L265.8,158.9 + L265.8,164.5 L266.0,164.5 L266.0,170.0 L266.2,170.0 L266.2,175.4 L266.5,175.4 L266.5,180.6 L266.7,180.6 + L266.7,185.8 L266.9,185.8 L266.9,190.8 L267.1,190.8 L267.1,195.8 L267.3,195.8 L267.3,200.6 L267.5,200.6 + L267.5,205.4 L267.8,205.4 L267.8,210.0 L268.0,210.0 L268.0,214.6 L268.2,214.6 L268.2,219.0 L268.4,219.0 + L268.4,223.4 L268.6,223.4 L268.6,227.7 L268.9,227.7 L268.9,231.9 L269.1,231.9 L269.1,236.0 L269.3,236.0 + L269.3,240.0 L269.5,240.0 L269.5,243.9 L269.7,243.9 L269.7,247.8 L269.9,247.8 L269.9,251.6 L270.2,251.6 + L270.2,255.3 L270.4,255.3 L270.4,258.9 L270.6,258.9 L270.6,262.5 L270.8,262.5 L270.8,265.9 L271.0,265.9 + L271.0,269.4 L271.2,269.4 L271.2,272.7 L271.5,272.7 L271.5,276.0 L271.7,276.0 L271.7,279.2 L271.9,279.2 + L271.9,282.3 L272.1,282.3 L272.1,285.4 L272.3,285.4 L272.3,288.4 L272.5,288.4 L272.5,291.4 L272.8,291.4 + L272.8,294.3 L273.0,294.3 L273.0,297.1 L273.2,297.1 L273.2,299.9 L273.4,299.9 L273.4,302.6 L273.6,302.6 + L273.6,305.3 L273.8,305.3 L273.8,307.9 L274.1,307.9 L274.1,310.4 L274.3,310.4 L274.3,312.9 L274.5,312.9 + L274.5,315.4 L274.7,315.4 L274.7,317.8 L274.9,317.8 L274.9,320.2 L275.1,320.2 L275.1,322.5 L275.4,322.5 + L275.4,324.7 L275.6,324.7 L275.6,326.9 L275.8,326.9 L275.8,329.1 L276.0,329.1 L276.0,331.2 L276.2,331.2 + L276.2,333.3 L276.4,333.3 L276.4,335.3 L276.7,335.3 L276.7,337.3 L276.9,337.3 L276.9,339.3 L277.1,339.3 + L277.1,341.2 L277.3,341.2 L277.3,343.1 L277.5,343.1 L277.5,344.9 L277.8,344.9 L277.8,346.7 L278.0,346.7 + L278.0,348.5 L278.2,348.5 L278.2,350.2 L278.4,350.2 L278.4,351.9 L278.6,351.9 L278.6,353.6 L278.8,353.6 + L278.8,355.2 L279.1,355.2 L279.1,356.8 L279.3,356.8 L279.3,358.4 L279.5,358.4 L279.5,359.9 L279.7,359.9 + L279.7,361.4 L279.9,361.4 L279.9,362.9 L280.1,362.9 L280.1,364.3 L280.4,364.3 L280.4,365.7 L280.6,365.7 + L280.6,367.1 L280.8,367.1 L280.8,368.4 L281.0,368.4 L281.0,369.8 L281.2,369.8 L281.2,371.0 L281.4,371.0 + L281.4,372.3 L281.7,372.3 L281.7,373.6 L281.9,373.6 L281.9,374.8 L282.1,374.8 L282.1,376.0 L282.3,376.0 + L282.3,377.1 L282.5,377.1 L282.5,378.3 L282.7,378.3 L282.7,379.4 L283.0,379.4 L283.0,380.5 L283.2,380.5 + L283.2,381.6 L283.4,381.6 L283.4,382.6 L283.6,382.6 L283.6,383.7 L283.8,383.7 L283.8,384.7 L284.0,384.7 + L284.0,385.7 L284.3,385.7 L284.3,386.6 L284.5,386.6 L284.5,387.6 L284.7,387.6 L284.7,388.5 L284.9,388.5 + L284.9,389.4 L285.1,389.4 L285.1,390.3 L285.4,390.3 L285.4,391.2 L285.6,391.2 L285.6,392.1 L285.8,392.1 + L285.8,392.9 L286.0,392.9 L286.0,393.7 L286.2,393.7 L286.2,394.5 L286.4,394.5 L286.4,395.3 L286.7,395.3 + L286.7,396.1 L286.9,396.1 L286.9,396.9 L287.1,396.9 L287.1,397.6 L287.3,397.6 L287.3,398.3 L287.5,398.3 + L287.5,399.1 L287.7,399.1 L287.7,399.8 L288.0,399.8 L288.0,400.4 L288.2,400.4 L288.2,401.1 L288.4,401.1 + L288.4,401.8 L288.6,401.8 L288.6,394.9 L288.8,394.9 L288.8,388.1 L289.0,388.1 L289.0,381.4 L289.3,381.4 + L289.3,374.8 L289.5,374.8 L289.5,368.3 L289.7,368.3 L289.7,361.9 L289.9,361.9 L289.9,355.7 L290.1,355.7 + L290.1,349.5 L290.3,349.5 L290.3,343.5 L290.6,343.5 L290.6,337.6 L290.8,337.6 L290.8,331.8 L291.0,331.8 + L291.0,326.1 L291.2,326.1 L291.2,320.5 L291.4,320.5 L291.4,315.0 L291.6,315.0 L291.6,309.6 L291.9,309.6 + L291.9,304.3 L292.1,304.3 L292.1,299.1 L292.3,299.1 L292.3,294.0 L292.5,294.0 L292.5,288.9 L292.7,288.9 + L292.7,284.0 L293.0,284.0 L293.0,279.2 L293.2,279.2 L293.2,274.4 L293.4,274.4 L293.4,269.7 L293.6,269.7 + L293.6,265.2 L293.8,265.2 L293.8,260.7 L294.0,260.7 L294.0,256.3 L294.3,256.3 L294.3,251.9 L294.5,251.9 + L294.5,247.7 L294.7,247.7 L294.7,243.5 L294.9,243.5 L294.9,239.4 L295.1,239.4 L295.1,235.3 L295.3,235.3 + L295.3,231.4 L295.6,231.4 L295.6,227.5 L295.8,227.5 L295.8,223.7 L296.0,223.7 L296.0,219.9 L296.2,219.9 + L296.2,216.3 L296.4,216.3 L296.4,212.6 L296.6,212.6 L296.6,209.1 L296.9,209.1 L296.9,205.6 L297.1,205.6 + L297.1,202.2 L297.3,202.2 L297.3,198.8 L297.5,198.8 L297.5,195.5 L297.7,195.5 L297.7,192.3 L297.9,192.3 + L297.9,189.1 L298.2,189.1 L298.2,186.0 L298.4,186.0 L298.4,182.9 L298.6,182.9 L298.6,179.9 L298.8,179.9 + L298.8,177.0 L299.0,177.0 L299.0,174.1 L299.2,174.1 L299.2,171.2 L299.5,171.2 L299.5,168.4 L299.7,168.4 + L299.7,165.7 L299.9,165.7 L299.9,163.0 L300.1,163.0 L300.1,160.3 L300.3,160.3 L300.3,157.7 L300.6,157.7 + L300.6,155.2 L300.8,155.2 L300.8,152.7 L301.0,152.7 L301.0,150.2 L301.2,150.2 L301.2,147.8 L301.4,147.8 + L301.4,145.4 L301.6,145.4 L301.6,143.1 L301.9,143.1 L301.9,140.8 L302.1,140.8 L302.1,138.6 L302.3,138.6 + L302.3,136.4 L302.5,136.4 L302.5,134.2 L302.7,134.2 L302.7,132.1 L302.9,132.1 L302.9,130.0 L303.2,130.0 + L303.2,127.9 L303.4,127.9 L303.4,125.9 L303.6,125.9 L303.6,123.9 L303.8,123.9 L303.8,122.0 L304.0,122.0 + L304.0,120.1 L304.2,120.1 L304.2,118.2 L304.5,118.2 L304.5,116.4 L304.7,116.4 L304.7,114.6 L304.9,114.6 + L304.9,112.8 L305.1,112.8 L305.1,111.1 L305.3,111.1 L305.3,109.3 L305.5,109.3 L305.5,107.7 L305.8,107.7 + L305.8,106.0 L306.0,106.0 L306.0,104.4 L306.2,104.4 L306.2,102.8 L306.4,102.8 L306.4,101.3 L306.6,101.3 + L306.6,99.7 L306.8,99.7 L306.8,98.2 L307.1,98.2 L307.1,96.8 L307.3,96.8 L307.3,95.3 L307.5,95.3 + L307.5,93.9 L307.7,93.9 L307.7,92.5 L307.9,92.5 L307.9,91.1 L308.1,91.1 L308.1,89.8 L308.4,89.8 + L308.4,88.4 L308.6,88.4 L308.6,87.1 L308.8,87.1 L308.8,85.9 L309.0,85.9 L309.0,84.6 L309.2,84.6 + L309.2,83.4 L309.5,83.4 L309.5,82.2 L309.7,82.2 L309.7,81.0 L309.9,81.0 L309.9,79.8 L310.1,79.8 + L310.1,78.7 L310.3,78.7 L310.3,77.6 L310.5,77.6 L310.5,76.5 L310.8,76.5 L310.8,75.4 L311.0,75.4 + L311.0,74.3 L311.2,74.3 L311.2,73.3 L311.4,73.3 L311.4,72.3 L311.6,72.3 L311.6,71.2 L311.8,71.2 + L311.8,70.3 L312.1,70.3 L312.1,69.3 L312.3,69.3 L312.3,68.3 L312.5,68.3 L312.5,67.4 L312.7,67.4 + L312.7,66.5 L312.9,66.5 L312.9,65.6 L313.1,65.6 L313.1,64.7 L313.4,64.7 L313.4,63.8 L313.6,63.8 + L313.6,63.0 L313.8,63.0 L313.8,62.1 L314.0,62.1 L314.0,61.3 L314.2,61.3 L314.2,60.5 L314.4,60.5 + L314.4,59.7 L314.7,59.7 L314.7,67.2 L314.9,67.2 L314.9,74.6 L315.1,74.6 L315.1,81.9 L315.3,81.9 + L315.3,89.1 L315.5,89.1 L315.5,96.1 L315.7,96.1 L315.7,103.0 L316.0,103.0 L316.0,109.7 L316.2,109.7 + L316.2,116.3 L316.4,116.3 L316.4,122.8 L316.6,122.8 L316.6,129.1 L316.8,129.1 L316.8,135.3 L317.1,135.3 + L317.1,141.4 L317.3,141.4 L317.3,147.4 L317.5,147.4 L317.5,153.2 L317.7,153.2 L317.7,158.9 L317.9,158.9 + L317.9,164.5 L318.1,164.5 L318.1,170.0 L318.4,170.0 L318.4,175.3 L318.6,175.3 L318.6,180.6 L318.8,180.6 + L318.8,185.8 L319.0,185.8 L319.0,190.8 L319.2,190.8 L319.2,195.7 L319.4,195.7 L319.4,200.6 L319.7,200.6 + L319.7,205.3 L319.9,205.3 L319.9,210.0 L320.1,210.0 L320.1,214.5 L320.3,214.5 L320.3,219.0 L320.5,219.0 + L320.5,223.4 L320.7,223.4 L320.7,227.6 L321.0,227.6 L321.0,231.8 L321.2,231.8 L321.2,235.9 L321.4,235.9 + L321.4,240.0 L321.6,240.0 L321.6,243.9 L321.8,243.9 L321.8,247.8 L322.0,247.8 L322.0,251.6 L322.3,251.6 + L322.3,255.3 L322.5,255.3 L322.5,258.9 L322.7,258.9 L322.7,262.5 L322.9,262.5 L322.9,265.9 L323.1,265.9 + L323.1,269.3 L323.3,269.3 L323.3,272.7 L323.6,272.7 L323.6,276.0 L323.8,276.0 L323.8,279.2 L324.0,279.2 + L324.0,282.3 L324.2,282.3 L324.2,285.4 L324.4,285.4 L324.4,288.4 L324.7,288.4 L324.7,291.4 L324.9,291.4 + L324.9,294.3 L325.1,294.3 L325.1,297.1 L325.3,297.1 L325.3,299.9 L325.5,299.9 L325.5,302.6 L325.7,302.6 + L325.7,305.3 L326.0,305.3 L326.0,307.9 L326.2,307.9 L326.2,310.4 L326.4,310.4 L326.4,312.9 L326.6,312.9 + L326.6,315.4 L326.8,315.4 L326.8,317.8 L327.0,317.8 L327.0,320.1 L327.3,320.1 L327.3,322.5 L327.5,322.5 + L327.5,324.7 L327.7,324.7 L327.7,326.9 L327.9,326.9 L327.9,329.1 L328.1,329.1 L328.1,331.2 L328.3,331.2 + L328.3,333.3 L328.6,333.3 L328.6,335.3 L328.8,335.3 L328.8,337.3 L329.0,337.3 L329.0,339.3 L329.2,339.3 + L329.2,341.2 L329.4,341.2 L329.4,343.1 L329.6,343.1 L329.6,344.9 L329.9,344.9 L329.9,346.7 L330.1,346.7 + L330.1,348.5 L330.3,348.5 L330.3,350.2 L330.5,350.2 L330.5,351.9 L330.7,351.9 L330.7,353.6 L330.9,353.6 + L330.9,355.2 L331.2,355.2 L331.2,356.8 L331.4,356.8 L331.4,358.4 L331.6,358.4 L331.6,359.9 L331.8,359.9 + L331.8,361.4 L332.0,361.4 L332.0,362.9 L332.2,362.9 L332.2,364.3 L332.5,364.3 L332.5,365.7 L332.7,365.7 + L332.7,367.1 L332.9,367.1 L332.9,368.4 L333.1,368.4 L333.1,369.7 L333.3,369.7 L333.3,371.0 L333.6,371.0 + L333.6,372.3 L333.8,372.3 L333.8,373.6 L334.0,373.6 L334.0,374.8 L334.2,374.8 L334.2,376.0 L334.4,376.0 + L334.4,377.1 L334.6,377.1 L334.6,378.3 L334.9,378.3 L334.9,379.4 L335.1,379.4 L335.1,380.5 L335.3,380.5 + L335.3,381.6 L335.5,381.6 L335.5,382.6 L335.7,382.6 L335.7,383.7 L335.9,383.7 L335.9,384.7 L336.2,384.7 + L336.2,385.7 L336.4,385.7 L336.4,386.6 L336.6,386.6 L336.6,387.6 L336.8,387.6 L336.8,388.5 L337.0,388.5 + L337.0,389.4 L337.2,389.4 L337.2,390.3 L337.5,390.3 L337.5,391.2 L337.7,391.2 L337.7,392.1 L337.9,392.1 + L337.9,392.9 L338.1,392.9 L338.1,393.7 L338.3,393.7 L338.3,394.5 L338.5,394.5 L338.5,395.3 L338.8,395.3 + L338.8,396.1 L339.0,396.1 L339.0,396.9 L339.2,396.9 L339.2,397.6 L339.4,397.6 L339.4,398.3 L339.6,398.3 + L339.6,399.1 L339.8,399.1 L339.8,399.7 L340.1,399.7 L340.1,400.4 L340.3,400.4 L340.3,401.1 L340.5,401.1 + L340.5,401.8 L340.7,401.8 L340.7,394.9 L340.9,394.9 L340.9,388.1 L341.2,388.1 L341.2,381.4 L341.4,381.4 + L341.4,374.8 L341.6,374.8 L341.6,368.3 L341.8,368.3 L341.8,361.9 L342.0,361.9 L342.0,355.7 L342.2,355.7 + L342.2,349.5 L342.5,349.5 L342.5,343.5 L342.7,343.5 L342.7,337.6 L342.9,337.6 L342.9,331.8 L343.1,331.8 + L343.1,326.1 L343.3,326.1 L343.3,320.5 L343.5,320.5 L343.5,315.0 L343.8,315.0 L343.8,309.6 L344.0,309.6 + L344.0,304.3 L344.2,304.3 L344.2,299.1 L344.4,299.1 L344.4,294.0 L344.6,294.0 L344.6,289.0 L344.8,289.0 + L344.8,284.0 L345.1,284.0 L345.1,279.2 L345.3,279.2 L345.3,274.4 L345.5,274.4 L345.5,269.8 L345.7,269.8 + L345.7,265.2 L345.9,265.2 L345.9,260.7 L346.1,260.7 L346.1,256.3 L346.4,256.3 L346.4,251.9 L346.6,251.9 + L346.6,247.7 L346.8,247.7 L346.8,243.5 L347.0,243.5 L347.0,239.4 L347.2,239.4 L347.2,235.4 L347.4,235.4 + L347.4,231.4 L347.7,231.4 L347.7,227.5 L347.9,227.5 L347.9,223.7 L348.1,223.7 L348.1,219.9 L348.3,219.9 + L348.3,216.3 L348.5,216.3 L348.5,212.7 L348.8,212.7 L348.8,209.1 L349.0,209.1 L349.0,205.6 L349.2,205.6 + L349.2,202.2 L349.4,202.2 L349.4,198.8 L349.6,198.8 L349.6,195.6 L349.8,195.6 L349.8,192.3 L350.1,192.3 + L350.1,189.1 L350.3,189.1 L350.3,186.0 L350.5,186.0 L350.5,182.9 L350.7,182.9 L350.7,179.9 L350.9,179.9 + L350.9,177.0 L351.1,177.0 L351.1,174.1 L351.4,174.1 L351.4,171.2 L351.6,171.2 L351.6,168.4 L351.8,168.4 + L351.8,165.7 L352.0,165.7 L352.0,163.0 L352.2,163.0 L352.2,160.3 L352.4,160.3 L352.4,157.7 L352.7,157.7 + L352.7,155.2 L352.9,155.2 L352.9,152.7 L353.1,152.7 L353.1,150.2 L353.3,150.2 L353.3,147.8 L353.5,147.8 + L353.5,145.4 L353.7,145.4 L353.7,143.1 L354.0,143.1 L354.0,140.8 L354.2,140.8 L354.2,138.6 L354.4,138.6 + L354.4,136.4 L354.6,136.4 L354.6,134.2 L354.8,134.2 L354.8,132.1 L355.0,132.1 L355.0,130.0 L355.3,130.0 + L355.3,127.9 L355.5,127.9 L355.5,125.9 L355.7,125.9 L355.7,123.9 L355.9,123.9 L355.9,122.0 L356.1,122.0 + L356.1,120.1 L356.4,120.1 L356.4,118.2 L356.6,118.2 L356.6,116.4 L356.8,116.4 L356.8,114.6 L357.0,114.6 + L357.0,112.8 L357.2,112.8 L357.2,111.1 L357.4,111.1 L357.4,109.4 L357.7,109.4 L357.7,107.7 L357.9,107.7 + L357.9,106.0 L358.1,106.0 L358.1,104.4 L358.3,104.4 L358.3,102.8 L358.5,102.8 L358.5,101.3 L358.7,101.3 + L358.7,99.7 L359.0,99.7 L359.0,98.2 L359.2,98.2 L359.2,96.8 L359.4,96.8 L359.4,95.3 L359.6,95.3 + L359.6,93.9 L359.8,93.9 L359.8,92.5 L360.0,92.5 L360.0,91.1 L360.3,91.1 L360.3,89.8 L360.5,89.8 + L360.5,88.4 L360.7,88.4 L360.7,87.1 L360.9,87.1 L360.9,85.9 L361.1,85.9 L361.1,84.6 L361.3,84.6 + L361.3,83.4 L361.6,83.4 L361.6,82.2 L361.8,82.2 L361.8,81.0 L362.0,81.0 L362.0,79.8 L362.2,79.8 + L362.2,78.7 L362.4,78.7 L362.4,77.6 L362.6,77.6 L362.6,76.5 L362.9,76.5 L362.9,75.4 L363.1,75.4 + L363.1,74.3 L363.3,74.3 L363.3,73.3 L363.5,73.3 L363.5,72.3 L363.7,72.3 L363.7,71.2 L363.9,71.2 + L363.9,70.3 L364.2,70.3 L364.2,69.3 L364.4,69.3 L364.4,68.3 L364.6,68.3 L364.6,67.4 L364.8,67.4 + L364.8,66.5 L365.0,66.5 L365.0,65.6 L365.3,65.6 L365.3,64.7 L365.5,64.7 L365.5,63.8 L365.7,63.8 + L365.7,63.0 L365.9,63.0 L365.9,62.1 L366.1,62.1 L366.1,61.3 L366.3,61.3 L366.3,60.5 L366.6,60.5 + L366.6,59.7 L366.8,59.7 L366.8,67.1 L367.0,67.1 L367.0,74.6 L367.2,74.6 L367.2,81.9 L367.4,81.9 + L367.4,89.1 L367.6,89.1 L367.6,96.1 L367.9,96.1 L367.9,103.0 L368.1,103.0 L368.1,109.7 L368.3,109.7 + L368.3,116.3 L368.5,116.3 L368.5,122.8 L368.7,122.8 L368.7,129.1 L368.9,129.1 L368.9,135.3 L369.2,135.3 + L369.2,141.4 L369.4,141.4 L369.4,147.3 L369.6,147.3 L369.6,153.2 L369.8,153.2 L369.8,158.9 L370.0,158.9 + L370.0,164.5 L370.2,164.5 L370.2,170.0 L370.5,170.0 L370.5,175.3 L370.7,175.3 L370.7,180.6 L370.9,180.6 + L370.9,185.7 L371.1,185.7 L371.1,190.8 L371.3,190.8 L371.3,195.7 L371.5,195.7 L371.5,200.6 L371.8,200.6 + L371.8,205.3 L372.0,205.3 L372.0,210.0 L372.2,210.0 L372.2,214.5 L372.4,214.5 L372.4,219.0 L372.6,219.0 + L372.6,223.4 L372.9,223.4 L372.9,227.6 L373.1,227.6 L373.1,231.8 L373.3,231.8 L373.3,235.9 L373.5,235.9 + L373.5,240.0 L373.7,240.0 L373.7,243.9 L373.9,243.9 L373.9,247.8 L374.2,247.8 L374.2,251.5 L374.4,251.5 + L374.4,255.3 L374.6,255.3 L374.6,258.9 L374.8,258.9 L374.8,262.4 L375.0,262.4 L375.0,265.9 L375.2,265.9 + L375.2,269.3 L375.5,269.3 L375.5,272.7 L375.7,272.7 L375.7,276.0 L375.9,276.0 L375.9,279.2 L376.1,279.2 + L376.1,282.3 L376.3,282.3 L376.3,285.4 L376.5,285.4 L376.5,288.4 L376.8,288.4 L376.8,291.4 L377.0,291.4 + L377.0,294.2 L377.2,294.2 L377.2,297.1 L377.4,297.1 L377.4,299.9 L377.6,299.9 L377.6,302.6 L377.8,302.6 + L377.8,305.2 L378.1,305.2 L378.1,307.9 L378.3,307.9 L378.3,310.4 L378.5,310.4 L378.5,312.9 L378.7,312.9 + L378.7,315.4 L378.9,315.4 L378.9,317.8 L379.1,317.8 L379.1,320.1 L379.4,320.1 L379.4,322.4 L379.6,322.4 + L379.6,324.7 L379.8,324.7 L379.8,326.9 L380.0,326.9 L380.0,329.1 L380.2,329.1 L380.2,331.2 L380.5,331.2 + L380.5,333.3 L380.7,333.3 L380.7,335.3 L380.9,335.3 L380.9,337.3 L381.1,337.3 L381.1,339.3 L381.3,339.3 + L381.3,341.2 L381.5,341.2 L381.5,343.1 L381.8,343.1 L381.8,344.9 L382.0,344.9 L382.0,346.7 L382.2,346.7 + L382.2,348.5 L382.4,348.5 L382.4,350.2 L382.6,350.2 L382.6,351.9 L382.8,351.9 L382.8,353.6 L383.1,353.6 + L383.1,355.2 L383.3,355.2 L383.3,356.8 L383.5,356.8 L383.5,358.4 L383.7,358.4 L383.7,359.9 L383.9,359.9 + L383.9,361.4 L384.1,361.4 L384.1,362.8 L384.4,362.8 L384.4,364.3 L384.6,364.3 L384.6,365.7 L384.8,365.7 + L384.8,367.1 L385.0,367.1 L385.0,368.4 L385.2,368.4 L385.2,369.7 L385.4,369.7 L385.4,371.0 L385.7,371.0 + L385.7,372.3 L385.9,372.3 L385.9,373.6 L386.1,373.6 L386.1,374.8 L386.3,374.8 L386.3,376.0 L386.5,376.0 + L386.5,377.1 L386.7,377.1 L386.7,378.3 L387.0,378.3 L387.0,379.4 L387.2,379.4 L387.2,380.5 L387.4,380.5 + L387.4,381.6 L387.6,381.6 L387.6,382.6 L387.8,382.6 L387.8,383.7 L388.1,383.7 L388.1,384.7 L388.3,384.7 + L388.3,385.7 L388.5,385.7 L388.5,386.6 L388.7,386.6 L388.7,387.6 L388.9,387.6 L388.9,388.5 L389.1,388.5 + L389.1,389.4 L389.4,389.4 L389.4,390.3 L389.6,390.3 L389.6,391.2 L389.8,391.2 L389.8,392.1 L390.0,392.1 + L390.0,392.9 L390.2,392.9 L390.2,393.7 L390.4,393.7 L390.4,394.5 L390.7,394.5 L390.7,395.3 L390.9,395.3 + L390.9,396.1 L391.1,396.1 L391.1,396.9 L391.3,396.9 L391.3,397.6 L391.5,397.6 L391.5,398.3 L391.7,398.3 + L391.7,399.0 L392.0,399.0 L392.0,399.7 L392.2,399.7 L392.2,400.4 L392.4,400.4 L392.4,401.1 L392.6,401.1 + L392.6,401.8 L392.8,401.8 L392.8,395.0 L393.0,395.0 L393.0,388.1 L393.3,388.1 L393.3,381.4 L393.5,381.4 + L393.5,374.8 L393.7,374.8 L393.7,368.3 L393.9,368.3 L393.9,362.0 L394.1,362.0 L394.1,355.7 L394.3,355.7 + L394.3,349.6 L394.6,349.6 L394.6,343.5 L394.8,343.5 L394.8,337.6 L395.0,337.6 L395.0,331.8 L395.2,331.8 + L395.2,326.1 L395.4,326.1 L395.4,320.5 L395.6,320.5 L395.6,315.0 L395.9,315.0 L395.9,309.6 L396.1,309.6 + L396.1,304.3 L396.3,304.3 L396.3,299.1 L396.5,299.1 L396.5,294.0 L396.7,294.0 L396.7,289.0 L397.0,289.0 + L397.0,284.0 L397.2,284.0 L397.2,279.2 L397.4,279.2 L397.4,274.4 L397.6,274.4 L397.6,269.8 L397.8,269.8 + L397.8,265.2 L398.0,265.2 L398.0,260.7 L398.3,260.7 L398.3,256.3 L398.5,256.3 L398.5,251.9 L398.7,251.9 + L398.7,247.7 L398.9,247.7 L398.9,243.5 L399.1,243.5 L399.1,239.4 L399.3,239.4 L399.3,235.4 L399.6,235.4 + L399.6,231.4 L399.8,231.4 L399.8,227.5 L400.0,227.5 L400.0,223.7 L400.2,223.7 L400.2,220.0 L400.4,220.0 + L400.4,216.3 L400.6,216.3 L400.6,212.7 L400.9,212.7 L400.9,209.1 L401.1,209.1 L401.1,205.6 L401.3,205.6 + L401.3,202.2 L401.5,202.2 L401.5,198.9 L401.7,198.9 L401.7,195.6 L401.9,195.6 L401.9,192.3 L402.2,192.3 + L402.2,189.1 L402.4,189.1 L402.4,186.0 L402.6,186.0 L402.6,183.0 L402.8,183.0 L402.8,179.9 L403.0,179.9 + L403.0,177.0 L403.2,177.0 L403.2,174.1 L403.5,174.1 L403.5,171.2 L403.7,171.2 L403.7,168.4 L403.9,168.4 + L403.9,165.7 L404.1,165.7 L404.1,163.0 L404.3,163.0 L404.3,160.4 L404.6,160.4 L404.6,157.8 L404.8,157.8 + L404.8,155.2 L405.0,155.2 L405.0,152.7 L405.2,152.7 L405.2,150.2 L405.4,150.2 L405.4,147.8 L405.6,147.8 + L405.6,145.4 L405.9,145.4 L405.9,143.1 L406.1,143.1 L406.1,140.8 L406.3,140.8 L406.3,138.6 L406.5,138.6 + L406.5,136.4 L406.7,136.4 L406.7,134.2 L406.9,134.2 L406.9,132.1 L407.2,132.1 L407.2,130.0 L407.4,130.0 + L407.4,127.9 L407.6,127.9 L407.6,125.9 L407.8,125.9 L407.8,123.9 L408.0,123.9 L408.0,122.0 L408.2,122.0 + L408.2,120.1 L408.5,120.1 L408.5,118.2 L408.7,118.2 L408.7,116.4 L408.9,116.4 L408.9,114.6 L409.1,114.6 + L409.1,112.8 L409.3,112.8 L409.3,111.1 L409.5,111.1 L409.5,109.4 L409.8,109.4 L409.8,107.7 L410.0,107.7 + L410.0,106.0 L410.2,106.0 L410.2,104.4 L410.4,104.4 L410.4,102.8 L410.6,102.8 L410.6,101.3 L410.8,101.3 + L410.8,99.7 L411.1,99.7 L411.1,98.2 L411.3,98.2 L411.3,96.8 L411.5,96.8 L411.5,95.3 L411.7,95.3 + L411.7,93.9 L411.9,93.9 L411.9,92.5 L412.2,92.5 L412.2,91.1 L412.4,91.1 L412.4,89.8 L412.6,89.8 + L412.6,88.5 L412.8,88.5 L412.8,87.2 L413.0,87.2 L413.0,85.9 L413.2,85.9 L413.2,84.6 L413.5,84.6 + L413.5,83.4 L413.7,83.4 L413.7,82.2 L413.9,82.2 L413.9,81.0 L414.1,81.0 L414.1,79.8 L414.3,79.8 + L414.3,78.7 L414.5,78.7 L414.5,77.6 L414.8,77.6 L414.8,76.5 L415.0,76.5 L415.0,75.4 L415.2,75.4 + L415.2,74.3 L415.4,74.3 L415.4,73.3 L415.6,73.3 L415.6,72.3 L415.8,72.3 L415.8,71.3 L416.1,71.3 + L416.1,70.3 L416.3,70.3 L416.3,69.3 L416.5,69.3 L416.5,68.3 L416.7,68.3 L416.7,67.4 L416.9,67.4 + L416.9,66.5 L417.1,66.5 L417.1,65.6 L417.4,65.6 L417.4,64.7 L417.6,64.7 L417.6,63.8 L417.8,63.8 + L417.8,63.0 L418.0,63.0 L418.0,62.1 L418.2,62.1 L418.2,61.3 L418.4,61.3 L418.4,60.5 L418.7,60.5 + L418.7,59.7 L418.9,59.7 L418.9,67.1 L419.1,67.1 L419.1,74.6 L419.3,74.6 L419.3,81.9 L419.5,81.9 + L419.5,89.1 L419.7,89.1 L419.7,96.1 L420.0,96.1 L420.0,103.0 L420.2,103.0 L420.2,109.7 L420.4,109.7 + L420.4,116.3 L420.6,116.3 L420.6,122.8 L420.8,122.8 L420.8,129.1 L421.1,129.1 L421.1,135.3 L421.3,135.3 + L421.3,141.4 L421.5,141.4 L421.5,147.3 L421.7,147.3 L421.7,153.1 L421.9,153.1 L421.9,158.9 L422.1,158.9 + L422.1,164.5 L422.4,164.5 L422.4,169.9 L422.6,169.9 L422.6,175.3 L422.8,175.3 L422.8,180.6 L423.0,180.6 + L423.0,185.7 L423.2,185.7 L423.2,190.8 L423.4,190.8 L423.4,195.7 L423.7,195.7 L423.7,200.6 L423.9,200.6 + L423.9,205.3 L424.1,205.3 L424.1,209.9 L424.3,209.9 L424.3,214.5 L424.5,214.5 L424.5,219.0 L424.7,219.0 + L424.7,223.3 L425.0,223.3 L425.0,227.6 L425.2,227.6 L425.2,231.8 L425.4,231.8 L425.4,235.9 L425.6,235.9 + L425.6,239.9 L425.8,239.9 L425.8,243.9 L426.0,243.9 L426.0,247.7 L426.3,247.7 L426.3,251.5 L426.5,251.5 + L426.5,255.2 L426.7,255.2 L426.7,258.9 L426.9,258.9 L426.9,262.4 L427.1,262.4 L427.1,265.9 L427.3,265.9 + L427.3,269.3 L427.6,269.3 L427.6,272.7 L427.8,272.7 L427.8,275.9 L428.0,275.9 L428.0,279.1 L428.2,279.1 + L428.2,282.3 L428.4,282.3 L428.4,285.4 L428.7,285.4 L428.7,288.4 L428.9,288.4 L428.9,291.3 L429.1,291.3 + L429.1,294.2 L429.3,294.2 L429.3,297.1 L429.5,297.1 L429.5,299.9 L429.7,299.9 L429.7,302.6 L430.0,302.6 + L430.0,305.2 L430.2,305.2 L430.2,307.8 L430.4,307.8 L430.4,310.4 L430.6,310.4 L430.6,312.9 L430.8,312.9 + L430.8,315.4 L431.0,315.4 L431.0,317.8 L431.3,317.8 L431.3,320.1 L431.5,320.1 L431.5,322.4 L431.7,322.4 + L431.7,324.7 L431.9,324.7 L431.9,326.9 L432.1,326.9 L432.1,329.1 L432.3,329.1 L432.3,331.2 L432.6,331.2 + L432.6,333.3 L432.8,333.3 L432.8,335.3 L433.0,335.3 L433.0,337.3 L433.2,337.3 L433.2,339.3 L433.4,339.3 + L433.4,341.2 L433.6,341.2 L433.6,343.1 L433.9,343.1 L433.9,344.9 L434.1,344.9 L434.1,346.7 L434.3,346.7 + L434.3,348.5 L434.5,348.5 L434.5,350.2 L434.7,350.2 L434.7,351.9 L434.9,351.9 L434.9,353.6 L435.2,353.6 + L435.2,355.2 L435.4,355.2 L435.4,356.8 L435.6,356.8 L435.6,358.3 L435.8,358.3 L435.8,359.9 L436.0,359.9 + L436.0,361.4 L436.3,361.4 L436.3,362.8 L436.5,362.8 L436.5,364.3 L436.7,364.3 L436.7,365.7 L436.9,365.7 + L436.9,367.1 L437.1,367.1 L437.1,368.4 L437.3,368.4 L437.3,369.7 L437.6,369.7 L437.6,371.0 L437.8,371.0 + L437.8,372.3 L438.0,372.3 L438.0,373.5 L438.2,373.5 L438.2,374.8 L438.4,374.8 L438.4,376.0 L438.6,376.0 + L438.6,377.1 L438.9,377.1 L438.9,378.3 L439.1,378.3 L439.1,379.4 L439.3,379.4 L439.3,380.5 L439.5,380.5 + L439.5,381.6 L439.7,381.6 L439.7,382.6 L439.9,382.6 L439.9,383.7 L440.2,383.7 L440.2,384.7 L440.4,384.7 + L440.4,385.7 L440.6,385.7 L440.6,386.6 L440.8,386.6 L440.8,387.6 L441.0,387.6 L441.0,388.5 L441.2,388.5 + L441.2,389.4 L441.5,389.4 L441.5,390.3 L441.7,390.3 L441.7,391.2 L441.9,391.2 L441.9,392.1 L442.1,392.1 + L442.1,392.9 L442.3,392.9 L442.3,393.7 L442.5,393.7 L442.5,394.5 L442.8,394.5 L442.8,395.3 L443.0,395.3 + L443.0,396.1 L443.2,396.1 L443.2,396.9 L443.4,396.9 L443.4,397.6 L443.6,397.6 L443.6,398.3 L443.9,398.3 + L443.9,399.0 L444.1,399.0 L444.1,399.7 L444.3,399.7 L444.3,400.4 L444.5,400.4 L444.5,401.1 L444.7,401.1 + L444.7,401.8 L444.9,401.8 L444.9,395.0 L445.2,395.0 L445.2,388.2 L445.4,388.2 L445.4,381.4 L445.6,381.4 + L445.6,374.8 L445.8,374.8 L445.8,368.3 L446.0,368.3 L446.0,362.0 L446.2,362.0 L446.2,355.7 L446.5,355.7 + L446.5,349.6 L446.7,349.6 L446.7,343.6 L446.9,343.6 L446.9,337.6 L447.1,337.6 L447.1,331.8 L447.3,331.8 + L447.3,326.1 L447.5,326.1 L447.5,320.5 L447.8,320.5 L447.8,315.0 L448.0,315.0 L448.0,309.6 L448.2,309.6 + L448.2,304.3 L448.4,304.3 L448.4,299.1 L448.6,299.1 L448.6,294.0 L448.8,294.0 L448.8,289.0 L449.1,289.0 + L449.1,284.1 L449.3,284.1 L449.3,279.2 L449.5,279.2 L449.5,274.5 L449.7,274.5 L449.7,269.8 L449.9,269.8 + L449.9,265.2 L450.1,265.2 L450.1,260.7 L450.4,260.7 L450.4,256.3 L450.6,256.3 L450.6,252.0 L450.8,252.0 + L450.8,247.7 L451.0,247.7 L451.0,243.5 L451.2,243.5 L451.2,239.4 L451.4,239.4 L451.4,235.4 L451.7,235.4 + L451.7,231.4 L451.9,231.4 L451.9,227.5 L452.1,227.5 L452.1,223.7 L452.3,223.7 L452.3,220.0 L452.5,220.0 + L452.5,216.3 L452.8,216.3 L452.8,212.7 L453.0,212.7 L453.0,209.1 L453.2,209.1 L453.2,205.7 L453.4,205.7 + L453.4,202.2 L453.6,202.2 L453.6,198.9 L453.8,198.9 L453.8,195.6 L454.1,195.6 L454.1,192.3 L454.3,192.3 + L454.3,189.2 L454.5,189.2 L454.5,186.0 L454.7,186.0 L454.7,183.0 L454.9,183.0 L454.9,180.0 L455.1,180.0 + L455.1,177.0 L455.4,177.0 L455.4,174.1 L455.6,174.1 L455.6,171.3 L455.8,171.3 L455.8,168.5 L456.0,168.5 + L456.0,165.7 L456.2,165.7 L456.2,163.0 L456.4,163.0 L456.4,160.4 L456.7,160.4 L456.7,157.8 L456.9,157.8 + L456.9,155.2 L457.1,155.2 L457.1,152.7 L457.3,152.7 L457.3,150.2 L457.5,150.2 L457.5,147.8 L457.7,147.8 + L457.7,145.4 L458.0,145.4 L458.0,143.1 L458.2,143.1 L458.2,140.8 L458.4,140.8 L458.4,138.6 L458.6,138.6 + L458.6,136.4 L458.8,136.4 L458.8,134.2 L459.0,134.2 L459.0,132.1 L459.3,132.1 L459.3,130.0 L459.5,130.0 + L459.5,127.9 L459.7,127.9 L459.7,125.9 L459.9,125.9 L459.9,124.0 L460.1,124.0 L460.1,122.0 L460.4,122.0 + L460.4,120.1 L460.6,120.1 L460.6,118.2 L460.8,118.2 L460.8,116.4 L461.0,116.4 L461.0,114.6 L461.2,114.6 + L461.2,112.8 L461.4,112.8 L461.4,111.1 L461.7,111.1 L461.7,109.4 L461.9,109.4 L461.9,107.7 L462.1,107.7 + L462.1,106.0 L462.3,106.0 L462.3,104.4 L462.5,104.4 L462.5,102.8 L462.7,102.8 L462.7,101.3 L463.0,101.3 + L463.0,99.7 L463.2,99.7 L463.2,98.2 L463.4,98.2 L463.4,96.8 L463.6,96.8 L463.6,95.3 L463.8,95.3 + L463.8,93.9 L464.0,93.9 L464.0,92.5 L464.3,92.5 L464.3,91.1 L464.5,91.1 L464.5,89.8 L464.7,89.8 + L464.7,88.5 L464.9,88.5 L464.9,87.2 L465.1,87.2 L465.1,85.9 L465.3,85.9 L465.3,84.6 L465.6,84.6 + L465.6,83.4 L465.8,83.4 L465.8,82.2 L466.0,82.2 L466.0,81.0 L466.2,81.0 L466.2,79.8 L466.4,79.8 + L466.4,78.7 L466.6,78.7 L466.6,77.6 L466.9,77.6 L466.9,76.5 L467.1,76.5 L467.1,75.4 L467.3,75.4 + L467.3,74.3 L467.5,74.3 L467.5,73.3 L467.7,73.3 L467.7,72.3 L468.0,72.3 L468.0,71.3 L468.2,71.3 + L468.2,70.3 L468.4,70.3 L468.4,69.3 L468.6,69.3 L468.6,68.3 L468.8,68.3 L468.8,67.4 L469.0,67.4 + L469.0,66.5 L469.3,66.5 L469.3,65.6 L469.5,65.6 L469.5,64.7 L469.7,64.7 L469.7,63.8 L469.9,63.8 + L469.9,63.0 L470.1,63.0 L470.1,62.1 L470.3,62.1 L470.3,61.3 L470.6,61.3 L470.6,60.5 L470.8,60.5 + L470.8,59.7 L471.0,59.7 L471.0,67.1 L471.2,67.1 L471.2,74.6 L471.4,74.6 L471.4,81.9 L471.6,81.9 + L471.6,89.0 L471.9,89.0 L471.9,96.1 L472.1,96.1 L472.1,102.9 L472.3,102.9 L472.3,109.7 L472.5,109.7 + L472.5,116.3 L472.7,116.3 L472.7,122.7 L472.9,122.7 L472.9,129.1 L473.2,129.1 L473.2,135.3 L473.4,135.3 + L473.4,141.3 L473.6,141.3 L473.6,147.3 L473.8,147.3 L473.8,153.1 L474.0,153.1 L474.0,158.8 L474.2,158.8 + L474.2,164.4 L474.5,164.4 L474.5,169.9 L474.7,169.9 L474.7,175.3 L474.9,175.3 L474.9,180.5 L475.1,180.5 + L475.1,185.7 L475.3,185.7 L475.3,190.7 L475.6,190.7 L475.6,195.7 L475.8,195.7 L475.8,200.5 L476.0,200.5 + L476.0,205.3 L476.2,205.3 L476.2,209.9 L476.4,209.9 L476.4,214.5 L476.6,214.5 L476.6,218.9 L476.9,218.9 + L476.9,223.3 L477.1,223.3 L477.1,227.6 L477.3,227.6 L477.3,231.8 L477.5,231.8 L477.5,235.9 L477.7,235.9 + L477.7,239.9 L477.9,239.9 L477.9,243.9 L478.2,243.9 L478.2,247.7 L478.4,247.7 L478.4,251.5 L478.6,251.5 + L478.6,255.2 L478.8,255.2 L478.8,258.9 L479.0,258.9 L479.0,262.4 L479.2,262.4 L479.2,265.9 L479.5,265.9 + L479.5,269.3 L479.7,269.3 L479.7,272.7 L479.9,272.7 L479.9,275.9 L480.1,275.9 L480.1,279.1 L480.3,279.1 + L480.3,282.3 L480.5,282.3 L480.5,285.4 L480.8,285.4 L480.8,288.4 L481.0,288.4 L481.0,291.3 L481.2,291.3 + L481.2,294.2 L481.4,294.2 L481.4,297.1 L481.6,297.1 L481.6,299.8 L481.8,299.8 L481.8,302.6 L482.1,302.6 + L482.1,305.2 L482.3,305.2 L482.3,307.8 L482.5,307.8 L482.5,310.4 L482.7,310.4 L482.7,312.9 L482.9,312.9 + L482.9,315.4 L483.1,315.4 L483.1,317.8 L483.4,317.8 L483.4,320.1 L483.6,320.1 L483.6,322.4 L483.8,322.4 + L483.8,324.7 L484.0,324.7 L484.0,326.9 L484.2,326.9 L484.2,329.1 L484.5,329.1 L484.5,331.2 L484.7,331.2 + L484.7,333.3 L484.9,333.3 L484.9,335.3 L485.1,335.3 L485.1,337.3 L485.3,337.3 L485.3,339.3 L485.5,339.3 + L485.5,341.2 L485.8,341.2 L485.8,343.1 L486.0,343.1 L486.0,344.9 L486.2,344.9 L486.2,346.7 L486.4,346.7 + L486.4,348.5 L486.6,348.5 L486.6,350.2 L486.8,350.2 L486.8,351.9 L487.1,351.9 L487.1,353.6 L487.3,353.6 + L487.3,355.2 L487.5,355.2 L487.5,356.8 L487.7,356.8 L487.7,358.3 L487.9,358.3 L487.9,359.9 L488.1,359.9 + L488.1,361.4 L488.4,361.4 L488.4,362.8 L488.6,362.8 L488.6,364.3 L488.8,364.3 L488.8,365.7 L489.0,365.7 + L489.0,367.1 L489.2,367.1 L489.2,368.4 L489.4,368.4 L489.4,369.7 L489.7,369.7 L489.7,371.0 L489.9,371.0 + L489.9,372.3 L490.1,372.3 L490.1,373.5 L490.3,373.5 L490.3,374.8 L490.5,374.8 L490.5,376.0 L490.7,376.0 + L490.7,377.1 L491.0,377.1 L491.0,378.3 L491.2,378.3 L491.2,379.4 L491.4,379.4 L491.4,380.5 L491.6,380.5 + L491.6,381.6 L491.8,381.6 L491.8,382.6 L492.1,382.6 L492.1,383.7 L492.3,383.7 L492.3,384.7 L492.5,384.7 + L492.5,385.7 L492.7,385.7 L492.7,386.6 L492.9,386.6 L492.9,387.6 L493.1,387.6 L493.1,388.5 L493.4,388.5 + L493.4,389.4 L493.6,389.4 L493.6,390.3 L493.8,390.3 L493.8,391.2 L494.0,391.2 L494.0,392.1 L494.2,392.1 + L494.2,392.9 L494.4,392.9 L494.4,393.7 L494.7,393.7 L494.7,394.5 L494.9,394.5 L494.9,395.3 L495.1,395.3 + L495.1,396.1 L495.3,396.1 L495.3,396.9 L495.5,396.9 L495.5,397.6 L495.7,397.6 L495.7,398.3 L496.0,398.3 + L496.0,399.0 L496.2,399.0 L496.2,399.7 L496.4,399.7 L496.4,400.4 L496.6,400.4 L496.6,401.1 L496.8,401.1 + L496.8,401.8 L497.0,401.8 L497.0,395.0 L497.3,395.0 L497.3,388.2 L497.5,388.2 L497.5,381.5 L497.7,381.5 + L497.7,374.9 L497.9,374.9 L497.9,368.4 L498.1,368.4 L498.1,362.0 L498.3,362.0 L498.3,355.8 L498.6,355.8 + L498.6,349.6 L498.8,349.6 L498.8,343.6 L499.0,343.6 L499.0,337.7 L499.2,337.7 L499.2,331.9 L499.4,331.9 + L499.4,326.2 L499.7,326.2 L499.7,320.6 L499.9,320.6 L499.9,315.1 L500.1,315.1 L500.1,309.7 L500.3,309.7 + L500.3,304.3 L500.5,304.3 L500.5,299.1 L500.7,299.1 L500.7,294.0 L501.0,294.0 L501.0,289.0 L501.2,289.0 + L501.2,284.1 L501.4,284.1 L501.4,279.2 L501.6,279.2 L501.6,274.5 L501.8,274.5 L501.8,269.8 L502.0,269.8 + L502.0,265.2 L502.3,265.2 L502.3,260.7 L502.5,260.7 L502.5,256.3 L502.7,256.3 L502.7,252.0 L502.9,252.0 + L502.9,247.7 L503.1,247.7 L503.1,243.5 L503.3,243.5 L503.3,239.4 L503.6,239.4 L503.6,235.4 L503.8,235.4 + L503.8,231.4 L504.0,231.4 L504.0,227.6 L504.2,227.6 L504.2,223.7 L504.4,223.7 L504.4,220.0 L504.6,220.0 + L504.6,216.3 L504.9,216.3 L504.9,212.7 L505.1,212.7 L505.1,209.1 L505.3,209.1 L505.3,205.7 L505.5,205.7 + L505.5,202.2 L505.7,202.2 L505.7,198.9 L505.9,198.9 L505.9,195.6 L506.2,195.6 L506.2,192.3 L506.4,192.3 + L506.4,189.2 L506.6,189.2 L506.6,186.0 L506.8,186.0 L506.8,183.0 L507.0,183.0 L507.0,180.0 L507.2,180.0 + L507.2,177.0 L507.5,177.0 L507.5,174.1 L507.7,174.1 L507.7,171.3 L507.9,171.3 L507.9,168.5 L508.1,168.5 + L508.1,165.7 L508.3,165.7 L508.3,163.0 L508.6,163.0 L508.6,160.4 L508.8,160.4 L508.8,157.8 L509.0,157.8 + L509.0,155.2 L509.2,155.2 L509.2,152.7 L509.4,152.7 L509.4,150.2 L509.6,150.2 L509.6,147.8 L509.9,147.8 + L509.9,145.5 L510.1,145.5 L510.1,143.1 L510.3,143.1 L510.3,140.8 L510.5,140.8 L510.5,138.6 L510.7,138.6 + L510.7,136.4 L510.9,136.4 L510.9,134.2 L511.2,134.2 L511.2,132.1 L511.4,132.1 L511.4,130.0 L511.6,130.0 + L511.6,127.9 L511.8,127.9 L511.8,125.9 L512.0,125.9 L512.0,124.0 L512.2,124.0 L512.2,122.0 L512.5,122.0 + L512.5,120.1 L512.7,120.1 L512.7,118.2 L512.9,118.2 L512.9,116.4 L513.1,116.4 L513.1,114.6 L513.3,114.6 + L513.3,112.8 L513.5,112.8 L513.5,111.1 L513.8,111.1 L513.8,109.4 L514.0,109.4 L514.0,107.7 L514.2,107.7 + L514.2,106.0 L514.4,106.0 L514.4,104.4 L514.6,104.4 L514.6,102.8 L514.8,102.8 L514.8,101.3 L515.1,101.3 + L515.1,99.8 L515.3,99.8 L515.3,98.2 L515.5,98.2 L515.5,96.8 L515.7,96.8 L515.7,95.3 L515.9,95.3 + L515.9,93.9 L516.2,93.9 L516.2,92.5 L516.4,92.5 L516.4,91.1 L516.6,91.1 L516.6,89.8 L516.8,89.8 + L516.8,88.5 L517.0,88.5 L517.0,87.2 L517.2,87.2 L517.2,85.9 L517.5,85.9 L517.5,84.6 L517.7,84.6 + L517.7,83.4 L517.9,83.4 L517.9,82.2 L518.1,82.2 L518.1,81.0 L518.3,81.0 L518.3,79.8 L518.5,79.8 + L518.5,78.7 L518.8,78.7 L518.8,77.6 L519.0,77.6 L519.0,76.5 L519.2,76.5 L519.2,75.4 L519.4,75.4 + L519.4,74.3 L519.6,74.3 L519.6,73.3 L519.8,73.3 L519.8,72.3 L520.1,72.3 L520.1,71.3 L520.3,71.3 + L520.3,70.3 L520.5,70.3 L520.5,69.3 L520.7,69.3 L520.7,68.4 L520.9,68.4 L520.9,67.4 L521.1,67.4 + L521.1,66.5 L521.4,66.5 L521.4,65.6 L521.6,65.6 L521.6,64.7 L521.8,64.7 L521.8,63.8 L522.0,63.8 + L522.0,63.0 L522.2,63.0 L522.2,62.2 L522.4,62.2 L522.4,61.3 L522.7,61.3 L522.7,60.5 L522.9,60.5 + L522.9,59.7 L523.1,59.7 L523.1,67.1 L523.3,67.1 L523.3,74.5 L523.5,74.5 L523.5,81.8 L523.8,81.8 + L523.8,89.0 L524.0,89.0 L524.0,96.0 L524.2,96.0 L524.2,102.9 L524.4,102.9 L524.4,109.6 L524.6,109.6 + L524.6,116.2 L524.8,116.2 L524.8,122.7 L525.1,122.7 L525.1,129.0 L525.3,129.0 L525.3,135.2 L525.5,135.2 + L525.5,141.3 L525.7,141.3 L525.7,147.3 L525.9,147.3 L525.9,153.1 L526.1,153.1 L526.1,158.8 L526.4,158.8 + L526.4,164.4 L526.6,164.4 L526.6,169.9 L526.8,169.9 L526.8,175.3 L527.0,175.3 L527.0,180.5 L527.2,180.5 + L527.2,185.7 L527.4,185.7 L527.4,190.7 L527.7,190.7 L527.7,195.7 L527.9,195.7 L527.9,200.5 L528.1,200.5 + L528.1,205.3 L528.3,205.3 L528.3,209.9 L528.5,209.9 L528.5,214.5 L528.7,214.5 L528.7,218.9 L529.0,218.9 + L529.0,223.3 L529.2,223.3 L529.2,227.6 L529.4,227.6 L529.4,231.8 L529.6,231.8 L529.6,235.9 L529.8,235.9 + L529.8,239.9 L530.0,239.9 L530.0,243.9 L530.3,243.9 L530.3,247.7 L530.5,247.7 L530.5,251.5 L530.7,251.5 + L530.7,255.2 L530.9,255.2 L530.9,258.8 L531.1,258.8 L531.1,262.4 L531.4,262.4 L531.4,265.9 L531.6,265.9 + L531.6,269.3 L531.8,269.3 L531.8,272.6 L532.0,272.6 L532.0,275.9 L532.2,275.9 L532.2,279.1 L532.4,279.1 + L532.4,282.3 L532.7,282.3 L532.7,285.3 L532.9,285.3 L532.9,288.4 L533.1,288.4 L533.1,291.3 L533.3,291.3 + L533.3,294.2 L533.5,294.2 L533.5,297.1 L533.7,297.1 L533.7,299.8 L534.0,299.8 L534.0,302.6 L534.2,302.6 + L534.2,305.2 L534.4,305.2 L534.4,307.8 L534.6,307.8 L534.6,310.4 L534.8,310.4 L534.8,312.9 L535.0,312.9 + L535.0,315.3 L535.3,315.3 L535.3,317.8 L535.5,317.8 L535.5,320.1 L535.7,320.1 L535.7,322.4 L535.9,322.4 + L535.9,324.7 L536.1,324.7 L536.1,326.9 L536.3,326.9 L536.3,329.1 L536.6,329.1 L536.6,331.2 L536.8,331.2 + L536.8,333.3 L537.0,333.3 L537.0,335.3 L537.2,335.3 L537.2,337.3 L537.4,337.3 L537.4,339.3 L537.6,339.3 + L537.6,341.2 L537.9,341.2 L537.9,343.1 L538.1,343.1 L538.1,344.9 L538.3,344.9 L538.3,346.7 L538.5,346.7 + L538.5,348.5 L538.7,348.5 L538.7,350.2 L538.9,350.2 L538.9,351.9 L539.2,351.9 L539.2,353.6 L539.4,353.6 + L539.4,355.2 L539.6,355.2 L539.6,356.8 L539.8,356.8 L539.8,358.3 L540.0,358.3 L540.0,359.9 L540.3,359.9 + L540.3,361.4 L540.5,361.4 L540.5,362.8 L540.7,362.8 L540.7,364.3 L540.9,364.3 L540.9,365.7 L541.1,365.7 + L541.1,367.1 L541.3,367.1 L541.3,368.4 L541.6,368.4 L541.6,369.7 L541.8,369.7 L541.8,371.0 L542.0,371.0 + L542.0,372.3 L542.2,372.3 L542.2,373.5 L542.4,373.5 L542.4,374.8 L542.6,374.8 L542.6,376.0 L542.9,376.0 + L542.9,377.1 L543.1,377.1 L543.1,378.3 L543.3,378.3 L543.3,379.4 L543.5,379.4 L543.5,380.5 L543.7,380.5 + L543.7,381.6 L543.9,381.6 L543.9,382.6 L544.2,382.6 L544.2,383.7 L544.4,383.7 L544.4,384.7 L544.6,384.7 + L544.6,385.7 L544.8,385.7 L544.8,386.6 L545.0,386.6 L545.0,387.6 L545.2,387.6 L545.2,388.5 L545.5,388.5 + L545.5,389.4 L545.7,389.4 L545.7,390.3 L545.9,390.3 L545.9,391.2 L546.1,391.2 L546.1,392.1 L546.3,392.1 + L546.3,392.9 L546.5,392.9 L546.5,393.7 L546.8,393.7 L546.8,394.5 L547.0,394.5 L547.0,395.3 L547.2,395.3 + L547.2,396.1 L547.4,396.1 L547.4,396.9 L547.6,396.9 L547.6,397.6 L547.9,397.6 L547.9,398.3 L548.1,398.3 + L548.1,399.0 L548.3,399.0 L548.3,399.7 L548.5,399.7 L548.5,400.4 L548.7,400.4 L548.7,401.1 L548.9,401.1 + L548.9,401.8 L549.2,401.8 L549.2,395.1 L549.4,395.1 L549.4,388.2 L549.6,388.2 L549.6,381.5 L549.8,381.5 + L549.8,374.9 L550.0,374.9 L550.0,368.4 L550.2,368.4 L550.2,362.0 L550.5,362.0 L550.5,355.8 L550.7,355.8 + L550.7,349.6 L550.9,349.6 L550.9,343.6 L551.1,343.6 L551.1,337.7 L551.3,337.7 L551.3,331.9 L551.5,331.9 + L551.5,326.2 L551.8,326.2 L551.8,320.6 L552.0,320.6 L552.0,315.1 L552.2,315.1 L552.2,309.7 L552.4,309.7 + L552.4,304.4 L552.6,304.4 L552.6,299.2 L552.8,299.2 L552.8,294.0 L553.1,294.0 L553.1,289.0 L553.3,289.0 + L553.3,284.1 L553.5,284.1 L553.5,279.3 L553.7,279.3 L553.7,274.5 L553.9,274.5 L553.9,269.8 L554.1,269.8 + L554.1,265.3 L554.4,265.3 L554.4,260.8 L554.6,260.8 L554.6,256.3 L554.8,256.3 L554.8,252.0 L555.0,252.0 + L555.0,247.7 L555.2,247.7 L555.2,243.6 L555.5,243.6 L555.5,239.4 L555.7,239.4 L555.7,235.4 L555.9,235.4 + L555.9,231.5 L556.1,231.5 L556.1,227.6 L556.3,227.6 L556.3,223.8 L556.5,223.8 L556.5,220.0 L556.8,220.0 + L556.8,216.3 L557.0,216.3 L557.0,212.7 L557.2,212.7 L557.2,209.2 L557.4,209.2 L557.4,205.7 L557.6,205.7 + L557.6,202.3 L557.8,202.3 L557.8,198.9 L558.1,198.9 L558.1,195.6 L558.3,195.6 L558.3,192.4 L558.5,192.4 + L558.5,189.2 L558.7,189.2 L558.7,186.1 L558.9,186.1 L558.9,183.0 L559.1,183.0 L559.1,180.0 L559.4,180.0 + L559.4,177.0 L559.6,177.0 L559.6,174.1 L559.8,174.1 L559.8,171.3 L560.0,171.3 L560.0,168.5 L560.2,168.5 + L560.2,165.7 L560.4,165.7 L560.4,163.0 L560.7,163.0 L560.7,160.4 L560.9,160.4 L560.9,157.8 L561.1,157.8 + L561.1,155.2 L561.3,155.2 L561.3,152.7 L561.5,152.7 L561.5,150.3 L561.7,150.3 L561.7,147.8 L562.0,147.8 + L562.0,145.5 L562.2,145.5 L562.2,143.1 L562.4,143.1 L562.4,140.8 L562.6,140.8 L562.6,138.6 L562.8,138.6 + L562.8,136.4 L563.1,136.4 L563.1,134.2 L563.3,134.2 L563.3,132.1 L563.5,132.1 L563.5,130.0 L563.7,130.0 + L563.7,128.0 L563.9,128.0 L563.9,125.9 L564.1,125.9 L564.1,124.0 L564.4,124.0 L564.4,122.0 L564.6,122.0 + L564.6,120.1 L564.8,120.1 L564.8,118.2 L565.0,118.2 L565.0,116.4 L565.2,116.4 L565.2,114.6 L565.4,114.6 + L565.4,112.8 L565.7,112.8 L565.7,111.1 L565.9,111.1 L565.9,109.4 L566.1,109.4 L566.1,107.7 L566.3,107.7 + L566.3,106.1 L566.5,106.1 L566.5,104.4 L566.7,104.4 L566.7,102.9 L567.0,102.9 L567.0,101.3 L567.2,101.3 + L567.2,99.8 L567.4,99.8 L567.4,98.3 L567.6,98.3 L567.6,96.8 L567.8,96.8 L567.8,95.3 L568.0,95.3 + L568.0,93.9 L568.3,93.9 L568.3,92.5 L568.5,92.5 L568.5,91.1 L568.7,91.1 L568.7,89.8 L568.9,89.8 + L568.9,88.5 L569.1,88.5 L569.1,87.2 L569.3,87.2 L569.3,85.9 L569.6,85.9 L569.6,84.6 L569.8,84.6 + L569.8,83.4 L570.0,83.4 L570.0,82.2 L570.2,82.2 L570.2,81.0 L570.4,81.0 L570.4,79.9 L570.6,79.9 + L570.6,78.7 L570.9,78.7 L570.9,77.6 L571.1,77.6 L571.1,76.5 L571.3,76.5 L571.3,75.4 L571.5,75.4 + L571.5,74.3 L571.7,74.3 L571.7,73.3 L572.0,73.3 L572.0,72.3 L572.2,72.3 L572.2,71.3 L572.4,71.3 + L572.4,70.3 L572.6,70.3 L572.6,69.3 L572.8,69.3 L572.8,68.4 L573.0,68.4 L573.0,67.4 L573.3,67.4 + L573.3,66.5 L573.5,66.5 L573.5,65.6 L573.7,65.6 L573.7,64.7 L573.9,64.7 L573.9,63.8 L574.1,63.8 + L574.1,63.0 L574.3,63.0 L574.3,62.2 L574.6,62.2 L574.6,61.3 L574.8,61.3 L574.8,60.5 L575.0,60.5 + L575.0,59.7 '/></g> + </g> + <g id="gnuplot_plot_2" ><title>gnuplot_plot_2</title> +<g style="fill:none; color:green; stroke:currentColor; stroke-width:1.00; stroke-linecap:butt; stroke-linejoin:miter"> + <g transform="translate(507.9,57.2)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:end"> + <text>I</text> + </g> + <path d='M516.2,52.7 L558.4,52.7 M53.9,444.0 L53.9,433.3 L80.0,433.3 L80.0,16.7 L106.0,16.7 L106.0,433.3 + L132.1,433.3 L132.1,16.7 L158.1,16.7 L158.1,433.3 L184.2,433.3 L184.2,16.7 L210.2,16.7 L210.2,433.3 + L236.3,433.3 L236.3,16.7 L262.3,16.7 L262.3,433.3 L288.4,433.3 L288.4,16.7 L314.5,16.7 L314.5,433.3 + L340.5,433.3 L340.5,16.7 L366.6,16.7 L366.6,433.3 L392.6,433.3 L392.6,16.7 L418.7,16.7 L418.7,433.3 + L444.7,433.3 L444.7,16.7 L470.8,16.7 L470.8,433.3 L496.8,433.3 L496.8,16.7 L522.9,16.7 L522.9,433.3 + L548.9,433.3 L548.9,16.7 '/></g> + </g> +<g style="fill:none; color:black; stroke:currentColor; stroke-width:1.00; stroke-linecap:butt; stroke-linejoin:miter"> + <path stroke='black' d='M53.9,16.7 L53.9,444.0 L575.0,444.0 L575.0,16.7 L53.9,16.7 Z '/></g> +</g> +</svg> + diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp index 7b171e851ed..c4d402ff3ee 100644 --- a/src/lib/netlist/nl_base.cpp +++ b/src/lib/netlist/nl_base.cpp @@ -18,18 +18,20 @@ namespace netlist { -#if (NL_USE_MEMPOOL) -static plib::mempool p(65536, 8); +namespace detail +{ +#if (USE_MEMPOOL) +static plib::mempool pool(65536, 8); void * object_t::operator new (size_t size) { - return p.alloc(size); + return pool.alloc(size); } void object_t::operator delete (void * mem) { if (mem) - p.free(mem); + pool.free(mem); } #else void * object_t::operator new (size_t size) @@ -44,6 +46,8 @@ void object_t::operator delete (void * mem) } #endif +} + // ---------------------------------------------------------------------------------------- // logic_family_ttl_t // ---------------------------------------------------------------------------------------- @@ -101,7 +105,7 @@ const logic_family_desc_t *family_CD4XXX() // queue_t // ---------------------------------------------------------------------------------------- -queue_t::queue_t(netlist_t &nl) +detail::queue_t::queue_t(netlist_t &nl) : timed_queue<net_t *, netlist_time>(512) , object_t("QUEUE") , netlist_ref(nl) @@ -112,7 +116,7 @@ queue_t::queue_t(netlist_t &nl) { } -void queue_t::register_state(plib::state_manager_t &manager, const pstring &module) +void detail::queue_t::register_state(plib::state_manager_t &manager, const pstring &module) { netlist().log().debug("register_state\n"); manager.save_item(this, m_qsize, module + "." + "qsize"); @@ -120,30 +124,30 @@ void queue_t::register_state(plib::state_manager_t &manager, const pstring &modu manager.save_item(this, &(m_names[0].m_buf[0]), module + "." + "names", m_names.size() * sizeof(names_t)); } -void queue_t::on_pre_save() +void detail::queue_t::on_pre_save() { netlist().log().debug("on_pre_save\n"); m_qsize = this->size(); netlist().log().debug("current time {1} qsize {2}\n", netlist().time().as_double(), m_qsize); - for (int i = 0; i < m_qsize; i++ ) + for (std::size_t i = 0; i < m_qsize; i++ ) { m_times[i] = this->listptr()[i].m_exec_time.as_raw(); pstring p = this->listptr()[i].m_object->name(); - int n = p.len(); - n = std::min(63, n); + std::size_t n = p.len(); + if (n > 63) n = 63; std::strncpy(m_names[i].m_buf, p.cstr(), n); m_names[i].m_buf[n] = 0; } } -void queue_t::on_post_load() +void detail::queue_t::on_post_load() { this->clear(); netlist().log().debug("current time {1} qsize {2}\n", netlist().time().as_double(), m_qsize); - for (int i = 0; i < m_qsize; i++ ) + for (std::size_t i = 0; i < m_qsize; i++ ) { - net_t *n = netlist().find_net(m_names[i].m_buf); + detail::net_t *n = netlist().find_net(m_names[i].m_buf); //log().debug("Got {1} ==> {2}\n", qtemp[i].m_name, n)); //log().debug("schedule time {1} ({2})\n", n->time().as_double(), netlist_time::from_raw(m_times[i]).as_double())); this->push(netlist_time::from_raw(m_times[i]), n); @@ -154,16 +158,16 @@ void queue_t::on_post_load() // object_t // ---------------------------------------------------------------------------------------- -object_t::object_t(const pstring &aname) +detail::object_t::object_t(const pstring &aname) : m_name(aname) { } -object_t::~object_t() +detail::object_t::~object_t() { } -const pstring &object_t::name() const +const pstring &detail::object_t::name() const { return m_name; } @@ -172,7 +176,7 @@ const pstring &object_t::name() const // device_object_t // ---------------------------------------------------------------------------------------- -device_object_t::device_object_t(core_device_t &dev, const pstring &aname, const type_t atype) +detail::device_object_t::device_object_t(core_device_t &dev, const pstring &aname, const type_t atype) : object_t(aname) , m_device(dev) , m_type(atype) @@ -227,6 +231,60 @@ void netlist_t::start() { /* load the library ... */ + /* make sure the solver and parameters are started first! */ + + for (auto & e : setup().m_device_factory) + { + if ( setup().factory().is_class<devices::NETLIB_NAME(mainclock)>(e.second) + || setup().factory().is_class<devices::NETLIB_NAME(solver)>(e.second) + || setup().factory().is_class<devices::NETLIB_NAME(gnd)>(e.second) + || setup().factory().is_class<devices::NETLIB_NAME(netlistparams)>(e.second)) + { + auto dev = plib::owned_ptr<device_t>(e.second->Create(*this, e.first)); + register_dev(std::move(dev)); + } + } + + log().debug("Searching for mainclock and solver ...\n"); + + m_mainclock = get_single_device<devices::NETLIB_NAME(mainclock)>("mainclock"); + m_solver = get_single_device<devices::NETLIB_NAME(solver)>("solver"); + m_gnd = get_single_device<devices::NETLIB_NAME(gnd)>("gnd"); + m_params = get_single_device<devices::NETLIB_NAME(netlistparams)>("parameter"); + + /* create devices */ + + for (auto & e : setup().m_device_factory) + { + if ( !setup().factory().is_class<devices::NETLIB_NAME(mainclock)>(e.second) + && !setup().factory().is_class<devices::NETLIB_NAME(solver)>(e.second) + && !setup().factory().is_class<devices::NETLIB_NAME(gnd)>(e.second) + && !setup().factory().is_class<devices::NETLIB_NAME(netlistparams)>(e.second)) + { + auto dev = plib::owned_ptr<device_t>(e.second->Create(*this, e.first)); + register_dev(std::move(dev)); + } + } + + bool use_deactivate = (m_params->m_use_deactivate() ? true : false); + + for (auto &d : m_devices) + { + if (use_deactivate) + { + auto p = setup().m_param_values.find(d->name() + ".HINT_NO_DEACTIVATE"); + if (p != setup().m_param_values.end()) + { + //FIXME: Error checking + auto v = p->second.as_long(); + d->set_hint_deactivate(!v); + } + } + else + d->set_hint_deactivate(false); + } + + pstring libpath = plib::util::environment("NL_BOOSTLIB", plib::util::buildpath({".", "nlboost.so"})); m_lib = plib::palloc<plib::dynlib>(libpath); @@ -243,7 +301,7 @@ void netlist_t::stop() dev->stop_dev(); } -net_t *netlist_t::find_net(const pstring &name) +detail::net_t *netlist_t::find_net(const pstring &name) { for (auto & net : m_nets) if (net->name() == name) @@ -291,8 +349,9 @@ void netlist_t::reset() * It is however not acceptable that this depends on the startup order. * Best would be, if reset would call update_dev for devices which need it. */ - for (int i = m_devices.size() - 1; i >= 0; i--) - m_devices[i]->update_dev(); + std::size_t i = m_devices.size(); + while (i>0) + m_devices[--i]->update_dev(); #endif } @@ -307,7 +366,7 @@ void netlist_t::process_queue(const netlist_time &delta) if (m_mainclock == nullptr) { - queue_t::entry_t e(m_queue.pop()); + detail::queue_t::entry_t e(m_queue.pop()); m_time = e.m_exec_time; while (e.m_object != nullptr) { @@ -333,7 +392,7 @@ void netlist_t::process_queue(const netlist_time &delta) mc_net.update_devs(); } - const queue_t::entry_t e(m_queue.pop()); + const detail::queue_t::entry_t e(m_queue.pop()); m_time = e.m_exec_time; if (e.m_object == nullptr) break; @@ -379,7 +438,9 @@ void netlist_t::print_stats() const } overhead.stop(); - uint_least64_t total_overhead = (uint_least64_t) overhead()*(uint_least64_t)total_count/(uint_least64_t)200000; + nperftime_t::type total_overhead = overhead() + * static_cast<nperftime_t::type>(total_count) + / static_cast<nperftime_t::type>(200000); log().verbose("Queue Pushes {1:15}", queue().m_prof_call()); log().verbose("Queue Moves {1:15}", queue().m_prof_sortmove()); @@ -391,7 +452,9 @@ void netlist_t::print_stats() const log().verbose(""); log().verbose("Take the next lines with a grain of salt. They depend on the measurement implementation."); log().verbose("Total overhead {1:15}", total_overhead); - log().verbose("Overhead per pop {1:11}", (m_stat_mainloop()-2*total_overhead - (total_time - total_overhead ))/queue().m_prof_call()); + nperftime_t::type overhead_per_pop = (m_stat_mainloop()-2*total_overhead - (total_time - total_overhead)) + / static_cast<nperftime_t::type>(queue().m_prof_call()); + log().verbose("Overhead per pop {1:11}", overhead_per_pop ); log().verbose(""); for (auto &entry : m_devices) { @@ -478,20 +541,6 @@ void core_device_t::stop_dev() //stop(); } -netlist_sig_t core_device_t::INPLOGIC_PASSIVE(logic_input_t &inp) -{ - if (inp.state() != logic_t::STATE_INP_PASSIVE) - return inp.Q(); - else - { - inp.activate(); - const netlist_sig_t ret = inp.Q(); - inp.inactivate(); - return ret; - } -} - - // ---------------------------------------------------------------------------------------- // device_t // ---------------------------------------------------------------------------------------- @@ -506,7 +555,7 @@ setup_t &device_t::setup() return netlist().setup(); } -void device_t::register_subalias(const pstring &name, core_terminal_t &term) +void device_t::register_subalias(const pstring &name, detail::core_terminal_t &term) { pstring alias = this->name() + "." + name; @@ -523,7 +572,7 @@ void device_t::register_subalias(const pstring &name, const pstring &aliased) setup().register_alias_nofqn(alias, aliased_fqn); } -void device_t::connect_late(core_terminal_t &t1, core_terminal_t &t2) +void device_t::connect_late(detail::core_terminal_t &t1, detail::core_terminal_t &t2) { setup().register_link_fqn(t1.name(), t2.name()); } @@ -536,7 +585,7 @@ void device_t::connect_late(const pstring &t1, const pstring &t2) /* FIXME: this is only used by solver code since matrix solvers are started in * post_start. */ -void device_t::connect_post_start(core_terminal_t &t1, core_terminal_t &t2) +void device_t::connect_post_start(detail::core_terminal_t &t1, detail::core_terminal_t &t2) { if (!setup().connect(t1, t2)) netlist().log().fatal("Error connecting {1} to {2}\n", t1.name(), t2.name()); @@ -547,12 +596,12 @@ void device_t::connect_post_start(core_terminal_t &t1, core_terminal_t &t2) // family_setter_t // ----------------------------------------------------------------------------- -family_setter_t::family_setter_t(core_device_t &dev, const char *desc) +detail::family_setter_t::family_setter_t(core_device_t &dev, const char *desc) { dev.set_logic_family(dev.netlist().setup().family_from_model(desc)); } -family_setter_t::family_setter_t(core_device_t &dev, const logic_family_desc_t *desc) +detail::family_setter_t::family_setter_t(core_device_t &dev, const logic_family_desc_t *desc) { dev.set_logic_family(desc); } @@ -568,7 +617,7 @@ struct do_nothing_deleter{ }; -net_t::net_t(netlist_t &nl, const pstring &aname, core_terminal_t *mr) +detail::net_t::net_t(netlist_t &nl, const pstring &aname, core_terminal_t *mr) : object_t(aname) , netlist_ref(nl) , m_new_Q(*this, "m_new_Q", 0) @@ -586,16 +635,16 @@ net_t::net_t(netlist_t &nl, const pstring &aname, core_terminal_t *mr) nl.m_nets.push_back(plib::owned_ptr<net_t>(this, true)); } -net_t::~net_t() +detail::net_t::~net_t() { netlist().state().remove_save_items(this); } -void net_t::inc_active(core_terminal_t &term) +void detail::net_t::inc_active(core_terminal_t &term) { m_active++; m_list_active.push_front(&term); - nl_assert(m_active <= (int) num_cons()); + nl_assert(m_active <= static_cast<int>(num_cons())); if (m_active == 1) { railterminal().device().do_inc_active(); @@ -615,7 +664,7 @@ void net_t::inc_active(core_terminal_t &term) } } -void net_t::dec_active(core_terminal_t &term) +void detail::net_t::dec_active(core_terminal_t &term) { --m_active; nl_assert(m_active >= 0); @@ -624,7 +673,7 @@ void net_t::dec_active(core_terminal_t &term) railterminal().device().do_dec_active(); } -void net_t::rebuild_list() +void detail::net_t::rebuild_list() { /* rebuild m_list */ @@ -639,7 +688,7 @@ void net_t::rebuild_list() m_active = cnt; } -void net_t::update_devs() +void detail::net_t::update_devs() { //assert(m_num_cons != 0); nl_assert(this->isRailNet()); @@ -665,7 +714,7 @@ void net_t::update_devs() } } -void net_t::reset() +void detail::net_t::reset() { m_time = netlist_time::zero(); m_active = 0; @@ -689,7 +738,7 @@ void net_t::reset() m_active++; } -void net_t::register_con(core_terminal_t &terminal) +void detail::net_t::register_con(detail::core_terminal_t &terminal) { terminal.set_net(this); @@ -699,15 +748,15 @@ void net_t::register_con(core_terminal_t &terminal) m_active++; } -void net_t::move_connections(net_t *dest_net) +void detail::net_t::move_connections(detail::net_t *dest_net) { - for (core_terminal_t *ct : m_core_terms) + for (auto &ct : m_core_terms) dest_net->register_con(*ct); m_core_terms.clear(); m_active = 0; } -void net_t::merge_net(net_t *othernet) +void detail::net_t::merge_net(detail::net_t *othernet) { netlist().log().debug("merging nets ...\n"); if (othernet == nullptr) @@ -738,7 +787,7 @@ void net_t::merge_net(net_t *othernet) // logic_net_t // ---------------------------------------------------------------------------------------- -logic_net_t::logic_net_t(netlist_t &nl, const pstring &aname, core_terminal_t *mr) +logic_net_t::logic_net_t(netlist_t &nl, const pstring &aname, detail::core_terminal_t *mr) : net_t(nl, aname, mr) { } @@ -748,7 +797,7 @@ logic_net_t::logic_net_t(netlist_t &nl, const pstring &aname, core_terminal_t *m // analog_net_t // ---------------------------------------------------------------------------------------- -analog_net_t::analog_net_t(netlist_t &nl, const pstring &aname, core_terminal_t *mr) +analog_net_t::analog_net_t(netlist_t &nl, const pstring &aname, detail::core_terminal_t *mr) : net_t(nl, aname, mr) , m_solver(nullptr) { @@ -772,7 +821,7 @@ void analog_net_t::process_net(std::vector<list_t> &groups) return; /* add the net */ groups.back().push_back(this); - for (core_terminal_t *p : m_core_terms) + for (auto &p : m_core_terms) { if (p->is_type(terminal_t::TERMINAL)) { @@ -789,7 +838,7 @@ void analog_net_t::process_net(std::vector<list_t> &groups) // core_terminal_t // ---------------------------------------------------------------------------------------- -core_terminal_t::core_terminal_t(core_device_t &dev, const pstring &aname, const type_t atype) +detail::core_terminal_t::core_terminal_t(core_device_t &dev, const pstring &aname, const type_t atype) : device_object_t(dev, dev.name() + "." + aname, atype) , plib::linkedlist_t<core_terminal_t>::element_t() , m_net(nullptr) @@ -797,7 +846,7 @@ core_terminal_t::core_terminal_t(core_device_t &dev, const pstring &aname, const { } -void core_terminal_t::reset() +void detail::core_terminal_t::reset() { if (is_type(OUTPUT)) set_state(STATE_OUT); @@ -805,12 +854,12 @@ void core_terminal_t::reset() set_state(STATE_INP_ACTIVE); } -void core_terminal_t::set_net(net_t *anet) +void detail::core_terminal_t::set_net(net_t *anet) { m_net = anet; } - void core_terminal_t::clear_net() + void detail::core_terminal_t::clear_net() { m_net = nullptr; } diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h index 9a0c9b824bf..fbd67862dd7 100644 --- a/src/lib/netlist/nl_base.h +++ b/src/lib/netlist/nl_base.h @@ -1,154 +1,8 @@ // license:GPL-2.0+ // copyright-holders:Couriersud -/* - * nlbase.h +/*! * - * A mixed signal circuit simulation - * - * D: Device - * O: Rail output (output) - * I: Infinite impedance input (input) - * T: Terminal (finite impedance) - * - * +---+ +---+ +---+ +---+ +---+ - * | | | | | | | | | | - * | D | | D | | D | | D | | D | - * | | | | | | | | | | - * +-O-+ +-I-+ +-I-+ +-T-+ +-T-+ - * | | | | | - * +-+---------+---------+---------+---------+-+ - * | rail net | - * +-------------------------------------------+ - * - * A rail net is a net which is driven by exactly one output with an - * (idealized) internal resistance of zero. - * Ideally, it can deliver infinite current. - * - * A infinite resistance input does not source or sink current. - * - * Terminals source or sink finite (but never zero) current. - * - * The system differentiates between analog and logic input and outputs and - * analog terminals. Analog and logic devices can not be connected to the - * same net. Instead, proxy devices are inserted automatically: - * - * +---+ +---+ - * | | | | - * | D1| | D2| - * | A | | L | - * +-O-+ +-I-+ - * | | - * +-+---------+---+ - * | rail net | - * +---------------+ - * - * is converted into - * +----------+ - * | | - * +---+ +-+-+ | +---+ - * | | | L | A-L | | | - * | D1| | D | Proxy | | D2| - * | A | | A | | | | - * +-O-+ +-I-+ | +-I-+ - * | | | | - * +-+---------+--+ +-+-----+-------+ - * | rail net (A) | | rail net (L) | - * +--------------| +---------------+ - * - * This works both analog to logic as well as logic to analog. - * - * The above is an advanced implementation of the existing discrete - * subsystem in MAME. Instead of relying on a fixed time-step, analog devices - * could either connect to fixed time-step clock or use an internal clock - * to update them. This would however introduce macro devices for RC, diodes - * and transistors again. - * - * ============================================================================ - * - * Instead, the following approach in case of a pure terminal/input network - * is taken: - * - * +---+ +---+ +---+ +---+ +---+ - * | | | | | | | | | | - * | D | | D | | D | | D | | D | - * | | | | | | | | | | - * +-T-+ +-I-+ +-I-+ +-T-+ +-T-+ - * | | | | | - * '+' | | '-' '-' - * +-+---------+---------+---------+---------+-+ - * | Calculated net | - * +-------------------------------------------+ - * - * SPICE uses the following basic two terminal device: - * - * (k) - * +-----T-----+ - * | | | - * | +--+--+ | - * | | | | - * | R | | - * | R | | - * | R I | - * | | I | Device n - * | V+ I | - * | V | | - * | V- | | - * | | | | - * | +--+--+ | - * | | | - * +-----T-----+ - * (l) - * - * This is a resistance in series to a voltage source and paralleled by a - * current source. This is suitable to model voltage sources, current sources, - * resistors, capacitors, inductances and diodes. - * - * I(n,l) = - I(n,k) = ( V(k) - V - V(l) ) * (1/R(n)) + I(n) - * - * Now, the sum of all currents for a given net must be 0: - * - * Sum(n,I(n,l)) = 0 = sum(n, ( V(k) - V(n) - V(l) ) * (1/R(n)) + I(n) ) - * - * With G(n) = 1 / R(n) and sum(n, G(n)) = Gtot and k=k(n) - * - * 0 = - V(l) * Gtot + sum(n, (V(k(n)) - V(n)) * G(n) + I(n)) - * - * and with l=l(n) and fixed k - * - * 0 = -V(k) * Gtot + sum(n, ( V(l(n) + V(n) ) * G(n) - I(n)) - * - * These equations represent a linear Matrix equation (with more math). - * - * In the end the solution of the analog subsystem boils down to - * - * (G - D) * V = I - * - * with G being the conductance matrix, D a diagonal matrix with the total - * conductance on the diagonal elements, V the net voltage vector and I the - * current vector. - * - * By using solely two terminal devices, we can simplify the whole calculation - * significantly. A BJT now is a four terminal device with two terminals being - * connected internally. - * - * The system is solved using an iterative approach: - * - * G * V - D * V = I - * - * assuming V=Vn=Vo - * - * Vn = D-1 * (I - G * Vo) - * - * Each terminal thus has three properties: - * - * a) Resistance - * b) Voltage source - * c) Current source/sink - * - * Going forward, the approach can be extended e.g. to use a linear - * equation solver. - * - * The formal representation of the circuit will stay the same, thus scales. + * \file nl_base.h * */ @@ -171,45 +25,92 @@ // Type definitions // ---------------------------------------------------------------------------------------- +/*! netlist_sig_t is the type used for logic signals. */ using netlist_sig_t = std::uint_least32_t; - //============================================================ - // MACROS / New Syntax - //============================================================ +//============================================================ +// MACROS / New Syntax +//============================================================ +/*! Construct a netlist device name */ #define NETLIB_NAME(chip) nld_ ## chip #define NETLIB_OBJECT_DERIVED(name, pclass) \ class NETLIB_NAME(name) : public NETLIB_NAME(pclass) +/*! Start a netlist device class. + * Used to start defining a netlist device class. + * The simplest device without inputs or outputs would look like this: + * + * NETLIB_OBJECT(base_dummy) + * { + * public: + * NETLIB_CONSTRUCTOR(base_dummy) { } + * }; + * + * Also refer to #NETLIB_CONSTRUCTOR. + */ #define NETLIB_OBJECT(name) \ class NETLIB_NAME(name) : public device_t #define NETLIB_CONSTRUCTOR_DERIVED(cname, pclass) \ - private: family_setter_t m_famsetter; \ + private: detail::family_setter_t m_famsetter; \ public: template <class CLASS> NETLIB_NAME(cname)(CLASS &owner, const pstring name) \ : NETLIB_NAME(pclass)(owner, name) -#define NETLIB_CONSTRUCTOR(cname) \ - private: family_setter_t m_famsetter; \ +/*! Used to define the constructor of a netlist device. + * Use this to define the constructor of a netlist device. Please refer to + * #NETLIB_OBJECT for an example. + */ +#define NETLIB_CONSTRUCTOR(cname) \ + private: detail::family_setter_t m_famsetter; \ public: template <class CLASS> NETLIB_NAME(cname)(CLASS &owner, const pstring name) \ : device_t(owner, name) + /*! Used to define the destructor of a netlist device. + * The use of a destructor for netlist device should normally not be necessary. + */ #define NETLIB_DESTRUCTOR(name) public: virtual ~NETLIB_NAME(name)() -#define NETLIB_CONSTRUCTOR_EX(cname, ...) \ - private: family_setter_t m_famsetter; \ + /*! Define an extended constructor and add further parameters to it. + * The macro allows to add further parameters to a device constructor. This is + * normally used for sub-devices and system devices only. + */ +#define NETLIB_CONSTRUCTOR_EX(cname, ...) \ + private: detail::family_setter_t m_famsetter; \ public: template <class CLASS> NETLIB_NAME(cname)(CLASS &owner, const pstring name, __VA_ARGS__) \ : device_t(owner, name) -#define NETLIB_DYNAMIC() \ + /*! Add this to a device definition to mark the device as dynamic. + * If this is added to device definition the device is treated as an analog + * dynamic device, i.e. #NETLIB_UPDATE_TERMINALSI is called on a each step + * of the Newton-Raphson step of solving the linear equations. + */ +#define NETLIB_DYNAMIC() \ public: virtual bool is_dynamic() const override { return true; } -#define NETLIB_TIMESTEP() \ + /*! Add this to a device definition to mark the device as a time-stepping device + * and add code. + * If this is added to device definition the device is treated as an analog + * time-stepping device. Currently, only the capacitor device uses this. An other + * example would be an inductor device. + * + * Example: + * + * NETLIB_TIMESTEP() + * { + * // Gpar should support convergence + * const nl_double G = m_C.Value() / step + m_GParallel; + * const nl_double I = -G * deltaV(); + * set(G, 0.0, I); + * } + * + */ +#define NETLIB_TIMESTEP() \ public: virtual bool is_timestep() const override { return true; } \ public: virtual void step_time(const nl_double step) override -#define NETLIB_UPDATE_AFTER_PARAM_CHANGE() \ +#define NETLIB_UPDATE_AFTER_PARAM_CHANGE() \ public: virtual bool needs_update_after_param_change() const override { return true; } #define NETLIB_FAMILY(family) , m_famsetter(*this, family) @@ -266,14 +167,33 @@ namespace netlist class NETLIB_NAME(base_d_to_a_proxy); } + namespace detail { + class object_t; + class device_object_t; + struct netlist_ref; + class core_terminal_t; + struct family_setter_t; + class queue_t; + class net_t; + } + //============================================================ // Exceptions //============================================================ + /*! Generic netlist expection. + * The exception is used in all events which are considered fatal. + */ class nl_exception : public plib::pexception { public: - explicit nl_exception(const pstring text) : plib::pexception(text) { } + /*! Constructor. + * Allows a descriptive text to be assed to the exception + */ + explicit nl_exception(const pstring text //!< text to be passed + ) + : plib::pexception(text) { } + /*! Copy constructor. */ nl_exception(const nl_exception &e) : plib::pexception(e) { } virtual ~nl_exception() noexcept {} }; @@ -287,16 +207,15 @@ namespace netlist class core_device_t; class device_t; - // ----------------------------------------------------------------------------- - // model_map_t - // ----------------------------------------------------------------------------- - + /*! Type of the model map used. + * This is used to hold all #Models in an unordered map + */ using model_map_t = std::unordered_map<pstring, pstring>; - // ----------------------------------------------------------------------------- - // logic_family_t - // ----------------------------------------------------------------------------- - + /*! Logic families descriptors are used create proxy devices. + * The logic family describe the analog capabilities of logic devices, + * inputs and outputs. + */ class logic_family_desc_t { public: @@ -305,14 +224,25 @@ namespace netlist virtual plib::owned_ptr<devices::nld_base_d_to_a_proxy> create_d_a_proxy(netlist_t &anetlist, const pstring &name, logic_output_t *proxied) const = 0; - nl_double m_low_thresh_V; - nl_double m_high_thresh_V; - nl_double m_low_V; - nl_double m_high_V; - nl_double m_R_low; - nl_double m_R_high; + nl_double m_low_thresh_V; //!< low input threshhold. If the input voltage is below this value, a "0" input is signalled + nl_double m_high_thresh_V; //!< high input threshhold. If the input voltage is above this value, a "0" input is signalled + nl_double m_low_V; //!< low output voltage. This voltage is output if the ouput is "0" + nl_double m_high_V; //!< high output voltage. This voltage is output if the ouput is "1" + nl_double m_R_low; //!< low output resistance. Value of series resistor used for low output + nl_double m_R_high; //!< high output resistance. Value of series resistor used for high output }; + /*! Base class for devices, terminals, outputs and inputs which support + * logic families. + * This class is a storage container to store the logic family for a + * netlist object. You will not directly use it. Please refer to + * #NETLIB_FAMILY to learn how to define a logic family for a device. + * + * All terminals inherit the family description from the device + * The default is the ttl family, but any device can override the family. + * For individual terminals, the family can be overwritten as well. + * + */ class logic_family_t { public: @@ -327,43 +257,58 @@ namespace netlist const logic_family_desc_t *m_logic_family; }; - /* Terminals inherit the family description from the device - * The default is the ttl family, but any device can override the family. - * For individual terminals, these can be overwritten as well. + const logic_family_desc_t *family_TTL(); //*!< logic family for TTL devices. + const logic_family_desc_t *family_CD4XXX(); //*!< logic family for CD4XXX CMOS devices. + + /*! A persistent variable template. + * Use the state_var template to define a variable whose value is saved. + * Within a device definition use * - * Only devices of type GENERIC should have a family description entry + * NETLIB_OBJECT(abc) + * { + * NETLIB_CONSTRUCTOR(abc) + * , m_var(*this, "myvar", 0) + * ... + * state_var<unsigned> m_var; + * } */ - - const logic_family_desc_t *family_TTL(); - const logic_family_desc_t *family_CD4XXX(); - - - // ----------------------------------------------------------------------------- - // State variables - use to preserve state - // ----------------------------------------------------------------------------- - template <typename T> struct state_var { public: template <typename O> - state_var(O &owner, const pstring name, const T &value); + //! Constructor. + state_var(O &owner, //!< owner must have a netlist() method. + const pstring name, //!< identifier/name for this state variable + const T &value //!< Initial value after construction + ); + //! Copy Constructor. state_var(const state_var &rhs) NOEXCEPT = default; + //! Move Constructor. state_var(state_var &&rhs) NOEXCEPT = default; + //! Assignment operator to assign value of a state var. state_var &operator=(state_var rhs) { std::swap(rhs.m_value, this->m_value); return *this; } + //! Assignment operator to assign value of type T. state_var &operator=(const T rhs) { m_value = rhs; return *this; } + //! Return value of state variable. operator T & () { return m_value; } + //! Return value of state variable. T & operator()() { return m_value; } + //! Return const value of state variable. operator const T & () const { return m_value; } + //! Return const value of state variable. const T & operator()() const { return m_value; } - T * ptr() { return &m_value; } const T * ptr() const { return &m_value; } private: T m_value; }; + /*! A persistent array template. + * Use this state_var template to define an array whose contents are saved. + * Please refer to \ref state_var. + */ template <typename T, std::size_t N> struct state_var<T[N]> { @@ -383,42 +328,55 @@ namespace netlist // State variables - predefined and c++11 non-optioanl // ----------------------------------------------------------------------------- + /*! predefined state variable type for uint_fast8_t */ using state_var_u8 = state_var<std::uint_fast8_t>; + /*! predefined state variable type for int_fast8_t */ using state_var_s8 = state_var<std::int_fast8_t>; + /*! predefined state variable type for uint_fast32_t */ using state_var_u32 = state_var<std::uint_fast32_t>; + /*! predefined state variable type for int_fast32_t */ using state_var_s32 = state_var<std::int_fast32_t>; // ----------------------------------------------------------------------------- // object_t // ----------------------------------------------------------------------------- - - class object_t + /*! The base class for netlist devices, terminals and parameters. + * + * This class serves as the base class for all device, terminal and + * objects. It provides new and delete operators to supported e.g. pooled + * memory allocation to enhance locality. Please refer to \ref USE_MEMPOOL as + * well. + */ + class detail::object_t { P_PREVENT_COPYING(object_t) public: - object_t(const pstring &aname); + /*! Constructor. + * + * Every class derived from the object_t class must have a name. + */ + object_t(const pstring &aname /*!< string containing name of the object */); ~object_t(); + /*! return name of the object + * + * \returns name of the object. + */ const pstring &name() const; - //netlist_t & m_netlist; - //netlist_t & netlist() { return m_netlist; } - //const netlist_t & netlist() const { return m_netlist; } - - private: - pstring m_name; - - public: void * operator new (size_t size, void *ptr) { return ptr; } void operator delete (void *ptr, void *) { } void * operator new (size_t size); void operator delete (void * mem); + + private: + pstring m_name; }; - struct netlist_ref + struct detail::netlist_ref { netlist_ref(netlist_t &nl) : m_netlist(nl) { } @@ -434,28 +392,53 @@ namespace netlist // device_object_t // ----------------------------------------------------------------------------- - class device_object_t : public object_t + /*! Base class for all objects being owned by a device. + * + * Serves as the base class of all objects being owned by a device. + * + */ + class detail::device_object_t : public detail::object_t { P_PREVENT_COPYING(device_object_t) public: + /*! Enum specifying the type of object */ enum type_t { - TERMINAL = 0, - INPUT = 1, - OUTPUT = 2, - PARAM = 3, + TERMINAL = 0, /*!< object is an analog terminal */ + INPUT = 1, /*!< object is an input */ + OUTPUT = 2, /*!< object is an output */ + PARAM = 3, /*!< object is a parameter */ }; - device_object_t(core_device_t &dev, const pstring &aname, const type_t atype); + /*! Constructor. + * + * \param dev device owning the object. + * \param name string holding the name of the device + * \param type type of this object. + */ + device_object_t(core_device_t &dev, const pstring &name, const type_t type); + /*! returns reference to owning device. + * \returns reference to owning device. + */ core_device_t &device() const { return m_device; } + /*! The object type. + * \returns type of the object + */ type_t type() const { return m_type; } - bool is_type(const type_t atype) const { return (m_type == atype); } + /*! Checks if object is of specified type. + * \param type type to check object against. + * \returns true if object is of specified type else false. + */ + bool is_type(const type_t type) const { return (m_type == type); } + /*! The netlist owning the owner of this object. + * \returns reference to netlist object. + */ netlist_t &netlist(); private: core_device_t & m_device; - const type_t m_type; + const type_t m_type; }; @@ -463,7 +446,7 @@ namespace netlist // core_terminal_t // ----------------------------------------------------------------------------- - class core_terminal_t : public device_object_t, public plib::linkedlist_t<core_terminal_t>::element_t + class detail::core_terminal_t : public device_object_t, public plib::linkedlist_t<core_terminal_t>::element_t { P_PREVENT_COPYING(core_terminal_t) public: @@ -513,7 +496,7 @@ namespace netlist // analog_t // ----------------------------------------------------------------------------- - class analog_t : public core_terminal_t + class analog_t : public detail::core_terminal_t { public: @@ -537,7 +520,7 @@ namespace netlist terminal_t(core_device_t &dev, const pstring &aname); - terminal_t *m_otherterm; + nl_double operator ()() const; void set(const nl_double G) { @@ -570,6 +553,8 @@ namespace netlist m_Idr1 = Idr; } + terminal_t *m_otherterm; + private: void set_ptr(nl_double *ptr, const nl_double val) { @@ -590,7 +575,7 @@ namespace netlist // logic_t // ----------------------------------------------------------------------------- - class logic_t : public core_terminal_t, public logic_family_t + class logic_t : public detail::core_terminal_t, public logic_family_t { public: logic_t(core_device_t &dev, const pstring &aname, const type_t atype) @@ -623,6 +608,12 @@ namespace netlist netlist_sig_t Q() const; + netlist_sig_t operator()() const + { + nl_assert(state() != STATE_INP_PASSIVE); + return Q(); + } + void inactivate(); void activate(); void activate_hl(); @@ -634,11 +625,27 @@ namespace netlist // analog_input_t // ----------------------------------------------------------------------------- + /*! terminal providing analog input voltage. + * + * This terminal class provides a voltage measurement. The conductance against + * ground is infinite. + */ class analog_input_t : public analog_t { public: - analog_input_t(core_device_t &dev, const pstring &aname); + /*! Constructor */ + analog_input_t(core_device_t &dev, /*!< owning device */ + const pstring &aname /*!< name of terminal */ + ); + + /*! returns voltage at terminal. + * \returns voltage at terminal. + */ + nl_double operator()() const { return Q_Analog(); } + /*! returns voltage at terminal. + * \returns voltage at terminal. + */ nl_double Q_Analog() const; }; @@ -647,7 +654,9 @@ namespace netlist // net_t // ----------------------------------------------------------------------------- - class net_t : public object_t, public netlist_ref + class detail::net_t : + public detail::object_t, + public detail::netlist_ref { P_PREVENT_COPYING(net_t) public: @@ -707,12 +716,12 @@ namespace netlist }; - class logic_net_t : public net_t + class logic_net_t : public detail::net_t { P_PREVENT_COPYING(logic_net_t) public: - logic_net_t(netlist_t &nl, const pstring &aname, core_terminal_t *mr = nullptr); + logic_net_t(netlist_t &nl, const pstring &aname, detail::core_terminal_t *mr = nullptr); virtual ~logic_net_t() { } netlist_sig_t Q() const { return m_cur_Q; } @@ -748,14 +757,14 @@ namespace netlist }; - class analog_net_t : public net_t + class analog_net_t : public detail::net_t { P_PREVENT_COPYING(analog_net_t) public: using list_t = std::vector<analog_net_t *>; - analog_net_t(netlist_t &nl, const pstring &aname, core_terminal_t *mr = nullptr); + analog_net_t(netlist_t &nl, const pstring &aname, detail::core_terminal_t *mr = nullptr); virtual ~analog_net_t() { } @@ -786,7 +795,7 @@ namespace netlist void initial(const netlist_sig_t val); - void set_Q(const netlist_sig_t newQ, const netlist_time delay) NOEXCEPT + void push(const netlist_sig_t newQ, const netlist_time delay) NOEXCEPT { m_my_net.set_Q(newQ, delay); // take the shortcut } @@ -799,13 +808,13 @@ namespace netlist { P_PREVENT_COPYING(analog_output_t) public: - analog_output_t(core_device_t &dev, const pstring &aname); + void push(const nl_double val) { set_Q(val); } void initial(const nl_double val); - void set_Q(const nl_double newQ); private: + void set_Q(const nl_double newQ); analog_net_t m_my_net; }; @@ -813,7 +822,7 @@ namespace netlist // param_t // ----------------------------------------------------------------------------- - class param_t : public device_object_t + class param_t : public detail::device_object_t { P_PREVENT_COPYING(param_t) public: @@ -842,13 +851,13 @@ namespace netlist public: param_template_t(device_t &device, const pstring name, const C val); - operator const C() const { return Value(); } + const C operator()() const { return Value(); } void setTo(const C ¶m); void initial(const C &val) { m_param = val; } - C Value() const { return m_param; } protected: + C Value() const { return m_param; } virtual void changed() { } C m_param; private: @@ -883,7 +892,10 @@ namespace netlist // core_device_t // ----------------------------------------------------------------------------- - class core_device_t : public object_t, public logic_family_t, public netlist_ref + class core_device_t : + public detail::object_t, + public logic_family_t, + public detail::netlist_ref { P_PREVENT_COPYING(core_device_t) public: @@ -929,18 +941,6 @@ namespace netlist void do_reset() { reset(); } void set_hint_deactivate(bool v) { m_hint_deactivate = v; } - netlist_sig_t INPLOGIC_PASSIVE(logic_input_t &inp); - netlist_sig_t INPLOGIC(const logic_input_t &inp) const - { - nl_assert(inp.state() != logic_t::STATE_INP_PASSIVE); - return inp.Q(); - } - - void OUTLOGIC(logic_output_t &out, const netlist_sig_t val, const netlist_time delay) NOEXCEPT; - nl_double INPANALOG(const analog_input_t &inp) const { return inp.Q_Analog(); } - nl_double TERMANALOG(const terminal_t &term) const { return term.net().Q_Analog(); } - void OUTANALOG(analog_output_t &out, const nl_double val) { out.set_Q(val); } - /* stats */ nperftime_t m_stat_total_time; nperfcount_t m_stat_call_count; @@ -1001,12 +1001,12 @@ namespace netlist } #endif - void register_subalias(const pstring &name, core_terminal_t &term); + void register_subalias(const pstring &name, detail::core_terminal_t &term); void register_subalias(const pstring &name, const pstring &aliased); void connect_late(const pstring &t1, const pstring &t2); - void connect_late(core_terminal_t &t1, core_terminal_t &t2); - void connect_post_start(core_terminal_t &t1, core_terminal_t &t2); + void connect_late(detail::core_terminal_t &t1, detail::core_terminal_t &t2); + void connect_post_start(detail::core_terminal_t &t1, detail::core_terminal_t &t2); protected: NETLIB_UPDATEI() { } @@ -1019,7 +1019,7 @@ namespace netlist // family_setter_t // ----------------------------------------------------------------------------- - struct family_setter_t + struct detail::family_setter_t { family_setter_t() { } family_setter_t(core_device_t &dev, const char *desc); @@ -1040,10 +1040,11 @@ namespace netlist // queue_t // ----------------------------------------------------------------------------- - class queue_t : public timed_queue<net_t *, netlist_time>, - public object_t, - public netlist_ref, - public plib::state_manager_t::callback_t + class detail::queue_t : + public timed_queue<net_t *, netlist_time>, + public detail::object_t, + public detail::netlist_ref, + public plib::state_manager_t::callback_t { public: explicit queue_t(netlist_t &nl); @@ -1056,7 +1057,7 @@ namespace netlist private: struct names_t { char m_buf[64]; }; - int m_qsize; + std::size_t m_qsize; std::vector<netlist_time::internal_type> m_times; std::vector<names_t> m_names; }; @@ -1068,7 +1069,6 @@ namespace netlist class netlist_t : public plib::plog_dispatch_intf { - friend class setup_t; P_PREVENT_COPYING(netlist_t) public: @@ -1080,15 +1080,15 @@ namespace netlist void start(); void stop(); - const queue_t &queue() const { return m_queue; } - queue_t &queue() { return m_queue; } + const detail::queue_t &queue() const { return m_queue; } + detail::queue_t &queue() { return m_queue; } const netlist_time time() const { return m_time; } devices::NETLIB_NAME(solver) *solver() const { return m_solver; } devices::NETLIB_NAME(gnd) *gnd() const { return m_gnd; } nl_double gmin() const; - void push_to_queue(net_t &out, const netlist_time attime) NOEXCEPT; - void remove_from_queue(net_t &out); + void push_to_queue(detail::net_t &out, const netlist_time attime) NOEXCEPT; + void remove_from_queue(detail::net_t &out); void process_queue(const netlist_time &delta); void abort_current_queue_slice() { m_queue.retime(m_time, nullptr); } @@ -1098,10 +1098,9 @@ namespace netlist void set_setup(setup_t *asetup) { m_setup = asetup; } setup_t &setup() { return *m_setup; } - void register_dev(plib::owned_ptr<device_t> dev); - net_t *find_net(const pstring &name); + detail::net_t *find_net(const pstring &name); template<class device_class> std::vector<device_class *> get_device_list() @@ -1143,7 +1142,7 @@ namespace netlist { this->state().save_item(static_cast<void *>(&owner), state, pstring(owner.name()) + "." + stname); } - template<typename O, typename C> void save(O &owner, C *state, const pstring &stname, const int count) + template<typename O, typename C> void save(O &owner, C *state, const pstring &stname, const std::size_t count) { this->state().save_state_ptr(static_cast<void *>(&owner), pstring(owner.name()) + "." + stname, plib::state_manager_t::datatype_f<C>::f(), count, state); } @@ -1154,21 +1153,18 @@ namespace netlist void print_stats() const; - std::vector<plib::owned_ptr<core_device_t>> m_devices; - + std::vector<plib::owned_ptr<core_device_t>> m_devices; /* sole use is to manage lifetime of net objects */ - std::vector<plib::owned_ptr<net_t>> m_nets; - + std::vector<plib::owned_ptr<detail::net_t>> m_nets; /* sole use is to manage lifetime of family objects */ std::vector<std::pair<pstring, std::unique_ptr<logic_family_desc_t>>> m_family_cache; private: - plib::state_manager_t m_state; + plib::state_manager_t m_state; /* mostly rw */ - netlist_time m_time; - queue_t m_queue; + netlist_time m_time; + detail::queue_t m_queue; - nperftime_t m_stat_mainloop; /* mostly ro */ devices::NETLIB_NAME(mainclock) * m_mainclock; @@ -1176,15 +1172,16 @@ namespace netlist devices::NETLIB_NAME(gnd) * m_gnd; devices::NETLIB_NAME(netlistparams) *m_params; - pstring m_name; - setup_t *m_setup; - plib::plog_base<NL_DEBUG> m_log; - plib::dynlib *m_lib; // external lib needs to be loaded as long as netlist exists + pstring m_name; + setup_t * m_setup; + plib::plog_base<NL_DEBUG> m_log; + plib::dynlib * m_lib; // external lib needs to be loaded as long as netlist exists // performance - nperfcount_t m_perf_out_processed; - nperfcount_t m_perf_inp_processed; - nperfcount_t m_perf_inp_active; + nperftime_t m_stat_mainloop; + nperfcount_t m_perf_out_processed; + nperfcount_t m_perf_inp_processed; + nperfcount_t m_perf_inp_active; }; // ----------------------------------------------------------------------------- @@ -1223,22 +1220,22 @@ namespace netlist } } - inline bool core_terminal_t::is_logic() const + inline bool detail::core_terminal_t::is_logic() const { return dynamic_cast<const logic_t *>(this) != nullptr; } - inline bool core_terminal_t::is_analog() const + inline bool detail::core_terminal_t::is_analog() const { return dynamic_cast<const analog_t *>(this) != nullptr; } - inline bool net_t::is_logic() const + inline bool detail::net_t::is_logic() const { return dynamic_cast<const logic_net_t *>(this) != nullptr; } - inline bool net_t::is_analog() const + inline bool detail::net_t::is_analog() const { return dynamic_cast<const analog_net_t *>(this) != nullptr; } @@ -1279,7 +1276,7 @@ namespace netlist } } - inline void net_t::push_to_queue(const netlist_time delay) NOEXCEPT + inline void detail::net_t::push_to_queue(const netlist_time delay) NOEXCEPT { if (!is_queued() && (num_cons() != 0)) { @@ -1292,7 +1289,7 @@ namespace netlist } } - inline void net_t::reschedule_in_queue(const netlist_time delay) NOEXCEPT + inline void detail::net_t::reschedule_in_queue(const netlist_time delay) NOEXCEPT { if (is_queued()) netlist().remove_from_queue(*this); @@ -1315,6 +1312,8 @@ namespace netlist return static_cast<analog_net_t &>(core_terminal_t::net()); } + inline nl_double terminal_t::operator ()() const { return net().Q_Analog(); } + inline logic_net_t & logic_t::net() { return *static_cast<logic_net_t *>(&core_terminal_t::net()); @@ -1345,21 +1344,16 @@ namespace netlist } } - inline void netlist_t::push_to_queue(net_t &out, const netlist_time attime) NOEXCEPT + inline void netlist_t::push_to_queue(detail::net_t &out, const netlist_time attime) NOEXCEPT { m_queue.push(attime, &out); } - inline void netlist_t::remove_from_queue(net_t &out) + inline void netlist_t::remove_from_queue(detail::net_t &out) { m_queue.remove(&out); } - inline void core_device_t::OUTLOGIC(logic_output_t &out, const netlist_sig_t val, const netlist_time delay) NOEXCEPT - { - out.set_Q(val, delay); - } - template <typename T> template <typename O> state_var<T>::state_var(O &owner, const pstring name, const T &value) @@ -1376,7 +1370,7 @@ namespace netlist m_value[i] = value; } - inline netlist_t &device_object_t::netlist() + inline netlist_t &detail::device_object_t::netlist() { return m_device.netlist(); } diff --git a/src/lib/netlist/nl_config.h b/src/lib/netlist/nl_config.h index d7a024d100a..a2fe70b5320 100644 --- a/src/lib/netlist/nl_config.h +++ b/src/lib/netlist/nl_config.h @@ -1,7 +1,8 @@ // license:GPL-2.0+ // copyright-holders:Couriersud -/* - * nlconfig.h +/*! + * + * \file nl_config.h * */ @@ -75,7 +76,15 @@ // GENERAL //============================================================ -#define NL_USE_MEMPOOL (0) +/*! Make use of a memory pool for performance related objects. + * + * Set to 1 to compile netlist with memory allocations from a + * linear memory pool. This is based of the assumption that + * due to enhanced locality there will be less cache misses. + * Your mileage may vary. + * + */ +#define USE_MEMPOOL (1) #define USE_TRUTHTABLE (1) //============================================================ diff --git a/src/lib/netlist/nl_dice_compat.h b/src/lib/netlist/nl_dice_compat.h index 5923ebdd10c..a6546e32d52 100644 --- a/src/lib/netlist/nl_dice_compat.h +++ b/src/lib/netlist/nl_dice_compat.h @@ -230,7 +230,7 @@ inline int CAPACITOR_tc_lh(const double c, const double r) NET_C(GND, name ## _C.2) #else // fast, might work -#define CHIP_CAPACITOR(name, pdesc) \ +#define CHIP_CAPACITOR(name, pdesc) \ RES(name ## _C, RES_K(1000)) \ ALIAS(name.1, name ## _C.1 ) \ ALIAS(name.2, name ## _C.1) \ diff --git a/src/lib/netlist/nl_factory.cpp b/src/lib/netlist/nl_factory.cpp index fee6d2272e9..f1d3281aa81 100644 --- a/src/lib/netlist/nl_factory.cpp +++ b/src/lib/netlist/nl_factory.cpp @@ -53,10 +53,12 @@ void factory_list_t::error(const pstring &s) base_factory_t * factory_list_t::factory_by_name(const pstring &devname) { for (auto & e : *this) + { if (e->name() == devname) return e.get(); + } - m_setup.log().fatal("Class {1} not found!\n", devname); + m_setup.log().fatal("Class <{1}> not found!\n", devname); return nullptr; // appease code analysis } diff --git a/src/lib/netlist/nl_lists.h b/src/lib/netlist/nl_lists.h index 0f5e2c5669e..84914d67450 100644 --- a/src/lib/netlist/nl_lists.h +++ b/src/lib/netlist/nl_lists.h @@ -117,7 +117,7 @@ namespace netlist // save state support & mame disasm const entry_t *listptr() const { return &m_list[1]; } - std::size_t size() const { return m_end - &m_list[1]; } + std::size_t size() const { return static_cast<std::size_t>(m_end - &m_list[1]); } const entry_t & operator[](const std::size_t index) const { return m_list[ 1 + index]; } private: diff --git a/src/lib/netlist/nl_parser.cpp b/src/lib/netlist/nl_parser.cpp index c0b0b56bdf1..6760873a4af 100644 --- a/src/lib/netlist/nl_parser.cpp +++ b/src/lib/netlist/nl_parser.cpp @@ -152,9 +152,9 @@ void parser_t::net_truthtable_start() { pstring name = get_identifier(); require_token(m_tok_comma); - unsigned ni = get_number_long(); + long ni = get_number_long(); require_token(m_tok_comma); - unsigned no = get_number_long(); + long no = get_number_long(); require_token(m_tok_comma); pstring def_param = get_string(); require_token(m_tok_param_right); @@ -162,8 +162,8 @@ void parser_t::net_truthtable_start() netlist::tt_desc desc; desc.classname = name; desc.name = name; - desc.ni = ni; - desc.no = no; + desc.ni = static_cast<unsigned long>(ni); + desc.no = static_cast<unsigned long>(no); desc.def_param = "+" + def_param; desc.family = ""; @@ -317,8 +317,8 @@ void parser_t::dippins() } if ((pins.size() % 2) == 1) error("You must pass an equal number of pins to DIPPINS"); - unsigned n = pins.size(); - for (unsigned i = 0; i < n / 2; i++) + std::size_t n = pins.size(); + for (std::size_t i = 0; i < n / 2; i++) { m_setup.register_alias(plib::pfmt("{1}")(i+1), pins[i*2]); m_setup.register_alias(plib::pfmt("{1}")(n-i), pins[i*2 + 1]); diff --git a/src/lib/netlist/nl_setup.cpp b/src/lib/netlist/nl_setup.cpp index 8aa30c9d945..8048b7db46a 100644 --- a/src/lib/netlist/nl_setup.cpp +++ b/src/lib/netlist/nl_setup.cpp @@ -138,8 +138,8 @@ bool setup_t::device_exists(const pstring name) const void setup_t::register_model(const pstring &model_in) { - int pos = model_in.find(" "); - if (pos < 0) + auto pos = model_in.find(" "); + if (pos == model_in.end()) log().fatal("Unable to parse model: {1}", model_in); pstring model = model_in.left(pos).trim().ucase(); pstring def = model_in.substr(pos + 1).trim(); @@ -165,15 +165,15 @@ void setup_t::register_dippins_arr(const pstring &terms) plib::pstring_vector_t list(terms,", "); if (list.size() == 0 || (list.size() % 2) == 1) log().fatal("You must pass an equal number of pins to DIPPINS"); - unsigned n = list.size(); - for (unsigned i = 0; i < n / 2; i++) + std::size_t n = list.size(); + for (std::size_t i = 0; i < n / 2; i++) { register_alias(plib::pfmt("{1}")(i+1), list[i * 2]); register_alias(plib::pfmt("{1}")(n-i), list[i * 2 + 1]); } } -pstring setup_t::objtype_as_str(device_object_t &in) const +pstring setup_t::objtype_as_str(detail::device_object_t &in) const { switch (in.type()) { @@ -187,7 +187,7 @@ pstring setup_t::objtype_as_str(device_object_t &in) const return "PARAM"; } // FIXME: noreturn - log().fatal("Unknown object type {1}\n", (unsigned) in.type()); + log().fatal("Unknown object type {1}\n", static_cast<unsigned>(in.type())); return "Error"; } @@ -214,7 +214,7 @@ void setup_t::register_and_set_param(pstring name, param_t ¶m) double vald = 0; if (sscanf(val.cstr(), "%lf", &vald) != 1) log().fatal("Invalid number conversion {1} : {2}\n", name, val); - static_cast<param_int_t &>(param).initial((int) vald); + static_cast<param_int_t &>(param).initial(static_cast<int>(vald)); } break; case param_t::STRING: @@ -224,14 +224,14 @@ void setup_t::register_and_set_param(pstring name, param_t ¶m) } break; //default: - // log().fatal("Parameter is not supported {1} : {2}\n", name, val); + // log().fatal("Parameter is not supported {1} : {2}\n", name, val); } } if (!m_params.insert({param.name(), param_ref_t(param.name(), param.device(), param)}).second) log().fatal("Error adding parameter {1} to parameter list\n", name); } -void setup_t::register_term(core_terminal_t &term) +void setup_t::register_term(detail::core_terminal_t &term) { if (!m_terminals.insert({term.name(), &term}).second) log().fatal("Error adding {1} {2} to terminal list\n", objtype_as_str(term), term.name()); @@ -351,7 +351,7 @@ const pstring setup_t::resolve_alias(const pstring &name) const return ret; } -core_terminal_t *setup_t::find_terminal(const pstring &terminal_in, bool required) +detail::core_terminal_t *setup_t::find_terminal(const pstring &terminal_in, bool required) { const pstring &tname = resolve_alias(terminal_in); auto ret = m_terminals.find(tname); @@ -362,7 +362,7 @@ core_terminal_t *setup_t::find_terminal(const pstring &terminal_in, bool require ret = m_terminals.find(tname + ".Q"); } - core_terminal_t *term = (ret == m_terminals.end() ? nullptr : ret->second); + detail::core_terminal_t *term = (ret == m_terminals.end() ? nullptr : ret->second); if (term == nullptr && required) log().fatal("terminal {1}({2}) not found!\n", terminal_in, tname); @@ -371,12 +371,13 @@ core_terminal_t *setup_t::find_terminal(const pstring &terminal_in, bool require return term; } -core_terminal_t *setup_t::find_terminal(const pstring &terminal_in, device_object_t::type_t atype, bool required) +detail::core_terminal_t *setup_t::find_terminal(const pstring &terminal_in, + detail::device_object_t::type_t atype, bool required) { const pstring &tname = resolve_alias(terminal_in); auto ret = m_terminals.find(tname); /* look for default */ - if (ret == m_terminals.end() && atype == device_object_t::OUTPUT) + if (ret == m_terminals.end() && atype == detail::device_object_t::OUTPUT) { /* look for ".Q" std output */ ret = m_terminals.find(tname + ".Q"); @@ -384,7 +385,7 @@ core_terminal_t *setup_t::find_terminal(const pstring &terminal_in, device_objec if (ret == m_terminals.end() && required) log().fatal("terminal {1}({2}) not found!\n", terminal_in, tname); - core_terminal_t *term = (ret == m_terminals.end() ? nullptr : ret->second); + detail::core_terminal_t *term = (ret == m_terminals.end() ? nullptr : ret->second); if (term != nullptr && term->type() != atype) { @@ -413,7 +414,7 @@ param_t *setup_t::find_param(const pstring ¶m_in, bool required) const } // FIXME avoid dynamic cast here -devices::nld_base_proxy *setup_t::get_d_a_proxy(core_terminal_t &out) +devices::nld_base_proxy *setup_t::get_d_a_proxy(detail::core_terminal_t &out) { nl_assert(out.is_logic()); @@ -450,7 +451,7 @@ devices::nld_base_proxy *setup_t::get_d_a_proxy(core_terminal_t &out) return proxy; } -void setup_t::connect_input_output(core_terminal_t &in, core_terminal_t &out) +void setup_t::connect_input_output(detail::core_terminal_t &in, detail::core_terminal_t &out) { if (out.is_analog() && in.is_logic()) { @@ -483,7 +484,7 @@ void setup_t::connect_input_output(core_terminal_t &in, core_terminal_t &out) } -void setup_t::connect_terminal_input(terminal_t &term, core_terminal_t &inp) +void setup_t::connect_terminal_input(terminal_t &term, detail::core_terminal_t &inp) { if (inp.is_analog()) { @@ -514,7 +515,7 @@ void setup_t::connect_terminal_input(terminal_t &term, core_terminal_t &inp) } } -void setup_t::connect_terminal_output(terminal_t &in, core_terminal_t &out) +void setup_t::connect_terminal_output(terminal_t &in, detail::core_terminal_t &out) { if (out.is_analog()) { @@ -538,7 +539,7 @@ void setup_t::connect_terminal_output(terminal_t &in, core_terminal_t &out) } } -void setup_t::connect_terminals(core_terminal_t &t1, core_terminal_t &t2) +void setup_t::connect_terminals(detail::core_terminal_t &t1, detail::core_terminal_t &t2) { if (t1.has_net() && t2.has_net()) { @@ -566,7 +567,7 @@ void setup_t::connect_terminals(core_terminal_t &t1, core_terminal_t &t2) } } -static core_terminal_t &resolve_proxy(core_terminal_t &term) +static detail::core_terminal_t &resolve_proxy(detail::core_terminal_t &term) { if (term.is_logic()) { @@ -577,7 +578,7 @@ static core_terminal_t &resolve_proxy(core_terminal_t &term) return term; } -bool setup_t::connect_input_input(core_terminal_t &t1, core_terminal_t &t2) +bool setup_t::connect_input_input(detail::core_terminal_t &t1, detail::core_terminal_t &t2) { bool ret = false; if (t1.has_net()) @@ -588,7 +589,7 @@ bool setup_t::connect_input_input(core_terminal_t &t1, core_terminal_t &t2) { for (auto & t : t1.net().m_core_terms) { - if (t->is_type(core_terminal_t::TERMINAL)) + if (t->is_type(detail::core_terminal_t::TERMINAL)) ret = connect(t2, *t); if (ret) break; @@ -603,7 +604,7 @@ bool setup_t::connect_input_input(core_terminal_t &t1, core_terminal_t &t2) { for (auto & t : t2.net().m_core_terms) { - if (t->is_type(core_terminal_t::TERMINAL)) + if (t->is_type(detail::core_terminal_t::TERMINAL)) ret = connect(t1, *t); if (ret) break; @@ -615,46 +616,46 @@ bool setup_t::connect_input_input(core_terminal_t &t1, core_terminal_t &t2) -bool setup_t::connect(core_terminal_t &t1_in, core_terminal_t &t2_in) +bool setup_t::connect(detail::core_terminal_t &t1_in, detail::core_terminal_t &t2_in) { log().debug("Connecting {1} to {2}\n", t1_in.name(), t2_in.name()); - core_terminal_t &t1 = resolve_proxy(t1_in); - core_terminal_t &t2 = resolve_proxy(t2_in); + detail::core_terminal_t &t1 = resolve_proxy(t1_in); + detail::core_terminal_t &t2 = resolve_proxy(t2_in); bool ret = true; - if (t1.is_type(core_terminal_t::OUTPUT) && t2.is_type(core_terminal_t::INPUT)) + if (t1.is_type(detail::core_terminal_t::OUTPUT) && t2.is_type(detail::core_terminal_t::INPUT)) { if (t2.has_net() && t2.net().isRailNet()) log().fatal("Input {1} already connected\n", t2.name()); connect_input_output(t2, t1); } - else if (t1.is_type(core_terminal_t::INPUT) && t2.is_type(core_terminal_t::OUTPUT)) + else if (t1.is_type(detail::core_terminal_t::INPUT) && t2.is_type(detail::core_terminal_t::OUTPUT)) { if (t1.has_net() && t1.net().isRailNet()) log().fatal("Input {1} already connected\n", t1.name()); connect_input_output(t1, t2); } - else if (t1.is_type(core_terminal_t::OUTPUT) && t2.is_type(core_terminal_t::TERMINAL)) + else if (t1.is_type(detail::core_terminal_t::OUTPUT) && t2.is_type(detail::core_terminal_t::TERMINAL)) { connect_terminal_output(dynamic_cast<terminal_t &>(t2), t1); } - else if (t1.is_type(core_terminal_t::TERMINAL) && t2.is_type(core_terminal_t::OUTPUT)) + else if (t1.is_type(detail::core_terminal_t::TERMINAL) && t2.is_type(detail::core_terminal_t::OUTPUT)) { connect_terminal_output(dynamic_cast<terminal_t &>(t1), t2); } - else if (t1.is_type(core_terminal_t::INPUT) && t2.is_type(core_terminal_t::TERMINAL)) + else if (t1.is_type(detail::core_terminal_t::INPUT) && t2.is_type(detail::core_terminal_t::TERMINAL)) { connect_terminal_input(dynamic_cast<terminal_t &>(t2), t1); } - else if (t1.is_type(core_terminal_t::TERMINAL) && t2.is_type(core_terminal_t::INPUT)) + else if (t1.is_type(detail::core_terminal_t::TERMINAL) && t2.is_type(detail::core_terminal_t::INPUT)) { connect_terminal_input(dynamic_cast<terminal_t &>(t1), t2); } - else if (t1.is_type(core_terminal_t::TERMINAL) && t2.is_type(core_terminal_t::TERMINAL)) + else if (t1.is_type(detail::core_terminal_t::TERMINAL) && t2.is_type(detail::core_terminal_t::TERMINAL)) { connect_terminals(dynamic_cast<terminal_t &>(t1), dynamic_cast<terminal_t &>(t2)); } - else if (t1.is_type(core_terminal_t::INPUT) && t2.is_type(core_terminal_t::INPUT)) + else if (t1.is_type(detail::core_terminal_t::INPUT) && t2.is_type(detail::core_terminal_t::INPUT)) { ret = connect_input_input(t1, t2); } @@ -682,8 +683,8 @@ void setup_t::resolve_inputs() { const pstring t1s = li->first; const pstring t2s = li->second; - core_terminal_t *t1 = find_terminal(t1s); - core_terminal_t *t2 = find_terminal(t2s); + detail::core_terminal_t *t1 = find_terminal(t1s); + detail::core_terminal_t *t2 = find_terminal(t2s); if (connect(*t1, *t2)) li = m_links.erase(li); @@ -720,7 +721,7 @@ void setup_t::resolve_inputs() log().verbose("looking for terminals not connected ..."); for (auto & i : m_terminals) { - core_terminal_t *term = i.second; + detail::core_terminal_t *term = i.second; if (!term->has_net() && dynamic_cast< devices::NETLIB_NAME(dummy_input) *>(&term->device()) != nullptr) log().warning("Found dummy terminal {1} without connections", term->name()); else if (!term->has_net()) @@ -777,61 +778,7 @@ void setup_t::start_devices() } } - /* make sure the solver and parameters are started first! */ - - for (auto & e : m_device_factory) - { - if ( factory().is_class<devices::NETLIB_NAME(mainclock)>(e.second) - || factory().is_class<devices::NETLIB_NAME(solver)>(e.second) - || factory().is_class<devices::NETLIB_NAME(gnd)>(e.second) - || factory().is_class<devices::NETLIB_NAME(netlistparams)>(e.second)) - { - auto dev = plib::owned_ptr<device_t>(e.second->Create(netlist(), e.first)); - netlist().register_dev(std::move(dev)); - } - } - - log().debug("Searching for mainclock and solver ...\n"); - - netlist().m_mainclock = netlist().get_single_device<devices::NETLIB_NAME(mainclock)>("mainclock"); - netlist().m_solver = netlist().get_single_device<devices::NETLIB_NAME(solver)>("solver"); - netlist().m_gnd = netlist().get_single_device<devices::NETLIB_NAME(gnd)>("gnd"); - netlist().m_params = netlist().get_single_device<devices::NETLIB_NAME(netlistparams)>("parameter"); - - /* create devices */ - - for (auto & e : m_device_factory) - { - if ( !factory().is_class<devices::NETLIB_NAME(mainclock)>(e.second) - && !factory().is_class<devices::NETLIB_NAME(solver)>(e.second) - && !factory().is_class<devices::NETLIB_NAME(gnd)>(e.second) - && !factory().is_class<devices::NETLIB_NAME(netlistparams)>(e.second)) - { - auto dev = plib::owned_ptr<device_t>(e.second->Create(netlist(), e.first)); - netlist().register_dev(std::move(dev)); - } - } - - bool use_deactivate = (netlist().m_params->m_use_deactivate.Value() ? true : false); - - for (auto &d : netlist().m_devices) - { - if (use_deactivate) - { - auto p = m_param_values.find(d->name() + ".HINT_NO_DEACTIVATE"); - if (p != m_param_values.end()) - { - //FIXME: Error checking - auto v = p->second.as_long(); - d->set_hint_deactivate(!v); - } - } - else - d->set_hint_deactivate(false); - } - netlist().start(); - } plib::plog_base<NL_DEBUG> &setup_t::log() @@ -901,13 +848,13 @@ static pstring model_string(model_map_t &map) void setup_t::model_parse(const pstring &model_in, model_map_t &map) { pstring model = model_in; - int pos = 0; + pstring::iterator pos(nullptr); pstring key; while (true) { pos = model.find("("); - if (pos >= 0) break; + if (pos != model.end()) break; key = model.ucase(); auto i = m_models.find(key); @@ -931,13 +878,14 @@ void setup_t::model_parse(const pstring &model_in, model_map_t &map) pstring remainder=model.substr(pos+1).trim(); if (!remainder.endsWith(")")) log().fatal("Model error {1}\n", model); - remainder = remainder.left(remainder.len() - 1); + // FIMXE: Not optimal + remainder = remainder.left(remainder.begin() + (remainder.len() - 1)); plib::pstring_vector_t pairs(remainder," ", true); for (pstring &pe : pairs) { - int pose = pe.find("="); - if (pose < 0) + auto pose = pe.find("="); + if (pose == pe.end()) log().fatal("Model error on pair {1}\n", model); map[pe.left(pose).ucase()] = pe.substr(pose+1); } @@ -962,8 +910,8 @@ nl_double setup_t::model_value(model_map_t &map, const pstring &entity) pstring tmp = model_value_str(map, entity); nl_double factor = NL_FCONST(1.0); - pstring numfac = tmp.right(1); - switch (numfac.code_at(0)) + auto p = tmp.begin() + (tmp.len() - 1); + switch (*p) { case 'M': factor = 1e6; break; case 'k': factor = 1e3; break; @@ -974,11 +922,11 @@ nl_double setup_t::model_value(model_map_t &map, const pstring &entity) case 'f': factor = 1e-15; break; case 'a': factor = 1e-18; break; default: - if (numfac < "0" || numfac > "9") - nl_exception(plib::pfmt("Unknown number factor <{1}> in: {2}")(numfac)(entity)); + if (*p < '0' || *p > '9') + nl_exception(plib::pfmt("Unknown number factor in: {1}")(entity)); } if (factor != NL_FCONST(1.0)) - tmp = tmp.left(tmp.len() - 1); + tmp = tmp.left(tmp.begin() + (tmp.len() - 1)); return tmp.as_double() * factor; } @@ -1013,7 +961,7 @@ bool setup_t::parse_stream(plib::pistream &istrm, const pstring &name) void setup_t::register_define(pstring defstr) { auto p = defstr.find("="); - if (p>0) + if (p != defstr.end()) register_define(defstr.left(p), defstr.substr(p+1)); else register_define(defstr, "1"); diff --git a/src/lib/netlist/nl_setup.h b/src/lib/netlist/nl_setup.h index 85dc1eb4fd5..86de48e81ce 100644 --- a/src/lib/netlist/nl_setup.h +++ b/src/lib/netlist/nl_setup.h @@ -120,8 +120,8 @@ namespace netlist { pstring name; pstring classname; - unsigned ni; - unsigned no; + unsigned long ni; + unsigned long no; pstring def_param; plib::pstring_vector_t desc; pstring family; @@ -184,7 +184,7 @@ namespace netlist void register_and_set_param(pstring name, param_t ¶m); - void register_term(core_terminal_t &obj); + void register_term(detail::core_terminal_t &obj); void register_dev(const pstring &classname, const pstring &name); @@ -207,7 +207,7 @@ namespace netlist void remove_connections(const pstring attach); - bool connect(core_terminal_t &t1, core_terminal_t &t2); + bool connect(detail::core_terminal_t &t1, detail::core_terminal_t &t2); bool device_exists(const pstring name) const; @@ -250,11 +250,6 @@ namespace netlist void model_parse(const pstring &model, model_map_t &map); - plib::plog_base<NL_DEBUG> &log(); - const plib::plog_base<NL_DEBUG> &log() const; - - std::vector<std::pair<pstring, base_factory_t *>> m_device_factory; - /* FIXME: truth table trampoline */ void tt_factory_create(tt_desc &desc); @@ -262,47 +257,44 @@ namespace netlist /* helper - also used by nltool */ const pstring resolve_alias(const pstring &name) const; - protected: - - private: - - core_terminal_t *find_terminal(const pstring &outname_in, bool required = true); - core_terminal_t *find_terminal(const pstring &outname_in, device_object_t::type_t atype, bool required = true); - - void connect_terminals(core_terminal_t &in, core_terminal_t &out); - void connect_input_output(core_terminal_t &in, core_terminal_t &out); - void connect_terminal_output(terminal_t &in, core_terminal_t &out); - void connect_terminal_input(terminal_t &term, core_terminal_t &inp); - bool connect_input_input(core_terminal_t &t1, core_terminal_t &t2); - - // helpers - pstring objtype_as_str(device_object_t &in) const; - - devices::nld_base_proxy *get_d_a_proxy(core_terminal_t &out); + plib::plog_base<NL_DEBUG> &log(); + const plib::plog_base<NL_DEBUG> &log() const; - netlist_t &m_netlist; + std::vector<std::pair<pstring, base_factory_t *>> m_device_factory; - public: std::unordered_map<pstring, pstring> m_alias; - std::unordered_map<pstring, param_ref_t> m_params; std::unordered_map<pstring, pstring> m_param_values; - std::unordered_map<pstring, core_terminal_t *> m_terminals; + std::unordered_map<pstring, detail::core_terminal_t *> m_terminals; + private: - std::vector<link_t> m_links; + detail::core_terminal_t *find_terminal(const pstring &outname_in, bool required = true); + detail::core_terminal_t *find_terminal(const pstring &outname_in, detail::device_object_t::type_t atype, bool required = true); - factory_list_t m_factory; + void connect_terminals(detail::core_terminal_t &in, detail::core_terminal_t &out); + void connect_input_output(detail::core_terminal_t &in, detail::core_terminal_t &out); + void connect_terminal_output(terminal_t &in, detail::core_terminal_t &out); + void connect_terminal_input(terminal_t &term, detail::core_terminal_t &inp); + bool connect_input_input(detail::core_terminal_t &t1, detail::core_terminal_t &t2); + + // helpers + pstring objtype_as_str(detail::device_object_t &in) const; - std::unordered_map<pstring, pstring> m_models; + devices::nld_base_proxy *get_d_a_proxy(detail::core_terminal_t &out); - int m_proxy_cnt; - int m_frontier_cnt; + netlist_t &m_netlist; + std::unordered_map<pstring, param_ref_t> m_params; + std::vector<link_t> m_links; + factory_list_t m_factory; + std::unordered_map<pstring, pstring> m_models; - std::stack<pstring> m_namespace_stack; - source_t::list_t m_sources; - std::vector<plib::ppreprocessor::define_t> m_defines; - std::vector<pstring> m_lib; + std::stack<pstring> m_namespace_stack; + source_t::list_t m_sources; + std::vector<plib::ppreprocessor::define_t> m_defines; + std::vector<pstring> m_lib; + unsigned m_proxy_cnt; + unsigned m_frontier_cnt; }; // ---------------------------------------------------------------------------------------- diff --git a/src/lib/netlist/nl_time.h b/src/lib/netlist/nl_time.h index 974ba4c669c..bd9a12168e9 100644 --- a/src/lib/netlist/nl_time.h +++ b/src/lib/netlist/nl_time.h @@ -104,7 +104,8 @@ namespace netlist } constexpr internal_type as_raw() const { return m_time; } - constexpr double as_double() const { return (double) m_time / (double) resolution; } + constexpr double as_double() const { return static_cast<double>(m_time) + / static_cast<double>(resolution); } // for save states .... internal_type *get_internaltype_ptr() { return &m_time; } @@ -114,7 +115,7 @@ namespace netlist static constexpr ptime from_msec(const internal_type ms) { return ptime(ms, UINT64_C(1000)); } static constexpr ptime from_hz(const internal_type hz) { return ptime(1 , hz); } static constexpr ptime from_raw(const internal_type raw) { return ptime(raw, resolution); } - static constexpr ptime from_double(const double t) { return ptime((internal_type) ( t * (double) resolution), resolution); } + static constexpr ptime from_double(const double t) { return ptime(static_cast<internal_type>( t * static_cast<double>(resolution)), resolution); } static constexpr ptime zero() { return ptime(0, resolution); } static constexpr ptime quantum() { return ptime(1, resolution); } diff --git a/src/lib/netlist/plib/palloc.cpp b/src/lib/netlist/plib/palloc.cpp index ef9e42dcba5..c89c2ed7e63 100644 --- a/src/lib/netlist/plib/palloc.cpp +++ b/src/lib/netlist/plib/palloc.cpp @@ -12,7 +12,6 @@ #include "pfmtlog.h" namespace plib { - //============================================================ // Exceptions //============================================================ @@ -56,7 +55,7 @@ out_of_mem_e::out_of_mem_e(const pstring &location) // Memory pool //============================================================ -mempool::mempool(int min_alloc, int min_align) +mempool::mempool(size_t min_alloc, size_t min_align) : m_min_alloc(min_alloc), m_min_align(min_align) { } @@ -71,7 +70,7 @@ mempool::~mempool() m_blocks.clear(); } -int mempool::new_block() +size_t mempool::new_block() { block b; b.data = new char[m_min_alloc]; @@ -93,21 +92,21 @@ void *mempool::alloc(size_t size) { b.m_free -= rs; b.m_num_alloc++; - info *i = (info *) b.cur_ptr; + auto i = reinterpret_cast<info *>(b.cur_ptr); i->m_block = bn; - void *ret = (void *) (b.cur_ptr + sizeof(info)); + auto ret = reinterpret_cast<void *>(b.cur_ptr + sizeof(info)); b.cur_ptr += rs; return ret; } } { - int bn = new_block(); + size_t bn = new_block(); auto &b = m_blocks[bn]; b.m_num_alloc = 1; b.m_free = m_min_alloc - rs; - info *i = (info *) b.cur_ptr; + auto i = reinterpret_cast<info *>(b.cur_ptr); i->m_block = bn; - void *ret = (void *) (b.cur_ptr + sizeof(info)); + auto ret = reinterpret_cast<void *>(b.cur_ptr + sizeof(info)); b.cur_ptr += rs; return ret; } @@ -115,9 +114,9 @@ void *mempool::alloc(size_t size) void mempool::free(void *ptr) { - char *p = (char *) ptr; + auto p = reinterpret_cast<char *>(ptr); - info *i = (info *) (p - sizeof(info)); + auto i = reinterpret_cast<info *>(p - sizeof(info)); block *b = &m_blocks[i->m_block]; if (b->m_num_alloc == 0) fprintf(stderr, "Argh .. double free\n"); diff --git a/src/lib/netlist/plib/palloc.h b/src/lib/netlist/plib/palloc.h index cd21be0c91e..fb467fbe173 100644 --- a/src/lib/netlist/plib/palloc.h +++ b/src/lib/netlist/plib/palloc.h @@ -17,7 +17,6 @@ #include "pstring.h" namespace plib { - //============================================================ // exception base //============================================================ @@ -204,7 +203,7 @@ private: char *data; }; - int new_block(); + size_t new_block(); struct info { @@ -213,14 +212,14 @@ private: }; public: - mempool(int min_alloc, int min_align); + mempool(size_t min_alloc, size_t min_align); ~mempool(); void *alloc(size_t size); void free(void *ptr); - int m_min_alloc; - int m_min_align; + size_t m_min_alloc; + size_t m_min_align; std::vector<block> m_blocks; }; diff --git a/src/lib/netlist/plib/pchrono.h b/src/lib/netlist/plib/pchrono.h index efb8cc061b5..e37cd995ab5 100644 --- a/src/lib/netlist/plib/pchrono.h +++ b/src/lib/netlist/plib/pchrono.h @@ -183,7 +183,8 @@ namespace chrono { type total() const { return m_time; } ctype count() const { return m_count; } - double as_seconds() const { return (double) total() / (double) T::per_second(); } + double as_seconds() const { return static_cast<double>(total()) + / static_cast<double>(T::per_second()); } constexpr static bool enabled = enabled_; private: diff --git a/src/lib/netlist/plib/pdynlib.cpp b/src/lib/netlist/plib/pdynlib.cpp index 6aa1f180aa3..2088ab47c1b 100644 --- a/src/lib/netlist/plib/pdynlib.cpp +++ b/src/lib/netlist/plib/pdynlib.cpp @@ -5,9 +5,54 @@ * */ -#include <plib/pdynlib.h> +#include "pdynlib.h" + #ifdef WIN32 #include "windows.h" +#include "palloc.h" + +namespace plib { +CHAR *astring_from_utf8(const char *utf8string) +{ + WCHAR *wstring; + int char_count; + CHAR *result; + + // convert MAME string (UTF-8) to UTF-16 + char_count = MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, nullptr, 0); + wstring = (WCHAR *)alloca(char_count * sizeof(*wstring)); + MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, wstring, char_count); + + // convert UTF-16 to "ANSI code page" string + char_count = WideCharToMultiByte(CP_ACP, 0, wstring, -1, nullptr, 0, nullptr, nullptr); + result = palloc_array<CHAR>(char_count); + if (result != nullptr) + WideCharToMultiByte(CP_ACP, 0, wstring, -1, result, char_count, nullptr, nullptr); + + return result; +} + +WCHAR *wstring_from_utf8(const char *utf8string) +{ + int char_count; + WCHAR *result; + + // convert MAME string (UTF-8) to UTF-16 + char_count = MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, nullptr, 0); + result = palloc_array<WCHAR>(char_count); + if (result != nullptr) + MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, result, char_count); + + return result; +} +} + +#ifdef UNICODE +#define tstring_from_utf8 plib::wstring_from_utf8 +#else // !UNICODE +#define tstring_from_utf8 plib::astring_from_utf8 +#endif // UNICODE + #else #include <dlfcn.h> #endif @@ -18,14 +63,16 @@ dynlib::dynlib(const pstring libname) { #ifdef WIN32 //fprintf(stderr, "win: loading <%s>\n", libname.cstr()); + TCHAR *buffer = tstring_from_utf8(libname.cstr()); if (libname != "") - m_lib = LoadLibrary(libname.cstr()); + m_lib = LoadLibrary(buffer); else m_lib = GetModuleHandle(nullptr); if (m_lib != nullptr) m_isLoaded = true; //else // fprintf(stderr, "win: library <%s> not found!\n", libname.cstr()); + pfree_array(buffer); #else //printf("loading <%s>\n", libname.cstr()); if (libname != "") @@ -44,8 +91,9 @@ dynlib::dynlib(const pstring path, const pstring libname) { // printf("win: loading <%s>\n", libname.cstr()); #ifdef WIN32 + TCHAR *buffer = tstring_from_utf8(libname.cstr()); if (libname != "") - m_lib = LoadLibrary(libname.cstr()); + m_lib = LoadLibrary(buffer); else m_lib = GetModuleHandle(nullptr); if (m_lib != nullptr) @@ -54,6 +102,7 @@ dynlib::dynlib(const pstring path, const pstring libname) { //printf("win: library <%s> not found!\n", libname.cstr()); } + pfree_array(buffer); #else //printf("loading <%s>\n", libname.cstr()); if (libname != "") diff --git a/src/lib/netlist/plib/pfmtlog.cpp b/src/lib/netlist/plib/pfmtlog.cpp index e29753c7a81..770a53af49d 100644 --- a/src/lib/netlist/plib/pfmtlog.cpp +++ b/src/lib/netlist/plib/pfmtlog.cpp @@ -20,7 +20,7 @@ namespace plib { pfmt::pfmt(const pstring &fmt) : m_str(m_str_buf), m_allocated(0), m_arg(0) { - unsigned l = fmt.blen() + 1; + std::size_t l = fmt.blen() + 1; if (l>sizeof(m_str_buf)) { m_allocated = 2 * l; @@ -32,7 +32,7 @@ pfmt::pfmt(const pstring &fmt) pfmt::pfmt(const char *fmt) : m_str(m_str_buf), m_allocated(0), m_arg(0) { - unsigned l = strlen(fmt) + 1; + std::size_t l = strlen(fmt) + 1; if (l>sizeof(m_str_buf)) { m_allocated = 2 * l; @@ -55,11 +55,11 @@ void pfmt::format_element(const char *f, const char *l, const char *fmt_spec, . char search[10] = ""; char buf[2048]; m_arg++; - int sl = sprintf(search, "{%d:", m_arg); + std::size_t sl = static_cast<std::size_t>(sprintf(search, "{%d:", m_arg)); char *p = strstr(m_str, search); if (p == nullptr) { - sl = sprintf(search, "{%d}", m_arg); + sl = static_cast<std::size_t>(sprintf(search, "{%d}", m_arg)); p = strstr(m_str, search); if (p == nullptr) { @@ -75,8 +75,8 @@ void pfmt::format_element(const char *f, const char *l, const char *fmt_spec, . char *p1 = strstr(p, "}"); if (p1 != nullptr) { - sl = p1 - p + 1; - strncat(fmt, p+1, p1 - p - 2); + sl = static_cast<std::size_t>(p1 - p + 1); + strncat(fmt, p+1, static_cast<std::size_t>(p1 - p - 2)); } else strcat(fmt, f); @@ -90,11 +90,11 @@ void pfmt::format_element(const char *f, const char *l, const char *fmt_spec, . char *p1 = strstr(p, "}"); if (p1 != nullptr) { - sl = p1 - p + 1; + sl = static_cast<std::size_t>(p1 - p + 1); if (m_arg>=10) - strncat(fmt, p+4, p1 - p - 4); + strncat(fmt, p+4, static_cast<std::size_t>(p1 - p - 4)); else - strncat(fmt, p+3, p1 - p - 3); + strncat(fmt, p+3, static_cast<std::size_t>(p1 - p - 3)); } else strcat(fmt, f); @@ -113,14 +113,14 @@ void pfmt::format_element(const char *f, const char *l, const char *fmt_spec, . } else strcat(fmt, fmt_spec); - int nl = vsprintf(buf, fmt, ap); + std::size_t nl = static_cast<std::size_t>(vsprintf(buf, fmt, ap)); if (p != nullptr) { // check room - unsigned new_size = (p - m_str) + nl + strlen(p) + 1 - sl; + std::size_t new_size = static_cast<std::size_t>(p - m_str) + nl + strlen(p) + 1 - sl; if (new_size > m_allocated) { - unsigned old_alloc = std::max(m_allocated, (unsigned) sizeof(m_str_buf)); + std::size_t old_alloc = std::max(m_allocated, sizeof(m_str_buf)); if (m_allocated < old_alloc) m_allocated = old_alloc; while (new_size > m_allocated) diff --git a/src/lib/netlist/plib/pfmtlog.h b/src/lib/netlist/plib/pfmtlog.h index 6fa7ac55776..44397da115a 100644 --- a/src/lib/netlist/plib/pfmtlog.h +++ b/src/lib/netlist/plib/pfmtlog.h @@ -21,6 +21,14 @@ struct ptype_treats }; template<> +struct ptype_treats<bool> +{ + static unsigned int cast(bool x) { return static_cast<unsigned int>(x); } + static const bool is_signed = false; + static const char *size_specifier() { return ""; } +}; + +template<> struct ptype_treats<char> { static short cast(char x) { return x; } @@ -119,6 +127,7 @@ public: P &operator ()(char *x, const char *f = "") { format_element(f, "", "s", x); return static_cast<P &>(*this); } P &operator ()(const void *x, const char *f = "") { format_element(f, "", "p", x); return static_cast<P &>(*this); } P &operator ()(const pstring &x, const char *f = "") { format_element(f, "", "s", x.cstr() ); return static_cast<P &>(*this); } + P &operator ()(const pstring_t<putf8_traits> &x, const char *f = "") { format_element(f, "", "s", x.cstr() ); return static_cast<P &>(*this); } template<typename T> P &operator ()(const T x, const char *f = "") @@ -169,7 +178,7 @@ private: char *m_str; char m_str_buf[256]; - unsigned m_allocated; + std::size_t m_allocated; unsigned m_arg; }; diff --git a/src/lib/netlist/plib/poptions.cpp b/src/lib/netlist/plib/poptions.cpp index e6bc45d15eb..2060e8ec46c 100644 --- a/src/lib/netlist/plib/poptions.cpp +++ b/src/lib/netlist/plib/poptions.cpp @@ -113,11 +113,13 @@ namespace plib { } else if (arg.startsWith("-")) { - opt = getopt_short(arg.substr(1,1)); - if (arg.len() > 2) + auto p = arg.begin() + 1; + opt = getopt_short(arg.substr(p,p + 1)); + ++p; + if (p != arg.end()) { has_equal_arg = true; - opt_arg = arg.substr(2); + opt_arg = arg.substr(p); } } else @@ -204,7 +206,7 @@ namespace plib { { line += v + "|"; } - line = line.left(line.len() - 1); + line = line.left(line.begin() + (line.len() - 1)); } else line += "Value"; diff --git a/src/lib/netlist/plib/pparser.cpp b/src/lib/netlist/plib/pparser.cpp index cfa30669801..be52b27dc30 100644 --- a/src/lib/netlist/plib/pparser.cpp +++ b/src/lib/netlist/plib/pparser.cpp @@ -29,7 +29,7 @@ void ptokenizer::skipeol() { c = getc(); if (c != 13) - ungetc(); + ungetc(c); return; } c = getc(); @@ -39,24 +39,28 @@ void ptokenizer::skipeol() pstring::code_t ptokenizer::getc() { - if (m_px >= m_cur_line.len()) + if (m_unget != 0) + { + pstring::code_t c = m_unget; + m_unget = 0; + return c; + } + if (m_px == m_cur_line.end()) { m_lineno++; if (m_strm.readline(m_cur_line)) - { - if (m_cur_line.right(1) != "\n") - m_cur_line += "\n"; - m_px = 0; - } + m_px = m_cur_line.begin(); else return 0; + return '\n'; } - return m_cur_line.code_at(m_px++); + pstring::code_t c = *(m_px++); + return c; } -void ptokenizer::ungetc() +void ptokenizer::ungetc(pstring::code_t c) { - m_px--; + m_unget = c; } void ptokenizer::require_token(const token_id_t &token_num) @@ -68,7 +72,11 @@ void ptokenizer::require_token(const token_t tok, const token_id_t &token_num) { if (!tok.is(token_num)) { - error(pfmt("Expected token <{1}> got <{2}>")(m_tokens[token_num.id()])(tok.str()) ); + pstring val(""); + for (auto &i : m_tokens) + if (i.second.id() == token_num.id()) + val = i.first; + error(pfmt("Expected token <{1}> got <{2}>")(val)(tok.str()) ); } } @@ -163,7 +171,7 @@ ptokenizer::token_t ptokenizer::get_token_internal() { /* skip ws */ pstring::code_t c = getc(); - while (m_whitespace.find(c)>=0) + while (m_whitespace.find(c) != m_whitespace.end()) { c = getc(); if (eof()) @@ -171,7 +179,7 @@ ptokenizer::token_t ptokenizer::get_token_internal() return token_t(ENDOFFILE); } } - if (m_number_chars_start.find(c)>=0) + if (m_number_chars_start.find(c) != m_number_chars_start.end()) { /* read number while we receive number or identifier chars * treat it as an identifier when there are identifier chars in it @@ -180,32 +188,30 @@ ptokenizer::token_t ptokenizer::get_token_internal() token_type ret = NUMBER; pstring tokstr = ""; while (true) { - if (m_identifier_chars.find(c)>=0 && m_number_chars.find(c)<0) + if (m_identifier_chars.find(c) != m_identifier_chars.end() && m_number_chars.find(c) == m_number_chars.end()) ret = IDENTIFIER; - else if (m_number_chars.find(c)<0) + else if (m_number_chars.find(c) == m_number_chars.end()) break; tokstr += c; c = getc(); } - ungetc(); + ungetc(c); return token_t(ret, tokstr); } - else if (m_identifier_chars.find(c)>=0) + else if (m_identifier_chars.find(c) != m_identifier_chars.end()) { /* read identifier till non identifier char */ pstring tokstr = ""; - while (m_identifier_chars.find(c)>=0) { + while (m_identifier_chars.find(c) != m_identifier_chars.end()) { tokstr += c; c = getc(); } - ungetc(); - token_id_t id(plib::container::indexof(m_tokens, tokstr)); - if (id.id() >= 0) - return token_t(id, tokstr); + ungetc(c); + auto id = m_tokens.find(tokstr); + if (id != m_tokens.end()) + return token_t(id->second, tokstr); else - { return token_t(IDENTIFIER, tokstr); - } } else if (c == m_string) { @@ -222,27 +228,24 @@ ptokenizer::token_t ptokenizer::get_token_internal() { /* read identifier till first identifier char or ws */ pstring tokstr = ""; - while ((m_identifier_chars.find(c)) < 0 && (m_whitespace.find(c) < 0)) { + while ((m_identifier_chars.find(c)) == m_identifier_chars.end() && (m_whitespace.find(c) == m_whitespace.end())) { tokstr += c; /* expensive, check for single char tokens */ if (tokstr.len() == 1) { - token_id_t id(plib::container::indexof(m_tokens, tokstr)); - if (id.id() >= 0) - return token_t(id, tokstr); + auto id = m_tokens.find(tokstr); + if (id != m_tokens.end()) + return token_t(id->second, tokstr); } c = getc(); } - ungetc(); - token_id_t id(plib::container::indexof(m_tokens, tokstr)); - if (id.id() >= 0) - return token_t(id, tokstr); + ungetc(c); + auto id = m_tokens.find(tokstr); + if (id != m_tokens.end()) + return token_t(id->second, tokstr); else - { return token_t(UNKNOWN, tokstr); - } } - } void ptokenizer::error(const pstring &errs) @@ -406,7 +409,7 @@ pstring ppreprocessor::process_line(const pstring &line) std::size_t start = 0; lt = replace_macros(lt); pstring_vector_t t(lt.substr(3).replace(" ",""), m_expr_sep); - int val = expr(t, start, 0); + int val = static_cast<int>(expr(t, start, 0)); if (val == 0) m_ifflag |= (1 << m_level); } diff --git a/src/lib/netlist/plib/pparser.h b/src/lib/netlist/plib/pparser.h index 463fdad9b76..301a4fc30a2 100644 --- a/src/lib/netlist/plib/pparser.h +++ b/src/lib/netlist/plib/pparser.h @@ -25,7 +25,7 @@ public: virtual ~ptokenizer() {} explicit ptokenizer(pistream &strm) - : m_strm(strm), m_lineno(0), m_px(0), m_string('"') + : m_strm(strm), m_lineno(0), m_cur_line(""), m_px(m_cur_line.begin()), m_unget(0), m_string('"') {} enum token_type @@ -42,32 +42,29 @@ public: struct token_id_t { public: - token_id_t() : m_id(-2) {} - token_id_t(const int id) : m_id(id) {} - int id() const { return m_id; } + + static const std::size_t npos = static_cast<std::size_t>(-1); + + token_id_t() : m_id(npos) {} + token_id_t(const std::size_t id) : m_id(id) {} + std::size_t id() const { return m_id; } private: - int m_id; + std::size_t m_id; }; struct token_t { token_t(token_type type) + : m_type(type), m_id(), m_token("") { - m_type = type; - m_id = token_id_t(-1); - m_token =""; } token_t(token_type type, const pstring &str) + : m_type(type), m_id(), m_token(str) { - m_type = type; - m_id = token_id_t(-1); - m_token = str; } token_t(const token_id_t id, const pstring &str) + : m_type(TOKEN), m_id(id), m_token(str) { - m_type = TOKEN; - m_id = id; - m_token = str; } bool is(const token_id_t &tok_id) const { return m_id.id() == tok_id.id(); } @@ -101,13 +98,14 @@ public: token_id_t register_token(pstring token) { - m_tokens.push_back(token); - return token_id_t(m_tokens.size() - 1); + token_id_t ret(m_tokens.size()); + m_tokens.emplace(token, ret); + return ret; } void set_identifier_chars(pstring s) { m_identifier_chars = s; } void set_number_chars(pstring st, pstring rem) { m_number_chars_start = st; m_number_chars = rem; } - void set_string_char(char c) { m_string = c; } + void set_string_char(pstring::code_t c) { m_string = c; } void set_whitespace(pstring s) { m_whitespace = s; } void set_comment(pstring start, pstring end, pstring line) { @@ -126,7 +124,7 @@ private: void skipeol(); pstring::code_t getc(); - void ungetc(); + void ungetc(pstring::code_t c); bool eof() { return m_strm.eof(); } @@ -134,14 +132,15 @@ private: int m_lineno; pstring m_cur_line; - unsigned m_px; + pstring::iterator m_px; + pstring::code_t m_unget; /* tokenizer stuff follows ... */ pstring m_identifier_chars; pstring m_number_chars; pstring m_number_chars_start; - std::vector<pstring> m_tokens; + std::unordered_map<pstring, token_id_t> m_tokens; pstring m_whitespace; pstring::code_t m_string; diff --git a/src/lib/netlist/plib/pstate.cpp b/src/lib/netlist/plib/pstate.cpp index 753671ceeda..61535acac09 100644 --- a/src/lib/netlist/plib/pstate.cpp +++ b/src/lib/netlist/plib/pstate.cpp @@ -19,7 +19,7 @@ state_manager_t::~state_manager_t() -void state_manager_t::save_state_ptr(const void *owner, const pstring &stname, const datatype_t dt, const int count, void *ptr) +void state_manager_t::save_state_ptr(const void *owner, const pstring &stname, const datatype_t dt, const std::size_t count, void *ptr) { auto p = plib::make_unique<entry_t>(stname, dt, owner, count, ptr); m_save.push_back(std::move(p)); diff --git a/src/lib/netlist/plib/pstate.h b/src/lib/netlist/plib/pstate.h index df6dd4d7901..cd6c8efe38b 100644 --- a/src/lib/netlist/plib/pstate.h +++ b/src/lib/netlist/plib/pstate.h @@ -113,7 +113,7 @@ public: save_state_ptr(owner, stname, datatype_f<C>::f(), N, &(state[0])); } - template<typename C> void save_item(const void *owner, C *state, const pstring &stname, const int count) + template<typename C> void save_item(const void *owner, C *state, const pstring &stname, const std::size_t count) { save_state_ptr(owner, stname, datatype_f<C>::f(), count, state); } @@ -130,7 +130,7 @@ public: const entry_t::list_t &save_list() const { return m_save; } - void save_state_ptr(const void *owner, const pstring &stname, const datatype_t dt, const int count, void *ptr); + void save_state_ptr(const void *owner, const pstring &stname, const datatype_t dt, const std::size_t count, void *ptr); protected: diff --git a/src/lib/netlist/plib/pstream.cpp b/src/lib/netlist/plib/pstream.cpp index 9fcede380d5..ad2010213f9 100644 --- a/src/lib/netlist/plib/pstream.cpp +++ b/src/lib/netlist/plib/pstream.cpp @@ -47,7 +47,7 @@ bool pistream::readline(pstring &line) void postream::write(pistream &strm) { char buf[1024]; - unsigned r; + pos_type r; while ((r=strm.read(buf, 1024)) > 0) write(buf, r); } @@ -78,9 +78,9 @@ pifilestream::pifilestream(void *file, const pstring name, const bool do_close) void pifilestream::init() { - if (ftell((FILE *) m_file) >= 0) + if (ftell(static_cast<FILE *>(m_file)) >= 0) { - if (fseek((FILE *) m_file, 0, SEEK_SET) >= 0) + if (fseek(static_cast<FILE *>(m_file), 0, SEEK_SET) >= 0) set_flag(FLAG_SEEKABLE); } } @@ -89,18 +89,18 @@ pifilestream::~pifilestream() { if (m_actually_close) { - fclose((FILE *) m_file); + fclose(static_cast<FILE *>(m_file)); } } -unsigned pifilestream::vread(void *buf, const unsigned n) +pifilestream::pos_type pifilestream::vread(void *buf, const pos_type n) { - std::size_t r = fread(buf, 1, n, (FILE *) m_file); + pos_type r = fread(buf, 1, n, static_cast<FILE *>(m_file)); if (r < n) { - if (feof((FILE *) m_file)) + if (feof(static_cast<FILE *>(m_file))) set_flag(FLAG_EOF); - if (ferror((FILE *) m_file)) + if (ferror(static_cast<FILE *>(m_file))) throw file_read_e(m_filename); } m_pos += r; @@ -109,27 +109,27 @@ unsigned pifilestream::vread(void *buf, const unsigned n) void pifilestream::vseek(const pos_type n) { - if (fseek((FILE *) m_file, SEEK_SET, n) < 0) + if (fseek(static_cast<FILE *>(m_file), static_cast<long>(n), SEEK_SET) < 0) throw file_e("File seek failed: {}", m_filename); else m_pos = n; - if (feof((FILE *) m_file)) + if (feof(static_cast<FILE *>(m_file))) set_flag(FLAG_EOF); else clear_flag(FLAG_EOF); - if (ferror((FILE *) m_file)) + if (ferror(static_cast<FILE *>(m_file))) throw file_e("Generic file operation failed: {}", m_filename); } pifilestream::pos_type pifilestream::vtell() { - long ret = ftell((FILE *) m_file); + long ret = ftell(static_cast<FILE *>(m_file)); if (ret < 0) { return m_pos; } else - return ret; + return static_cast<pos_type>(ret); } // ----------------------------------------------------------------------------- @@ -164,23 +164,23 @@ pofilestream::pofilestream(void *file, const pstring name, const bool do_close) void pofilestream::init() { - if (ftell((FILE *) m_file) >= 0) - if (fseek((FILE *) m_file, 0, SEEK_SET) >= 0) + if (ftell(static_cast<FILE *>(m_file)) >= 0) + if (fseek(static_cast<FILE *>(m_file), 0, SEEK_SET) >= 0) set_flag(FLAG_SEEKABLE); } pofilestream::~pofilestream() { if (m_actually_close) - fclose((FILE *) m_file); + fclose(static_cast<FILE *>(m_file)); } -void pofilestream::vwrite(const void *buf, const unsigned n) +void pofilestream::vwrite(const void *buf, const pos_type n) { - std::size_t r = fwrite(buf, 1, n, (FILE *) m_file); + std::size_t r = fwrite(buf, 1, n, static_cast<FILE *>(m_file)); if (r < n) { - if (ferror((FILE *) m_file)) + if (ferror(static_cast<FILE *>(m_file))) throw file_write_e(m_filename); } m_pos += r; @@ -188,25 +188,25 @@ void pofilestream::vwrite(const void *buf, const unsigned n) void pofilestream::vseek(const pos_type n) { - if (fseek((FILE *) m_file, SEEK_SET, n) < 0) + if (fseek(static_cast<FILE *>(m_file), static_cast<long>(n), SEEK_SET) < 0) throw file_e("File seek failed: {}", m_filename); else { m_pos = n; - if (ferror((FILE *) m_file)) + if (ferror(static_cast<FILE *>(m_file))) throw file_e("Generic file operation failed: {}", m_filename); } } pstream::pos_type pofilestream::vtell() { - long ret = ftell((FILE *) m_file); + std::ptrdiff_t ret = ftell(static_cast<FILE *>(m_file)); if (ret < 0) { return m_pos; } else - return ret; + return static_cast<pos_type>(ret); } // ----------------------------------------------------------------------------- @@ -232,12 +232,12 @@ pstdout::pstdout() // ----------------------------------------------------------------------------- pimemstream::pimemstream(const void *mem, const pos_type len) - : pistream(FLAG_SEEKABLE), m_pos(0), m_len(len), m_mem((char *) mem) + : pistream(FLAG_SEEKABLE), m_pos(0), m_len(len), m_mem(static_cast<const pstring::mem_t *>(mem)) { } pimemstream::pimemstream(const pomemstream &ostrm) -: pistream(FLAG_SEEKABLE), m_pos(0), m_len(ostrm.size()), m_mem((char *) ostrm.memory()) +: pistream(FLAG_SEEKABLE), m_pos(0), m_len(ostrm.size()), m_mem(reinterpret_cast<pstring::mem_t *>(ostrm.memory())) { } @@ -245,9 +245,9 @@ pimemstream::~pimemstream() { } -unsigned pimemstream::vread(void *buf, const unsigned n) +pimemstream::pos_type pimemstream::vread(void *buf, const pos_type n) { - unsigned ret = (m_pos + n <= m_len) ? n : m_len - m_pos; + pos_type ret = (m_pos + n <= m_len) ? n : m_len - m_pos; if (ret > 0) { @@ -288,7 +288,7 @@ pomemstream::~pomemstream() pfree_array(m_mem); } -void pomemstream::vwrite(const void *buf, const unsigned n) +void pomemstream::vwrite(const void *buf, const pos_type n) { if (m_pos + n >= m_capacity) { diff --git a/src/lib/netlist/plib/pstream.h b/src/lib/netlist/plib/pstream.h index 1e9a3ed6a1c..68ab55ca58b 100644 --- a/src/lib/netlist/plib/pstream.h +++ b/src/lib/netlist/plib/pstream.h @@ -27,7 +27,7 @@ public: using pos_type = std::size_t; - static constexpr pos_type SEEK_EOF = (pos_type) -1; + static constexpr pos_type SEEK_EOF = static_cast<pos_type>(-1); explicit pstream(const unsigned flags) : m_flags(flags) { @@ -92,14 +92,14 @@ public: return (read(&b, 1) == 1); } - unsigned read(void *buf, const unsigned n) + pos_type read(void *buf, const unsigned n) { return vread(buf, n); } protected: /* read up to n bytes from stream */ - virtual unsigned vread(void *buf, const unsigned n) = 0; + virtual pos_type vread(void *buf, const pos_type n) = 0; private: pstringbuffer m_linebuf; @@ -135,7 +135,7 @@ public: write(&c, 1); } - void write(const void *buf, const unsigned n) + void write(const void *buf, const pos_type n) { vwrite(buf, n); } @@ -144,7 +144,7 @@ public: protected: /* write n bytes to stream */ - virtual void vwrite(const void *buf, const unsigned n) = 0; + virtual void vwrite(const void *buf, const pos_type n) = 0; private: }; @@ -162,11 +162,11 @@ public: virtual ~pomemstream(); char *memory() const { return m_mem; } - unsigned size() const { return m_size; } + pos_type size() const { return m_size; } protected: /* write n bytes to stream */ - virtual void vwrite(const void *buf, const unsigned n) override; + virtual void vwrite(const void *buf, const pos_type) override; virtual void vseek(const pos_type n) override; virtual pos_type vtell() override; @@ -190,7 +190,7 @@ public: protected: /* write n bytes to stream */ - virtual void vwrite(const void *buf, const unsigned n) override + virtual void vwrite(const void *buf, const pos_type n) override { m_buf.cat(buf, n); } @@ -216,7 +216,7 @@ public: protected: pofilestream(void *file, const pstring name, const bool do_close); /* write n bytes to stream */ - virtual void vwrite(const void *buf, const unsigned n) override; + virtual void vwrite(const void *buf, const pos_type n) override; virtual void vseek(const pos_type n) override; virtual pos_type vtell() override; @@ -267,7 +267,7 @@ protected: pifilestream(void *file, const pstring name, const bool do_close); /* read up to n bytes from stream */ - virtual unsigned vread(void *buf, const unsigned n) override; + virtual pos_type vread(void *buf, const pos_type n) override; virtual void vseek(const pos_type n) override; virtual pos_type vtell() override; @@ -307,14 +307,14 @@ public: protected: /* read up to n bytes from stream */ - virtual unsigned vread(void *buf, const unsigned n) override; + virtual pos_type vread(void *buf, const pos_type n) override; virtual void vseek(const pos_type n) override; virtual pos_type vtell() override; private: pos_type m_pos; pos_type m_len; - char *m_mem; + const char *m_mem; }; // ----------------------------------------------------------------------------- diff --git a/src/lib/netlist/plib/pstring.cpp b/src/lib/netlist/plib/pstring.cpp index 4db3de10503..644f7d6f49a 100644 --- a/src/lib/netlist/plib/pstring.cpp +++ b/src/lib/netlist/plib/pstring.cpp @@ -32,7 +32,7 @@ pstring_t<F>::~pstring_t() template<typename F> void pstring_t<F>::pcat(const mem_t *s) { - int slen = strlen(s); + std::size_t slen = strlen(s); pstr_t *n = salloc(m_ptr->len() + slen); if (m_ptr->len() > 0) std::memcpy(n->str(), m_ptr->str(), m_ptr->len()); @@ -46,7 +46,7 @@ void pstring_t<F>::pcat(const mem_t *s) template<typename F> void pstring_t<F>::pcat(const pstring_t &s) { - int slen = s.blen(); + std::size_t slen = s.blen(); pstr_t *n = salloc(m_ptr->len() + slen); if (m_ptr->len() > 0) std::memcpy(n->str(), m_ptr->str(), m_ptr->len()); @@ -60,7 +60,7 @@ void pstring_t<F>::pcat(const pstring_t &s) template<typename F> int pstring_t<F>::pcmp(const pstring_t &right) const { - long l = std::min(blen(), right.blen()); + std::size_t l = std::min(blen(), right.blen()); if (l == 0) { if (blen() == 0 && right.blen() == 0) @@ -72,18 +72,18 @@ int pstring_t<F>::pcmp(const pstring_t &right) const } int ret = memcmp(m_ptr->str(), right.cstr(), l); if (ret == 0) - ret = this->blen() - right.blen(); - if (ret < 0) - return -1; - else if (ret > 0) - return 1; - else - return 0; + { + if (this->blen() > right.blen()) + ret = 1; + else if (this->blen() < right.blen()) + ret = -1; + } + return ret; } template<typename F> -void pstring_t<F>::pcopy(const mem_t *from, int size) +void pstring_t<F>::pcopy(const mem_t *from, std::size_t size) { pstr_t *n = salloc(size); if (size > 0) @@ -94,139 +94,128 @@ void pstring_t<F>::pcopy(const mem_t *from, int size) } template<typename F> -const pstring_t<F> pstring_t<F>::substr(unsigned start, unsigned count) const +const pstring_t<F> pstring_t<F>::substr(const iterator start, const iterator end) const { pstring_t ret; - unsigned alen = len(); - if (start >= alen || count == 0) - return ret; - if (start + count > alen) - count = alen - start; - const mem_t *p = cstr(); - // find start - for (unsigned i=0; i<start; i++) - p += F::codelen(p); - const char *e = p; - for (unsigned i=0; i<count; i++) - e += F::codelen(e); - ret.pcopy(p, e-p); + //FIXME: throw ? + ret.pcopy(start.p, static_cast<std::size_t>(end.p - start.p)); return ret; } + template<typename F> const pstring_t<F> pstring_t<F>::ucase() const { pstring_t ret = *this; ret.pcopy(cstr(), blen()); for (std::size_t i=0; i<ret.len(); i++) - ret.m_ptr->str()[i] = toupper((unsigned) ret.m_ptr->str()[i]); + ret.m_ptr->str()[i] = static_cast<char>(toupper(static_cast<int>(ret.m_ptr->str()[i]))); return ret; } template<typename F> -int pstring_t<F>::find_first_not_of(const pstring_t &no) const +typename pstring_t<F>::iterator pstring_t<F>::find_first_not_of(const pstring_t &no) const { - char *t = m_ptr->str(); - unsigned nolen = no.len(); - unsigned tlen = len(); - for (std::size_t i=0; i < tlen; i++) + for (auto it = begin(); it != end(); ++it) { - char *n = no.m_ptr->str(); bool f = true; - for (std::size_t j=0; j < nolen; j++) + for (auto const jt : no) { - if (F::code(t) == F::code(n)) + if (*it == jt) + { f = false; - n += F::codelen(t); + break; + } } if (f) - return i; - t += F::codelen(t); + return it; } - return -1; + return end(); } template<typename F> -int pstring_t<F>::find_last_not_of(const pstring_t &no) const +typename pstring_t<F>::iterator pstring_t<F>::find_last_not_of(const pstring_t &no) const { - char *t = m_ptr->str(); - unsigned nolen = no.len(); - unsigned tlen = len(); - int last_found = -1; - for (std::size_t i=0; i < tlen; i++) + /* FIXME: reverse iterator */ + iterator last_found = end(); + for (auto it = begin(); it != end(); ++it) { - char *n = no.m_ptr->str(); bool f = true; - for (std::size_t j=0; j < nolen; j++) + for (auto const jt : no) { - if (F::code(t) == F::code(n)) + if (*it == jt) + { f = false; - n += F::codelen(t); + break; + } } if (f) - last_found = i; - t += F::codelen(t); + last_found = it; } return last_found; } template<typename F> -pstring_t<F> pstring_t<F>::replace(const pstring_t &search, const pstring_t &replace) const +typename pstring_t<F>::iterator pstring_t<F>::find(const pstring_t &search, iterator start) const { - // FIXME: use this pstringbuffer ret = ""; - pstring_t ret = ""; - const int slen = search.blen(); - const int tlen = blen(); - - if (slen == 0 || tlen < slen ) - return *this; - int i = 0; - while (i < tlen - slen + 1) + for (; start != end(); ++start) { - if (memcmp(cstr()+i,search.cstr(),slen) == 0) - { - ret += replace; - i += slen; - } - else + iterator itc(start); + auto cmp = search.begin(); + while (itc != end() && cmp != search.end() && *itc == *cmp) { - /* avoid adding a code, cat a string ... */ - mem_t buf[2] = { *(cstr() + i), 0 }; - ret = ret.cat(buf); - i++; + ++itc; + ++cmp; } + if (cmp == search.end()) + return start; + } + return end(); +} + +template<typename F> +pstring_t<F> pstring_t<F>::replace(const pstring_t &search, const pstring_t &replace) const +{ + pstring_t ret(""); + const size_type slen = search.len(); + + auto last_s = begin(); + auto s = find(search, last_s); + while (s != end()) + { + ret += substr(last_s, s); + ret += replace; + last_s = s + slen; + s = find(search, last_s); } - ret = ret.cat(cstr() + i); + ret += substr(last_s, end()); return ret; } template<typename F> const pstring_t<F> pstring_t<F>::ltrim(const pstring_t &ws) const { - int f = find_first_not_of(ws); - if (f>=0) - return substr(f); - else - return ""; + return substr(find_first_not_of(ws), end()); } template<typename F> const pstring_t<F> pstring_t<F>::rtrim(const pstring_t &ws) const { - int f = find_last_not_of(ws); - if (f>=0) - return left(f+1); + auto f = find_last_not_of(ws); + if (f==end()) + return pstring_t(""); else - return ""; + return substr(begin(), f + 1); } template<typename F> -const pstring_t<F> pstring_t<F>::rpad(const pstring_t &ws, const unsigned cnt) const +const pstring_t<F> pstring_t<F>::rpad(const pstring_t &ws, const size_type cnt) const { // FIXME: pstringbuffer ret(*this); pstring_t ret(*this); - while (ret.len() < cnt) + size_type wsl = ws.len(); + for (auto i = ret.len(); i < cnt; i+=wsl) ret += ws; return ret; } @@ -271,6 +260,133 @@ long pstring_t<F>::as_long(bool *error) const return ret; } +template<typename F> +typename pstring_t<F>::iterator pstring_t<F>::find(const mem_t *search, iterator start) const +{ + for (; start != end(); ++start) + { + iterator itc(start); + iterator cmp(search); + while (itc != end() && *cmp != 0 && *itc == *cmp) + { + ++itc; + ++cmp; + } + if (*cmp == 0) + return start; + } + return end(); +} + +template<typename F> +bool pstring_t<F>::startsWith(const pstring_t &arg) const +{ + if (arg.blen() > blen()) + return false; + else + return (memcmp(arg.cstr(), cstr(), arg.blen()) == 0); +} + +template<typename F> +bool pstring_t<F>::endsWith(const pstring_t &arg) const +{ + if (arg.blen() > blen()) + return false; + else + return (memcmp(cstr()+this->blen()-arg.blen(), arg.cstr(), arg.blen()) == 0); +} + + +template<typename F> +bool pstring_t<F>::startsWith(const mem_t *arg) const +{ + std::size_t alen = strlen(arg); + if (alen > blen()) + return false; + else + return (memcmp(arg, cstr(), alen) == 0); +} + +template<typename F> +int pstring_t<F>::pcmp(const mem_t *right) const +{ + return std::strcmp(m_ptr->str(), right); +} + +// ---------------------------------------------------------------------------------------- +// pstringbuffer +// ---------------------------------------------------------------------------------------- + +pstringbuffer::~pstringbuffer() +{ + if (m_ptr != nullptr) + plib::pfree_array(m_ptr); +} + +void pstringbuffer::resize(const std::size_t size) +{ + if (m_ptr == nullptr) + { + m_size = DEFAULT_SIZE; + while (m_size <= size) + m_size *= 2; + m_ptr = plib::palloc_array<char>(m_size); + *m_ptr = 0; + m_len = 0; + } + else if (m_size < size) + { + while (m_size < size) + m_size *= 2; + char *new_buf = plib::palloc_array<char>(m_size); + std::memcpy(new_buf, m_ptr, m_len + 1); + plib::pfree_array(m_ptr); + m_ptr = new_buf; + } +} + +void pstringbuffer::pcopy(const char *from) +{ + std::size_t nl = strlen(from) + 1; + resize(nl); + std::memcpy(m_ptr, from, nl); +} + +void pstringbuffer::pcopy(const pstring &from) +{ + std::size_t nl = from.blen() + 1; + resize(nl); + std::memcpy(m_ptr, from.cstr(), nl); +} + +void pstringbuffer::pcat(const char *s) +{ + const std::size_t slen = std::strlen(s); + const std::size_t nl = m_len + slen + 1; + resize(nl); + std::memcpy(m_ptr + m_len, s, slen + 1); + m_len += slen; +} + +void pstringbuffer::pcat(const void *m, std::size_t l) +{ + const std::size_t nl = m_len + l + 1; + resize(nl); + std::memcpy(m_ptr + m_len, m, l); + m_len += l; + *(m_ptr + m_len) = 0; +} + +void pstringbuffer::pcat(const pstring &s) +{ + const std::size_t slen = s.blen(); + const std::size_t nl = m_len + slen + 1; + resize(nl); + std::memcpy(m_ptr + m_len, s.cstr(), slen); + m_len += slen; + m_ptr[m_len] = 0; +} + // ---------------------------------------------------------------------------------------- // static stuff ... // ---------------------------------------------------------------------------------------- @@ -285,11 +401,11 @@ long pstring_t<F>::as_long(bool *error) const static std::stack<pstr_t *> *stk = nullptr; -static inline unsigned countleadbits(unsigned x) +static inline std::size_t countleadbits(std::size_t x) { #ifndef count_leading_zeros - unsigned msk; - unsigned ret; + std::size_t msk; + std::size_t ret; if (x < 0x100) { msk = 0x80; @@ -329,25 +445,25 @@ void pstring_t<F>::sfree(pstr_t *s) { if (stk != nullptr) { - unsigned sn= ((32 - countleadbits(s->len())) + 1) / 2; + size_type sn= ((32 - countleadbits(s->len())) + 1) / 2; stk[sn].push(s); } else - plib::pfree_array(((char *)s)); + plib::pfree_array(reinterpret_cast<char *>(s)); //_mm_free(((char *)s)); } } template<typename F> -pstr_t *pstring_t<F>::salloc(int n) +pstr_t *pstring_t<F>::salloc(std::size_t n) { if (stk == nullptr) stk = plib::palloc_array<std::stack<pstr_t *>>(17); pstr_t *p; std::size_t sn= ((32 - countleadbits(n)) + 1) / 2; - std::size_t size = sizeof(pstr_t) + ((std::size_t) 1<<(sn * 2)) + 1; + std::size_t size = sizeof(pstr_t) + (static_cast<std::size_t>(1)<<(sn * 2)) + 1; if (stk[sn].empty()) - p = (pstr_t *) plib::palloc_array<char>(size); + p = reinterpret_cast<pstr_t *>(plib::palloc_array<char>(size)); else { p = stk[sn].top(); @@ -384,7 +500,7 @@ void pstring_t<F>::sfree(pstr_t *s) s->m_ref_count--; if (s->m_ref_count == 0 && s != &m_zero) { - pfree_array(((char *)s)); + plib::pfree_array(((char *)s)); //_mm_free(((char *)s)); } } @@ -393,7 +509,7 @@ template<typename F> pstr_t *pstring_t<F>::salloc(int n) { int size = sizeof(pstr_t) + n + 1; - pstr_t *p = (pstr_t *) palloc_array(char, size); + pstr_t *p = (pstr_t *) plib::palloc_array<char>(size); // str_t *p = (str_t *) mm_malloc(size, 8); p->init(n); return p; @@ -406,168 +522,9 @@ void pstring_t<F>::resetmem() } #endif - -// ---------------------------------------------------------------------------------------- -// pstring ... -// ---------------------------------------------------------------------------------------- - -template<typename F> -int pstring_t<F>::find(const pstring_t &search, unsigned start) const -{ - const unsigned tlen = len(); - const unsigned slen = search.len(); - const mem_t *s = search.cstr(); - const unsigned startt = std::min(start, tlen); - const mem_t *t = cstr(); - for (std::size_t i=0; i<startt; i++) - t += F::codelen(t); - for (int i=0; i <= (int) tlen - (int) startt - (int) slen; i++) - { - if (F::code(t) == F::code(s)) - if (std::memcmp(t,s,search.blen())==0) - return i+startt; - t += F::codelen(t); - } - return -1; -} - -template<typename F> -int pstring_t<F>::find(const mem_t *search, unsigned start) const -{ - const unsigned tlen = len(); - unsigned slen = 0; - unsigned sblen = 0; - const mem_t *x = search; - while (*x != 0) - { - slen++; - const unsigned sl = F::codelen(x); - x += sl; - sblen += sl; - } - const char *s = search; - const unsigned startt = std::min(start, tlen); - const char *t = cstr(); - for (std::size_t i=0; i<startt; i++) - t += F::codelen(t); - for (int i=0; i <= (int) tlen - (int) startt - (int) slen; i++) - { - if (F::code(t) == F::code(s)) - if (std::memcmp(t,s,sblen)==0) - return i+startt; - t += F::codelen(t); - } - return -1; -} - -template<typename F> -bool pstring_t<F>::startsWith(const pstring_t &arg) const -{ - if (arg.blen() > blen()) - return false; - else - return (memcmp(arg.cstr(), cstr(), arg.len()) == 0); -} - -template<typename F> -bool pstring_t<F>::endsWith(const pstring_t &arg) const -{ - if (arg.blen() > blen()) - return false; - else - return (memcmp(cstr()+this->len()-arg.len(), arg.cstr(), arg.len()) == 0); -} - - -template<typename F> -bool pstring_t<F>::startsWith(const mem_t *arg) const -{ - unsigned alen = strlen(arg); - if (alen > blen()) - return false; - else - return (memcmp(arg, cstr(), alen) == 0); -} - -template<typename F> -int pstring_t<F>::pcmp(const mem_t *right) const -{ - return std::strcmp(m_ptr->str(), right); -} - // ---------------------------------------------------------------------------------------- -// pstringbuffer +// template stuff ... // ---------------------------------------------------------------------------------------- -pstringbuffer::~pstringbuffer() -{ - if (m_ptr != nullptr) - plib::pfree_array(m_ptr); -} - -void pstringbuffer::resize(const std::size_t size) -{ - if (m_ptr == nullptr) - { - m_size = DEFAULT_SIZE; - while (m_size <= size) - m_size *= 2; - m_ptr = plib::palloc_array<char>(m_size); - *m_ptr = 0; - m_len = 0; - } - else if (m_size < size) - { - while (m_size < size) - m_size *= 2; - char *new_buf = plib::palloc_array<char>(m_size); - std::memcpy(new_buf, m_ptr, m_len + 1); - plib::pfree_array(m_ptr); - m_ptr = new_buf; - } -} - -void pstringbuffer::pcopy(const char *from) -{ - std::size_t nl = strlen(from) + 1; - resize(nl); - std::memcpy(m_ptr, from, nl); -} - -void pstringbuffer::pcopy(const pstring &from) -{ - std::size_t nl = from.blen() + 1; - resize(nl); - std::memcpy(m_ptr, from.cstr(), nl); -} - -void pstringbuffer::pcat(const char *s) -{ - const std::size_t slen = std::strlen(s); - const std::size_t nl = m_len + slen + 1; - resize(nl); - std::memcpy(m_ptr + m_len, s, slen + 1); - m_len += slen; -} - -void pstringbuffer::pcat(const void *m, unsigned l) -{ - const std::size_t nl = m_len + l + 1; - resize(nl); - std::memcpy(m_ptr + m_len, m, l); - m_len += l; - *(m_ptr + m_len) = 0; -} - -void pstringbuffer::pcat(const pstring &s) -{ - const std::size_t slen = s.blen(); - const std::size_t nl = m_len + slen + 1; - resize(nl); - std::memcpy(m_ptr + m_len, s.cstr(), slen); - m_len += slen; - m_ptr[m_len] = 0; -} - template struct pstring_t<pu8_traits>; template struct pstring_t<putf8_traits>; diff --git a/src/lib/netlist/plib/pstring.h b/src/lib/netlist/plib/pstring.h index df4d79d587f..e7c8b3ba0dc 100644 --- a/src/lib/netlist/plib/pstring.h +++ b/src/lib/netlist/plib/pstring.h @@ -9,6 +9,7 @@ #include <cstdarg> #include <cstddef> +#include <iterator> #include "pconfig.h" @@ -22,21 +23,22 @@ struct pstr_t { //str_t() : m_ref_count(1), m_len(0) { m_str[0] = 0; } - pstr_t(const unsigned alen) + pstr_t(const std::size_t alen) { init(alen); } - void init(const unsigned alen) + void init(const std::size_t alen) { m_ref_count = 1; m_len = alen; m_str[0] = 0; } char *str() { return &m_str[0]; } - unsigned len() const { return m_len; } + unsigned char *ustr() { return reinterpret_cast<unsigned char *>(&m_str[0]); } + std::size_t len() const { return m_len; } int m_ref_count; private: - unsigned m_len; + std::size_t m_len; char m_str[1]; }; @@ -47,8 +49,9 @@ struct pstring_t public: typedef F traits; - typedef typename traits::mem_t mem_t; - typedef typename traits::code_t code_t; + typedef typename F::mem_t mem_t; + typedef typename F::code_t code_t; + typedef std::size_t size_type; // simple construction/destruction pstring_t() @@ -66,6 +69,26 @@ public: pstring_t &operator=(const mem_t *string) { pcopy(string); return *this; } pstring_t &operator=(const pstring_t &string) { pcopy(string); return *this; } + struct iterator final : public std::iterator<std::forward_iterator_tag, mem_t> + { + const mem_t * p; + public: + explicit constexpr iterator(const mem_t *x) noexcept : p(x) {} + iterator(const iterator &rhs) noexcept = default; + iterator(iterator &&rhs) noexcept { p = rhs.p; } + iterator &operator=(const iterator &it) { p = it.p; return *this; } + iterator& operator++() noexcept {p += traits::codelen(p); return *this;} + iterator operator++(int) noexcept {iterator tmp(*this); operator++(); return tmp;} + bool operator==(const iterator& rhs) noexcept {return p==rhs.p;} + bool operator!=(const iterator& rhs) noexcept {return p!=rhs.p;} + const code_t operator*() noexcept {return traits::code(p);} + iterator& operator+=(size_type count) { while (count>0) { --count; ++(*this); } return *this; } + friend iterator operator+(iterator lhs, const size_type &rhs) { return (lhs += rhs); } + }; + + iterator begin() const { return iterator(m_ptr->str()); } + iterator end() const { return iterator(m_ptr->str() + blen()); } + // C string conversion helpers const mem_t *cstr() const { return m_ptr->str(); } @@ -93,8 +116,8 @@ public: bool equals(const pstring_t &string) const { return (pcmp(string) == 0); } - int cmp(const pstring_t &string) const { return pcmp(string); } - int cmp(const mem_t *string) const { return pcmp(string); } + //int cmp(const pstring_t &string) const { return pcmp(string); } + //int cmp(const mem_t *string) const { return pcmp(string); } bool startsWith(const pstring_t &arg) const; bool startsWith(const mem_t *arg) const; @@ -107,47 +130,45 @@ public: const pstring_t cat(const pstring_t &s) const { return *this + s; } const pstring_t cat(const mem_t *s) const { return *this + s; } - unsigned blen() const { return m_ptr->len(); } + size_type blen() const { return m_ptr->len(); } // conversions double as_double(bool *error = nullptr) const; long as_long(bool *error = nullptr) const; - unsigned len() const + size_type len() const { return traits::len(m_ptr); } - pstring_t& operator+=(const code_t c) { mem_t buf[F::MAXCODELEN+1] = { 0 }; F::encode(c, buf); pcat(buf); return *this; } + pstring_t& operator+=(const code_t c) { mem_t buf[traits::MAXCODELEN+1] = { 0 }; traits::encode(c, buf); pcat(buf); return *this; } friend pstring_t operator+(const pstring_t &lhs, const code_t rhs) { return pstring_t(lhs) += rhs; } - int find(const pstring_t &search, unsigned start = 0) const; - int find(const mem_t *search, unsigned start = 0) const; - int find(const code_t search, unsigned start = 0) const { mem_t buf[F::MAXCODELEN+1] = { 0 }; F::encode(search, buf); return find(buf, start); } + iterator find(const pstring_t &search, iterator start) const; + iterator find(const pstring_t &search) const { return find(search, begin()); } + iterator find(const mem_t *search, iterator start) const; + iterator find(const mem_t *search) const { return find(search, begin()); } + iterator find(const code_t search, iterator start) const { mem_t buf[traits::MAXCODELEN+1] = { 0 }; traits::encode(search, buf); return find(buf, start); } + iterator find(const code_t search) const { return find(search, begin()); } - const pstring_t substr(unsigned start, unsigned count) const ; - const pstring_t substr(unsigned start) const { if (start>=len()) return pstring_t(""); else return substr(start, len()-start); } + const pstring_t substr(const iterator start, const iterator end) const ; + const pstring_t substr(const iterator start) const { return substr(start, end()); } + const pstring_t substr(size_type start) const { if (start>=len()) return pstring_t(""); else return substr(begin() + start, end()); } - const pstring_t left(unsigned count) const { return substr(0, count); } - const pstring_t right(unsigned count) const { if (len()<count) return pstring_t(*this); else return substr(len() - count, count); } + const pstring_t left(iterator leftof) const { return substr(begin(), leftof); } + const pstring_t right(iterator pos) const { return substr(pos, end()); } - int find_first_not_of(const pstring_t &no) const; - int find_last_not_of(const pstring_t &no) const; + iterator find_first_not_of(const pstring_t &no) const; + iterator find_last_not_of(const pstring_t &no) const; const pstring_t ltrim(const pstring_t &ws = " \t\n\r") const; const pstring_t rtrim(const pstring_t &ws = " \t\n\r") const; const pstring_t trim(const pstring_t &ws = " \t\n\r") const { return this->ltrim(ws).rtrim(ws); } - const pstring_t rpad(const pstring_t &ws, const unsigned cnt) const; - - /* - * everything below MAY not work for utf8. - * Example a=s.find(EUROSIGN); b=s.substr(a,1); will deliver invalid utf8 - */ + const pstring_t rpad(const pstring_t &ws, const size_type cnt) const; - // FIXME: - code_t code_at(const unsigned pos) const { return F::code(F::nthcode(m_ptr->str(),pos)); } + code_t code_at(const size_type pos) const { return F::code(F::nthcode(m_ptr->str(),pos)); } const pstring_t ucase() const; @@ -168,7 +189,7 @@ private: int pcmp(const mem_t *right) const; - void pcopy(const mem_t *from, int size); + void pcopy(const mem_t *from, std::size_t size); void pcopy(const mem_t *from); @@ -182,7 +203,7 @@ private: void pcat(const mem_t *s); void pcat(const pstring_t &s); - static pstr_t *salloc(int n); + static pstr_t *salloc(std::size_t n); static void sfree(pstr_t *s); static pstr_t m_zero; @@ -193,12 +214,12 @@ struct pu8_traits static const unsigned MAXCODELEN = 1; /* in memory units */ typedef char mem_t; typedef char code_t; - static unsigned len(const pstr_t *p) { return p->len(); } + static std::size_t len(const pstr_t *p) { return p->len(); } static unsigned codelen(const mem_t *p) { return 1; } static unsigned codelen(const code_t c) { return 1; } static code_t code(const mem_t *p) { return *p; } static void encode(const code_t c, mem_t *p) { *p = c; } - static const mem_t *nthcode(const mem_t *p, const unsigned n) { return &(p[n]); } + static const mem_t *nthcode(const mem_t *p, const std::size_t n) { return &(p[n]); } }; /* No checking, this may deliver invalid codes */ @@ -207,10 +228,10 @@ struct putf8_traits static const unsigned MAXCODELEN = 4; /* in memory units, RFC 3629 */ typedef char mem_t; typedef unsigned code_t; - static unsigned len(pstr_t *p) + static std::size_t len(pstr_t *p) { - unsigned ret = 0; - unsigned char *c = (unsigned char *) p->str(); + std::size_t ret = 0; + unsigned char *c = p->ustr(); while (*c) { if (!((*c & 0xC0) == 0x80)) @@ -221,7 +242,7 @@ struct putf8_traits } static unsigned codelen(const mem_t *p) { - unsigned char *p1 = (unsigned char *) p; + const unsigned char *p1 = reinterpret_cast<const unsigned char *>(p); if ((*p1 & 0x80) == 0x00) return 1; else if ((*p1 & 0xE0) == 0xC0) @@ -248,48 +269,48 @@ struct putf8_traits } static code_t code(const mem_t *p) { - unsigned char *p1 = (unsigned char *)p; + const unsigned char *p1 = reinterpret_cast<const unsigned char *>(p); if ((*p1 & 0x80) == 0x00) - return (code_t) *p1; + return *p1; else if ((*p1 & 0xE0) == 0xC0) - return ((p1[0] & 0x3f) << 6) | ((p1[1] & 0x3f)); + return static_cast<code_t>(((p1[0] & 0x3f) << 6) | (p1[1] & 0x3f)); else if ((*p1 & 0xF0) == 0xE0) - return ((p1[0] & 0x1f) << 12) | ((p1[1] & 0x3f) << 6) | ((p1[2] & 0x3f) << 0); + return static_cast<code_t>(((p1[0] & 0x1f) << 12) | ((p1[1] & 0x3f) << 6) | ((p1[2] & 0x3f) << 0)); else if ((*p1 & 0xF8) == 0xF0) - return ((p1[0] & 0x0f) << 18) | ((p1[1] & 0x3f) << 12) | ((p1[2] & 0x3f) << 6) | ((p1[3] & 0x3f) << 0); + return static_cast<code_t>(((p1[0] & 0x0f) << 18) | ((p1[1] & 0x3f) << 12) | ((p1[2] & 0x3f) << 6) | ((p1[3] & 0x3f) << 0)); else return *p1; // not correct } static void encode(const code_t c, mem_t *p) { - unsigned char *m = (unsigned char*)p; + unsigned char *m = reinterpret_cast<unsigned char *>(p); if (c < 0x0080) { - m[0] = c; + m[0] = static_cast<unsigned char>(c); } else if (c < 0x800) { - m[0] = 0xC0 | (c >> 6); - m[1] = 0x80 | (c & 0x3f); + m[0] = static_cast<unsigned char>(0xC0 | (c >> 6)); + m[1] = static_cast<unsigned char>(0x80 | (c & 0x3f)); } else if (c < 0x10000) { - m[0] = 0xE0 | (c >> 12); - m[1] = 0x80 | ((c>>6) & 0x3f); - m[2] = 0x80 | (c & 0x3f); + m[0] = static_cast<unsigned char>(0xE0 | (c >> 12)); + m[1] = static_cast<unsigned char>(0x80 | ((c>>6) & 0x3f)); + m[2] = static_cast<unsigned char>(0x80 | (c & 0x3f)); } else /* U+10000 U+1FFFFF */ { - m[0] = 0xF0 | (c >> 18); - m[1] = 0x80 | ((c>>12) & 0x3f); - m[2] = 0x80 | ((c>>6) & 0x3f); - m[3] = 0x80 | (c & 0x3f); + m[0] = static_cast<unsigned char>(0xF0 | (c >> 18)); + m[1] = static_cast<unsigned char>(0x80 | ((c>>12) & 0x3f)); + m[2] = static_cast<unsigned char>(0x80 | ((c>>6) & 0x3f)); + m[3] = static_cast<unsigned char>(0x80 | (c & 0x3f)); } } - static const mem_t *nthcode(const mem_t *p, const unsigned n) + static const mem_t *nthcode(const mem_t *p, const std::size_t n) { const mem_t *p1 = p; - int i = n; + std::size_t i = n; while (i-- > 0) p1 += codelen(p1); return p1; @@ -358,7 +379,7 @@ public: void cat(const pstring &s) { pcat(s); } void cat(const char *s) { pcat(s); } - void cat(const void *m, unsigned l) { pcat(m, l); } + void cat(const void *m, std::size_t l) { pcat(m, l); } void clear() { m_len = 0; *m_ptr = 0; } @@ -377,7 +398,7 @@ private: void pcopy(const pstring &from); void pcat(const char *s); void pcat(const pstring &s); - void pcat(const void *m, unsigned l); + void pcat(const void *m, std::size_t l); char *m_ptr; std::size_t m_size; @@ -397,7 +418,7 @@ namespace std const pstring::mem_t *string = s.cstr(); result_type result = 5381; for (pstring::mem_t c = *string; c != 0; c = *string++) - result = ((result << 5) + result ) ^ (result >> (32 - 5)) ^ c; + result = ((result << 5) + result ) ^ (result >> (32 - 5)) ^ static_cast<result_type>(c); return result; } }; diff --git a/src/lib/netlist/plib/ptypes.h b/src/lib/netlist/plib/ptypes.h index c9b4379e590..2e2d19994e4 100644 --- a/src/lib/netlist/plib/ptypes.h +++ b/src/lib/netlist/plib/ptypes.h @@ -58,15 +58,14 @@ namespace plib bool set_from_string (const pstring &s) { \ static const char *strings = # __VA_ARGS__; \ int f = from_string_int(strings, s.cstr()); \ - if (f>=0) { m_v = (e) f; return true; } else { return false; } \ + if (f>=0) { m_v = static_cast<e>(f); return true; } else { return false; } \ } \ operator e() const {return m_v;} \ - int as_int() const {return (int) m_v;} \ bool operator==(const ename &rhs) const {return m_v == rhs.m_v;} \ - bool operator==(const e &rhs) const {return m_v == (int) rhs;} \ + bool operator==(const e &rhs) const {return m_v == rhs;} \ const pstring name() const { \ static const char *strings = # __VA_ARGS__; \ - return nthstr((int) m_v, strings); \ + return nthstr(static_cast<int>(m_v), strings); \ } \ private: e m_v; }; diff --git a/src/lib/netlist/plib/putil.cpp b/src/lib/netlist/plib/putil.cpp index e8951d05aa9..f3f9b4c15ea 100644 --- a/src/lib/netlist/plib/putil.cpp +++ b/src/lib/netlist/plib/putil.cpp @@ -43,21 +43,20 @@ namespace plib pstring_vector_t::pstring_vector_t(const pstring &str, const pstring &onstr, bool ignore_empty) : std::vector<pstring>() { - int p = 0; - int pn; + pstring::iterator p = str.begin(); + pstring::iterator pn = str.find(onstr, p); - pn = str.find(onstr, p); - while (pn>=0) + while (pn != str.end()) { - pstring t = str.substr(p, pn - p); + pstring t = str.substr(p, pn); if (!ignore_empty || t.len() != 0) this->push_back(t); p = pn + onstr.len(); pn = str.find(onstr, p); } - if (p < (int) str.len()) + if (p != str.end()) { - pstring t = str.substr(p); + pstring t = str.substr(p, str.end()); if (!ignore_empty || t.len() != 0) this->push_back(t); } @@ -71,7 +70,7 @@ namespace plib unsigned i = 0; while (i<str.blen()) { - int p = -1; + std::size_t p = static_cast<std::size_t>(-1); for (std::size_t j=0; j < onstrl.size(); j++) { if (std::memcmp(onstrl[j].cstr(), &(str.cstr()[i]), onstrl[j].blen())==0) @@ -80,7 +79,7 @@ namespace plib break; } } - if (p>=0) + if (p != static_cast<std::size_t>(-1)) { if (col != "") this->push_back(col); @@ -105,13 +104,13 @@ namespace plib { int cnt = 0; const char *cur = str; - int lx = strlen(x); + std::size_t lx = strlen(x); while (*str) { if (*str == ',') { - int l = str-cur; - if (l == lx) + std::ptrdiff_t l = str-cur; + if (static_cast<std::size_t>(l) == lx) if (strncmp(cur, x, lx) == 0) return cnt; } @@ -122,8 +121,8 @@ namespace plib } str++; } - int l = str-cur; - if (l == lx) + std::ptrdiff_t l = str-cur; + if (static_cast<std::size_t>(l) == lx) if (strncmp(cur, x, lx) == 0) return cnt; return -1; diff --git a/src/lib/netlist/plib/putil.h b/src/lib/netlist/plib/putil.h index 39d10bcadb5..cc388cd3393 100644 --- a/src/lib/netlist/plib/putil.h +++ b/src/lib/netlist/plib/putil.h @@ -29,19 +29,20 @@ namespace plib return std::find(con.begin(), con.end(), elem) != con.end(); } + static constexpr const std::size_t npos = static_cast<std::size_t>(-1); template <class C> - int indexof(C &con, const typename C::value_type &elem) + std::size_t indexof(C &con, const typename C::value_type &elem) { auto it = std::find(con.begin(), con.end(), elem); if (it != con.end()) - return it - con.begin(); - return -1; + return static_cast<std::size_t>(it - con.begin()); + return npos; } template <class C> void insert_at(C &con, const std::size_t index, const typename C::value_type &elem) { - con.insert(con.begin() + index, elem); + con.insert(con.begin() + static_cast<std::ptrdiff_t>(index), elem); } } diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp index 31cb8af00f6..92057688954 100644 --- a/src/lib/netlist/prg/nltool.cpp +++ b/src/lib/netlist/prg/nltool.cpp @@ -36,7 +36,7 @@ public: opt_help(*this, "h", "help", "display help and exit"), opt_grp2(*this, "Options for run and static commands", "These options apply to run and static commands."), opt_name(*this, "n", "name", "", "the netlist in file specified by ""-f"" option to run; default is first one"), - opt_grp3(*this, "Options for run command", "These options are only used by the run command."), + opt_grp3(*this, "Options for run command", "These options are only used by the run command."), opt_ttr (*this, "t", "time_to_run", 1.0, "time to run the emulation (seconds)"), opt_logs(*this, "l", "log" , "define terminal to log. This option may be specified repeatedly."), opt_inp(*this, "i", "input", "", "input file to process (default is none)"), @@ -196,10 +196,10 @@ struct input_t static_cast<netlist::param_double_t*>(m_param)->setTo(m_value); break; case netlist::param_t::INTEGER: - static_cast<netlist::param_int_t*>(m_param)->setTo((int)m_value); + static_cast<netlist::param_int_t*>(m_param)->setTo(static_cast<int>(m_value)); break; case netlist::param_t::LOGIC: - static_cast<netlist::param_logic_t*>(m_param)->setTo((int) m_value); + static_cast<netlist::param_logic_t*>(m_param)->setTo(static_cast<bool>(m_value)); break; } } @@ -335,7 +335,7 @@ static void listdevices(tool_options_t &opts) if (t.second->name().startsWith(d->name())) { pstring tn(t.second->name().substr(d->name().len()+1)); - if (tn.find(".")<0) + if (tn.find(".") == tn.end()) terms.push_back(tn); } } @@ -345,7 +345,7 @@ static void listdevices(tool_options_t &opts) if (t.first.startsWith(d->name())) { pstring tn(t.first.substr(d->name().len()+1)); - if (tn.find(".")<0) + if (tn.find(".") == tn.end()) { terms.push_back(tn); pstring resolved = nt.setup().resolve_alias(t.first); diff --git a/src/lib/netlist/prg/nlwav.cpp b/src/lib/netlist/prg/nlwav.cpp index a48323f265f..ea5fc450f2b 100644 --- a/src/lib/netlist/prg/nlwav.cpp +++ b/src/lib/netlist/prg/nlwav.cpp @@ -63,7 +63,7 @@ public: void write_sample(int sample) { m_data.len += m_fmt.block_align; - short ps = sample; /* 16 bit sample, FIXME: Endianess? */ + short ps = static_cast<short>(sample); /* 16 bit sample, FIXME: Endianess? */ m_f.write(&ps, sizeof(ps)); } @@ -77,14 +77,14 @@ private: struct riff_format_t { - char signature[4]; - unsigned fmt_length; - short format_tag; - short channels; - unsigned sample_rate; - unsigned bytes_per_second; - short block_align; - short bits_sample; + char signature[4]; + unsigned fmt_length; + short format_tag; + unsigned short channels; + unsigned sample_rate; + unsigned bytes_per_second; + unsigned short block_align; + unsigned short bits_sample; }; struct riff_data_t @@ -129,7 +129,7 @@ static void convert(nlwav_options_t &opts) plib::pifilestream fin(opts.opt_inp()); - double dt = 1.0 / (double) wo.sample_rate(); + double dt = 1.0 / static_cast<double>(wo.sample_rate()); double ct = dt; //double mean = 2.4; double amp = opts.opt_amp(); @@ -160,12 +160,12 @@ static void convert(nlwav_options_t &opts) minsam = std::min(minsam, outsam); n++; //mean = means / (double) n; - mean += 5.0 / (double) wo.sample_rate() * (outsam - mean); + mean += 5.0 / static_cast<double>(wo.sample_rate()) * (outsam - mean); } outsam = (outsam - mean) * amp; outsam = std::max(-32000.0, outsam); outsam = std::min(32000.0, outsam); - wo.write_sample((int) outsam); + wo.write_sample(static_cast<int>(outsam)); outsam = 0.0; lt = ct; ct += dt; @@ -195,7 +195,7 @@ static void convert(nlwav_options_t &opts) #endif } pout("Mean (low freq filter): {}\n", mean); - pout("Mean (static): {}\n", means / (double) n); + pout("Mean (static): {}\n", means / static_cast<double>(n)); pout("Amp + {}\n", 32000.0 / (maxsam- mean)); pout("Amp - {}\n", -32000.0 / (minsam- mean)); } diff --git a/src/lib/netlist/solver/nld_matrix_solver.h b/src/lib/netlist/solver/nld_matrix_solver.h index e196649735e..36e39462c17 100644 --- a/src/lib/netlist/solver/nld_matrix_solver.h +++ b/src/lib/netlist/solver/nld_matrix_solver.h @@ -29,8 +29,8 @@ namespace netlist nl_double m_max_timestep; nl_double m_sor; bool m_dynamic; - int m_gs_loops; - int m_nr_loops; + unsigned m_gs_loops; + unsigned m_nr_loops; netlist_time m_nt_sync_delay; bool m_log_stats; }; @@ -60,7 +60,7 @@ public: void add(terminal_t *term, int net_other, bool sorted); - inline unsigned count() { return m_term.size(); } + inline std::size_t count() { return m_term.size(); } inline terminal_t **terms() { return m_term.data(); } inline int *net_other() { return m_net_other.data(); } @@ -71,7 +71,7 @@ public: void set_pointers(); - unsigned m_railstart; + std::size_t m_railstart; std::vector<unsigned> m_nz; /* all non zero for multiplication */ std::vector<unsigned> m_nzrd; /* non zero right of the diagonal for elimination, may include RHS element */ @@ -157,7 +157,7 @@ public: NETLIB_RESETI(); public: - int get_net_idx(net_t *net); + int get_net_idx(detail::net_t *net); plib::plog_base<NL_DEBUG> &log() { return netlist().log(); } @@ -174,10 +174,10 @@ protected: void update_dynamic(); virtual void vsetup(analog_net_t::list_t &nets) = 0; - virtual int vsolve_non_dynamic(const bool newton_raphson) = 0; + virtual unsigned vsolve_non_dynamic(const bool newton_raphson) = 0; netlist_time compute_next_timestep(const double cur_ts); - /* virtual */ void add_term(int net_idx, terminal_t *term); + /* virtual */ void add_term(std::size_t net_idx, terminal_t *term); template <typename T> void store(const T * RESTRICT V); @@ -230,17 +230,17 @@ T matrix_solver_t::delta(const T * RESTRICT V) * and thus belong into a different calculation. This applies to all solvers. */ - const unsigned iN = this->m_terms.size(); + std::size_t iN = this->m_terms.size(); T cerr = 0; for (unsigned i = 0; i < iN; i++) - cerr = std::max(cerr, std::abs(V[i] - (T) this->m_nets[i]->m_cur_Analog)); + cerr = std::max(cerr, std::abs(V[i] - static_cast<T>(this->m_nets[i]->m_cur_Analog))); return cerr; } template <typename T> void matrix_solver_t::store(const T * RESTRICT V) { - for (unsigned i = 0, iN=m_terms.size(); i < iN; i++) + for (std::size_t i = 0, iN=m_terms.size(); i < iN; i++) this->m_nets[i]->m_cur_Analog = V[i]; } @@ -257,8 +257,8 @@ void matrix_solver_t::build_LE_A() for (unsigned i=0; i < iN; i++) child.A(k,i) = 0.0; - const unsigned terms_count = m_terms[k]->count(); - const unsigned railstart = m_terms[k]->m_railstart; + const std::size_t terms_count = m_terms[k]->count(); + const std::size_t railstart = m_terms[k]->m_railstart; const nl_double * RESTRICT gt = m_terms[k]->gt(); { @@ -272,7 +272,7 @@ void matrix_solver_t::build_LE_A() const nl_double * RESTRICT go = m_terms[k]->go(); const int * RESTRICT net_other = m_terms[k]->net_other(); - for (unsigned i = 0; i < railstart; i++) + for (std::size_t i = 0; i < railstart; i++) child.A(k,net_other[i]) -= go[i]; } } @@ -289,15 +289,15 @@ void matrix_solver_t::build_LE_RHS() nl_double rhsk_a = 0.0; nl_double rhsk_b = 0.0; - const unsigned terms_count = m_terms[k]->count(); + const std::size_t terms_count = m_terms[k]->count(); const nl_double * RESTRICT go = m_terms[k]->go(); const nl_double * RESTRICT Idr = m_terms[k]->Idr(); const nl_double * const * RESTRICT other_cur_analog = m_terms[k]->other_curanalog(); - for (unsigned i = 0; i < terms_count; i++) + for (std::size_t i = 0; i < terms_count; i++) rhsk_a = rhsk_a + Idr[i]; - for (unsigned i = m_terms[k]->m_railstart; i < terms_count; i++) + for (std::size_t i = m_terms[k]->m_railstart; i < terms_count; i++) //rhsk = rhsk + go[i] * terms[i]->m_otherterm->net().as_analog().Q_Analog(); rhsk_b = rhsk_b + go[i] * *other_cur_analog[i]; diff --git a/src/lib/netlist/solver/nld_ms_direct.h b/src/lib/netlist/solver/nld_ms_direct.h index e4af64749e5..a4424970848 100644 --- a/src/lib/netlist/solver/nld_ms_direct.h +++ b/src/lib/netlist/solver/nld_ms_direct.h @@ -123,8 +123,8 @@ class matrix_solver_direct_t: public matrix_solver_t friend class matrix_solver_t; public: - matrix_solver_direct_t(netlist_t &anetlist, const pstring &name, const solver_parameters_t *params, const int size); - matrix_solver_direct_t(netlist_t &anetlist, const pstring &name, const eSortType sort, const solver_parameters_t *params, const int size); + matrix_solver_direct_t(netlist_t &anetlist, const pstring &name, const solver_parameters_t *params, const unsigned size); + matrix_solver_direct_t(netlist_t &anetlist, const pstring &name, const eSortType sort, const solver_parameters_t *params, const unsigned size); virtual ~matrix_solver_direct_t(); @@ -132,8 +132,8 @@ public: virtual void reset() override { matrix_solver_t::reset(); } protected: - virtual int vsolve_non_dynamic(const bool newton_raphson) override; - int solve_non_dynamic(const bool newton_raphson); + virtual unsigned vsolve_non_dynamic(const bool newton_raphson) override; + unsigned solve_non_dynamic(const bool newton_raphson); inline unsigned N() const { if (m_N == 0) return m_dim; else return m_N; } @@ -348,17 +348,17 @@ void matrix_solver_direct_t<m_N, storage_N>::LE_back_subst( /* back substitution */ if (m_params.m_pivot) { - for (int j = kN - 1; j >= 0; j--) + for (unsigned j = kN; j-- > 0; ) { T tmp = 0; - for (unsigned k = j+1; k < kN; k++) + for (std::size_t k = j+1; k < kN; k++) tmp += A(j,k) * x[k]; x[j] = (RHS(j) - tmp) / A(j,j); } } else { - for (int j = kN - 1; j >= 0; j--) + for (unsigned j = kN; j-- > 0; ) { T tmp = 0; @@ -377,7 +377,7 @@ void matrix_solver_direct_t<m_N, storage_N>::LE_back_subst( template <unsigned m_N, unsigned storage_N> -int matrix_solver_direct_t<m_N, storage_N>::solve_non_dynamic(const bool newton_raphson) +unsigned matrix_solver_direct_t<m_N, storage_N>::solve_non_dynamic(const bool newton_raphson) { nl_double new_V[storage_N]; // = { 0.0 }; @@ -400,7 +400,7 @@ int matrix_solver_direct_t<m_N, storage_N>::solve_non_dynamic(const bool newton_ } template <unsigned m_N, unsigned storage_N> -inline int matrix_solver_direct_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_raphson) +inline unsigned matrix_solver_direct_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_raphson) { build_LE_A<matrix_solver_direct_t>(); build_LE_RHS<matrix_solver_direct_t>(); @@ -414,7 +414,7 @@ inline int matrix_solver_direct_t<m_N, storage_N>::vsolve_non_dynamic(const bool template <unsigned m_N, unsigned storage_N> matrix_solver_direct_t<m_N, storage_N>::matrix_solver_direct_t(netlist_t &anetlist, const pstring &name, - const solver_parameters_t *params, const int size) + const solver_parameters_t *params, const unsigned size) : matrix_solver_t(anetlist, name, ASCENDING, params) , m_dim(size) { @@ -432,7 +432,7 @@ matrix_solver_direct_t<m_N, storage_N>::matrix_solver_direct_t(netlist_t &anetli template <unsigned m_N, unsigned storage_N> matrix_solver_direct_t<m_N, storage_N>::matrix_solver_direct_t(netlist_t &anetlist, const pstring &name, - const eSortType sort, const solver_parameters_t *params, const int size) + const eSortType sort, const solver_parameters_t *params, const unsigned size) : matrix_solver_t(anetlist, name, sort, params) , m_dim(size) { diff --git a/src/lib/netlist/solver/nld_ms_direct1.h b/src/lib/netlist/solver/nld_ms_direct1.h index 944e4bbcab2..3209ee5bd93 100644 --- a/src/lib/netlist/solver/nld_ms_direct1.h +++ b/src/lib/netlist/solver/nld_ms_direct1.h @@ -22,7 +22,7 @@ public: matrix_solver_direct1_t(netlist_t &anetlist, const pstring &name, const solver_parameters_t *params) : matrix_solver_direct_t<1, 1>(anetlist, name, params, 1) {} - virtual int vsolve_non_dynamic(const bool newton_raphson) override; + virtual unsigned vsolve_non_dynamic(const bool newton_raphson) override; }; @@ -30,7 +30,7 @@ public: // matrix_solver - Direct1 // ---------------------------------------------------------------------------------------- -inline int matrix_solver_direct1_t::vsolve_non_dynamic(ATTR_UNUSED const bool newton_raphson) +inline unsigned matrix_solver_direct1_t::vsolve_non_dynamic(ATTR_UNUSED const bool newton_raphson) { build_LE_A<matrix_solver_direct1_t>(); build_LE_RHS<matrix_solver_direct1_t>(); diff --git a/src/lib/netlist/solver/nld_ms_direct2.h b/src/lib/netlist/solver/nld_ms_direct2.h index 3661d96b9fe..4a2525d1ef7 100644 --- a/src/lib/netlist/solver/nld_ms_direct2.h +++ b/src/lib/netlist/solver/nld_ms_direct2.h @@ -22,7 +22,7 @@ public: matrix_solver_direct2_t(netlist_t &anetlist, const pstring &name, const solver_parameters_t *params) : matrix_solver_direct_t<2, 2>(anetlist, name, params, 2) {} - virtual int vsolve_non_dynamic(const bool newton_raphson) override; + virtual unsigned vsolve_non_dynamic(const bool newton_raphson) override; }; @@ -30,7 +30,7 @@ public: // matrix_solver - Direct2 // ---------------------------------------------------------------------------------------- -inline int matrix_solver_direct2_t::vsolve_non_dynamic(ATTR_UNUSED const bool newton_raphson) +inline unsigned matrix_solver_direct2_t::vsolve_non_dynamic(ATTR_UNUSED const bool newton_raphson) { build_LE_A<matrix_solver_direct2_t>(); build_LE_RHS<matrix_solver_direct2_t>(); diff --git a/src/lib/netlist/solver/nld_ms_direct_lu.h b/src/lib/netlist/solver/nld_ms_direct_lu.h index cd2a749dec6..1f9e86bebd7 100644 --- a/src/lib/netlist/solver/nld_ms_direct_lu.h +++ b/src/lib/netlist/solver/nld_ms_direct_lu.h @@ -28,8 +28,8 @@ class matrix_solver_direct_t: public matrix_solver_t { public: - matrix_solver_direct_t(const solver_parameters_t *params, const int size); - matrix_solver_direct_t(const eSolverType type, const solver_parameters_t *params, const int size); + matrix_solver_direct_t(const solver_parameters_t *params, const unsigned size); + matrix_solver_direct_t(const eSolverType type, const solver_parameters_t *params, const unsigned size); virtual ~matrix_solver_direct_t(); @@ -568,7 +568,7 @@ void matrix_solver_direct_t<m_N, storage_N>::store( template <unsigned m_N, unsigned storage_N> -int matrix_solver_direct_t<m_N, storage_N>::solve_non_dynamic(const bool newton_raphson) +unsigned matrix_solver_direct_t<m_N, storage_N>::solve_non_dynamic(const bool newton_raphson) { nl_double new_V[storage_N]; // = { 0.0 }; @@ -602,7 +602,7 @@ inline int matrix_solver_direct_t<m_N, storage_N>::vsolve_non_dynamic(const bool } template <unsigned m_N, unsigned storage_N> -matrix_solver_direct_t<m_N, storage_N>::matrix_solver_direct_t(const solver_parameters_t *params, const int size) +matrix_solver_direct_t<m_N, storage_N>::matrix_solver_direct_t(const solver_parameters_t *params, const unsigned size) : matrix_solver_t(GAUSSIAN_ELIMINATION, params) , m_dim(size) , m_lp_fact(0) @@ -616,7 +616,7 @@ matrix_solver_direct_t<m_N, storage_N>::matrix_solver_direct_t(const solver_para } template <unsigned m_N, unsigned storage_N> -matrix_solver_direct_t<m_N, storage_N>::matrix_solver_direct_t(const eSolverType type, const solver_parameters_t *params, const int size) +matrix_solver_direct_t<m_N, storage_N>::matrix_solver_direct_t(const eSolverType type, const solver_parameters_t *params, const unsigned size) : matrix_solver_t(type, params) , m_dim(size) , m_lp_fact(0) diff --git a/src/lib/netlist/solver/nld_ms_gcr.h b/src/lib/netlist/solver/nld_ms_gcr.h index 014a7b6efec..8ce09a9ec78 100644 --- a/src/lib/netlist/solver/nld_ms_gcr.h +++ b/src/lib/netlist/solver/nld_ms_gcr.h @@ -33,7 +33,7 @@ class matrix_solver_GCR_t: public matrix_solver_t public: matrix_solver_GCR_t(netlist_t &anetlist, const pstring &name, - const solver_parameters_t *params, int size) + const solver_parameters_t *params, const unsigned size) : matrix_solver_t(anetlist, name, matrix_solver_t::ASCENDING, params) , m_dim(size) , m_proc(nullptr) @@ -47,7 +47,7 @@ public: inline unsigned N() const { if (m_N == 0) return m_dim; else return m_N; } virtual void vsetup(analog_net_t::list_t &nets) override; - virtual int vsolve_non_dynamic(const bool newton_raphson) override; + virtual unsigned vsolve_non_dynamic(const bool newton_raphson) override; virtual void create_solver_code(plib::postream &strm) override; @@ -67,7 +67,7 @@ private: } unsigned m_dim; - std::vector<int> m_term_cr[storage_N]; + std::vector<unsigned> m_term_cr[storage_N]; mat_cr_t<storage_N> mat; nl_double m_A[storage_N * storage_N]; @@ -152,7 +152,7 @@ void matrix_solver_GCR_t<m_N, storage_N>::vsetup(analog_net_t::list_t &nets) { int other = this->m_terms[k]->net_other()[j]; for (unsigned i = mat.ia[k]; i < nz; i++) - if (other == (int) mat.ja[i]) + if (other == static_cast<int>(mat.ja[i])) { m_term_cr[k].push_back(i); break; @@ -164,7 +164,8 @@ void matrix_solver_GCR_t<m_N, storage_N>::vsetup(analog_net_t::list_t &nets) mat.ia[iN] = nz; mat.nz_num = nz; - this->log().verbose("Ops: {1} Occupancy ratio: {2}\n", ops, (double) nz / double (iN * iN)); + this->log().verbose("Ops: {1} Occupancy ratio: {2}\n", ops, + static_cast<double>(nz) / static_cast<double>(iN * iN)); // FIXME: Move me @@ -238,7 +239,7 @@ void matrix_solver_GCR_t<m_N, storage_N>::create_solver_code(plib::postream &str template <unsigned m_N, unsigned storage_N> -int matrix_solver_GCR_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_raphson) +unsigned matrix_solver_GCR_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_raphson) { const unsigned iN = this->N(); @@ -254,8 +255,8 @@ int matrix_solver_GCR_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_ra nl_double gtot_t = 0.0; nl_double RHS_t = 0.0; - const unsigned term_count = t->count(); - const unsigned railstart = t->m_railstart; + const std::size_t term_count = t->count(); + const std::size_t railstart = t->m_railstart; const nl_double * const RESTRICT gt = t->gt(); const nl_double * const RESTRICT go = t->go(); const nl_double * const RESTRICT Idr = t->Idr(); @@ -284,7 +285,7 @@ int matrix_solver_GCR_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_ra RHS_t += Idr[i]; } #endif - for (unsigned i = railstart; i < term_count; i++) + for (std::size_t i = railstart; i < term_count; i++) RHS_t += go[i] * *other_cur_analog[i]; RHS[k] = RHS_t; @@ -350,7 +351,7 @@ int matrix_solver_GCR_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_ra /* row n-1 */ new_V[iN - 1] = RHS[iN - 1] / m_A[mat.diag[iN - 1]]; - for (int j = iN - 2; j >= 0; j--) + for (unsigned j = iN - 1; j-- > 0;) { //__builtin_prefetch(&new_V[j-1], 1); //if (j>0)__builtin_prefetch(&m_A[mat.diag[j-1]], 0); diff --git a/src/lib/netlist/solver/nld_ms_gmres.h b/src/lib/netlist/solver/nld_ms_gmres.h index da0c239dd47..881f4c71fa2 100644 --- a/src/lib/netlist/solver/nld_ms_gmres.h +++ b/src/lib/netlist/solver/nld_ms_gmres.h @@ -28,7 +28,7 @@ class matrix_solver_GMRES_t: public matrix_solver_direct_t<m_N, storage_N> { public: - matrix_solver_GMRES_t(netlist_t &anetlist, const pstring &name, const solver_parameters_t *params, int size) + matrix_solver_GMRES_t(netlist_t &anetlist, const pstring &name, const solver_parameters_t *params, const unsigned size) : matrix_solver_direct_t<m_N, storage_N>(anetlist, name, matrix_solver_t::ASCENDING, params, size) , m_use_iLU_preconditioning(true) , m_use_more_precise_stop_condition(false) @@ -41,13 +41,13 @@ public: } virtual void vsetup(analog_net_t::list_t &nets) override; - virtual int vsolve_non_dynamic(const bool newton_raphson) override; + virtual unsigned vsolve_non_dynamic(const bool newton_raphson) override; private: - int solve_ilu_gmres(nl_double * RESTRICT x, const nl_double * RESTRICT rhs, const unsigned restart_max, const unsigned mr, nl_double accuracy); + unsigned solve_ilu_gmres(nl_double * RESTRICT x, const nl_double * RESTRICT rhs, const unsigned restart_max, const unsigned mr, nl_double accuracy); - std::vector<int> m_term_cr[storage_N]; + std::vector<unsigned> m_term_cr[storage_N]; bool m_use_iLU_preconditioning; bool m_use_more_precise_stop_condition; @@ -97,7 +97,7 @@ void matrix_solver_GMRES_t<m_N, storage_N>::vsetup(analog_net_t::list_t &nets) for (unsigned j=0; j< this->m_terms[k]->m_railstart;j++) { for (unsigned i = mat.ia[k]; i<nz; i++) - if (this->m_terms[k]->net_other()[j] == (int) mat.ja[i]) + if (this->m_terms[k]->net_other()[j] == static_cast<int>(mat.ja[i])) { m_term_cr[k].push_back(i); break; @@ -111,7 +111,7 @@ void matrix_solver_GMRES_t<m_N, storage_N>::vsetup(analog_net_t::list_t &nets) } template <unsigned m_N, unsigned storage_N> -int matrix_solver_GMRES_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_raphson) +unsigned matrix_solver_GMRES_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_raphson) { const unsigned iN = this->N(); @@ -135,8 +135,8 @@ int matrix_solver_GMRES_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_ nl_double gtot_t = 0.0; nl_double RHS_t = 0.0; - const unsigned term_count = this->m_terms[k]->count(); - const unsigned railstart = this->m_terms[k]->m_railstart; + const std::size_t term_count = this->m_terms[k]->count(); + const std::size_t railstart = this->m_terms[k]->m_railstart; const nl_double * const RESTRICT gt = this->m_terms[k]->gt(); const nl_double * const RESTRICT go = this->m_terms[k]->go(); const nl_double * const RESTRICT Idr = this->m_terms[k]->Idr(); @@ -144,13 +144,13 @@ int matrix_solver_GMRES_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_ new_V[k] = this->m_nets[k]->m_cur_Analog; - for (unsigned i = 0; i < term_count; i++) + for (std::size_t i = 0; i < term_count; i++) { gtot_t = gtot_t + gt[i]; RHS_t = RHS_t + Idr[i]; } - for (unsigned i = railstart; i < term_count; i++) + for (std::size_t i = railstart; i < term_count; i++) RHS_t = RHS_t + go[i] * *other_cur_analog[i]; RHS[k] = RHS_t; @@ -158,7 +158,7 @@ int matrix_solver_GMRES_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_ // add diagonal element m_A[mat.diag[k]] = gtot_t; - for (unsigned i = 0; i < railstart; i++) + for (std::size_t i = 0; i < railstart; i++) { const unsigned pi = m_term_cr[k][i]; m_A[pi] -= go[i]; @@ -168,12 +168,12 @@ int matrix_solver_GMRES_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_ const nl_double accuracy = this->m_params.m_accuracy; - int mr = iN; + unsigned mr = iN; if (iN > 3 ) - mr = (int) sqrt(iN) * 2; - int iter = std::max(1, this->m_params.m_gs_loops); - int gsl = solve_ilu_gmres(new_V, RHS, iter, mr, accuracy); - int failed = mr * iter; + mr = static_cast<unsigned>(std::sqrt(iN) * 2.0); + unsigned iter = std::max(1u, this->m_params.m_gs_loops); + unsigned gsl = solve_ilu_gmres(new_V, RHS, iter, mr, accuracy); + unsigned failed = mr * iter; this->m_iterative_total += gsl; this->m_stat_calculations++; @@ -210,7 +210,7 @@ inline void givens_mult( const T & c, const T & s, T & g0, T & g1 ) } template <unsigned m_N, unsigned storage_N> -int matrix_solver_GMRES_t<m_N, storage_N>::solve_ilu_gmres (nl_double * RESTRICT x, const nl_double * RESTRICT rhs, const unsigned restart_max, const unsigned mr, nl_double accuracy) +unsigned matrix_solver_GMRES_t<m_N, storage_N>::solve_ilu_gmres (nl_double * RESTRICT x, const nl_double * RESTRICT rhs, const unsigned restart_max, const unsigned mr, nl_double accuracy) { /*------------------------------------------------------------------------- * The code below was inspired by code published by John Burkardt under @@ -266,7 +266,7 @@ int matrix_solver_GMRES_t<m_N, storage_N>::solve_ilu_gmres (nl_double * RESTRICT rho_delta = accuracy * rho_to_accuracy; } else - rho_delta = accuracy * std::sqrt((double) n) * m_accuracy_mult; + rho_delta = accuracy * std::sqrt(n) * m_accuracy_mult; for (unsigned itr = 0; itr < restart_max; itr++) { @@ -344,7 +344,7 @@ int matrix_solver_GMRES_t<m_N, storage_N>::solve_ilu_gmres (nl_double * RESTRICT /* Solve the system H * y = g */ /* x += m_v[j] * m_y[j] */ - for (int i = last_k; i >= 0; i--) + for (unsigned i = last_k + 1; i-- > 0;) { double tmp = m_g[i]; for (unsigned j = i + 1; j <= last_k; j++) diff --git a/src/lib/netlist/solver/nld_ms_sm.h b/src/lib/netlist/solver/nld_ms_sm.h index ffe59f93d21..2f3597f3a89 100644 --- a/src/lib/netlist/solver/nld_ms_sm.h +++ b/src/lib/netlist/solver/nld_ms_sm.h @@ -55,7 +55,7 @@ class matrix_solver_sm_t: public matrix_solver_t public: matrix_solver_sm_t(netlist_t &anetlist, const pstring &name, - const solver_parameters_t *params, const int size); + const solver_parameters_t *params, const unsigned size); virtual ~matrix_solver_sm_t(); @@ -63,8 +63,8 @@ public: virtual void reset() override { matrix_solver_t::reset(); } protected: - virtual int vsolve_non_dynamic(const bool newton_raphson) override; - int solve_non_dynamic(const bool newton_raphson); + virtual unsigned vsolve_non_dynamic(const bool newton_raphson) override; + unsigned solve_non_dynamic(const bool newton_raphson); inline unsigned N() const { if (m_N == 0) return m_dim; else return m_N; } @@ -155,19 +155,19 @@ void matrix_solver_sm_t<m_N, storage_N>::LE_invert() /* FIXME: Singular matrix? */ const nl_double f = 1.0 / W(i,i); const auto * RESTRICT const p = m_terms[i]->m_nzrd.data(); - const unsigned e = m_terms[i]->m_nzrd.size(); + const std::size_t e = m_terms[i]->m_nzrd.size(); /* Eliminate column i from row j */ const auto * RESTRICT const pb = m_terms[i]->m_nzbd.data(); - const unsigned eb = m_terms[i]->m_nzbd.size(); - for (unsigned jb = 0; jb < eb; jb++) + const std::size_t eb = m_terms[i]->m_nzbd.size(); + for (std::size_t jb = 0; jb < eb; jb++) { const unsigned j = pb[jb]; const nl_double f1 = - W(j,i) * f; if (f1 != 0.0) { - for (unsigned k = 0; k < e; k++) + for (std::size_t k = 0; k < e; k++) W(j,p[k]) += W(i,p[k]) * f1; for (unsigned k = 0; k <= i; k ++) Ainv(j,k) += Ainv(i,k) * f1; @@ -175,11 +175,11 @@ void matrix_solver_sm_t<m_N, storage_N>::LE_invert() } } /* up */ - for (int i = kN - 1; i >= 0; i--) + for (unsigned i = kN; i-- > 0; ) { /* FIXME: Singular matrix? */ const nl_double f = 1.0 / W(i,i); - for (int j = i - 1; j>=0; j--) + for (unsigned j = i; j-- > 0; ) { const nl_double f1 = - W(j,i) * f; if (f1 != 0.0) @@ -219,7 +219,7 @@ void matrix_solver_sm_t<m_N, storage_N>::LE_compute_x( template <unsigned m_N, unsigned storage_N> -int matrix_solver_sm_t<m_N, storage_N>::solve_non_dynamic(const bool newton_raphson) +unsigned matrix_solver_sm_t<m_N, storage_N>::solve_non_dynamic(const bool newton_raphson) { static const bool incremental = true; static unsigned cnt = 0; @@ -309,7 +309,7 @@ int matrix_solver_sm_t<m_N, storage_N>::solve_non_dynamic(const bool newton_raph } template <unsigned m_N, unsigned storage_N> -inline int matrix_solver_sm_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_raphson) +inline unsigned matrix_solver_sm_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_raphson) { build_LE_A<matrix_solver_sm_t>(); build_LE_RHS<matrix_solver_sm_t>(); @@ -323,7 +323,7 @@ inline int matrix_solver_sm_t<m_N, storage_N>::vsolve_non_dynamic(const bool new template <unsigned m_N, unsigned storage_N> matrix_solver_sm_t<m_N, storage_N>::matrix_solver_sm_t(netlist_t &anetlist, const pstring &name, - const solver_parameters_t *params, const int size) + const solver_parameters_t *params, const unsigned size) : matrix_solver_t(anetlist, name, NOSORT, params) , m_dim(size) { diff --git a/src/lib/netlist/solver/nld_ms_sor.h b/src/lib/netlist/solver/nld_ms_sor.h index b7012f5532d..686280f7611 100644 --- a/src/lib/netlist/solver/nld_ms_sor.h +++ b/src/lib/netlist/solver/nld_ms_sor.h @@ -26,7 +26,7 @@ class matrix_solver_SOR_t: public matrix_solver_direct_t<m_N, storage_N> { public: - matrix_solver_SOR_t(netlist_t &anetlist, const pstring &name, const solver_parameters_t *params, int size) + matrix_solver_SOR_t(netlist_t &anetlist, const pstring &name, const solver_parameters_t *params, const unsigned size) : matrix_solver_direct_t<m_N, storage_N>(anetlist, name, matrix_solver_t::ASCENDING, params, size) , m_lp_fact(*this, "m_lp_fact", 0) { @@ -35,7 +35,7 @@ public: virtual ~matrix_solver_SOR_t() {} virtual void vsetup(analog_net_t::list_t &nets) override; - virtual int vsolve_non_dynamic(const bool newton_raphson) override; + virtual unsigned vsolve_non_dynamic(const bool newton_raphson) override; private: state_var<nl_double> m_lp_fact; @@ -53,11 +53,11 @@ void matrix_solver_SOR_t<m_N, storage_N>::vsetup(analog_net_t::list_t &nets) } template <unsigned m_N, unsigned storage_N> -int matrix_solver_SOR_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_raphson) +unsigned matrix_solver_SOR_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_raphson) { const unsigned iN = this->N(); bool resched = false; - int resched_cnt = 0; + unsigned resched_cnt = 0; /* ideally, we could get an estimate for the spectral radius of * Inv(D - L) * U @@ -80,7 +80,7 @@ int matrix_solver_SOR_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_ra nl_double gabs_t = 0.0; nl_double RHS_t = 0.0; - const unsigned term_count = this->m_terms[k]->count(); + const std::size_t term_count = this->m_terms[k]->count(); const nl_double * const RESTRICT gt = this->m_terms[k]->gt(); const nl_double * const RESTRICT go = this->m_terms[k]->go(); const nl_double * const RESTRICT Idr = this->m_terms[k]->Idr(); @@ -88,20 +88,20 @@ int matrix_solver_SOR_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_ra new_V[k] = this->m_nets[k]->m_cur_Analog; - for (unsigned i = 0; i < term_count; i++) + for (std::size_t i = 0; i < term_count; i++) { gtot_t = gtot_t + gt[i]; RHS_t = RHS_t + Idr[i]; } - for (unsigned i = this->m_terms[k]->m_railstart; i < term_count; i++) + for (std::size_t i = this->m_terms[k]->m_railstart; i < term_count; i++) RHS_t = RHS_t + go[i] * *other_cur_analog[i]; RHS[k] = RHS_t; if (USE_GABS) { - for (unsigned i = 0; i < term_count; i++) + for (std::size_t i = 0; i < term_count; i++) gabs_t = gabs_t + std::abs(go[i]); gabs_t *= NL_FCONST(0.5); // derived by try and error @@ -138,11 +138,11 @@ int matrix_solver_SOR_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_ra for (unsigned k = 0; k < iN; k++) { const int * RESTRICT net_other = this->m_terms[k]->net_other(); - const unsigned railstart = this->m_terms[k]->m_railstart; + const std::size_t railstart = this->m_terms[k]->m_railstart; const nl_double * RESTRICT go = this->m_terms[k]->go(); nl_double Idrive = 0.0; - for (unsigned i = 0; i < railstart; i++) + for (std::size_t i = 0; i < railstart; i++) Idrive = Idrive + go[i] * new_V[net_other[i]]; const nl_double new_val = new_V[k] * one_m_w[k] + (Idrive + RHS[k]) * w[k]; diff --git a/src/lib/netlist/solver/nld_ms_sor_mat.h b/src/lib/netlist/solver/nld_ms_sor_mat.h index f53727cfe9b..f56a7028556 100644 --- a/src/lib/netlist/solver/nld_ms_sor_mat.h +++ b/src/lib/netlist/solver/nld_ms_sor_mat.h @@ -29,7 +29,7 @@ class matrix_solver_SOR_mat_t: public matrix_solver_direct_t<m_N, storage_N> public: - matrix_solver_SOR_mat_t(netlist_t &anetlist, const pstring &name, const solver_parameters_t *params, int size) + matrix_solver_SOR_mat_t(netlist_t &anetlist, const pstring &name, const solver_parameters_t *params, const unsigned size) : matrix_solver_direct_t<m_N, storage_N>(anetlist, name, matrix_solver_t::DESCENDING, params, size) , m_Vdelta(*this, "m_Vdelta", 0.0) , m_omega(*this, "m_omega", params->m_sor) @@ -43,7 +43,7 @@ public: virtual void vsetup(analog_net_t::list_t &nets) override; - virtual int vsolve_non_dynamic(const bool newton_raphson) override; + virtual unsigned vsolve_non_dynamic(const bool newton_raphson) override; private: state_var<nl_double[storage_N]> m_Vdelta; @@ -114,7 +114,7 @@ nl_double matrix_solver_SOR_mat_t<m_N, storage_N>::vsolve() #endif template <unsigned m_N, unsigned storage_N> -int matrix_solver_SOR_mat_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_raphson) +unsigned matrix_solver_SOR_mat_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_raphson) { /* The matrix based code looks a lot nicer but actually is 30% slower than * the optimized code which works directly on the data structures. @@ -130,7 +130,7 @@ int matrix_solver_SOR_mat_t<m_N, storage_N>::vsolve_non_dynamic(const bool newto bool resched = false; - int resched_cnt = 0; + unsigned resched_cnt = 0; #if 0 @@ -181,9 +181,9 @@ int matrix_solver_SOR_mat_t<m_N, storage_N>::vsolve_non_dynamic(const bool newto nl_double Idrive = 0; const auto *p = this->m_terms[k]->m_nz.data(); - const unsigned e = this->m_terms[k]->m_nz.size(); + const std::size_t e = this->m_terms[k]->m_nz.size(); - for (unsigned i = 0; i < e; i++) + for (std::size_t i = 0; i < e; i++) Idrive = Idrive + this->A(k,p[i]) * new_v[p[i]]; const nl_double delta = m_omega * (this->RHS(k) - Idrive) / this->A(k,k); diff --git a/src/lib/netlist/solver/nld_ms_w.h b/src/lib/netlist/solver/nld_ms_w.h index 33e94a207c3..55d9d630224 100644 --- a/src/lib/netlist/solver/nld_ms_w.h +++ b/src/lib/netlist/solver/nld_ms_w.h @@ -60,7 +60,7 @@ class matrix_solver_w_t: public matrix_solver_t friend class matrix_solver_t; public: - matrix_solver_w_t(netlist_t &anetlist, const pstring &name, const solver_parameters_t *params, const int size); + matrix_solver_w_t(netlist_t &anetlist, const pstring &name, const solver_parameters_t *params, const unsigned size); virtual ~matrix_solver_w_t(); @@ -68,8 +68,8 @@ public: virtual void reset() override { matrix_solver_t::reset(); } protected: - virtual int vsolve_non_dynamic(const bool newton_raphson) override; - int solve_non_dynamic(const bool newton_raphson); + virtual unsigned vsolve_non_dynamic(const bool newton_raphson) override; + unsigned solve_non_dynamic(const bool newton_raphson); inline unsigned N() const { if (m_N == 0) return m_dim; else return m_N; } @@ -164,12 +164,12 @@ void matrix_solver_w_t<m_N, storage_N>::LE_invert() /* FIXME: Singular matrix? */ const nl_double f = 1.0 / W(i,i); const auto * RESTRICT const p = m_terms[i]->m_nzrd.data(); - const unsigned e = m_terms[i]->m_nzrd.size(); + const size_t e = m_terms[i]->m_nzrd.size(); /* Eliminate column i from row j */ const auto * RESTRICT const pb = m_terms[i]->m_nzbd.data(); - const unsigned eb = m_terms[i]->m_nzbd.size(); + const size_t eb = m_terms[i]->m_nzbd.size(); for (unsigned jb = 0; jb < eb; jb++) { const auto j = pb[jb]; @@ -184,11 +184,11 @@ void matrix_solver_w_t<m_N, storage_N>::LE_invert() } } /* up */ - for (int i = kN - 1; i >= 0; i--) + for (unsigned i = kN; i-- > 0; ) { /* FIXME: Singular matrix? */ const nl_double f = 1.0 / W(i,i); - for (int j = i - 1; j>=0; j--) + for (unsigned j = i; j-- > 0; ) { const nl_double f1 = - W(j,i) * f; if (f1 != 0.0) @@ -227,7 +227,7 @@ void matrix_solver_w_t<m_N, storage_N>::LE_compute_x( template <unsigned m_N, unsigned storage_N> -int matrix_solver_w_t<m_N, storage_N>::solve_non_dynamic(const bool newton_raphson) +unsigned matrix_solver_w_t<m_N, storage_N>::solve_non_dynamic(const bool newton_raphson) { const auto iN = N(); @@ -320,7 +320,7 @@ int matrix_solver_w_t<m_N, storage_N>::solve_non_dynamic(const bool newton_raphs /* Back substitution */ //inv(H) w = t w = H t nl_double t[storage_N]; // FIXME: convert to member - for (int j = rowcount - 1; j >= 0; j--) + for (unsigned j = rowcount; j-- > 0; ) { nl_double tmp = 0; const nl_double *pj = &H[j][j+1]; @@ -373,7 +373,7 @@ int matrix_solver_w_t<m_N, storage_N>::solve_non_dynamic(const bool newton_raphs } template <unsigned m_N, unsigned storage_N> -inline int matrix_solver_w_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_raphson) +inline unsigned matrix_solver_w_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_raphson) { build_LE_A<matrix_solver_w_t>(); build_LE_RHS<matrix_solver_w_t>(); @@ -387,7 +387,7 @@ inline int matrix_solver_w_t<m_N, storage_N>::vsolve_non_dynamic(const bool newt template <unsigned m_N, unsigned storage_N> matrix_solver_w_t<m_N, storage_N>::matrix_solver_w_t(netlist_t &anetlist, const pstring &name, - const solver_parameters_t *params, const int size) + const solver_parameters_t *params, const unsigned size) : matrix_solver_t(anetlist, name, NOSORT, params) ,m_cnt(0) , m_dim(size) diff --git a/src/lib/netlist/solver/nld_solver.cpp b/src/lib/netlist/solver/nld_solver.cpp index 583ac904198..b26b7525b40 100644 --- a/src/lib/netlist/solver/nld_solver.cpp +++ b/src/lib/netlist/solver/nld_solver.cpp @@ -127,9 +127,9 @@ void matrix_solver_t::setup_base(analog_net_t::list_t &nets) net->set_solver(this); - for (core_terminal_t *p : net->m_core_terms) + for (auto &p : net->m_core_terms) { - log().debug("{1} {2} {3}\n", p->name(), net->name(), (int) net->isRailNet()); + log().debug("{1} {2} {3}\n", p->name(), net->name(), net->isRailNet()); switch (p->type()) { case terminal_t::TERMINAL: @@ -187,12 +187,12 @@ void matrix_solver_t::setup_base(analog_net_t::list_t &nets) void matrix_solver_t::setup_matrix() { - const unsigned iN = m_nets.size(); + const std::size_t iN = m_nets.size(); - for (unsigned k = 0; k < iN; k++) + for (std::size_t k = 0; k < iN; k++) { m_terms[k]->m_railstart = m_terms[k]->count(); - for (unsigned i = 0; i < m_rails_temp[k]->count(); i++) + for (std::size_t i = 0; i < m_rails_temp[k]->count(); i++) this->m_terms[k]->add(m_rails_temp[k]->terms()[i], m_rails_temp[k]->net_other()[i], false); m_rails_temp[k]->clear(); // no longer needed @@ -231,7 +231,7 @@ void matrix_solver_t::setup_matrix() for (unsigned k = 0; k < iN - 1; k++) for (unsigned i = k+1; i < iN; i++) { - if (((int) m_terms[k]->m_railstart - (int) m_terms[i]->m_railstart) * sort_order < 0) + if ((static_cast<int>(m_terms[k]->m_railstart) - static_cast<int>(m_terms[i]->m_railstart)) * sort_order < 0) { std::swap(m_terms[i], m_terms[k]); std::swap(m_nets[i], m_nets[k]); @@ -257,8 +257,8 @@ void matrix_solver_t::setup_matrix() t->m_nz.clear(); for (unsigned i = 0; i < t->m_railstart; i++) - if (!plib::container::contains(t->m_nz, other[i])) - t->m_nz.push_back(other[i]); + if (!plib::container::contains(t->m_nz, static_cast<unsigned>(other[i]))) + t->m_nz.push_back(static_cast<unsigned>(other[i])); t->m_nz.push_back(k); // add diagonal @@ -291,8 +291,8 @@ void matrix_solver_t::setup_matrix() } for (unsigned i = 0; i < t->m_railstart; i++) - if (!plib::container::contains(t->m_nzrd, other[i]) && other[i] >= (int) (k + 1)) - t->m_nzrd.push_back(other[i]); + if (!plib::container::contains(t->m_nzrd, static_cast<unsigned>(other[i])) && other[i] >= static_cast<int>(k + 1)) + t->m_nzrd.push_back(static_cast<unsigned>(other[i])); /* and sort */ std::sort(t->m_nzrd.begin(), t->m_nzrd.end()); @@ -369,15 +369,15 @@ void matrix_solver_t::setup_matrix() void matrix_solver_t::update_inputs() { // avoid recursive calls. Inputs are updated outside this call - for (std::size_t i=0; i<m_inps.size(); i++) - m_inps[i]->set_Q(m_inps[i]->m_proxied_net->Q_Analog()); + for (auto &inp : m_inps) + inp->push(inp->m_proxied_net->Q_Analog()); } void matrix_solver_t::update_dynamic() { /* update all non-linear devices */ - for (std::size_t i=0; i < m_dynamic_devices.size(); i++) - m_dynamic_devices[i]->update_terminals(); + for (auto &dyn : m_dynamic_devices) + dyn->update_terminals(); } void matrix_solver_t::reset() @@ -419,8 +419,8 @@ void matrix_solver_t::solve_base() m_stat_vsolver_calls++; if (has_dynamic_devices()) { - int this_resched; - int newton_loops = 0; + unsigned this_resched; + unsigned newton_loops = 0; do { update_dynamic(); @@ -465,15 +465,15 @@ const netlist_time matrix_solver_t::solve() return next_time_step; } -int matrix_solver_t::get_net_idx(net_t *net) +int matrix_solver_t::get_net_idx(detail::net_t *net) { for (std::size_t k = 0; k < m_nets.size(); k++) if (m_nets[k] == net) - return k; + return static_cast<int>(k); return -1; } -void matrix_solver_t::add_term(int k, terminal_t *term) +void matrix_solver_t::add_term(std::size_t k, terminal_t *term) { if (term->m_otherterm->net().isRailNet()) { @@ -505,7 +505,7 @@ netlist_time matrix_solver_t::compute_next_timestep(const double cur_ts) * FIXME: We should extend the logic to use either all nets or * only output nets. */ - for (unsigned k = 0, iN=m_terms.size(); k < iN; k++) + for (std::size_t k = 0, iN=m_terms.size(); k < iN; k++) { analog_net_t *n = m_nets[k]; terms_t *t = m_terms[k]; @@ -550,28 +550,23 @@ void matrix_solver_t::log_stats() log().verbose(" ==> {1} nets", this->m_nets.size()); //, (*(*groups[i].first())->m_core_terms.first())->name()); log().verbose(" has {1} elements", this->has_dynamic_devices() ? "dynamic" : "no dynamic"); log().verbose(" has {1} elements", this->has_timestep_devices() ? "timestep" : "no timestep"); - log().verbose(" {1:6.3} average newton raphson loops", (double) this->m_stat_newton_raphson / (double) this->m_stat_vsolver_calls); - log().verbose(" {1:10} invocations ({2:6} Hz) {3:10} gs fails ({4:6.2} %) {5:6.3} average", + log().verbose(" {1:6.3} average newton raphson loops", + static_cast<double>(this->m_stat_newton_raphson) / static_cast<double>(this->m_stat_vsolver_calls)); + log().verbose(" {1:10} invocations ({2:6.0} Hz) {3:10} gs fails ({4:6.2} %) {5:6.3} average", this->m_stat_calculations(), - this->m_stat_calculations() * 10 / (int) (this->netlist().time().as_double() * 10.0), + static_cast<double>(this->m_stat_calculations()) / this->netlist().time().as_double(), this->m_iterative_fail(), - 100.0 * (double) this->m_iterative_fail() / (double) this->m_stat_calculations(), - (double) this->m_iterative_total() / (double) this->m_stat_calculations()); + 100.0 * static_cast<double>(this->m_iterative_fail()) + / static_cast<double>(this->m_stat_calculations()), + static_cast<double>(this->m_iterative_total()) / static_cast<double>(this->m_stat_calculations())); } } - - - - - // ---------------------------------------------------------------------------------------- // solver // ---------------------------------------------------------------------------------------- - - NETLIB_RESET(solver) { for (std::size_t i = 0; i < m_mat_solvers.size(); i++) @@ -596,7 +591,7 @@ NETLIB_UPDATE(solver) #if HAS_OPENMP && USE_OPENMP const std::size_t t_cnt = m_mat_solvers.size(); - if (m_parallel.Value()) + if (m_parallel()) { omp_set_num_threads(3); //omp_set_dynamic(0); @@ -634,7 +629,7 @@ NETLIB_UPDATE(solver) } template <int m_N, int storage_N> -std::unique_ptr<matrix_solver_t> NETLIB_NAME(solver)::create_solver(int size, const bool use_specific) +std::unique_ptr<matrix_solver_t> NETLIB_NAME(solver)::create_solver(unsigned size, const bool use_specific) { pstring solvername = plib::pfmt("Solver_{1}")(m_mat_solvers.size()); if (use_specific && m_N == 1) @@ -643,48 +638,48 @@ std::unique_ptr<matrix_solver_t> NETLIB_NAME(solver)::create_solver(int size, co return plib::make_unique<matrix_solver_direct2_t>(netlist(), solvername, &m_params); else { - if (size >= m_gs_threshold) + if (static_cast<int>(size) >= m_gs_threshold()) { - if (pstring("SOR_MAT").equals(m_iterative_solver)) + if (pstring("SOR_MAT").equals(m_iterative_solver())) { typedef matrix_solver_SOR_mat_t<m_N,storage_N> solver_sor_mat; return plib::make_unique<solver_sor_mat>(netlist(), solvername, &m_params, size); } - else if (pstring("MAT_CR").equals(m_iterative_solver)) + else if (pstring("MAT_CR").equals(m_iterative_solver())) { typedef matrix_solver_GCR_t<m_N,storage_N> solver_mat; return plib::make_unique<solver_mat>(netlist(), solvername, &m_params, size); } - else if (pstring("MAT").equals(m_iterative_solver)) + else if (pstring("MAT").equals(m_iterative_solver())) { typedef matrix_solver_direct_t<m_N,storage_N> solver_mat; return plib::make_unique<solver_mat>(netlist(), solvername, &m_params, size); } - else if (pstring("SM").equals(m_iterative_solver)) + else if (pstring("SM").equals(m_iterative_solver())) { /* Sherman-Morrison Formula */ typedef matrix_solver_sm_t<m_N,storage_N> solver_mat; return plib::make_unique<solver_mat>(netlist(), solvername, &m_params, size); } - else if (pstring("W").equals(m_iterative_solver)) + else if (pstring("W").equals(m_iterative_solver())) { /* Woodbury Formula */ typedef matrix_solver_w_t<m_N,storage_N> solver_mat; return plib::make_unique<solver_mat>(netlist(), solvername, &m_params, size); } - else if (pstring("SOR").equals(m_iterative_solver)) + else if (pstring("SOR").equals(m_iterative_solver())) { typedef matrix_solver_SOR_t<m_N,storage_N> solver_GS; return plib::make_unique<solver_GS>(netlist(), solvername, &m_params, size); } - else if (pstring("GMRES").equals(m_iterative_solver)) + else if (pstring("GMRES").equals(m_iterative_solver())) { typedef matrix_solver_GMRES_t<m_N,storage_N> solver_GMRES; return plib::make_unique<solver_GMRES>(netlist(), solvername, &m_params, size); } else { - netlist().log().fatal("Unknown solver type: {1}\n", m_iterative_solver.Value()); + netlist().log().fatal("Unknown solver type: {1}\n", m_iterative_solver()); return nullptr; } } @@ -701,17 +696,18 @@ void NETLIB_NAME(solver)::post_start() std::vector<analog_net_t::list_t> groups; const bool use_specific = true; - m_params.m_pivot = m_pivot.Value(); - m_params.m_accuracy = m_accuracy.Value(); - m_params.m_gs_loops = m_gs_loops.Value(); - m_params.m_nr_loops = m_nr_loops.Value(); - m_params.m_nt_sync_delay = netlist_time::from_double(m_sync_delay.Value()); - m_params.m_lte = m_lte.Value(); - m_params.m_sor = m_sor.Value(); + m_params.m_pivot = m_pivot(); + m_params.m_accuracy = m_accuracy(); + /* FIXME: Throw when negative */ + m_params.m_gs_loops = static_cast<unsigned>(m_gs_loops()); + m_params.m_nr_loops = static_cast<unsigned>(m_nr_loops()); + m_params.m_nt_sync_delay = netlist_time::from_double(m_sync_delay()); + m_params.m_lte = m_lte(); + m_params.m_sor = m_sor(); - m_params.m_min_timestep = m_min_timestep.Value(); - m_params.m_dynamic = (m_dynamic.Value() == 1 ? true : false); - m_params.m_max_timestep = netlist_time::from_hz(m_freq.Value()).as_double(); + m_params.m_min_timestep = m_min_timestep(); + m_params.m_dynamic = (m_dynamic() == 1 ? true : false); + m_params.m_max_timestep = netlist_time::from_double(1.0 / m_freq()).as_double(); if (m_params.m_dynamic) { @@ -727,9 +723,9 @@ void NETLIB_NAME(solver)::post_start() // Override log statistics pstring p = plib::util::environment("NL_STATS"); if (p != "") - m_params.m_log_stats = (bool) p.as_long(); + m_params.m_log_stats = p.as_long(); else - m_params.m_log_stats = (bool) m_log_stats.Value(); + m_params.m_log_stats = m_log_stats(); netlist().log().verbose("Scanning net groups ..."); // determine net groups @@ -754,7 +750,7 @@ void NETLIB_NAME(solver)::post_start() for (auto & grp : groups) { std::unique_ptr<matrix_solver_t> ms; - std::size_t net_count = grp.size(); + unsigned net_count = static_cast<unsigned>(grp.size()); switch (net_count) { @@ -806,7 +802,7 @@ void NETLIB_NAME(solver)::post_start() break; #endif default: - netlist().log().warning("No specific solver found for netlist of size {1}", (unsigned) net_count); + netlist().log().warning("No specific solver found for netlist of size {1}", net_count); if (net_count <= 16) { ms = create_solver<0,16>(net_count, use_specific); @@ -841,10 +837,10 @@ void NETLIB_NAME(solver)::post_start() netlist().log().verbose(" ==> {2} nets", grp.size()); netlist().log().verbose(" has {1} elements", ms->has_dynamic_devices() ? "dynamic" : "no dynamic"); netlist().log().verbose(" has {1} elements", ms->has_timestep_devices() ? "timestep" : "no timestep"); - for (net_t *n : grp) + for (auto &n : grp) { netlist().log().verbose("Net {1}", n->name()); - for (const core_terminal_t *pcore : n->m_core_terms) + for (const auto &pcore : n->m_core_terms) { netlist().log().verbose(" {1}", pcore->name()); } diff --git a/src/lib/netlist/solver/nld_solver.h b/src/lib/netlist/solver/nld_solver.h index d683e627d3f..6fb7dad37ba 100644 --- a/src/lib/netlist/solver/nld_solver.h +++ b/src/lib/netlist/solver/nld_solver.h @@ -75,7 +75,7 @@ NETLIB_OBJECT(solver) void post_start(); void stop() override; - inline nl_double gmin() { return m_gmin.Value(); } + inline nl_double gmin() { return m_gmin(); } void create_solver_code(plib::postream &strm); @@ -111,7 +111,7 @@ private: solver_parameters_t m_params; template <int m_N, int storage_N> - std::unique_ptr<matrix_solver_t> create_solver(int size, bool use_specific); + std::unique_ptr<matrix_solver_t> create_solver(unsigned size, bool use_specific); }; } //namespace devices diff --git a/src/lib/netlist/tools/nl_convert.cpp b/src/lib/netlist/tools/nl_convert.cpp index d8a7401018e..5a238bfe9ba 100644 --- a/src/lib/netlist/tools/nl_convert.cpp +++ b/src/lib/netlist/tools/nl_convert.cpp @@ -153,12 +153,11 @@ double nl_convert_base_t::get_sp_unit(const pstring &unit) double nl_convert_base_t::get_sp_val(const pstring &sin) { - int p = sin.len() - 1; - while (p>=0 && (sin.substr(p,1) < "0" || sin.substr(p,1) > "9")) - p--; - pstring val = sin.substr(0,p + 1); - pstring unit = sin.substr(p + 1); - + auto p = sin.begin(); + while (p != sin.end() && (m_numberchars.find(*p) != m_numberchars.end())) + ++p; + pstring val = sin.left(p); + pstring unit = sin.substr(p); double ret = get_sp_unit(unit) * val.as_double(); return ret; } @@ -223,7 +222,7 @@ void nl_convert_spice_t::process_line(const pstring &line) switch (tt[0].code_at(0)) { case ';': - out("// {}\n", line.substr(1).cstr()); + out("// {}\n", line.substr(1)); break; case '*': out("// {}\n", line.substr(1).cstr()); @@ -249,7 +248,7 @@ void nl_convert_spice_t::process_line(const pstring &line) /* check for fourth terminal ... should be numeric net * including "0" or start with "N" (ltspice) */ - ATTR_UNUSED int nval =tt[4].as_long(&cerr); + ATTR_UNUSED long nval =tt[4].as_long(&cerr); pstring model; pstring pins ="CBE"; @@ -262,7 +261,7 @@ void nl_convert_spice_t::process_line(const pstring &line) { if (m[1].len() != 4) fprintf(stderr, "error with model desc %s\n", model.cstr()); - pins = m[1].left(3); + pins = m[1].left(m[1].begin() + 3); } add_device("QBJT_EB", tt[0], m[0]); add_term(tt[1], tt[0] + "." + pins.code_at(0)); diff --git a/src/lib/netlist/tools/nl_convert.h b/src/lib/netlist/tools/nl_convert.h index ca086d5346b..209057a06d5 100644 --- a/src/lib/netlist/tools/nl_convert.h +++ b/src/lib/netlist/tools/nl_convert.h @@ -23,7 +23,7 @@ class nl_convert_base_t { public: - nl_convert_base_t() : out(m_buf) {} + nl_convert_base_t() : out(m_buf), m_numberchars("0123456789-+e.") {} virtual ~nl_convert_base_t() { m_nets.clear(); @@ -136,6 +136,7 @@ private: std::unordered_map<pstring, std::unique_ptr<pin_alias_t>> m_pins; static unit_t m_units[]; + pstring m_numberchars; }; diff --git a/src/lib/util/chd.cpp b/src/lib/util/chd.cpp index 55bc313102a..fd6f1c5ad1a 100644 --- a/src/lib/util/chd.cpp +++ b/src/lib/util/chd.cpp @@ -115,7 +115,7 @@ struct chd_file::metadata_entry struct chd_file::metadata_hash { UINT8 tag[4]; // tag of the metadata in big-endian - sha1_t sha1; // hash data + util::sha1_t sha1; // hash data }; @@ -159,9 +159,9 @@ inline void chd_file::be_write(UINT8 *base, UINT64 value, int numbytes) // stream in bigendian order //------------------------------------------------- -inline sha1_t chd_file::be_read_sha1(const UINT8 *base) +inline util::sha1_t chd_file::be_read_sha1(const UINT8 *base) { - sha1_t result; + util::sha1_t result; memcpy(&result.m_raw[0], base, sizeof(result.m_raw)); return result; } @@ -172,7 +172,7 @@ inline sha1_t chd_file::be_read_sha1(const UINT8 *base) // stream in bigendian order //------------------------------------------------- -inline void chd_file::be_write_sha1(UINT8 *base, sha1_t value) +inline void chd_file::be_write_sha1(UINT8 *base, util::sha1_t value) { memcpy(base, &value.m_raw[0], sizeof(value.m_raw)); } @@ -311,7 +311,7 @@ chd_file::~chd_file() } /** - * @fn sha1_t chd_file::sha1() + * @fn util::sha1_t chd_file::sha1() * * @brief ------------------------------------------------- * sha1 - return our SHA1 value @@ -320,24 +320,24 @@ chd_file::~chd_file() * @return A sha1_t. */ -sha1_t chd_file::sha1() +util::sha1_t chd_file::sha1() { try { // read the big-endian version - UINT8 rawbuf[sizeof(sha1_t)]; + UINT8 rawbuf[sizeof(util::sha1_t)]; file_read(m_sha1_offset, rawbuf, sizeof(rawbuf)); return be_read_sha1(rawbuf); } catch (chd_error &) { // on failure, return nullptr - return sha1_t::null; + return util::sha1_t::null; } } /** - * @fn sha1_t chd_file::raw_sha1() + * @fn util::sha1_t chd_file::raw_sha1() * * @brief ------------------------------------------------- * raw_sha1 - return our raw SHA1 value @@ -349,7 +349,7 @@ sha1_t chd_file::sha1() * @return A sha1_t. */ -sha1_t chd_file::raw_sha1() +util::sha1_t chd_file::raw_sha1() { try { @@ -358,19 +358,19 @@ sha1_t chd_file::raw_sha1() throw CHDERR_UNSUPPORTED_VERSION; // read the big-endian version - UINT8 rawbuf[sizeof(sha1_t)]; + UINT8 rawbuf[sizeof(util::sha1_t)]; file_read(m_rawsha1_offset, rawbuf, sizeof(rawbuf)); return be_read_sha1(rawbuf); } catch (chd_error &) { // on failure, return nullptr - return sha1_t::null; + return util::sha1_t::null; } } /** - * @fn sha1_t chd_file::parent_sha1() + * @fn util::sha1_t chd_file::parent_sha1() * * @brief ------------------------------------------------- * parent_sha1 - return our parent's SHA1 value @@ -382,7 +382,7 @@ sha1_t chd_file::raw_sha1() * @return A sha1_t. */ -sha1_t chd_file::parent_sha1() +util::sha1_t chd_file::parent_sha1() { try { @@ -391,14 +391,14 @@ sha1_t chd_file::parent_sha1() throw CHDERR_UNSUPPORTED_VERSION; // read the big-endian version - UINT8 rawbuf[sizeof(sha1_t)]; + UINT8 rawbuf[sizeof(util::sha1_t)]; file_read(m_parentsha1_offset, rawbuf, sizeof(rawbuf)); return be_read_sha1(rawbuf); } catch (chd_error &) { // on failure, return nullptr - return sha1_t::null; + return util::sha1_t::null; } } @@ -523,10 +523,10 @@ chd_error chd_file::hunk_info(UINT32 hunknum, chd_codec_type &compressor, UINT32 * @param rawdata The rawdata. */ -void chd_file::set_raw_sha1(sha1_t rawdata) +void chd_file::set_raw_sha1(util::sha1_t rawdata) { // create a big-endian version - UINT8 rawbuf[sizeof(sha1_t)]; + UINT8 rawbuf[sizeof(util::sha1_t)]; be_write_sha1(rawbuf, rawdata); // write to the header @@ -551,14 +551,14 @@ void chd_file::set_raw_sha1(sha1_t rawdata) * @param parent The parent. */ -void chd_file::set_parent_sha1(sha1_t parent) +void chd_file::set_parent_sha1(util::sha1_t parent) { // if no file, fail if (m_file == nullptr) throw CHDERR_INVALID_FILE; // create a big-endian version - UINT8 rawbuf[sizeof(sha1_t)]; + UINT8 rawbuf[sizeof(util::sha1_t)]; be_write_sha1(rawbuf, parent); // write to the header @@ -902,13 +902,13 @@ chd_error chd_file::read_hunk(UINT32 hunknum, void *buffer) blocklen = be_read(&rawmap[12], 2) + (rawmap[14] << 16); file_read(blockoffs, &m_compressed[0], blocklen); m_decompressor[0]->decompress(&m_compressed[0], blocklen, dest, m_hunkbytes); - if (!(rawmap[15] & V34_MAP_ENTRY_FLAG_NO_CRC) && dest != nullptr && crc32_creator::simple(dest, m_hunkbytes) != blockcrc) + if (!(rawmap[15] & V34_MAP_ENTRY_FLAG_NO_CRC) && dest != nullptr && util::crc32_creator::simple(dest, m_hunkbytes) != blockcrc) throw CHDERR_DECOMPRESSION_ERROR; return CHDERR_NONE; case V34_MAP_ENTRY_TYPE_UNCOMPRESSED: file_read(blockoffs, dest, m_hunkbytes); - if (!(rawmap[15] & V34_MAP_ENTRY_FLAG_NO_CRC) && crc32_creator::simple(dest, m_hunkbytes) != blockcrc) + if (!(rawmap[15] & V34_MAP_ENTRY_FLAG_NO_CRC) && util::crc32_creator::simple(dest, m_hunkbytes) != blockcrc) throw CHDERR_DECOMPRESSION_ERROR; return CHDERR_NONE; @@ -916,7 +916,7 @@ chd_error chd_file::read_hunk(UINT32 hunknum, void *buffer) be_write(dest, blockoffs, 8); for (UINT32 bytes = 8; bytes < m_hunkbytes; bytes++) dest[bytes] = dest[bytes - 8]; - if (!(rawmap[15] & V34_MAP_ENTRY_FLAG_NO_CRC) && crc32_creator::simple(dest, m_hunkbytes) != blockcrc) + if (!(rawmap[15] & V34_MAP_ENTRY_FLAG_NO_CRC) && util::crc32_creator::simple(dest, m_hunkbytes) != blockcrc) throw CHDERR_DECOMPRESSION_ERROR; return CHDERR_NONE; @@ -961,15 +961,15 @@ chd_error chd_file::read_hunk(UINT32 hunknum, void *buffer) case COMPRESSION_TYPE_3: file_read(blockoffs, &m_compressed[0], blocklen); m_decompressor[rawmap[0]]->decompress(&m_compressed[0], blocklen, dest, m_hunkbytes); - if (!m_decompressor[rawmap[0]]->lossy() && dest != nullptr && crc16_creator::simple(dest, m_hunkbytes) != blockcrc) + if (!m_decompressor[rawmap[0]]->lossy() && dest != nullptr && util::crc16_creator::simple(dest, m_hunkbytes) != blockcrc) throw CHDERR_DECOMPRESSION_ERROR; - if (m_decompressor[rawmap[0]]->lossy() && crc16_creator::simple(&m_compressed[0], blocklen) != blockcrc) + if (m_decompressor[rawmap[0]]->lossy() && util::crc16_creator::simple(&m_compressed[0], blocklen) != blockcrc) throw CHDERR_DECOMPRESSION_ERROR; return CHDERR_NONE; case COMPRESSION_NONE: file_read(blockoffs, dest, m_hunkbytes); - if (crc16_creator::simple(dest, m_hunkbytes) != blockcrc) + if (util::crc16_creator::simple(dest, m_hunkbytes) != blockcrc) throw CHDERR_DECOMPRESSION_ERROR; return CHDERR_NONE; @@ -1558,7 +1558,7 @@ chd_error chd_file::clone_all_metadata(chd_file &source) } /** - * @fn sha1_t chd_file::compute_overall_sha1(sha1_t rawsha1) + * @fn util::sha1_t chd_file::compute_overall_sha1(sha1_t rawsha1) * * @brief ------------------------------------------------- * compute_overall_sha1 - iterate through the metadata and compute the overall hash of @@ -1570,7 +1570,7 @@ chd_error chd_file::clone_all_metadata(chd_file &source) * @return The calculated overall sha 1. */ -sha1_t chd_file::compute_overall_sha1(sha1_t rawsha1) +util::sha1_t chd_file::compute_overall_sha1(util::sha1_t rawsha1) { // only works for v4 and above if (m_version < 4) @@ -1593,7 +1593,7 @@ sha1_t chd_file::compute_overall_sha1(sha1_t rawsha1) // create an entry for this metadata and add it metadata_hash hashentry; be_write(hashentry.tag, metaentry.metatag, 4); - hashentry.sha1 = sha1_creator::simple(&filedata[0], metaentry.length); + hashentry.sha1 = util::sha1_creator::simple(&filedata[0], metaentry.length); hasharray.push_back(hashentry); } @@ -1602,7 +1602,7 @@ sha1_t chd_file::compute_overall_sha1(sha1_t rawsha1) qsort(&hasharray[0], hasharray.size(), sizeof(hasharray[0]), metadata_hash_compare); // read the raw data hash from our header and start a new SHA1 with that data - sha1_creator overall_sha1; + util::sha1_creator overall_sha1; overall_sha1.append(&rawsha1, sizeof(rawsha1)); if (!hasharray.empty()) overall_sha1.append(&hasharray[0], hasharray.size() * sizeof(hasharray[0])); @@ -1750,7 +1750,7 @@ UINT32 chd_file::guess_unitbytes() * @param [in,out] parentsha1 The first parentsha. */ -void chd_file::parse_v3_header(UINT8 *rawheader, sha1_t &parentsha1) +void chd_file::parse_v3_header(UINT8 *rawheader, util::sha1_t &parentsha1) { // verify header length if (be_read(&rawheader[8], 4) != V3_HEADER_SIZE) @@ -1813,7 +1813,7 @@ void chd_file::parse_v3_header(UINT8 *rawheader, sha1_t &parentsha1) * @param [in,out] parentsha1 The first parentsha. */ -void chd_file::parse_v4_header(UINT8 *rawheader, sha1_t &parentsha1) +void chd_file::parse_v4_header(UINT8 *rawheader, util::sha1_t &parentsha1) { // verify header length if (be_read(&rawheader[8], 4) != V4_HEADER_SIZE) @@ -1873,7 +1873,7 @@ void chd_file::parse_v4_header(UINT8 *rawheader, sha1_t &parentsha1) * @param [in,out] parentsha1 The first parentsha. */ -void chd_file::parse_v5_header(UINT8 *rawheader, sha1_t &parentsha1) +void chd_file::parse_v5_header(UINT8 *rawheader, util::sha1_t &parentsha1) { // verify header length if (be_read(&rawheader[8], 4) != V5_HEADER_SIZE) @@ -1928,7 +1928,7 @@ chd_error chd_file::compress_v5_map() try { // first get a CRC-16 of the original rawmap - crc16_t mapcrc = crc16_creator::simple(&m_rawmap[0], m_hunkcount * 12); + util::crc16_t mapcrc = util::crc16_creator::simple(&m_rawmap[0], m_hunkcount * 12); // create a buffer to hold the RLE data dynamic_buffer compression_rle(m_hunkcount); @@ -2244,7 +2244,7 @@ void chd_file::decompress_v5_map() } // verify the final CRC - if (crc16_creator::simple(&m_rawmap[0], m_hunkcount * 12) != mapcrc) + if (util::crc16_creator::simple(&m_rawmap[0], m_hunkcount * 12) != mapcrc) throw CHDERR_DECOMPRESSION_ERROR; } @@ -2310,15 +2310,15 @@ chd_error chd_file::create_common() be_write(&rawheader[48], m_metaoffset, 8); be_write(&rawheader[56], m_hunkbytes, 4); be_write(&rawheader[60], m_unitbytes, 4); - be_write_sha1(&rawheader[64], sha1_t::null); - be_write_sha1(&rawheader[84], sha1_t::null); - be_write_sha1(&rawheader[104], (m_parent != nullptr) ? m_parent->sha1() : sha1_t::null); + be_write_sha1(&rawheader[64], util::sha1_t::null); + be_write_sha1(&rawheader[84], util::sha1_t::null); + be_write_sha1(&rawheader[104], (m_parent != nullptr) ? m_parent->sha1() : util::sha1_t::null); // write the resulting header file_write(0, rawheader, sizeof(rawheader)); // parse it back out to set up fields appropriately - sha1_t parentsha1; + util::sha1_t parentsha1; parse_v5_header(rawheader, parentsha1); // writes are obviously permitted; reads only if uncompressed @@ -2403,7 +2403,7 @@ chd_error chd_file::open_common(bool writeable) throw CHDERR_UNSUPPORTED_VERSION; // read the header if we support it - sha1_t parentsha1 = sha1_t::null; + util::sha1_t parentsha1 = util::sha1_t::null; switch (m_version) { case 3: parse_v3_header(rawheader, parentsha1); break; @@ -2416,7 +2416,7 @@ chd_error chd_file::open_common(bool writeable) throw CHDERR_FILE_NOT_WRITEABLE; // make sure we have a parent if we need one (and don't if we don't) - if (parentsha1 != sha1_t::null) + if (parentsha1 != util::sha1_t::null) { if (m_parent == nullptr) m_parent_missing = true; @@ -2535,7 +2535,7 @@ void chd_file::verify_proper_compression_append(UINT32 hunknum) * @param crc16 The CRC 16. */ -void chd_file::hunk_write_compressed(UINT32 hunknum, INT8 compression, const UINT8 *compressed, UINT32 complength, crc16_t crc16) +void chd_file::hunk_write_compressed(UINT32 hunknum, INT8 compression, const UINT8 *compressed, UINT32 complength, util::crc16_t crc16) { // verify that we are appending properly to a compressed file verify_proper_compression_append(hunknum); @@ -2711,10 +2711,10 @@ void chd_file::metadata_update_hash() return; // compute the new overall hash - sha1_t fullsha1 = compute_overall_sha1(raw_sha1()); + util::sha1_t fullsha1 = compute_overall_sha1(raw_sha1()); // create a big-endian version - UINT8 rawbuf[sizeof(sha1_t)]; + UINT8 rawbuf[sizeof(util::sha1_t)]; be_write_sha1(&rawbuf[0], fullsha1); // write to the header @@ -3033,8 +3033,8 @@ void chd_file_compressor::async_walk_parent(work_item &item) units = 1; for (UINT32 unit = 0; unit < units; unit++) { - item.m_hash[unit].m_crc16 = crc16_creator::simple(item.m_data + unit * unit_bytes(), hunk_bytes()); - item.m_hash[unit].m_sha1 = sha1_creator::simple(item.m_data + unit * unit_bytes(), hunk_bytes()); + item.m_hash[unit].m_crc16 = util::crc16_creator::simple(item.m_data + unit * unit_bytes(), hunk_bytes()); + item.m_hash[unit].m_sha1 = util::sha1_creator::simple(item.m_data + unit * unit_bytes(), hunk_bytes()); } item.m_status = WS_COMPLETE; } @@ -3075,8 +3075,8 @@ void chd_file_compressor::async_compress_hunk(work_item &item, int threadid) item.m_codecs = m_codecs[threadid]; // compute CRC-16 and SHA-1 hashes - item.m_hash[0].m_crc16 = crc16_creator::simple(item.m_data, hunk_bytes()); - item.m_hash[0].m_sha1 = sha1_creator::simple(item.m_data, hunk_bytes()); + item.m_hash[0].m_crc16 = util::crc16_creator::simple(item.m_data, hunk_bytes()); + item.m_hash[0].m_sha1 = util::sha1_creator::simple(item.m_data, hunk_bytes()); // find the best compression scheme, unless we already have a self or parent match // (note we may miss a self match from blocks not yet added, but this just results in extra work) @@ -3254,7 +3254,7 @@ void chd_file_compressor::hashmap::reset() * @return An UINT64. */ -UINT64 chd_file_compressor::hashmap::find(crc16_t crc16, sha1_t sha1) +UINT64 chd_file_compressor::hashmap::find(util::crc16_t crc16, util::sha1_t sha1) { // look up the entry in the map for (entry_t *entry = m_map[crc16]; entry != nullptr; entry = entry->m_next) @@ -3275,7 +3275,7 @@ UINT64 chd_file_compressor::hashmap::find(crc16_t crc16, sha1_t sha1) * @param sha1 The first sha. */ -void chd_file_compressor::hashmap::add(UINT64 itemnum, crc16_t crc16, sha1_t sha1) +void chd_file_compressor::hashmap::add(UINT64 itemnum, util::crc16_t crc16, util::sha1_t sha1) { // add to the appropriate map if (m_block_list->m_nextalloc == ARRAY_LENGTH(m_block_list->m_array)) diff --git a/src/lib/util/chd.h b/src/lib/util/chd.h index a3b0e0c7304..b0eb4143374 100644 --- a/src/lib/util/chd.h +++ b/src/lib/util/chd.h @@ -317,14 +317,14 @@ public: bool compressed() const { return (m_compression[0] != CHD_CODEC_NONE); } chd_codec_type compression(int index) const { return m_compression[index]; } chd_file *parent() const { return m_parent; } - sha1_t sha1(); - sha1_t raw_sha1(); - sha1_t parent_sha1(); + util::sha1_t sha1(); + util::sha1_t raw_sha1(); + util::sha1_t parent_sha1(); chd_error hunk_info(UINT32 hunknum, chd_codec_type &compressor, UINT32 &compbytes); // setters - void set_raw_sha1(sha1_t rawdata); - void set_parent_sha1(sha1_t parent); + void set_raw_sha1(util::sha1_t rawdata); + void set_parent_sha1(util::sha1_t parent); // file create chd_error create(const char *filename, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 unitbytes, chd_codec_type compression[4]); @@ -359,7 +359,7 @@ public: chd_error clone_all_metadata(chd_file &source); // hashing helper - sha1_t compute_overall_sha1(sha1_t rawsha1); + util::sha1_t compute_overall_sha1(util::sha1_t rawsha1); // codec interfaces chd_error codec_configure(chd_codec_type codec, int param, void *config); @@ -374,8 +374,8 @@ private: // inline helpers UINT64 be_read(const UINT8 *base, int numbytes); void be_write(UINT8 *base, UINT64 value, int numbytes); - sha1_t be_read_sha1(const UINT8 *base); - void be_write_sha1(UINT8 *base, sha1_t value); + util::sha1_t be_read_sha1(const UINT8 *base); + void be_write_sha1(UINT8 *base, util::sha1_t value); void file_read(UINT64 offset, void *dest, UINT32 length); void file_write(UINT64 offset, const void *source, UINT32 length); UINT64 file_append(const void *source, UINT32 length, UINT32 alignment = 0); @@ -383,16 +383,16 @@ private: // internal helpers UINT32 guess_unitbytes(); - void parse_v3_header(UINT8 *rawheader, sha1_t &parentsha1); - void parse_v4_header(UINT8 *rawheader, sha1_t &parentsha1); - void parse_v5_header(UINT8 *rawheader, sha1_t &parentsha1); + void parse_v3_header(UINT8 *rawheader, util::sha1_t &parentsha1); + void parse_v4_header(UINT8 *rawheader, util::sha1_t &parentsha1); + void parse_v5_header(UINT8 *rawheader, util::sha1_t &parentsha1); chd_error compress_v5_map(); void decompress_v5_map(); chd_error create_common(); chd_error open_common(bool writeable); void create_open_common(); void verify_proper_compression_append(UINT32 hunknum); - void hunk_write_compressed(UINT32 hunknum, INT8 compression, const UINT8 *compressed, UINT32 complength, crc16_t crc16); + void hunk_write_compressed(UINT32 hunknum, INT8 compression, const UINT8 *compressed, UINT32 complength, util::crc16_t crc16); void hunk_copy_from_self(UINT32 hunknum, UINT32 otherhunk); void hunk_copy_from_parent(UINT32 hunknum, UINT64 parentunit); bool metadata_find(chd_metadata_tag metatag, INT32 metaindex, metadata_entry &metaentry, bool resume = false); @@ -469,8 +469,8 @@ private: // operations void reset(); - UINT64 find(crc16_t crc16, sha1_t sha1); - void add(UINT64 itemnum, crc16_t crc16, sha1_t sha1); + UINT64 find(util::crc16_t crc16, util::sha1_t sha1); + void add(UINT64 itemnum, util::crc16_t crc16, util::sha1_t sha1); // constants static const UINT64 NOT_FOUND = ~UINT64(0); @@ -480,7 +480,7 @@ private: { entry_t * m_next; // next entry in list UINT64 m_itemnum; // item number - sha1_t m_sha1; // SHA-1 of the block + util::sha1_t m_sha1; // SHA-1 of the block }; // block of entries @@ -511,8 +511,8 @@ private: // a CRC-16/SHA-1 pair struct hash_pair { - crc16_t m_crc16; // calculated CRC-16 - sha1_t m_sha1; // calculated SHA-1 + util::crc16_t m_crc16; // calculated CRC-16 + util::sha1_t m_sha1; // calculated SHA-1 }; // a single work item @@ -556,7 +556,7 @@ private: bool m_walking_parent; // are we building the parent map? UINT64 m_total_in; // total bytes in UINT64 m_total_out; // total bytes out - sha1_creator m_compsha1; // running SHA-1 on raw data + util::sha1_creator m_compsha1; // running SHA-1 on raw data // hash lookup maps hashmap m_parent_map; // hash map for parent diff --git a/src/lib/util/chdcd.cpp b/src/lib/util/chdcd.cpp index 0e8b32b1ed6..2310456a8d1 100644 --- a/src/lib/util/chdcd.cpp +++ b/src/lib/util/chdcd.cpp @@ -649,8 +649,7 @@ chd_error chdcd_parse_iso(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i memset(&outtoc, 0, sizeof(outtoc)); outinfo.reset(); - fseek(infile, 0, SEEK_END); - long size = ftell(infile); + UINT64 size = get_file_size(tocfname); fclose(infile); diff --git a/src/emu/hash.cpp b/src/lib/util/hash.cpp index 2eaa4c03c2a..6d7ac9319e3 100644 --- a/src/emu/hash.cpp +++ b/src/lib/util/hash.cpp @@ -2,7 +2,7 @@ // copyright-holders:Aaron Giles /*************************************************************************** - hash.c + hash.cpp Function to handle hash functions (checksums) @@ -10,11 +10,12 @@ ***************************************************************************/ -#include "emu.h" +#include "hash.h" #include "hashing.h" #include <ctype.h> +namespace util { //************************************************************************** // GLOBAL VARIABLES //************************************************************************** @@ -418,3 +419,5 @@ void hash_collection::copyfrom(const hash_collection &src) // don't copy creators m_creator = nullptr; } + +} // namespace util diff --git a/src/emu/hash.h b/src/lib/util/hash.h index a421aa5523f..ec628a949f2 100644 --- a/src/emu/hash.h +++ b/src/lib/util/hash.h @@ -29,7 +29,7 @@ #define BAD_DUMP "^" - +namespace util { //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -117,4 +117,6 @@ private: }; +} // namespace util + #endif /* __HASH_H__ */ diff --git a/src/lib/util/hashing.cpp b/src/lib/util/hashing.cpp index 240e64af9ad..dd6b9847f15 100644 --- a/src/lib/util/hashing.cpp +++ b/src/lib/util/hashing.cpp @@ -14,6 +14,7 @@ #include <sstream> +namespace util { //************************************************************************** // CONSTANTS //************************************************************************** @@ -291,3 +292,5 @@ void crc16_creator::append(const void *data, UINT32 length) crc = (crc << 8) ^ s_table[(crc >> 8) ^ *src++]; m_accum.m_raw = crc; } + +} // namespace util diff --git a/src/lib/util/hashing.h b/src/lib/util/hashing.h index 51a7da7c694..8b58d3afc8b 100644 --- a/src/lib/util/hashing.h +++ b/src/lib/util/hashing.h @@ -20,6 +20,7 @@ #include "sha1.h" +namespace util { //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -217,4 +218,6 @@ protected: }; +} // namespace util + #endif // __HASHING_H__ diff --git a/src/mame/drivers/apricotf.cpp b/src/mame/drivers/apricotf.cpp index 8c990e46c48..ee0b210b6c2 100644 --- a/src/mame/drivers/apricotf.cpp +++ b/src/mame/drivers/apricotf.cpp @@ -34,6 +34,7 @@ #include "machine/wd_fdc.h" #include "machine/z80ctc.h" #include "machine/z80dart.h" +#include "machine/input_merger.h" #include "formats/apridisk.h" @@ -68,8 +69,7 @@ public: m_floppy1(*this, WD2797_TAG ":1"), m_centronics(*this, CENTRONICS_TAG), m_cent_data_out(*this, "cent_data_out"), - m_ctc_int(CLEAR_LINE), - m_sio_int(CLEAR_LINE), + m_irqs(*this, "irqs"), m_p_scrollram(*this, "p_scrollram"), m_p_paletteram(*this, "p_paletteram"), m_palette(*this, "palette") @@ -87,8 +87,7 @@ public: required_device<floppy_connector> m_floppy1; required_device<centronics_device> m_centronics; required_device<output_latch_device> m_cent_data_out; - int m_ctc_int; - int m_sio_int; + required_device<input_merger_active_high_device> m_irqs; required_shared_ptr<UINT16> m_p_scrollram; required_shared_ptr<UINT16> m_p_paletteram; required_device<palette_device> m_palette; @@ -98,8 +97,6 @@ public: DECLARE_READ16_MEMBER( palette_r ); DECLARE_WRITE16_MEMBER( palette_w ); DECLARE_WRITE8_MEMBER( system_w ); - DECLARE_WRITE_LINE_MEMBER( sio_int_w ); - DECLARE_WRITE_LINE_MEMBER( ctc_int_w ); DECLARE_WRITE_LINE_MEMBER( ctc_z1_w ); DECLARE_WRITE_LINE_MEMBER( ctc_z2_w ); @@ -294,27 +291,9 @@ INPUT_PORTS_END //************************************************************************** //------------------------------------------------- -// Z80SIO -//------------------------------------------------- - -WRITE_LINE_MEMBER( f1_state::sio_int_w ) -{ - m_sio_int = state; - - m_maincpu->set_input_line(INPUT_LINE_IRQ0, m_ctc_int || m_sio_int); -} - -//------------------------------------------------- // Z80CTC //------------------------------------------------- -WRITE_LINE_MEMBER( f1_state::ctc_int_w ) -{ - m_ctc_int = state; - - m_maincpu->set_input_line(INPUT_LINE_IRQ0, m_ctc_int | m_sio_int); -} - WRITE_LINE_MEMBER( f1_state::ctc_z1_w ) { m_sio->rxcb_w(state); @@ -355,6 +334,9 @@ static MACHINE_CONFIG_START( act_f1, f1_state ) MCFG_CPU_PROGRAM_MAP(act_f1_mem) MCFG_CPU_IO_MAP(act_f1_io) + MCFG_INPUT_MERGER_ACTIVE_HIGH("irqs") + MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE(I8086_TAG, INPUT_LINE_IRQ0)) + /* video hardware */ MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) MCFG_SCREEN_REFRESH_RATE(50) @@ -371,10 +353,10 @@ static MACHINE_CONFIG_START( act_f1, f1_state ) MCFG_DEVICE_ADD(APRICOT_KEYBOARD_TAG, APRICOT_KEYBOARD, 0) MCFG_Z80SIO2_ADD(Z80SIO2_TAG, 2500000, 0, 0, 0, 0) - MCFG_Z80DART_OUT_INT_CB(WRITELINE(f1_state, sio_int_w)) + MCFG_Z80DART_OUT_INT_CB(DEVWRITELINE("irqs", input_merger_active_high_device, in0_w)) MCFG_DEVICE_ADD(Z80CTC_TAG, Z80CTC, 2500000) - MCFG_Z80CTC_INTR_CB(WRITELINE(f1_state, ctc_int_w)) + MCFG_Z80CTC_INTR_CB(DEVWRITELINE("irqs", input_merger_active_high_device, in1_w)) MCFG_Z80CTC_ZC1_CB(WRITELINE(f1_state, ctc_z1_w)) MCFG_Z80CTC_ZC2_CB(WRITELINE(f1_state, ctc_z2_w)) diff --git a/src/mame/drivers/bbc.cpp b/src/mame/drivers/bbc.cpp index 056eb7c53da..a89bde1c039 100644 --- a/src/mame/drivers/bbc.cpp +++ b/src/mame/drivers/bbc.cpp @@ -810,6 +810,15 @@ static SLOT_INTERFACE_START( bbc_floppies_35 ) SLOT_INTERFACE("qd", FLOPPY_35_DD) SLOT_INTERFACE_END + +WRITE_LINE_MEMBER(bbc_state::adlc_irq_w) +{ + m_adlc_irq = state; + + bbc_update_nmi(); +} + + WRITE_LINE_MEMBER(bbc_state::econet_clk_w) { m_adlc->rxc_w(state); @@ -906,7 +915,7 @@ static MACHINE_CONFIG_START( bbca, bbc_state ) MCFG_DEVICE_ADD("acia6850", ACIA6850, 0) MCFG_ACIA6850_TXD_HANDLER(WRITELINE(bbc_state, bbc_txd_w)) MCFG_ACIA6850_RTS_HANDLER(WRITELINE(bbc_state, bbc_rts_w)) - MCFG_ACIA6850_IRQ_HANDLER(INPUTLINE("maincpu", M6502_IRQ_LINE)) + MCFG_ACIA6850_IRQ_HANDLER(WRITELINE(bbc_state, bbcb_acia6850_irq_w)) MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, nullptr) MCFG_RS232_RXD_HANDLER(WRITELINE(bbc_state, write_rxd_serial)) @@ -922,7 +931,7 @@ static MACHINE_CONFIG_START( bbca, bbc_state ) MCFG_VIA6522_READPB_HANDLER(READ8(bbc_state, bbcb_via_system_read_portb)) MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(bbc_state, bbcb_via_system_write_porta)) MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(bbc_state, bbcb_via_system_write_portb)) - MCFG_VIA6522_IRQ_HANDLER(INPUTLINE("maincpu", M6502_IRQ_LINE)) + MCFG_VIA6522_IRQ_HANDLER(WRITELINE(bbc_state, bbcb_via_system_irq_w)) /* EPROM sockets */ MCFG_FRAGMENT_ADD(bbc_eprom_sockets) @@ -954,7 +963,7 @@ static MACHINE_CONFIG_DERIVED( bbcb, bbca ) MCFG_VIA6522_WRITEPA_HANDLER(DEVWRITE8("cent_data_out", output_latch_device, write)) MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(bbc_state, bbcb_via_user_write_portb)) MCFG_VIA6522_CA2_HANDLER(DEVWRITELINE("centronics", centronics_device, write_strobe)) - MCFG_VIA6522_IRQ_HANDLER(INPUTLINE("maincpu", M6502_IRQ_LINE)) + MCFG_VIA6522_IRQ_HANDLER(WRITELINE(bbc_state, bbcb_via_user_irq_w)) /* adc */ MCFG_DEVICE_ADD("upd7002", UPD7002, 0) @@ -968,7 +977,7 @@ static MACHINE_CONFIG_DERIVED( bbcb, bbca ) /* fdc */ MCFG_DEVICE_ADD("i8271", I8271, 0) - MCFG_I8271_IRQ_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI)) + MCFG_I8271_IRQ_CALLBACK(WRITELINE(bbc_state, fdc_intrq_w)) MCFG_I8271_HDL_CALLBACK(WRITELINE(bbc_state, motor_w)) MCFG_I8271_OPT_CALLBACK(WRITELINE(bbc_state, side_w)) MCFG_FLOPPY_DRIVE_ADD("i8271:0", bbc_floppies_525, "qd", bbc_state::floppy_formats_bbc) @@ -979,7 +988,7 @@ static MACHINE_CONFIG_DERIVED( bbcb, bbca ) /* econet */ MCFG_DEVICE_ADD("mc6854", MC6854, 0) MCFG_MC6854_OUT_TXD_CB(DEVWRITELINE(ECONET_TAG, econet_device, data_w)) - MCFG_MC6854_OUT_IRQ_CB(INPUTLINE("maincpu", M6502_NMI_LINE)) + MCFG_MC6854_OUT_IRQ_CB(WRITELINE(bbc_state, adlc_irq_w)) MCFG_ECONET_ADD() MCFG_ECONET_CLK_CALLBACK(WRITELINE(bbc_state, econet_clk_w)) MCFG_ECONET_DATA_CALLBACK(DEVWRITELINE("mc6854", mc6854_device, set_rx)) @@ -1296,7 +1305,7 @@ static MACHINE_CONFIG_START( bbcm, bbc_state ) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY) MCFG_CASSETTE_INTERFACE("bbc_cass") - // 2 x EPROM sockets (32K) in BBC-Master + // 2 x cartridge sockets in BBC-Master MCFG_GENERIC_SOCKET_ADD("exp_rom1", generic_plain_slot, "bbcm_cart") MCFG_GENERIC_LOAD(bbc_state, bbcm_exp1_load) @@ -1319,7 +1328,7 @@ static MACHINE_CONFIG_START( bbcm, bbc_state ) MCFG_DEVICE_ADD("acia6850", ACIA6850, 0) MCFG_ACIA6850_TXD_HANDLER(WRITELINE(bbc_state, bbc_txd_w)) MCFG_ACIA6850_RTS_HANDLER(WRITELINE(bbc_state, bbc_rts_w)) - MCFG_ACIA6850_IRQ_HANDLER(INPUTLINE("maincpu", M6502_IRQ_LINE)) + MCFG_ACIA6850_IRQ_HANDLER(WRITELINE(bbc_state, bbcb_acia6850_irq_w)) MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, nullptr) MCFG_RS232_RXD_HANDLER(WRITELINE(bbc_state, write_rxd_serial)) @@ -1340,7 +1349,7 @@ static MACHINE_CONFIG_START( bbcm, bbc_state ) MCFG_VIA6522_READPB_HANDLER(READ8(bbc_state, bbcb_via_system_read_portb)) MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(bbc_state, bbcb_via_system_write_porta)) MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(bbc_state, bbcb_via_system_write_portb)) - MCFG_VIA6522_IRQ_HANDLER(INPUTLINE("maincpu", M6502_IRQ_LINE)) + MCFG_VIA6522_IRQ_HANDLER(WRITELINE(bbc_state, bbcb_via_system_irq_w)) /* user via */ MCFG_DEVICE_ADD("via6522_1", VIA6522, XTAL_16MHz / 16) @@ -1348,7 +1357,7 @@ static MACHINE_CONFIG_START( bbcm, bbc_state ) MCFG_VIA6522_WRITEPA_HANDLER(DEVWRITE8("cent_data_out", output_latch_device, write)) MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(bbc_state, bbcb_via_user_write_portb)) MCFG_VIA6522_CA2_HANDLER(DEVWRITELINE("centronics", centronics_device, write_strobe)) - MCFG_VIA6522_IRQ_HANDLER(INPUTLINE("maincpu", M6502_IRQ_LINE)) + MCFG_VIA6522_IRQ_HANDLER(WRITELINE(bbc_state, bbcb_via_user_irq_w)) /* fdc */ MCFG_WD1770_ADD("wd1770", XTAL_16MHz / 2) @@ -1363,7 +1372,7 @@ static MACHINE_CONFIG_START( bbcm, bbc_state ) /* econet */ MCFG_DEVICE_ADD("mc6854", MC6854, 0) MCFG_MC6854_OUT_TXD_CB(DEVWRITELINE(ECONET_TAG, econet_device, data_w)) - MCFG_MC6854_OUT_IRQ_CB(INPUTLINE("maincpu", M6502_NMI_LINE)) + MCFG_MC6854_OUT_IRQ_CB(WRITELINE(bbc_state, adlc_irq_w)) MCFG_ECONET_ADD() MCFG_ECONET_CLK_CALLBACK(WRITELINE(bbc_state, econet_clk_w)) MCFG_ECONET_DATA_CALLBACK(DEVWRITELINE("mc6854", mc6854_device, set_rx)) diff --git a/src/mame/drivers/chihiro.cpp b/src/mame/drivers/chihiro.cpp index 23145b98751..0e973b7e5d9 100644 --- a/src/mame/drivers/chihiro.cpp +++ b/src/mame/drivers/chihiro.cpp @@ -499,6 +499,8 @@ public: ohci_hlean2131sc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); void initialize(running_machine &machine, ohci_usb_controller *usb_bus_manager) override; int handle_nonstandard_request(int endpoint, USBSetupPacket *setup) override; + int handle_bulk_pid(int endpoint, int pid, UINT8 *buffer, int size) override; + void set_region_base(UINT8 *data); protected: virtual void device_start() override; @@ -515,6 +517,7 @@ private: static const UINT8 strdesc0[]; static const UINT8 strdesc1[]; static const UINT8 strdesc2[]; + UINT8 *region; }; const device_type OHCI_HLEAN2131SC = &device_creator<ohci_hlean2131sc_device>; @@ -959,7 +962,7 @@ int ohci_hlean2131qc_device::handle_nonstandard_request(int endpoint, USBSetupPa int ohci_hlean2131qc_device::handle_bulk_pid(int endpoint, int pid, UINT8 *buffer, int size) { #ifdef VERBOSE_MSG - printf("Bulk request: %x %d %x\n\r", endpoint, pid, size); + printf("Bulk request to an2131qc: %x %d %x\n\r", endpoint, pid, size); #endif if (((endpoint == 1) || (endpoint == 2)) && (pid == InPid)) { @@ -1076,6 +1079,12 @@ ohci_hlean2131sc_device::ohci_hlean2131sc_device(const machine_config &mconfig, device_t(mconfig, OHCI_HLEAN2131SC, "OHCI Hlean2131sc", tag, owner, clock, "ohci_hlean2131sc", __FILE__), ohci_function_device() { + region = nullptr; +} + +void ohci_hlean2131sc_device::set_region_base(UINT8 *data) +{ + region = data; } void ohci_hlean2131sc_device::initialize(running_machine &machine, ohci_usb_controller *usb_bus_manager) @@ -1104,12 +1113,133 @@ int ohci_hlean2131sc_device::handle_nonstandard_request(int endpoint, USBSetupPa if (endpoint != 0) return -1; for (int n = 0; n < setup->wLength; n++) - endpoints[endpoint].buffer[n] = 0xa0 ^ n; + endpoints[endpoint].buffer[n] = 0x50 ^ n; + endpoints[endpoint].buffer[1] = 0; + endpoints[endpoint].buffer[2] = 0x52; // PINSB + endpoints[endpoint].buffer[3] = 0x53; // OUTB + endpoints[endpoint].buffer[4] = 0; + endpoints[endpoint].buffer[5] = 0; + endpoints[endpoint].buffer[6] = 0x56; // PINSC + endpoints[endpoint].buffer[7] = 0x57; // OUTC + // bRequest is a command value + if (setup->bRequest == 0x16) + { + // this command is used to read data from the first i2c serial eeprom connected to the chip + // setup->wValue = start address to read from + // setup->wIndex = number of bytes to read + // data will be transferred to the host using endpoint 1 (IN) + endpoints[1].remain = setup->wIndex & 255; + endpoints[1].position = region + setup->wValue; // usually wValue is 0x1f00 + endpoints[endpoint].buffer[0] = 0; + } + else if (setup->bRequest == 0x17) + { + endpoints[endpoint].buffer[0] = 0x99; + } + else if (setup->bRequest == 0x1a) + { + endpoints[endpoint].buffer[0] = 0x99; + } + else if (setup->bRequest == 0x1b) + { + endpoints[endpoint].buffer[0] = 0x99; // + } + else if (setup->bRequest == 0x1d) + { + // this command is used to write data to the first i2c serial eeprom connected to the chip + // no more than 32 bytes can be written at a time + // setup->wValue = start address to write to + // setup->wIndex = number of bytes to write + // data will be transferred from the host using endpoint 1 (OUT) + endpoints[endpoint].buffer[0] = 0; + } + else if (setup->bRequest == 0x1e) + { + endpoints[endpoint].buffer[0] = 0x99; + } + else if (setup->bRequest == 0x22) + { + endpoints[endpoint].buffer[0] = 0x99; + } + else if (setup->bRequest == 0x23) + { + endpoints[endpoint].buffer[0] = 0x99; + } + else if (setup->bRequest == 0x25) // + { + endpoints[endpoint].buffer[0] = 0x99; + } + else if (setup->bRequest == 0x26) // + { + endpoints[endpoint].buffer[0] = 0x99; + } + else if (setup->bRequest == 0x27) // + { + endpoints[endpoint].buffer[0] = 0x99; + } + else if (setup->bRequest == 0x28) + { + endpoints[endpoint].buffer[0] = 0x99; + } + else if (setup->bRequest == 0x29) + { + endpoints[endpoint].buffer[0] = 0x99; + } + else if (setup->bRequest == 0x2a) + { + endpoints[endpoint].buffer[0] = 0x99; + } + else if (setup->bRequest == 0x2b) + { + endpoints[endpoint].buffer[0] = 0x99; + } + else if (setup->bRequest == 0x2c) + { + endpoints[endpoint].buffer[0] = 0x99; + } + else if (setup->bRequest == 0x2d) + { + endpoints[endpoint].buffer[0] = 0x99; + } + else if (setup->bRequest == 0x2e) // + { + endpoints[endpoint].buffer[0] = 0x99; + } + else if (setup->bRequest == 0x2f) + { + endpoints[endpoint].buffer[0] = 0x99; + } + else if (setup->bRequest == 0x30) + { + endpoints[endpoint].buffer[0] = 0x99; + } + else if (setup->bRequest == 0x31) + { + endpoints[endpoint].buffer[0] = 0x99; + } else + endpoints[endpoint].buffer[0] = 0x99; // usnupported command + endpoints[endpoint].position = endpoints[endpoint].buffer; endpoints[endpoint].remain = setup->wLength; return 0; } +int ohci_hlean2131sc_device::handle_bulk_pid(int endpoint, int pid, UINT8 *buffer, int size) +{ +//#ifdef VERBOSE_MSG + printf("Bulk request to an2131sc: %x %d %x\n\r", endpoint, pid, size); +//#endif + if (((endpoint == 1) || (endpoint == 2)) && (pid == InPid)) + { + if (size > endpoints[endpoint].remain) + size = endpoints[endpoint].remain; + memcpy(buffer, endpoints[endpoint].position, size); + endpoints[endpoint].position = endpoints[endpoint].position + size; + endpoints[endpoint].remain = endpoints[endpoint].remain - size; + } + return size; +} + void ohci_hlean2131sc_device::device_start() { } @@ -1423,8 +1553,8 @@ INPUT_PORTS_END void chihiro_state::machine_start() { - ohci_hlean2131qc_device *usb_device; - //ohci_hlean2131sc_device *usb_device; + ohci_hlean2131qc_device *usb_device1; + ohci_hlean2131sc_device *usb_device2; xbox_base_state::machine_start(); chihiro_devs.ide = machine().device<bus_master_ide_controller_device>("ide"); @@ -1444,11 +1574,14 @@ void chihiro_state::machine_start() break; } usbhack_counter = 0; - usb_device = machine().device<ohci_hlean2131qc_device>("ohci_hlean2131qc"); - usb_device->initialize(machine(), ohci_usb); - usb_device->set_region_base(memregion(":others")->base()); // temporary - //usb_device = machine().device<ohci_hlean2131sc_device>("ohci_hlean2131sc"); - ohci_usb->usb_ohci_plug(1, usb_device); // connect + usb_device1 = machine().device<ohci_hlean2131qc_device>("ohci_hlean2131qc"); + usb_device1->initialize(machine(), ohci_usb); + usb_device1->set_region_base(memregion(":others")->base()); // temporary + ohci_usb->usb_ohci_plug(1, usb_device1); // connect + usb_device2 = machine().device<ohci_hlean2131sc_device>("ohci_hlean2131sc"); + usb_device2->initialize(machine(), ohci_usb); + usb_device2->set_region_base(memregion(":others")->base() + 0x2080); // temporary + ohci_usb->usb_ohci_plug(2, usb_device2); // connect // savestates save_item(NAME(usbhack_counter)); } @@ -1470,6 +1603,7 @@ static MACHINE_CONFIG_DERIVED_CLASS(chihiro_base, xbox_base, chihiro_state) // next lines are temporary MCFG_DEVICE_ADD("ohci_hlean2131qc", OHCI_HLEAN2131QC, 0) + MCFG_DEVICE_ADD("ohci_hlean2131sc", OHCI_HLEAN2131SC, 0) MCFG_DEVICE_ADD("jvs_master", JVS_MASTER, 0) MCFG_SEGA_837_13551_DEVICE_ADD("837_13551", "jvs_master", ":TILT", ":P1", ":P2", ":A0", ":A1", ":A2", ":A3", ":A4", ":A5", ":A6", ":A7", ":OUTPUT") MACHINE_CONFIG_END diff --git a/src/mame/drivers/dec0.cpp b/src/mame/drivers/dec0.cpp index 737a88f1d70..826e4ef6cbf 100644 --- a/src/mame/drivers/dec0.cpp +++ b/src/mame/drivers/dec0.cpp @@ -2451,7 +2451,7 @@ ROM_START( hippodrm ) ROM_LOAD( "ew03", 0x0000, 0x10000, CRC(b606924d) SHA1(b759fcec10b333465cf5cd1b30987bf2d62186b2) ) ROM_END -ROM_START( ffantasy ) +ROM_START( ffantasyj ) ROM_REGION( 0x60000, "maincpu", 0 ) /* 4*64k for 68000 code */ ROM_LOAD16_BYTE( "ff-02-2.bin", 0x00000, 0x10000, CRC(29fc22a7) SHA1(73cbd47c34bee22c16a69cfc6037a60dc30effe8) ) ROM_LOAD16_BYTE( "ff-01-2.bin", 0x00001, 0x10000, CRC(9f617cb4) SHA1(447ea4e57dd6b23aaf48e5e14c7893277730c7d9) ) @@ -2494,6 +2494,52 @@ ROM_START( ffantasy ) ROM_LOAD( "ew03", 0x0000, 0x10000, CRC(b606924d) SHA1(b759fcec10b333465cf5cd1b30987bf2d62186b2) ) ROM_END +// I believe 'EX' is the world (export) release, but it still shows a 'ONLY FOR USE IN JAPAN' screen +// 'EV' is original Japanese release. +// 'EW' is US release. +ROM_START( ffantasy ) + ROM_REGION( 0x60000, "maincpu", 0 ) /* 4*64k for 68000 code */ + ROM_LOAD16_BYTE( "ex02-3.4b", 0x00000, 0x10000, CRC(df0d7dc6) SHA1(a60197ad6f19f730e05cf6a3be9181f28d425344) ) + ROM_LOAD16_BYTE( "ex01-3.3b", 0x00001, 0x10000, CRC(c0fb4fe5) SHA1(f6ed0904ec19491c4ed5f5e5da16df02476ab1f3) ) + ROM_LOAD16_BYTE( "ex05-.4c", 0x20000, 0x10000, CRC(c76d65ec) SHA1(620990acaf2fd7f3fbfe7135a17ac0195feb8330) ) + ROM_LOAD16_BYTE( "ex00-.1b", 0x20001, 0x10000, CRC(e9b427a6) SHA1(b334992846771739d31756724138b82f897dfad5) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* 6502 sound */ + ROM_LOAD( "ex04-.1c", 0x8000, 0x8000, CRC(9871b98d) SHA1(2b6c46bc2b10a28946d6ad8251e1a156a0b99947) ) + + ROM_REGION( 0x10000, "sub", 0 ) /* HuC6280 CPU */ + ROM_LOAD( "ew08", 0x00000, 0x10000, CRC(53010534) SHA1(8b996e48414bacd009e05ff49848884ecf15d967) ) + + ROM_REGION( 0x20000, "gfx1", 0 ) /* chars */ + ROM_LOAD( "ev14", 0x00000, 0x10000, CRC(686f72c1) SHA1(41d4fc1208d779f3428990a96586f6a555c28562) ) + ROM_LOAD( "ev13", 0x10000, 0x10000, CRC(b787dcc9) SHA1(7fce9d2040bcb2483419ea1cafed538bb8aba4f9) ) + + ROM_REGION( 0x20000, "gfx2", 0 ) /* tiles */ + ROM_LOAD( "ew19", 0x00000, 0x08000, CRC(6b80d7a3) SHA1(323162e7e0ce16f6244d8d98fdb2396ffef87e82) ) + ROM_LOAD( "ew18", 0x08000, 0x08000, CRC(78d3d764) SHA1(e8f77a23bd4f4d268bec7c0153fb957acd07cdee) ) + ROM_LOAD( "ew20", 0x10000, 0x08000, CRC(ce9f5de3) SHA1(b8af33f52ca3579a45b41395751697a58931f9d6) ) + ROM_LOAD( "ew21", 0x18000, 0x08000, CRC(487a7ba2) SHA1(7d52cc1517def8426355e8281440ec5e617d1121) ) + + ROM_REGION( 0x20000, "gfx3", 0 ) /* tiles */ + ROM_LOAD( "ew24", 0x00000, 0x08000, CRC(4e1bc2a4) SHA1(d7d4c42fd932722436f1847929088e46d03184bd) ) + ROM_LOAD( "ew25", 0x08000, 0x08000, CRC(9eb47dfb) SHA1(bb1e8a3a47f447f3a983ea51943d3081d56ad9a4) ) + ROM_LOAD( "ew23", 0x10000, 0x08000, CRC(9ecf479e) SHA1(a8d4c1490f12e1b15d53a2a97147920dcb638378) ) + ROM_LOAD( "ew22", 0x18000, 0x08000, CRC(e55669aa) SHA1(2a9b0e85bb81ff87a108e08b28e19b7b469463e4) ) + + ROM_REGION( 0x80000, "gfx4", 0 ) /* sprites */ + ROM_LOAD( "ev15", 0x00000, 0x10000, CRC(1d80f797) SHA1(1b6878155367350ff826593ea73bda5b893c1823) ) + ROM_LOAD( "ew16", 0x10000, 0x10000, CRC(96233177) SHA1(929a1b7fb65ab33277719b84517ff57da563f875) ) + ROM_LOAD( "ev10", 0x20000, 0x10000, CRC(c4e7116b) SHA1(1e665ba150e08ceb1c0d5f7b7e777f3d60997811) ) + ROM_LOAD( "ew11", 0x30000, 0x10000, CRC(f2e007fc) SHA1(da30ad3725b9bc4a07dbb1afa05f145c3574c84c) ) + ROM_LOAD( "ev06", 0x40000, 0x10000, CRC(6c794f1a) SHA1(ab7996917bea99850aef5a0890485dd27778cd99) ) + ROM_LOAD( "ew07", 0x50000, 0x10000, CRC(470b6989) SHA1(16b292d8a3a54048bf29f0b4f41bb6ca049b347c) ) + ROM_LOAD( "ev17", 0x60000, 0x10000, CRC(045509d4) SHA1(ebbd71de8e8492ff6321e3ede0d98d9ed462de01) ) + ROM_LOAD( "ew12", 0x70000, 0x10000, CRC(a2d244bc) SHA1(ff2391efc480f36a302650691f8a7a620b86d99a) ) + + ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */ + ROM_LOAD( "ew03", 0x0000, 0x10000, CRC(b606924d) SHA1(b759fcec10b333465cf5cd1b30987bf2d62186b2) ) +ROM_END + ROM_START( ffantasya ) ROM_REGION( 0x60000, "maincpu", 0 ) /* 4*64k for 68000 code */ ROM_LOAD16_BYTE( "ev02", 0x00000, 0x10000, CRC(797a7860) SHA1(aaab24c99e96b393d2bda435f18b0dc4003cdf09) ) @@ -3255,7 +3301,8 @@ GAME( 1988, robocopj, robocop, robocop, robocop, dec0_state, robocop, ROT0 GAME( 1988, robocopu, robocop, robocop, robocop, dec0_state, robocop, ROT0, "Data East USA", "Robocop (US revision 1)", MACHINE_SUPPORTS_SAVE ) GAME( 1988, robocopu0, robocop, robocop, robocop, dec0_state, robocop, ROT0, "Data East USA", "Robocop (US revision 0)", MACHINE_SUPPORTS_SAVE ) GAME( 1989, hippodrm, 0, hippodrm, hippodrm, dec0_state, hippodrm, ROT0, "Data East USA", "Hippodrome (US)", MACHINE_SUPPORTS_SAVE ) -GAME( 1989, ffantasy, hippodrm, hippodrm, ffantasy, dec0_state, hippodrm, ROT0, "Data East Corporation", "Fighting Fantasy (Japan revision 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1989, ffantasy, hippodrm, hippodrm, ffantasy, dec0_state, hippodrm, ROT0, "Data East Corporation", "Fighting Fantasy (World revision 3)", MACHINE_SUPPORTS_SAVE ) +GAME( 1989, ffantasyj, hippodrm, hippodrm, ffantasy, dec0_state, hippodrm, ROT0, "Data East Corporation", "Fighting Fantasy (Japan revision 2)", MACHINE_SUPPORTS_SAVE ) GAME( 1989, ffantasya, hippodrm, hippodrm, ffantasy, dec0_state, hippodrm, ROT0, "Data East Corporation", "Fighting Fantasy (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1989, secretag, 0, slyspy, slyspy, dec0_state, slyspy, ROT0, "Data East Corporation", "Secret Agent (World revision 3)", MACHINE_SUPPORTS_SAVE ) GAME( 1989, secretagj, secretag, slyspy, slyspy, dec0_state, slyspy, ROT0, "Data East Corporation", "Secret Agent (Japan revision 2)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/dmax8000.cpp b/src/mame/drivers/dmax8000.cpp new file mode 100644 index 00000000000..66a107f7305 --- /dev/null +++ b/src/mame/drivers/dmax8000.cpp @@ -0,0 +1,214 @@ +// license:BSD-3-Clause +// copyright-holders:Robbbert +/****************************************************************************************************************** + +Datamax 8000 + +2016-07-24 Skeleton driver + +This computer was designed and made by Datamax Pty Ltd, in Manly, Sydney, Australia. + +It could have up to 4x 8 inch floppy drives, in the IBM format. +There were a bunch of optional extras such as 256kB RAM, numeric coprocessor, RTC, etc. + + +ToDo: +- Everything... there are partial schematics, but there's still a lot of guesswork. + + + + +****************************************************************************************************************/ + +#include "emu.h" +#include "cpu/z80/z80.h" +#include "machine/wd_fdc.h" +#include "cpu/z80/z80daisy.h" +#include "machine/z80pio.h" +#include "machine/z80dart.h" +#include "machine/z80ctc.h" +#include "machine/terminal.h" + + + +class dmax8000_state : public driver_device +{ +public: + dmax8000_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_terminal(*this, "terminal") + , m_fdc(*this, "fdc") + { + } + + DECLARE_DRIVER_INIT(dmax8000); + DECLARE_MACHINE_RESET(dmax8000); + DECLARE_READ8_MEMBER(port80_r); + DECLARE_READ8_MEMBER(port81_r); + DECLARE_WRITE8_MEMBER(port40_w); + DECLARE_WRITE8_MEMBER(kbd_put); + DECLARE_WRITE_LINE_MEMBER(ctc_z0_w); + DECLARE_WRITE_LINE_MEMBER(ctc_z1_w); + DECLARE_WRITE_LINE_MEMBER(ctc_z2_w); +private: + UINT8 m_term_data; + required_device<cpu_device> m_maincpu; + required_device<generic_terminal_device> m_terminal; + required_device<fd1793_t> m_fdc; +}; + + +WRITE8_MEMBER( dmax8000_state::port40_w ) +{ + membank("bankr0")->set_entry(BIT(data, 0)); +} + +READ8_MEMBER( dmax8000_state::port80_r ) +{ + UINT8 ret = m_term_data; + m_term_data = 0; + return ret; +} + +READ8_MEMBER( dmax8000_state::port81_r ) +{ + return (m_term_data) ? 13 : 12; +} + +static ADDRESS_MAP_START(dmax8000_mem, AS_PROGRAM, 8, dmax8000_state) + AM_RANGE(0x0000, 0x0fff) AM_READ_BANK("bankr0") AM_WRITE_BANK("bankw0") + AM_RANGE(0x1000, 0xffff) AM_RAM +ADDRESS_MAP_END + +static ADDRESS_MAP_START(dmax8000_io, AS_IO, 8, dmax8000_state) + ADDRESS_MAP_GLOBAL_MASK(0xff) + ADDRESS_MAP_UNMAP_HIGH + AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("fdc", fd1793_t, read, write) + //AM_RANGE(0x04, 0x07) AM_DEVREADWRITE("dart1", z80dart_device, ba_cd_r, ba_cd_w) + AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("ctc", z80ctc_device, read, write) + AM_RANGE(0x0c, 0x0f) AM_DEVREADWRITE("pio1", z80pio_device, read, write) + AM_RANGE(0x10, 0x13) AM_DEVREADWRITE("pio2", z80pio_device, read, write) + //AM_RANGE(0x14, 0x17) AM_WRITE(port14_r) + //AM_RANGE(0x18, 0x19) AM_MIRROR(2) AM_DEVREADWRITE("am9512", am9512_device, read, write) // optional numeric coprocessor + //AM_RANGE(0x1c, 0x1d) AM_MIRROR(2) // optional hard disk controller (1C=status, 1D=data) + AM_RANGE(0x20, 0x23) AM_DEVREADWRITE("dart2", z80dart_device, ba_cd_r, ba_cd_w) + AM_RANGE(0x40, 0x40) AM_WRITE(port40_w) // memory bank control + //AM_RANGE(0x60, 0x67) // optional IEEE488 GPIB + //AM_RANGE(0x70, 0x7f) AM_DEVREADWRITE("rtc", mm58274c_device, read, write) // optional RTC + AM_RANGE(0x04, 0x04) AM_READ(port80_r) AM_DEVWRITE("terminal", generic_terminal_device, write) + AM_RANGE(0x05, 0x05) AM_READ(port81_r) +ADDRESS_MAP_END + +/* Input ports */ +static INPUT_PORTS_START( dmax8000 ) +INPUT_PORTS_END + +/* Z80 Daisy Chain */ + +// order unknown +static const z80_daisy_config daisy_chain[] = +{ + { "pio1" }, + { "pio2" }, + { "dart1" }, + { "dart2" }, + { "ctc" }, + { nullptr } +}; + +/* Z80-CTC Interface */ + +WRITE_LINE_MEMBER( dmax8000_state::ctc_z0_w ) +{ +// guess this generates clock for z80dart +} + +WRITE_LINE_MEMBER( dmax8000_state::ctc_z1_w ) +{ +} + +WRITE_LINE_MEMBER( dmax8000_state::ctc_z2_w ) +{ +} + +/* after the first 4 bytes have been read from ROM, switch the ram back in */ +MACHINE_RESET_MEMBER( dmax8000_state, dmax8000 ) +{ + membank("bankr0")->set_entry(0); // point at rom + membank("bankw0")->set_entry(0); // always write to ram +} + +DRIVER_INIT_MEMBER( dmax8000_state, dmax8000 ) +{ + UINT8 *main = memregion("maincpu")->base(); + + membank("bankr0")->configure_entry(1, &main[0x0000]); + membank("bankr0")->configure_entry(0, &main[0x10000]); + membank("bankw0")->configure_entry(0, &main[0x0000]); +} + +static SLOT_INTERFACE_START( floppies ) + SLOT_INTERFACE( "drive0", FLOPPY_8_DSDD ) +SLOT_INTERFACE_END + +WRITE8_MEMBER( dmax8000_state::kbd_put ) +{ + m_term_data = data; +} + +static MACHINE_CONFIG_START( dmax8000, dmax8000_state ) + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", Z80, XTAL_4MHz ) // no idea what crystal is used, but 4MHz clock is confirmed + MCFG_CPU_PROGRAM_MAP(dmax8000_mem) + MCFG_CPU_IO_MAP(dmax8000_io) + MCFG_Z80_DAISY_CHAIN(daisy_chain) + MCFG_MACHINE_RESET_OVERRIDE(dmax8000_state, dmax8000) + + MCFG_DEVICE_ADD("terminal", GENERIC_TERMINAL, 0) + MCFG_GENERIC_TERMINAL_KEYBOARD_CB(WRITE8(dmax8000_state, kbd_put)) + + MCFG_DEVICE_ADD("ctc", Z80CTC, XTAL_4MHz) + MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) + MCFG_Z80CTC_ZC0_CB(WRITELINE(dmax8000_state, ctc_z0_w)) + MCFG_Z80CTC_ZC1_CB(WRITELINE(dmax8000_state, ctc_z1_w)) + MCFG_Z80CTC_ZC2_CB(WRITELINE(dmax8000_state, ctc_z2_w)) + + MCFG_Z80DART_ADD("dart1", XTAL_4MHz, 0, 0, 0, 0 ) + //MCFG_Z80DART_OUT_TXDA_CB(DEVWRITELINE("rs232", rs232_port_device, write_txd)) + //MCFG_Z80DART_OUT_DTRA_CB(DEVWRITELINE("rs232", rs232_port_device, write_dtr)) + //MCFG_Z80DART_OUT_RTSA_CB(DEVWRITELINE("rs232", rs232_port_device, write_rts)) + MCFG_Z80DART_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) + //MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") + //MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart", z80dart_device, write_rxd)) + //MCFG_RS232_DSR_HANDLER(DEVWRITELINE("uart", z80dart_device, write_dsr)) + //MCFG_RS232_CTS_HANDLER(DEVWRITELINE("uart", z80dart_device, write_cts)) + //MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", dmax8000 ) + + MCFG_Z80DART_ADD("dart2", XTAL_4MHz, 0, 0, 0, 0 ) + MCFG_Z80DART_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) + + MCFG_DEVICE_ADD("pio1", Z80PIO, XTAL_4MHz) + MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) + MCFG_DEVICE_ADD("pio2", Z80PIO, XTAL_4MHz) + MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) + + MCFG_FD1793_ADD("fdc", XTAL_2MHz) + //MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(dmax8000_state, fdc_intrq_w)) + //MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(dmax8000_state, fdc_drq_w)) + MCFG_FLOPPY_DRIVE_ADD("fdc:0", floppies, "drive0", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_SOUND(true) +MACHINE_CONFIG_END + + +/* ROM definition */ +ROM_START( dmax8000 ) + ROM_REGION( 0x11000, "maincpu", 0 ) + ROM_LOAD( "rev1_0.rom", 0x10000, 0x001000, CRC(acbec83f) SHA1(fce0a4307a791250dbdc6bb6a190f7fec3619d82) ) + // ROM_LOAD( "rev1_1.rom", 0x10000, 0x001000, CRC(2eb98a61) SHA1(cdd9a58f63ee7e3d3dd1c4ae3fd4376b308fd10f) ) // this is a hacked rom to speed up the serial port +ROM_END + +/* Driver */ + +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ +COMP( 1981, dmax8000, 0, 0, dmax8000, dmax8000, dmax8000_state, dmax8000, "Datamax", "Datamax 8000", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW) diff --git a/src/mame/drivers/dynax.cpp b/src/mame/drivers/dynax.cpp index 5780f72416f..39fe85b9aac 100644 --- a/src/mame/drivers/dynax.cpp +++ b/src/mame/drivers/dynax.cpp @@ -6378,6 +6378,45 @@ ROM_START( shpeng ) ROM_LOAD_OPTIONAL( "1.17g", 0x200, 0x200, CRC(324fa9cf) SHA1(a03e23d9a9687dec4c23a8e41254a3f4b70c7e25) ) ROM_END +/* +Intergirl by Barko + +1x GM68A45S uj11 CRT Controller (CRTC) +1x Z8400ADSD-Z80ACPU ug8 8-bit Microprocessor - main +1x GL324 u14 Quad Operational Amplifier - sound +1x YM2203C uj5 FM Operator Type-N (OPM) - sound +1x YM3014B u13 D/A Converter (DAC) - sound +1x oscillator 22.1184MHz xt1 + +ROMs +2x TMS27C512 1,2 dumped +3x TMS27C020 3,4,5 dumped + +RAMs +1x GM76C88AL-15 ug1 +6x KM424C64P-10 uf13,uf13a,uf14,uf15,uf16,uf17 + +PLDs +1x PAL16L8ACN ug6 read protected +1x CY7C381-0JC read protected +*/ + +ROM_START( intrgirl ) + ROM_REGION( 0x90000, "maincpu", 0 ) // Z80 Code + ROM_LOAD( "ka-1.ug3", 0x00000, 0x10000, CRC(07b36540) SHA1(1679438a153a7449256c826c4f10443e739c0825) ) + ROM_LOAD( "ka-2.ug5", 0x28000, 0x10000, CRC(9f2fc058) SHA1(0be90d44ca7cac7040dfa53ba36f6bc3d504fb01) ) + + ROM_REGION( 0xc0000, "gfx1", 0 ) // blitter data + ROM_LOAD( "ka-3.rom1", 0x00000, 0x40000, CRC(57fd8b34) SHA1(b7fa977bb79a0e831bc86be635398950dd717b47) ) + ROM_LOAD( "ka-4.rom2", 0x40000, 0x40000, CRC(ad90d3a1) SHA1(d955620fdd4aacc96e59e9f94da85568cce47843) ) + ROM_LOAD( "ka-5.rom3", 0x80000, 0x40000, CRC(2ed30171) SHA1(883d9e96df4f234652b01599e065f7f1985d1748) ) + + // there aren't PROMs on the PCB, but these are currently here because they will show the game running, although with bad colors. + // to be removed once the real source of the palette is identified (maybe the CY7C381-0JC FPGA?) + ROM_REGION( 0x400, "proms", 0 ) // Color PROMs + ROM_LOAD( "fake_prom_1", 0x000, 0x200, NO_DUMP ) + ROM_LOAD( "fake_prom_2", 0x200, 0x200, NO_DUMP ) +ROM_END // Decrypted by yong DRIVER_INIT_MEMBER(dynax_state,mjelct3) @@ -7451,4 +7490,5 @@ GAME( 1991, ougonpaib,ougonpai, tenkai, tenkai, driver_device, 0, ROT GAME( 1994, mjreach, 0, tenkai, mjreach, dynax_state, mjreach, ROT0, "bootleg / Dynax", "Mahjong Reach (bootleg)", MACHINE_SUPPORTS_SAVE ) GAME( 1994, cdracula, 0, cdracula, cdracula, driver_device, 0, ROT0, "Yun Sung (Escape license)","Castle Of Dracula", MACHINE_SUPPORTS_SAVE ) // not a dynax board GAME( 1995, shpeng, 0, sprtmtch, drgpunch, driver_device, 0, ROT0, "WSAC Systems?", "Sea Hunter Penguin", MACHINE_NO_COCKTAIL | MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // not a dynax board. proms? +GAME( 1995, intrgirl, 0, sprtmtch, drgpunch, driver_device, 0, ROT0, "Barko", "Intergirl", MACHINE_NO_COCKTAIL | MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // not a dynax board. proms? GAME( 1996, majrjhdx, 0, majrjhdx, tenkai, driver_device, 0, ROT0, "Dynax", "Mahjong Raijinhai DX", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/expro02.cpp b/src/mame/drivers/expro02.cpp index 362dccd324d..b1bbf6448fc 100644 --- a/src/mame/drivers/expro02.cpp +++ b/src/mame/drivers/expro02.cpp @@ -159,7 +159,7 @@ U78 (22CV10) ------------- Comad games ------------------ The Comad games are clearly derived from this version of the game, not -the one in galspanic.c. Fantasia even still has the encrypted tile +the one in galspanic.cpp. Fantasia even still has the encrypted tile roms and makes use of the extra layer. The other games write to the RAM for this layer, but don't have any roms. @@ -218,40 +218,38 @@ class expro02_state : public driver_device public: expro02_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_expro02_fg_ind8_pixram(*this, "fg_ind8ram"), - m_expro02_bg_rgb555_pixram(*this, "bg_rgb555ram"), - m_view2_0(*this, "view2_0"), - m_kaneko_spr(*this, "kan_spr"), - m_spriteram(*this, "spriteram"), m_maincpu(*this, "maincpu"), m_palette(*this, "palette"), - m_generic_paletteram_16(*this, "paletteram"), - m_screen(*this, "screen") + m_screen(*this, "screen"), + m_paletteram(*this, "palette"), + m_fg_ind8_pixram(*this, "fg_ind8ram"), + m_bg_rgb555_pixram(*this, "bg_rgb555ram"), + m_view2_0(*this, "view2_0"), + m_kaneko_spr(*this, "kan_spr"), + m_spriteram(*this, "spriteram") { } + + required_device<cpu_device> m_maincpu; + required_device<palette_device> m_palette; + required_device<screen_device> m_screen; - optional_shared_ptr<UINT16> m_expro02_fg_ind8_pixram; - optional_shared_ptr<UINT16> m_expro02_bg_rgb555_pixram; + required_shared_ptr<UINT16> m_paletteram; + required_shared_ptr<UINT16> m_fg_ind8_pixram; + required_shared_ptr<UINT16> m_bg_rgb555_pixram; optional_device<kaneko_view2_tilemap_device> m_view2_0; - optional_device<kaneko16_sprite_device> m_kaneko_spr; - optional_shared_ptr<UINT16> m_spriteram; + required_device<kaneko16_sprite_device> m_kaneko_spr; + required_shared_ptr<UINT16> m_spriteram; - UINT16 m_vram_0_bank_num; - UINT16 m_vram_1_bank_num; DECLARE_WRITE16_MEMBER(expro02_6295_bankswitch_w); - DECLARE_WRITE16_MEMBER(expro02_paletteram_w); + DECLARE_DRIVER_INIT(expro02); - virtual void machine_reset() override; - virtual void video_start() override; + virtual void machine_start() override; DECLARE_PALETTE_INIT(expro02); + UINT32 screen_update_backgrounds(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_expro02(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_zipzap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - TIMER_DEVICE_CALLBACK_MEMBER(expro02_scanline); - - required_device<cpu_device> m_maincpu; - required_device<palette_device> m_palette; - required_shared_ptr<UINT16> m_generic_paletteram_16; - required_device<screen_device> m_screen; + TIMER_DEVICE_CALLBACK_MEMBER(scanline); // comad READ16_MEMBER(comad_timer_r); @@ -260,6 +258,11 @@ public: }; +void expro02_state::machine_start() +{ + membank("okibank")->configure_entries(0, 16, memregion("oki")->base(), 0x10000); +} + PALETTE_INIT_MEMBER(expro02_state, expro02) { int i; @@ -285,11 +288,11 @@ UINT32 expro02_state::screen_update_backgrounds(screen_device &screen, bitmap_in for (x=0;x<256;x++) { - UINT16 dat = (m_expro02_bg_rgb555_pixram[count] & 0xfffe)>>1; + UINT16 dat = (m_bg_rgb555_pixram[count] & 0xfffe)>>1; dat+=2048; // never seen to test - //if (!(m_expro02_bg_rgb555_pixram[count] & 0x0001)) + //if (!(m_bg_rgb555_pixram[count] & 0x0001)) { dest[x] = dat; } @@ -311,9 +314,9 @@ UINT32 expro02_state::screen_update_backgrounds(screen_device &screen, bitmap_in for (x=0;x<256;x++) { - UINT16 dat = (m_expro02_fg_ind8_pixram[count]); + UINT16 dat = (m_fg_ind8_pixram[count]); dat &=0x7ff; - if (!(m_generic_paletteram_16[(dat&0x7ff)] & 0x0001)) + if (!(m_paletteram[(dat&0x7ff)] & 0x0001)) dest[x] = dat; count++; @@ -338,7 +341,7 @@ UINT32 expro02_state::screen_update_backgrounds(screen_device &screen, bitmap_in return 0; } -UINT32 expro02_state::screen_update_expro02(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 expro02_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { screen_update_backgrounds(screen, bitmap, cliprect); m_kaneko_spr->kaneko16_render_sprites(bitmap,cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()); @@ -353,11 +356,6 @@ UINT32 expro02_state::screen_update_zipzap(screen_device &screen, bitmap_ind16 & } -void expro02_state::video_start() -{ -} - - /************************************* * * Game-specific port definitions @@ -629,25 +627,10 @@ WRITE16_MEMBER(expro02_state::expro02_6295_bankswitch_w) { if (ACCESSING_BITS_8_15) { - UINT8 *rom = memregion("oki")->base(); - memcpy(&rom[0x30000],&rom[0x40000 + ((data >> 8) & 0x0f) * 0x10000],0x10000); + membank("okibank")->set_entry((data >> 8) & 0x0f); } } -/************************************* - * - * Video handlers - * - *************************************/ - -WRITE16_MEMBER(expro02_state::expro02_paletteram_w) -{ - data = COMBINE_DATA(&m_generic_paletteram_16[offset]); - m_palette->set_pen_color(offset,pal5bit(data >> 6),pal5bit(data >> 11),pal5bit(data >> 1)); -} - - - /************************************* * @@ -660,7 +643,7 @@ static ADDRESS_MAP_START( expro02_video_base_map, AS_PROGRAM, 16, expro02_state AM_RANGE(0x500000, 0x51ffff) AM_RAM AM_SHARE("fg_ind8ram") AM_RANGE(0x520000, 0x53ffff) AM_RAM AM_SHARE("bg_rgb555ram") AM_RANGE(0x580000, 0x583fff) AM_DEVREADWRITE("view2_0", kaneko_view2_tilemap_device, kaneko_tmap_vram_r, kaneko_tmap_vram_w ) - AM_RANGE(0x600000, 0x600fff) AM_RAM_WRITE(expro02_paletteram_w) AM_SHARE("paletteram") // palette? + AM_RANGE(0x600000, 0x600fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // palette? AM_RANGE(0x680000, 0x68001f) AM_DEVREADWRITE("view2_0", kaneko_view2_tilemap_device, kaneko_tmap_regs_r, kaneko_tmap_regs_w) AM_RANGE(0x700000, 0x700fff) AM_RAM AM_SHARE("spriteram") // sprites? 0x72f words tested AM_RANGE(0x780000, 0x78001f) AM_DEVREADWRITE("kan_spr", kaneko16_sprite_device, kaneko16_sprites_regs_r, kaneko16_sprites_regs_w) @@ -672,7 +655,7 @@ static ADDRESS_MAP_START( expro02_video_base_map_noview2, AS_PROGRAM, 16, expro0 AM_RANGE(0x500000, 0x51ffff) AM_RAM AM_SHARE("fg_ind8ram") AM_RANGE(0x520000, 0x53ffff) AM_RAM AM_SHARE("bg_rgb555ram") AM_RANGE(0x580000, 0x583fff) AM_NOP // games still makes leftover accesses - AM_RANGE(0x600000, 0x600fff) AM_RAM_WRITE(expro02_paletteram_w) AM_SHARE("paletteram") // palette? + AM_RANGE(0x600000, 0x600fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // palette? AM_RANGE(0x680000, 0x68001f) AM_NOP // games still makes leftover accesses AM_RANGE(0x700000, 0x700fff) AM_RAM AM_SHARE("spriteram") // sprites? 0x72f words tested AM_RANGE(0x780000, 0x78001f) AM_DEVREADWRITE("kan_spr", kaneko16_sprite_device, kaneko16_sprites_regs_r, kaneko16_sprites_regs_w) @@ -814,6 +797,10 @@ static ADDRESS_MAP_START( smissw_map, AS_PROGRAM, 16, expro02_state ) AM_RANGE(0xf00000, 0xf00001) AM_READ8(comad_okim6295_r, 0xff00) AM_DEVWRITE8("oki", okim6295_device, write, 0xff00) /* fantasia, missw96 */ ADDRESS_MAP_END +static ADDRESS_MAP_START( oki_map, AS_0, 8, expro02_state ) + AM_RANGE(0x00000, 0x2ffff) AM_ROM + AM_RANGE(0x30000, 0x3ffff) AM_ROMBANK("okibank") +ADDRESS_MAP_END /************************************* * @@ -821,7 +808,7 @@ ADDRESS_MAP_END * *************************************/ -TIMER_DEVICE_CALLBACK_MEMBER(expro02_state::expro02_scanline) +TIMER_DEVICE_CALLBACK_MEMBER(expro02_state::scanline) { int scanline = param; @@ -833,10 +820,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(expro02_state::expro02_scanline) m_maincpu->set_input_line(4, HOLD_LINE); } -void expro02_state::machine_reset() -{ -} - /************************************* * * Comad specific (kludges?) @@ -861,9 +844,7 @@ WRITE16_MEMBER(expro02_state::galpanica_6295_bankswitch_w) { if (ACCESSING_BITS_8_15) { - UINT8 *rom = memregion("oki")->base(); - - memcpy(&rom[0x30000],&rom[0x40000 + ((data >> 8) & 0x0f) * 0x10000],0x10000); + membank("okibank")->set_entry((data >> 8) & 0x0f); } } @@ -908,7 +889,7 @@ static MACHINE_CONFIG_START( expro02, expro02_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, 12000000) MCFG_CPU_PROGRAM_MAP(expro02_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", expro02_state, expro02_scanline, "screen", 0, 1) + MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", expro02_state, scanline, "screen", 0, 1) /* CALC01 MCU @ 16Mhz (unknown type, simulated) */ @@ -918,11 +899,12 @@ static MACHINE_CONFIG_START( expro02, expro02_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(256, 256) MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-32-1) - MCFG_SCREEN_UPDATE_DRIVER(expro02_state, screen_update_expro02) + MCFG_SCREEN_UPDATE_DRIVER(expro02_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", expro02) MCFG_PALETTE_ADD("palette", 2048 + 32768) + MCFG_PALETTE_FORMAT(GGGGGRRRRRBBBBBx) MCFG_PALETTE_INIT_OWNER(expro02_state, expro02) MCFG_DEVICE_ADD("view2_0", KANEKO_TMAP, 0) @@ -948,6 +930,7 @@ static MACHINE_CONFIG_START( expro02, expro02_state ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_OKIM6295_ADD("oki", 12000000/6, OKIM6295_PIN7_LOW) + MCFG_DEVICE_ADDRESS_MAP(AS_0, oki_map) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -986,6 +969,7 @@ static MACHINE_CONFIG_DERIVED( supmodel, comad_noview2 ) MCFG_CPU_MODIFY("maincpu") MCFG_CPU_PROGRAM_MAP(supmodel_map) MCFG_OKIM6295_REPLACE("oki", 1584000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified + MCFG_DEVICE_ADDRESS_MAP(AS_0, oki_map) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -1003,6 +987,7 @@ static MACHINE_CONFIG_DERIVED( galhustl, comad_noview2 ) MCFG_CPU_MODIFY("maincpu") MCFG_CPU_PROGRAM_MAP(galhustl_map) MCFG_OKIM6295_REPLACE("oki", 1056000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified + MCFG_DEVICE_ADDRESS_MAP(AS_0, oki_map) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MCFG_SCREEN_MODIFY("screen") @@ -1014,6 +999,7 @@ static MACHINE_CONFIG_DERIVED( zipzap, comad_noview2 ) MCFG_CPU_MODIFY("maincpu") MCFG_CPU_PROGRAM_MAP(zipzap_map) MCFG_OKIM6295_REPLACE("oki", 1056000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified + MCFG_DEVICE_ADDRESS_MAP(AS_0, oki_map) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MCFG_SCREEN_MODIFY("screen") // doesn't work with original kaneko_spr implementation @@ -1058,11 +1044,10 @@ ROM_START( galsnew ) /* EXPRO-02 PCB */ ROM_LOAD( "pm016e.u92", 0x180000, 0x080000, CRC(c0b9494c) SHA1(f0b066dd78eb9fcf947da90ddb6c7b62299c5743) ) - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "pm008e.u46", 0x00000, 0x80000, CRC(d9379ba8) SHA1(5ae7c743319b1a12f2b101a9f0f8fe0728ed1476) ) - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "pm007e.u47", 0xc0000, 0x80000, CRC(c7ed7950) SHA1(133258b058d3c562208d0d00b9fac71202647c32) ) + ROM_LOAD( "pm007e.u47", 0x80000, 0x80000, CRC(c7ed7950) SHA1(133258b058d3c562208d0d00b9fac71202647c32) ) ROM_END ROM_START( galsnewa ) /* EXPRO-02 PCB */ @@ -1097,11 +1082,10 @@ ROM_START( galsnewa ) /* EXPRO-02 PCB */ ROM_LOAD( "pm015e.u91", 0x100000, 0x080000, CRC(a563f8ef) SHA1(6e4171746e4d401992bf3a7619d5bed0063d57e5) ) ROM_LOAD( "pm016e.u92", 0x180000, 0x080000, CRC(c0b9494c) SHA1(f0b066dd78eb9fcf947da90ddb6c7b62299c5743) ) - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "pm008e.u46", 0x00000, 0x80000, CRC(d9379ba8) SHA1(5ae7c743319b1a12f2b101a9f0f8fe0728ed1476) ) - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "pm007e.u47", 0xc0000, 0x80000, CRC(c7ed7950) SHA1(133258b058d3c562208d0d00b9fac71202647c32) ) + ROM_LOAD( "pm007e.u47", 0x80000, 0x80000, CRC(c7ed7950) SHA1(133258b058d3c562208d0d00b9fac71202647c32) ) ROM_END ROM_START( galsnewj ) /* EXPRO-02 PCB */ @@ -1136,11 +1120,10 @@ ROM_START( galsnewj ) /* EXPRO-02 PCB */ ROM_LOAD( "pm015e.u91", 0x100000, 0x080000, CRC(a563f8ef) SHA1(6e4171746e4d401992bf3a7619d5bed0063d57e5) ) ROM_LOAD( "pm016e.u92", 0x180000, 0x080000, CRC(c0b9494c) SHA1(f0b066dd78eb9fcf947da90ddb6c7b62299c5743) ) - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "pm008j.u46", 0x00000, 0x80000, CRC(f394670e) SHA1(171f8dc519a13f352e6440aaadebe490c82361f0) ) - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "pm007j.u47", 0xc0000, 0x80000, CRC(06780287) SHA1(8b9b57f6604b86d6dff42e5e51cd59a7111e1e79) ) + ROM_LOAD( "pm007j.u47", 0x80000, 0x80000, CRC(06780287) SHA1(8b9b57f6604b86d6dff42e5e51cd59a7111e1e79) ) ROM_END ROM_START( galsnewk ) /* EXPRO-02 PCB, Korean title is "Ddang Dda Meok Gi" */ @@ -1175,11 +1158,10 @@ ROM_START( galsnewk ) /* EXPRO-02 PCB, Korean title is "Ddang Dda Meok Gi" */ ROM_LOAD( "pm016e.u92", 0x180000, 0x080000, CRC(c0b9494c) SHA1(f0b066dd78eb9fcf947da90ddb6c7b62299c5743) ) - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "pm008k.u46", 0x00000, 0x80000, CRC(7498483f) SHA1(d1f7461c8d1469704cc34460d7283f0a914afc29) ) - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "pm007k.u47", 0xc0000, 0x80000, CRC(a8dc1fd5) SHA1(c324f7eab7302e4a71d505c915ab2ad591b8ff33) ) + ROM_LOAD( "pm007k.u47", 0x80000, 0x80000, CRC(a8dc1fd5) SHA1(c324f7eab7302e4a71d505c915ab2ad591b8ff33) ) ROM_END @@ -1263,11 +1245,10 @@ ROM_START( fantasia ) /* PCB silkscreened COMAD INDUSTRY CO.,LTD940429 MADE IN K ROM_LOAD( "17.scr3", 0x00000, 0x80000, CRC(aadb6eb7) SHA1(6eaa994ad7b4e8341360eaf5ddb46240316b7274) ) /* SCR1 and SCR2 are unpopulated */ - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "2.music1", 0x00000, 0x80000, CRC(22955efb) SHA1(791c18d1aa0c10810da05c199108f51f99fe1d49) ) - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "1.music2", 0xc0000, 0x80000, CRC(4cd4d6c3) SHA1(a617472a810aef6d82f5fe75ef2980c03c21c2fa) ) + ROM_LOAD( "1.music2", 0x80000, 0x80000, CRC(4cd4d6c3) SHA1(a617472a810aef6d82f5fe75ef2980c03c21c2fa) ) ROM_REGION( 0x200000, "gfx2", ROMREGION_ERASEFF ) /* sprites */ @@ -1296,11 +1277,10 @@ ROM_START( fantasiaa ) /* PCB silkscreened COMAD INDUSTRY CO.,LTD 940307 MADE IN ROM_LOAD( "obj1_17.u5", 0x00000, 0x80000, CRC(aadb6eb7) SHA1(6eaa994ad7b4e8341360eaf5ddb46240316b7274) ) /* same data, different PCB location */ /* U4 OBJ2 18 and U3 OBJ3 19 are unpopulated */ - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "music1_1.ub6", 0x00000, 0x80000, CRC(af0be817) SHA1(5c8897dcd9957add19ff9553c01ce03fec68b354) ) /* This sound sample is different, Earlier ver or BAD??? */ - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "music2_2.uc6", 0xc0000, 0x80000, CRC(4cd4d6c3) SHA1(a617472a810aef6d82f5fe75ef2980c03c21c2fa) ) /* same data, different PCB location */ + ROM_LOAD( "music2_2.uc6", 0x80000, 0x80000, CRC(4cd4d6c3) SHA1(a617472a810aef6d82f5fe75ef2980c03c21c2fa) ) /* same data, different PCB location */ ROM_REGION( 0x200000, "gfx2", ROMREGION_ERASEFF ) /* sprites */ @@ -1328,11 +1308,10 @@ ROM_START( fantasiab ) ROM_LOAD( "17.scr3", 0x00000, 0x80000, CRC(aadb6eb7) SHA1(6eaa994ad7b4e8341360eaf5ddb46240316b7274) ) /* SCR1 and SCR2 are unpopulated */ - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "2.music1", 0x00000, 0x80000, CRC(22955efb) SHA1(791c18d1aa0c10810da05c199108f51f99fe1d49) ) - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "1.music2", 0xc0000, 0x80000, CRC(4cd4d6c3) SHA1(a617472a810aef6d82f5fe75ef2980c03c21c2fa) ) + ROM_LOAD( "1.music2", 0x80000, 0x80000, CRC(4cd4d6c3) SHA1(a617472a810aef6d82f5fe75ef2980c03c21c2fa) ) ROM_REGION( 0x200000, "gfx2", ROMREGION_ERASEFF ) /* sprites */ @@ -1390,11 +1369,10 @@ ROM_START( fantsy95 ) ROM_REGION( 0x80000, "gfx1", 0 ) /* sprites */ ROM_LOAD( "obj1.13", 0x00000, 0x80000, CRC(832cd451) SHA1(29dfab1d4b7a15f3fe9fbedef41d405a40235a77) ) // sldh - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "music1.1", 0x00000, 0x80000, CRC(3117e2ef) SHA1(6581a7104556d44f814c537bbd74998922927034) ) - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "music2.2", 0xc0000, 0x80000, CRC(0c1109f9) SHA1(0e4ea534a32b1649e2e9bb8af7254b917ec03a90) ) + ROM_LOAD( "music2.2", 0x80000, 0x80000, CRC(0c1109f9) SHA1(0e4ea534a32b1649e2e9bb8af7254b917ec03a90) ) ROM_END ROM_START( fantasian ) /* PCB silkscreened COMAD INDUSTRY CO.,LTD 940803 MADE IN KOREA */ @@ -1413,11 +1391,10 @@ ROM_START( fantasian ) /* PCB silkscreened COMAD INDUSTRY CO.,LTD 940803 MADE IN ROM_REGION( 0x80000, "gfx1", 0 ) /* sprites */ ROM_LOAD( "obj1_13.u5", 0x00000, 0x80000, CRC(f99751f5) SHA1(10f0a2e369abc36a6df2f0c9879ffb7071ee214b) ) - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "music1_1.ub6", 0x00000, 0x80000, CRC(22955efb) SHA1(791c18d1aa0c10810da05c199108f51f99fe1d49) ) /* sample roms same as expro02.c sets, but different positions */ - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "music2_2.uc6", 0xc0000, 0x80000, CRC(4cd4d6c3) SHA1(a617472a810aef6d82f5fe75ef2980c03c21c2fa) ) + ROM_LOAD( "music2_2.uc6", 0x80000, 0x80000, CRC(4cd4d6c3) SHA1(a617472a810aef6d82f5fe75ef2980c03c21c2fa) ) ROM_END ROM_START( newfant ) @@ -1436,11 +1413,10 @@ ROM_START( newfant ) ROM_REGION( 0x80000, "gfx1", 0 ) /* sprites */ ROM_LOAD( "nf95obj1.13", 0x00000, 0x80000, CRC(e6d1bc71) SHA1(df0b6c1742c01991196659bab2691230323e7b8d) ) // sldh - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "musc1.01", 0x00000, 0x80000, CRC(10347fce) SHA1(f5fbe8ef363fe18b7104be5d2fa92943d1a5d7a2) ) - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "musc2.02", 0xc0000, 0x80000, CRC(b9646a8c) SHA1(e9432261ac86e4251a2c97301c6d014c05110a9c) ) + ROM_LOAD( "musc2.02", 0x80000, 0x80000, CRC(b9646a8c) SHA1(e9432261ac86e4251a2c97301c6d014c05110a9c) ) ROM_END ROM_START( newfanta ) @@ -1459,11 +1435,10 @@ ROM_START( newfanta ) ROM_REGION( 0x80000, "gfx1", 0 ) /* sprites */ ROM_LOAD( "obj1.13", 0x00000, 0x80000, CRC(832cd451) SHA1(29dfab1d4b7a15f3fe9fbedef41d405a40235a77) ) // sldh - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "musc1.01", 0x00000, 0x80000, CRC(10347fce) SHA1(f5fbe8ef363fe18b7104be5d2fa92943d1a5d7a2) ) - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "musc2.02", 0xc0000, 0x80000, CRC(b9646a8c) SHA1(e9432261ac86e4251a2c97301c6d014c05110a9c) ) + ROM_LOAD( "musc2.02", 0x80000, 0x80000, CRC(b9646a8c) SHA1(e9432261ac86e4251a2c97301c6d014c05110a9c) ) ROM_END ROM_START( missw96 ) @@ -1480,11 +1455,10 @@ ROM_START( missw96 ) ROM_REGION( 0x80000, "gfx1", 0 ) /* sprites */ ROM_LOAD( "mw96_11.bin", 0x00000, 0x80000, CRC(3983152f) SHA1(6308e936ba54e88b34253f1d4fbd44725e9d88ae) ) - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "mw96_01.bin", 0x00000, 0x80000, CRC(e78a659e) SHA1(d209184c70e0d7e6d17034c6f536535cda782d42) ) - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "mw96_02.bin", 0xc0000, 0x80000, CRC(60fa0c00) SHA1(391aa31e61663cc083a8a2320ba48a9859f3fd4e) ) + ROM_LOAD( "mw96_02.bin", 0x80000, 0x80000, CRC(60fa0c00) SHA1(391aa31e61663cc083a8a2320ba48a9859f3fd4e) ) ROM_END ROM_START( missw96a ) @@ -1501,11 +1475,10 @@ ROM_START( missw96a ) ROM_REGION( 0x80000, "gfx1", 0 ) /* sprites */ ROM_LOAD( "mw96_11.bin", 0x00000, 0x80000, CRC(3983152f) SHA1(6308e936ba54e88b34253f1d4fbd44725e9d88ae) ) - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "mw96_01.bin", 0x00000, 0x80000, CRC(e78a659e) SHA1(d209184c70e0d7e6d17034c6f536535cda782d42) ) - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "mw96_02.bin", 0xc0000, 0x80000, CRC(60fa0c00) SHA1(391aa31e61663cc083a8a2320ba48a9859f3fd4e) ) + ROM_LOAD( "mw96_02.bin", 0x80000, 0x80000, CRC(60fa0c00) SHA1(391aa31e61663cc083a8a2320ba48a9859f3fd4e) ) ROM_END ROM_START( missw96b ) @@ -1522,11 +1495,10 @@ ROM_START( missw96b ) ROM_REGION( 0x80000, "gfx1", 0 ) /* sprites */ ROM_LOAD( "mw96_11.bin", 0x00000, 0x80000, CRC(3983152f) SHA1(6308e936ba54e88b34253f1d4fbd44725e9d88ae) ) - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "mw96_01.bin", 0x00000, 0x80000, CRC(e78a659e) SHA1(d209184c70e0d7e6d17034c6f536535cda782d42) ) - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "mw96_02.bin", 0xc0000, 0x80000, CRC(60fa0c00) SHA1(391aa31e61663cc083a8a2320ba48a9859f3fd4e) ) + ROM_LOAD( "mw96_02.bin", 0x80000, 0x80000, CRC(60fa0c00) SHA1(391aa31e61663cc083a8a2320ba48a9859f3fd4e) ) ROM_END ROM_START( missw96c ) @@ -1543,11 +1515,10 @@ ROM_START( missw96c ) ROM_REGION( 0x80000, "gfx1", 0 ) /* sprites */ ROM_LOAD( "20_OBJ1.U5", 0x00000, 0x80000, CRC(3983152f) SHA1(6308e936ba54e88b34253f1d4fbd44725e9d88ae) ) - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "1_MUSIC1.UB6", 0x00000, 0x80000, CRC(e78a659e) SHA1(d209184c70e0d7e6d17034c6f536535cda782d42) ) - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "2_MUSIC2.UC6", 0xc0000, 0x80000, CRC(60fa0c00) SHA1(391aa31e61663cc083a8a2320ba48a9859f3fd4e) ) + ROM_LOAD( "2_MUSIC2.UC6", 0x80000, 0x80000, CRC(60fa0c00) SHA1(391aa31e61663cc083a8a2320ba48a9859f3fd4e) ) ROM_END @@ -1565,11 +1536,10 @@ ROM_START( missmw96 ) ROM_REGION( 0x80000, "gfx1", 0 ) /* sprites */ ROM_LOAD( "mmw96_11.bin", 0x00000, 0x80000, CRC(7d491f8c) SHA1(63f580bd65579cac70b90eaa0e7f2413ef1597b8) ) - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "mw96_01.bin", 0x00000, 0x80000, CRC(e78a659e) SHA1(d209184c70e0d7e6d17034c6f536535cda782d42) ) - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "mw96_02.bin", 0xc0000, 0x80000, CRC(60fa0c00) SHA1(391aa31e61663cc083a8a2320ba48a9859f3fd4e) ) + ROM_LOAD( "mw96_02.bin", 0x80000, 0x80000, CRC(60fa0c00) SHA1(391aa31e61663cc083a8a2320ba48a9859f3fd4e) ) ROM_END ROM_START( smissw ) @@ -1586,11 +1556,10 @@ ROM_START( smissw ) ROM_REGION( 0x80000, "gfx1", 0 ) /* sprites */ ROM_LOAD( "15_OBJ11.U5", 0x00000, 0x80000, CRC(3983152f) SHA1(6308e936ba54e88b34253f1d4fbd44725e9d88ae) ) - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "1_MUSIC1.UB6", 0x00000, 0x80000, CRC(e78a659e) SHA1(d209184c70e0d7e6d17034c6f536535cda782d42) ) - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "2_MUSIC2.UC6", 0xc0000, 0x80000, CRC(60fa0c00) SHA1(391aa31e61663cc083a8a2320ba48a9859f3fd4e) ) + ROM_LOAD( "2_MUSIC2.UC6", 0x80000, 0x80000, CRC(60fa0c00) SHA1(391aa31e61663cc083a8a2320ba48a9859f3fd4e) ) ROM_END @@ -1611,11 +1580,10 @@ ROM_START( fantsia2 ) ROM_LOAD( "obj1.1i", 0x00000, 0x80000, CRC(52e6872a) SHA1(7e5274b9a415ee0e536cd3b87f73d3eae9644669) ) ROM_LOAD( "obj2.2i", 0x80000, 0x80000, CRC(ea6e3861) SHA1(463b40f5441231a0451571a0b8afe1ed0fd4b164) ) - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "music2.1b", 0x00000, 0x80000, CRC(23cc4f9c) SHA1(06b5342c25de966ce590917c571e5b19af1fef7d) ) - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "music1.1a", 0xc0000, 0x80000, CRC(864167c2) SHA1(c454b26b6dea993e6bd64546f92beef05e46d7d7) ) + ROM_LOAD( "music1.1a", 0x80000, 0x80000, CRC(864167c2) SHA1(c454b26b6dea993e6bd64546f92beef05e46d7d7) ) ROM_END ROM_START( fantsia2a ) @@ -1635,11 +1603,10 @@ ROM_START( fantsia2a ) ROM_LOAD( "obj1.1i", 0x00000, 0x80000, CRC(52e6872a) SHA1(7e5274b9a415ee0e536cd3b87f73d3eae9644669) ) ROM_LOAD( "obj2.2i", 0x80000, 0x80000, CRC(ea6e3861) SHA1(463b40f5441231a0451571a0b8afe1ed0fd4b164) ) - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "music2.1b", 0x00000, 0x80000, CRC(23cc4f9c) SHA1(06b5342c25de966ce590917c571e5b19af1fef7d) ) - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "music1.1a", 0xc0000, 0x80000, CRC(864167c2) SHA1(c454b26b6dea993e6bd64546f92beef05e46d7d7) ) + ROM_LOAD( "music1.1a", 0x80000, 0x80000, CRC(864167c2) SHA1(c454b26b6dea993e6bd64546f92beef05e46d7d7) ) ROM_END /* sole change seems to be copyright date, PCB has chip references instead of grid references. Not correcting all labels in other sets in case these are legitimate labels */ @@ -1660,11 +1627,10 @@ ROM_START( fantsia2n ) ROM_LOAD( "23_OBJ1.U5", 0x00000, 0x80000, CRC(b45c9234) SHA1(b5eeec91b9c6952b338130458405997e1a51bf2f) ) ROM_LOAD( "obj2.2i", 0x80000, 0x80000, CRC(ea6e3861) SHA1(463b40f5441231a0451571a0b8afe1ed0fd4b164) ) - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "music2.1b", 0x00000, 0x80000, CRC(23cc4f9c) SHA1(06b5342c25de966ce590917c571e5b19af1fef7d) ) - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "music1.1a", 0xc0000, 0x80000, CRC(864167c2) SHA1(c454b26b6dea993e6bd64546f92beef05e46d7d7) ) + ROM_LOAD( "music1.1a", 0x80000, 0x80000, CRC(864167c2) SHA1(c454b26b6dea993e6bd64546f92beef05e46d7d7) ) ROM_END ROM_START( wownfant) @@ -1678,11 +1644,10 @@ ROM_START( wownfant) ROM_LOAD( "ep-4001 42750001 u113.bin", 0x00000, 0x80000, CRC(3e77ca1f) SHA1(f946e65a29bc02b89c02b2a869578d38cfe7e2d0) ) ROM_LOAD( "ep-4001 42750001 u112.bin", 0x80000, 0x80000, CRC(51f4b604) SHA1(52e8ce0a2c1b9b00f04e0c775789bc550bad8ae0) ) - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "ep-4001 42750001 u4.bin", 0x00000, 0x80000, CRC(06dc889e) SHA1(726561ff01bbde43669293a6ff7ee22b048b4118) ) // almost the same as fantasia2, just some changes to the sample references in the header - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "ep-4001 42750001 u1.bin", 0xc0000, 0x80000, CRC(864167c2) SHA1(c454b26b6dea993e6bd64546f92beef05e46d7d7) ) + ROM_LOAD( "ep-4001 42750001 u1.bin", 0x80000, 0x80000, CRC(864167c2) SHA1(c454b26b6dea993e6bd64546f92beef05e46d7d7) ) ROM_END ROM_START( galhustl ) // An original PCB has been seen with genuine AFEGA labels @@ -1692,11 +1657,10 @@ ROM_START( galhustl ) // An original PCB has been seen with genuine AFEGA labels ROM_REGION16_BE( 0x100000, "maincpudata", ROMREGION_ERASEFF ) /* 68000 Data */ - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "galhstl1.ub6", 0x00000, 0x80000, CRC(23848790) SHA1(2e77fbe04f46e258daecb4c5917e383c7c06a306) ) // Also found as AFEGA 1 - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "galhstl2.uc6", 0xc0000, 0x80000, CRC(2168e54a) SHA1(87534334b16d3ddc3daefcb1b8086aff44157ccf) ) // Also found as AFEGA 2 + ROM_LOAD( "galhstl2.uc6", 0x80000, 0x80000, CRC(2168e54a) SHA1(87534334b16d3ddc3daefcb1b8086aff44157ccf) ) // Also found as AFEGA 2 ROM_REGION( 0x100000, "gfx1", 0 ) ROM_LOAD( "galhstl5.u5", 0x00000, 0x80000, CRC(44a18f15) SHA1(1217cf7fbbb442358b15016099efeface5dcbd22) ) // Also found as AFEGA 5 @@ -1714,8 +1678,7 @@ ROM_START( pgalvip ) // this set has extra data roms for the gfx ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "afega_12.ub6", 0x00000, 0x20000, CRC(d32a6c0c) SHA1(6f16043ed1e174b42de83462e2ea7a601bac6678) ) - ROM_RELOAD( 0x40000, 0x20000 ) - ROM_LOAD( "afega_11.uc6", 0xc0000, 0x80000, CRC(2168e54a) SHA1(87534334b16d3ddc3daefcb1b8086aff44157ccf) ) + ROM_LOAD( "afega_11.uc6", 0x80000, 0x80000, CRC(2168e54a) SHA1(87534334b16d3ddc3daefcb1b8086aff44157ccf) ) ROM_REGION( 0x100000, "gfx1", 0 ) ROM_LOAD( "afega_17.u5", 0x00000, 0x80000, CRC(a8a50745) SHA1(e51963947c7a7556b8531d172b9d7bf9f321b21b) ) @@ -1728,11 +1691,10 @@ ROM_START( pgalvipa ) // this set is more like Gals Hustler ROM_REGION16_BE( 0x100000, "maincpudata", ROMREGION_ERASEFF ) /* 68000 Data */ - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "pgalvip_1.ub6", 0x00000, 0x20000, CRC(d32a6c0c) SHA1(6f16043ed1e174b42de83462e2ea7a601bac6678) ) - ROM_RELOAD( 0x40000, 0x20000 ) - ROM_LOAD( "pgalvip_2.uc6", 0xc0000, 0x80000, CRC(2168e54a) SHA1(87534334b16d3ddc3daefcb1b8086aff44157ccf) ) + ROM_LOAD( "pgalvip_2.uc6", 0x80000, 0x80000, CRC(2168e54a) SHA1(87534334b16d3ddc3daefcb1b8086aff44157ccf) ) ROM_REGION( 0x100000, "gfx1", 0 ) ROM_LOAD( "pgalvip_5.u5", 0x00000, 0x80000, CRC(2d6e5a90) SHA1(b5487e5764d83dfecd982a8614d213c9075fbee4) ) @@ -1755,11 +1717,10 @@ ROM_START( supmodel ) ROM_REGION( 0x80000, "gfx1", 0 ) /* sprites */ ROM_LOAD( "obj1.13", 0x00000, 0x80000, CRC(832cd451) SHA1(29dfab1d4b7a15f3fe9fbedef41d405a40235a77) ) // sldh - ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* OKIM6295 samples */ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */ ROM_LOAD( "music1.1", 0x00000, 0x80000, CRC(2b1f6655) SHA1(e7b52cf4bd16590c598c375d5a97b724bc9ef631) ) - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_LOAD( "music2.2", 0xc0000, 0x80000, CRC(cccae65a) SHA1(5e4e2e51884eaf191f103aa189ff33371fc91d6d) ) + ROM_LOAD( "music2.2", 0x80000, 0x80000, CRC(cccae65a) SHA1(5e4e2e51884eaf191f103aa189ff33371fc91d6d) ) ROM_END @@ -1800,10 +1761,9 @@ ROM_START( zipzap ) ROM_REGION( 0x100000, "gfx1", 0 ) // sprites ROM_LOAD( "u5.bin", 0x000000, 0x80000, CRC(c274d8b5) SHA1(2c45961aaf8311f027a734df7e33fe085dfdd099) ) - ROM_REGION( 0x140000, "oki", 0 ) /* Samples */ + ROM_REGION( 0x100000, "oki", 0 ) /* Samples */ ROM_LOAD( "snd.bin", 0x00000, 0x80000, CRC(bc20423e) SHA1(1f4bd52ec4f9b3b3e6b10ac2b3afaadf76a2c7c9) ) - ROM_RELOAD( 0x40000, 0x80000 ) - ROM_RELOAD( 0xc0000, 0x80000 ) + ROM_RELOAD( 0x80000, 0x80000 ) ROM_END @@ -1853,41 +1813,41 @@ DRIVER_INIT_MEMBER(expro02_state,expro02) * *************************************/ -GAME( 1990, galsnew, 0, expro02, expro02, expro02_state, expro02, ROT90, "Kaneko", "Gals Panic (US, EXPRO-02 PCB)", MACHINE_NO_COCKTAIL ) -GAME( 1990, galsnewa, galsnew, expro02, galsnewa, expro02_state, expro02, ROT90, "Kaneko", "Gals Panic (Export, EXPRO-02 PCB)", MACHINE_NO_COCKTAIL ) -GAME( 1990, galsnewj, galsnew, expro02, galsnewj, expro02_state, expro02, ROT90, "Kaneko (Taito license)", "Gals Panic (Japan, EXPRO-02 PCB)", MACHINE_NO_COCKTAIL ) -GAME( 1990, galsnewk, galsnew, expro02, galsnewj, expro02_state, expro02, ROT90, "Kaneko (Inter license)", "Gals Panic (Korea, EXPRO-02 PCB)", MACHINE_NO_COCKTAIL ) +GAME( 1990, galsnew, 0, expro02, expro02, expro02_state, expro02, ROT90, "Kaneko", "Gals Panic (US, EXPRO-02 PCB)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1990, galsnewa, galsnew, expro02, galsnewa, expro02_state, expro02, ROT90, "Kaneko", "Gals Panic (Export, EXPRO-02 PCB)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1990, galsnewj, galsnew, expro02, galsnewj, expro02_state, expro02, ROT90, "Kaneko (Taito license)", "Gals Panic (Japan, EXPRO-02 PCB)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1990, galsnewk, galsnew, expro02, galsnewj, expro02_state, expro02, ROT90, "Kaneko (Inter license)", "Gals Panic (Korea, EXPRO-02 PCB)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) /* the first version of Fantasia clones the EXPRO02 almost exactly, including the encrypted tiles*/ -GAME( 1994, fantasia, 0, comad, fantasia, expro02_state, expro02, ROT90, "Comad & New Japan System", "Fantasia (940429 PCB, set 1)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1994, fantasiab, fantasia, comad, fantasia, expro02_state, expro02, ROT90, "Comad & New Japan System", "Fantasia (940429 PCB, set 2)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1994, fantasiaa, fantasia, comad, fantasia, expro02_state, expro02, ROT90, "Comad & New Japan System", "Fantasia (940307 PCB)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1994, fantasia, 0, comad, fantasia, expro02_state, expro02, ROT90, "Comad & New Japan System", "Fantasia (940429 PCB, set 1)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1994, fantasiab, fantasia, comad, fantasia, expro02_state, expro02, ROT90, "Comad & New Japan System", "Fantasia (940429 PCB, set 2)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1994, fantasiaa, fantasia, comad, fantasia, expro02_state, expro02, ROT90, "Comad & New Japan System", "Fantasia (940307 PCB)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) /* subsequent releases remove the encrypted tile (View2 layer) but leave the unused writes to it in the program code */ -GAME( 1994, fantasian,fantasia, fantasia, fantasiaa, driver_device, 0, ROT90, "Comad & New Japan System", "Fantasia (940803 PCB)", MACHINE_NO_COCKTAIL ) +GAME( 1994, fantasian,fantasia, fantasia, fantasiaa, driver_device, 0, ROT90, "Comad & New Japan System", "Fantasia (940803 PCB)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1994, supmodel, 0, supmodel, fantasiaa, driver_device, 0, ROT90, "Comad & New Japan System", "Super Model",MACHINE_NO_COCKTAIL ) +GAME( 1994, supmodel, 0, supmodel, fantasiaa, driver_device, 0, ROT90, "Comad & New Japan System", "Super Model",MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1995, newfant, 0, fantasia, fantasiaa, driver_device, 0, ROT90, "Comad & New Japan System", "New Fantasia (1995 copyright)", MACHINE_NO_COCKTAIL ) // the only difference between the two is the gfx rom containing the copyright -GAME( 1994, newfanta, newfant, fantasia, fantasiaa, driver_device, 0, ROT90, "Comad & New Japan System", "New Fantasia (1994 copyright)", MACHINE_NO_COCKTAIL ) -GAME( 1995, fantsy95, newfant, fantasia, fantasiaa, driver_device, 0, ROT90, "Hi-max Technology Inc.", "Fantasy '95", MACHINE_NO_COCKTAIL ) +GAME( 1995, newfant, 0, fantasia, fantasiaa, driver_device, 0, ROT90, "Comad & New Japan System", "New Fantasia (1995 copyright)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // the only difference between the two is the gfx rom containing the copyright +GAME( 1994, newfanta, newfant, fantasia, fantasiaa, driver_device, 0, ROT90, "Comad & New Japan System", "New Fantasia (1994 copyright)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1995, fantsy95, newfant, fantasia, fantasiaa, driver_device, 0, ROT90, "Hi-max Technology Inc.", "Fantasy '95", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // the PCB label (A/B) could be related to the 3 different levels of nudity Comad offered -GAME( 1996, missw96, 0, fantasia, missw96, driver_device, 0, ROT0, "Comad", "Miss World '96 (Nude) (C-3000A PCB, set 1)", MACHINE_NO_COCKTAIL ) -GAME( 1996, missw96a, missw96, fantasia, missw96, driver_device, 0, ROT0, "Comad", "Miss World '96 (Nude) (C-3000A PCB, set 2)", MACHINE_NO_COCKTAIL ) -GAME( 1996, missw96b, missw96, fantasia, missw96, driver_device, 0, ROT0, "Comad", "Miss World '96 (Nude) (C-3000A PCB, set 3)", MACHINE_NO_COCKTAIL ) -GAME( 1996, missw96c, missw96, fantasia, missw96, driver_device, 0, ROT0, "Comad", "Miss World '96 (Nude) (C-3000B PCB)", MACHINE_NO_COCKTAIL ) +GAME( 1996, missw96, 0, fantasia, missw96, driver_device, 0, ROT0, "Comad", "Miss World '96 (Nude) (C-3000A PCB, set 1)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1996, missw96a, missw96, fantasia, missw96, driver_device, 0, ROT0, "Comad", "Miss World '96 (Nude) (C-3000A PCB, set 2)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1996, missw96b, missw96, fantasia, missw96, driver_device, 0, ROT0, "Comad", "Miss World '96 (Nude) (C-3000A PCB, set 3)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1996, missw96c, missw96, fantasia, missw96, driver_device, 0, ROT0, "Comad", "Miss World '96 (Nude) (C-3000B PCB)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1996, missmw96, missw96, fantasia, missw96, driver_device, 0, ROT0, "Comad", "Miss Mister World '96 (Nude)", MACHINE_NO_COCKTAIL ) +GAME( 1996, missmw96, missw96, fantasia, missw96, driver_device, 0, ROT0, "Comad", "Miss Mister World '96 (Nude)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1996, smissw, 0, smissw, missw96, driver_device, 0, ROT0, "Comad", "Super Miss World", MACHINE_NO_COCKTAIL ) // 951127 PCB +GAME( 1996, smissw, 0, smissw, missw96, driver_device, 0, ROT0, "Comad", "Super Miss World", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // 951127 PCB -GAME( 1997, fantsia2, 0, fantsia2, missw96, driver_device, 0, ROT0, "Comad", "Fantasia II (Explicit)", MACHINE_NO_COCKTAIL ) -GAME( 1997, fantsia2a,fantsia2, fantsia2, missw96, driver_device, 0, ROT0, "Comad", "Fantasia II (Less Explicit)", MACHINE_NO_COCKTAIL ) -GAME( 1998, fantsia2n,fantsia2, fantsia2, missw96, driver_device, 0, ROT0, "Comad", "Fantasia II (1998)", MACHINE_NO_COCKTAIL ) +GAME( 1997, fantsia2, 0, fantsia2, missw96, driver_device, 0, ROT0, "Comad", "Fantasia II (Explicit)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1997, fantsia2a,fantsia2, fantsia2, missw96, driver_device, 0, ROT0, "Comad", "Fantasia II (Less Explicit)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1998, fantsia2n,fantsia2, fantsia2, missw96, driver_device, 0, ROT0, "Comad", "Fantasia II (1998)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 2002, wownfant, 0, fantsia2, missw96, driver_device, 0, ROT0, "Comad", "WOW New Fantasia", MACHINE_NO_COCKTAIL ) +GAME( 2002, wownfant, 0, fantsia2, missw96, driver_device, 0, ROT0, "Comad", "WOW New Fantasia", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1996, pgalvip, 0, galhustl, galhustl, driver_device, 0, ROT0, "ACE International / Afega","Pocket Gals V.I.P (set 1)", MACHINE_IMPERFECT_GRAPHICS ) // roms were all AFEGA stickered, select screen seems wrong? maybe not a final version. -GAME( 1997, pgalvipa, pgalvip, galhustl, galhustl, driver_device, 0, ROT0, "<unknown>", "Pocket Gals V.I.P (set 2)", 0 ) -GAME( 1997, galhustl, pgalvip, galhustl, galhustl, driver_device, 0, ROT0, "ACE International", "Gals Hustler", 0 ) // hack of the above? +GAME( 1996, pgalvip, 0, galhustl, galhustl, driver_device, 0, ROT0, "ACE International / Afega","Pocket Gals V.I.P (set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // roms were all AFEGA stickered, select screen seems wrong? maybe not a final version. +GAME( 1997, pgalvipa, pgalvip, galhustl, galhustl, driver_device, 0, ROT0, "<unknown>", "Pocket Gals V.I.P (set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1997, galhustl, pgalvip, galhustl, galhustl, driver_device, 0, ROT0, "ACE International", "Gals Hustler", MACHINE_SUPPORTS_SAVE ) // hack of the above? -GAME( 1995, zipzap, 0, zipzap, zipzap, driver_device, 0, ROT90, "Barko Corp", "Zip & Zap", MACHINE_IMPERFECT_GRAPHICS|MACHINE_IMPERFECT_SOUND ) +GAME( 1995, zipzap, 0, zipzap, zipzap, driver_device, 0, ROT90, "Barko Corp", "Zip & Zap", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/feversoc.cpp b/src/mame/drivers/feversoc.cpp index a30a9c76873..9b4f1132140 100644 --- a/src/mame/drivers/feversoc.cpp +++ b/src/mame/drivers/feversoc.cpp @@ -8,11 +8,14 @@ A down-grade of the Seibu SPI Hardware with SH-2 as main cpu. driver by Angelo Salese & Nicola Salmoria +The input routines are very convoluted in comparison to previous Seibu games, +looping over a complex control structure. Could these be derived from the +"Touch Panel System" DVD mahjong games Seibu released under the CATS label? + TODO: -- Determine what buttons 5-7 actually do - Layout including lamps -- Add hopper, etc. -- Figure out remaining DIPs +- Hook up a ticket dispenser and solve the "HOPPER ERROR" issue +- Do button 5 or remaining DIPs actually do anything outside service mode? ============================================================================ @@ -222,11 +225,12 @@ static GFXDECODE_START( feversoc ) GFXDECODE_END static INPUT_PORTS_START( feversoc ) + // The "ANALIZE" input shown in test mode does not exist on this hardware. PORT_START("IN0") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE ) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_NAME("Key In (Service)") PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Hopper") PORT_TOGGLE PORT_CODE(KEYCODE_H) PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) @@ -248,9 +252,9 @@ static INPUT_PORTS_START( feversoc ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Stop 2 (BTN2)") PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Stop 3 (BTN3)") PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Bet (BTN4)") - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_NAME("BTN5") // ? - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_NAME("BTN6") // ? - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_GAMBLE_HALF ) PORT_NAME("BTN7") // ? + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Unknown (BTN5)") PORT_CODE(KEYCODE_J) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_NAME("Key Out (BTN6)") + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_NAME("Coin Out (BTN7)") PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Reset") PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END diff --git a/src/mame/drivers/fidel6502.cpp b/src/mame/drivers/fidel6502.cpp index 18de1e788c2..49e965f6f0d 100644 --- a/src/mame/drivers/fidel6502.cpp +++ b/src/mame/drivers/fidel6502.cpp @@ -191,7 +191,6 @@ PCB photos show only a 3MHz XTAL. ****************************************************************************** - Sensory Chess Challenger "9" (SC9) 2 versions were available, the newer version was 2MHz and included the Budapest program. --------------------------------- @@ -819,6 +818,11 @@ static ADDRESS_MAP_START( sc9_map, AS_PROGRAM, 8, fidel6502_state ) AM_RANGE(0xc000, 0xffff) AM_ROM ADDRESS_MAP_END +static ADDRESS_MAP_START( sc9b_map, AS_PROGRAM, 8, fidel6502_state ) + AM_RANGE(0xa000, 0xa007) AM_MIRROR(0x1ff8) AM_READ(sc12_input_r) + AM_IMPORT_FROM( sc9_map ) +ADDRESS_MAP_END + // SC12/6086 @@ -1357,6 +1361,13 @@ static MACHINE_CONFIG_START( sc9, fidel6502_state ) MCFG_SOFTWARE_LIST_ADD("cart_list", "fidel_scc") MACHINE_CONFIG_END +static MACHINE_CONFIG_DERIVED( sc9b, sc9 ) + + /* basic machine hardware */ + MCFG_CPU_MODIFY("maincpu") + MCFG_CPU_PROGRAM_MAP(sc9b_map) +MACHINE_CONFIG_END + static MACHINE_CONFIG_START( sc12, fidel6502_state ) /* basic machine hardware */ @@ -1553,6 +1564,12 @@ ROM_START( fscc9 ) ROM_LOAD("b31", 0xe000, 0x2000, CRC(cbaf97d7) SHA1(7ed8e68bb74713d9e2ff1d9c037012320b7bfcbf) ) // " ROM_END +ROM_START( fscc9b ) // this one came from an overclocked board, let's assume the roms were unmodified + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("b30", 0xc000, 0x2000, CRC(65288753) SHA1(651f5ca5969ddd72a20cbebdec2de83c4bf10650) ) + ROM_LOAD("b31", 0xe000, 0x2000, CRC(238b092f) SHA1(7ddffc6dba822aee9d8ad6815b23024ed5cdfd26) ) +ROM_END + ROM_START( fscc12 ) ROM_REGION( 0x10000, "maincpu", 0 ) @@ -1597,7 +1614,8 @@ CONS( 1983, super9ccsp, super9cc, 0, su9, su9g, driver_device, 0, CONS( 1983, super9ccg, super9cc, 0, su9, su9g, driver_device, 0, "Fidelity Electronics", "Super 9 Sensory Chess Challenger (German)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1983, super9ccfr, super9cc, 0, su9, su9g, driver_device, 0, "Fidelity Electronics", "Super 9 Sensory Chess Challenger (French)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1982, fscc9, 0, 0, sc9, sc12, driver_device, 0, "Fidelity Electronics", "Sensory Chess Challenger 9", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1982, fscc9, 0, 0, sc9, sc12, driver_device, 0, "Fidelity Electronics", "Sensory Chess Challenger 9 (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1982, fscc9b, fscc9, 0, sc9b, sc12, driver_device, 0, "Fidelity Electronics", "Sensory Chess Challenger 9 (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1984, fscc12, 0, 0, sc12, sc12, driver_device, 0, "Fidelity Electronics", "Sensory Chess Challenger 12-B", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1987, fexcel, 0, 0, fexcel, fexcel, driver_device, 0, "Fidelity Electronics", "Excellence (model 6080/6093)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/drivers/goldstar.cpp b/src/mame/drivers/goldstar.cpp index 50c05729146..b3d2011f7c8 100644 --- a/src/mame/drivers/goldstar.cpp +++ b/src/mame/drivers/goldstar.cpp @@ -14652,11 +14652,17 @@ ROM_END Custom Hardware Notes: + To initialize the game the first time, enter BOOKS/STATS/SETUP (Key 0), + and advance through the menus with RESET key (key R). When finish press + again BOOKS/STATS/SETUP (Key 0) to exit the setup mode. + + --- + GFX Bank 1 (chars and BG graphics) is colors-accurate. GFX Bank 2 needs some work... - Seems that there is an extra layer for the bonus graphics. - This graphic is taken from Bank 2, and is the "representative" + There is a window that should shows the bonus graphics. + This graphic icon is taken from Bank 2, and is the "representative" for the chosen gfx set. Code writes the bonus graphics at 9A80-9A89, and the "reel scroll" @@ -14670,6 +14676,11 @@ ROM_END ...and written 0x10 at B0C0-B0FF. + + The taiwanese hardware needs better decoded reels graphics ROMs, + The chars/text graphics are properly decodes, but texts strings + look bad in the game. + *******************************************************************************************/ /* @@ -15552,6 +15563,15 @@ DRIVER_INIT_MEMBER(wingco_state, flaming7) { src2[i] = BITSWAP8(src2[i], 3, 4, 2, 5, 1, 6, 0, 7); // OK } + +/* Patch to bypass the iButton electronic serial number check. + + 5D79: jumps to $5D83 for the demo game. + just patched to jump to $5D80 (jmp $6115) + where the check is succesfull. +*/ + UINT8 *ROM = memregion("maincpu")->base(); + ROM[0x5d7a] = 0x05; } /* @@ -15563,6 +15583,15 @@ DRIVER_INIT_MEMBER(wingco_state, flaming7) */ DRIVER_INIT_MEMBER(wingco_state, flam7_tw) { +/* Patch to bypass the iButton electronic serial number check. + + 60B2: After last compare, code jumps to $60BC for the demo game. + Just patched to jump to $60B9 (jmp $644E) where the check + is succesfull. +*/ + UINT8 *ROM = memregion("maincpu")->base(); + ROM[0x60b3] = 0x05; + } @@ -15663,11 +15692,11 @@ GAMEL( 1993, bingownga, bingowng, bingownga,bingownga,driver_device, 0, // --- Flaming 7's hardware (W-4 derivative) --- GAME( 199?, fl7_3121, 0, flam7_w4, flam7_w4, driver_device, 0, ROT0, "Cyberdyne Systems", "Flaming 7 (W4 Hardware, Red, White & Blue 7's + Hollywood Nights)", 0 ) -GAME( 199?, fl7_50, 0, flaming7, flaming7, wingco_state, flaming7, ROT0, "Cyberdyne Systems", "Flaming 7 (Custom Hardware, Main, 50 Bonus)", MACHINE_NOT_WORKING ) -GAME( 199?, fl7_500, fl7_50, flaming7, flaming7, wingco_state, flaming7, ROT0, "Cyberdyne Systems", "Flaming 7 (Custom Hardware, Main, 500 Bonus)", MACHINE_NOT_WORKING ) -GAME( 199?, fl7_2000, fl7_50, flaming7, flaming7, wingco_state, flaming7, ROT0, "Cyberdyne Systems", "Flaming 7 (Custom Hardware, Main, 2000 Bonus)", MACHINE_NOT_WORKING ) -GAME( 199?, fl7_2k16, fl7_50, flaming7, flaming7, wingco_state, flaming7, ROT0, "Cyberdyne Systems", "Flaming 7 (Custom Hardware, Egyptian Gold, 2000 Bonus)", MACHINE_NOT_WORKING ) -GAME( 199?, fl7_tw, fl7_50, flam7_tw, flaming7, wingco_state, flam7_tw, ROT0, "Cyberdyne Systems", "Flaming 7 (Taiwanese Hardware, unknown version)", MACHINE_NOT_WORKING ) // needs proper gfx roms decryption. +GAME( 199?, fl7_50, 0, flaming7, flaming7, wingco_state, flaming7, ROT0, "Cyberdyne Systems", "Flaming 7 (Custom Hardware, Main, 50 Bonus)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 199?, fl7_500, fl7_50, flaming7, flaming7, wingco_state, flaming7, ROT0, "Cyberdyne Systems", "Flaming 7 (Custom Hardware, Main, 500 Bonus)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 199?, fl7_2000, fl7_50, flaming7, flaming7, wingco_state, flaming7, ROT0, "Cyberdyne Systems", "Flaming 7 (Custom Hardware, Main, 2000 Bonus)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 199?, fl7_2k16, fl7_50, flaming7, flaming7, wingco_state, flaming7, ROT0, "Cyberdyne Systems", "Flaming 7 (Custom Hardware, Egyptian Gold, 2000 Bonus)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 199?, fl7_tw, fl7_50, flam7_tw, flaming7, wingco_state, flam7_tw, ROT0, "Cyberdyne Systems", "Flaming 7 (Taiwanese Hardware, unknown version)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_GRAPHICS ) // needs proper reels gfx roms decryption. // --- Wing W-8 hardware --- diff --git a/src/mame/drivers/hk68v10.cpp b/src/mame/drivers/hk68v10.cpp index 364161fcf8b..cab10d05ac0 100644 --- a/src/mame/drivers/hk68v10.cpp +++ b/src/mame/drivers/hk68v10.cpp @@ -152,16 +152,11 @@ * ---------------------------------------------------------- * * TODO: - * - Dump the ROMs (DONE) - * - Setup a working address map (DONE) - * - Fix terminal for HBUG (DONE) * - Add VME bus driver * - Add DMA/MMU devices * - Add CIO port * - ADD SCSI controller device * - dump PALs and describe descrete logic - * - Setup BAUD generation correctly, (eg find that x32 divider) - * it is a multilayer PCB so very hard to trace. * - Add LED:s * - Add Jumpers and strap areas * - Find and Boot Heurikon Unix from a SCSI device @@ -183,9 +178,15 @@ #define logerror printf #endif +#ifdef _MSC_VER +#define FUNCNAME __func__ +#else +#define FUNCNAME __PRETTY_FUNCTION__ +#endif + #define BAUDGEN_CLOCK XTAL_19_6608MHz /* Raltron */ -// TODO: figure out the correct divider circuit -#define SCC_CLOCK (BAUDGEN_CLOCK / 5) /* Giving 9600 but not the 4.9152MHz the documentation says... */ +#define SCC_CLOCK (BAUDGEN_CLOCK / 4) /* through a 74LS393 counter */ + class hk68v10_state : public driver_device { public: @@ -240,9 +241,9 @@ INPUT_PORTS_END /* Start it up */ void hk68v10_state::machine_start () { - LOG (("%d %s\n", m_maincpu->total_cycles(), __func__)); + LOG(("%s\n", FUNCNAME)); - /* Setup pointer to bootvector in ROM for bootvector handler bootvect_r */ + /* Setup pointer to bootvector in ROM for bootvector handler bootvect_r */ m_sysrom = (UINT16*)(memregion ("maincpu")->base () + 0x0fc0000); } @@ -254,11 +255,11 @@ void hk68v10_state::machine_start () */ void hk68v10_state::machine_reset () { - LOG (("%d %s\n", m_maincpu->total_cycles(), __func__)); + LOG(("%s\n", FUNCNAME)); - /* Reset pointer to bootvector in ROM for bootvector handler bootvect_r */ - if (m_sysrom == &m_sysram[0]) /* Condition needed because memory map is not setup first time */ - m_sysrom = (UINT16*)(memregion ("maincpu")->base () + 0x0fc0000); + /* Reset pointer to bootvector in ROM for bootvector handler bootvect_r */ + if (m_sysrom == &m_sysram[0]) /* Condition needed because memory map is not setup first time */ + m_sysrom = (UINT16*)(memregion ("maincpu")->base () + 0x0fc0000); } /* Boot vector handler, the PCB hardwires the first 8 bytes from 0xfc0000 to 0x0 at reset*/ @@ -269,35 +270,35 @@ void hk68v10_state::machine_reset () FC002E: move.l #$0, $4.l # There is for sure some hardware mapping going in here */ READ16_MEMBER (hk68v10_state::bootvect_r){ - //LOG (("bootvect_r %s\n", m_sysrom != &m_sysram[0] ? "as reset" : "as swapped")); - return m_sysrom[offset]; + LOG(("%s %s\n", FUNCNAME, m_sysrom != &m_sysram[0] ? "as reset" : "as swapped")); + return m_sysrom[offset]; } WRITE16_MEMBER (hk68v10_state::bootvect_w){ - LOG (("bootvect_w offset %08x, mask %08x, data %04x\n", offset, mem_mask, data)); - m_sysram[offset % sizeof(m_sysram)] &= ~mem_mask; - m_sysram[offset % sizeof(m_sysram)] |= (data & mem_mask); - m_sysrom = &m_sysram[0]; // redirect all upcomming accesses to masking RAM until reset. + LOG (("%s offset %08x, mask %08x, data %04x\n", FUNCNAME, offset, mem_mask, data)); + m_sysram[offset % sizeof(m_sysram)] &= ~mem_mask; + m_sysram[offset % sizeof(m_sysram)] |= (data & mem_mask); + m_sysrom = &m_sysram[0]; // redirect all upcomming accesses to masking RAM until reset. } #if 0 /* Dummy VME access methods until the VME bus device is ready for use */ READ16_MEMBER (hk68v10_state::vme_a24_r){ - LOG (("vme_a24_r\n")); - return (UINT16) 0; + LOG(("%s\n", FUNCNAME)); + return (UINT16) 0; } WRITE16_MEMBER (hk68v10_state::vme_a24_w){ - LOG (("vme_a24_w\n")); + LOG(("%s\n", FUNCNAME)); } READ16_MEMBER (hk68v10_state::vme_a16_r){ - LOG (("vme_16_r\n")); - return (UINT16) 0; + LOG(("%s\n", FUNCNAME)); + return (UINT16) 0; } WRITE16_MEMBER (hk68v10_state::vme_a16_w){ - LOG (("vme_a16_w\n")); + LOG(("%s\n", FUNCNAME)); } #endif @@ -365,16 +366,19 @@ ROM_LOAD16_BYTE ("hk68kv10U12.bin", 0xFC0000, 0x2000, CRC (f2d688e9) SHA1 (e6869 * 'bsf' Boot from floppy (SCSI) * * Setup sequence channel B - * 00 - * 04 4C - x16 clock, 2 stop bits, no parity - * 05 EA - - * 03 E1 - 8 bit, receiver enable, auto enable on - * 09 00 - no reset - * 01 00 - * 0B 56 - * 0C 0B - low baudrate divider - * 0D 00 - hi baudrate divider - * 0E 03 - Baud Rate Generator enabled, PCLK is source + * :scc B Reg 04 <- 4c x16 clock, 2 stop bits, no parity + * :scc B Reg 05 <- ea Setting up the transmitter, Transmitter Enable 1, Transmitter Bits/Character 8, Send Break 0, RTS=1, DTR=1 + * :scc B Reg 03 <- e1 Setting up the receiver, Receiver Enable 1, Auto Enables 1, Receiver Bits/Character 8 + * :scc B Reg 09 <- 00 Master Interrupt Control - No reset 02 A&B: RTS=1 DTR=1 INT=0 Vector generated + * :scc B Reg 01 <- 00 Ext INT:0 Tx INT:0 Parity SC:0 Wait/Ready Enable:0 as Wait on Transmit, Rx INT:0 + * :scc B Reg 0b <- 56 Clock Mode Control 55 Clock type TTL level on RTxC pin, RCV CLK=BRG, TRA CLK=BRG, TRxC pin is Output, TRxC CLK=BRG - not_implemented + * :scc B Reg 0c <- 0b Low byte of Time Constant for Baudrate generator -> 38400 baud + * :scc B Reg 0d <- 00 High byte of Time Constant for Baudrate generator + * :scc B Reg 0e <- 03 Misc Control Bits DPLL NULL Command, BRG enabled SRC=PCLK, BRG SRC bps=307200=PCLK 4915200/16, BRG OUT 9600=307200/16(32) + * Repeated for :scc A + * :scc B Reg 0c <- 0e Low byte of Time Constant for Baudrate generator -> 9600 baud + * :scc B Reg 0d <- 00 High byte of Time Constant for Baudrate generator + * Repeated for :scc A */ ROM_END diff --git a/src/mame/drivers/myb3k.cpp b/src/mame/drivers/myb3k.cpp index 283cb63d531..97ceaf9b2fe 100644 --- a/src/mame/drivers/myb3k.cpp +++ b/src/mame/drivers/myb3k.cpp @@ -25,16 +25,16 @@ public: m_maincpu(*this, "maincpu"), m_fdc(*this, "fdc"), m_crtc(*this, "crtc"), - m_floppy0(*this, "fdc:0:8dsdd"), - m_floppy1(*this, "fdc:1:8dsdd"), + m_floppy0(*this, "fdc:0"), + m_floppy1(*this, "fdc:1"), m_p_vram(*this, "p_vram"), m_palette(*this, "palette") { } required_device<cpu_device> m_maincpu; required_device<mb8877_t> m_fdc; required_device<mc6845_device> m_crtc; - required_device<floppy_image_device> m_floppy0; - required_device<floppy_image_device> m_floppy1; + required_device<floppy_connector> m_floppy0; + required_device<floppy_connector> m_floppy1; DECLARE_WRITE8_MEMBER(myb3k_6845_address_w); DECLARE_WRITE8_MEMBER(myb3k_6845_data_w); DECLARE_WRITE8_MEMBER(myb3k_video_mode_w); @@ -130,8 +130,8 @@ WRITE8_MEMBER( myb3k_state::myb3k_fdc_output_w ) /* TODO: complete guesswork! (it just does a 0x24 -> 0x20 in there) */ floppy_image_device *floppy = nullptr; - if (data & 1) floppy = m_floppy0; - if (data & 2) floppy = m_floppy1; + if (data & 1) floppy = m_floppy0->get_device(); + if (data & 2) floppy = m_floppy1->get_device(); if (floppy) { diff --git a/src/mame/drivers/naomi.cpp b/src/mame/drivers/naomi.cpp index a96abadce77..2e14c2a5269 100644 --- a/src/mame/drivers/naomi.cpp +++ b/src/mame/drivers/naomi.cpp @@ -9253,11 +9253,11 @@ ROM_START( maxspeed ) ROM_REGION( 0x9000000, "rom_board", ROMREGION_ERASE) ROM_LOAD( "ax0501p01.ic18", 0x0000000, 0x0800000, CRC(e1651867) SHA1(49caf82f4b111da312b14bb0a9c31e3732b4b24e) ) - ROM_LOAD( "ax0501m01.ic11", 0x0800000, 0x1000000, CRC(4a847a59) SHA1(7808bcd357b85861082b426dbe34a20ae7016f6a) ) - ROM_LOAD( "ax0502m01.ic12", 0x1000000, 0x1000000, CRC(2580237f) SHA1(2e92c940f95edae33d6a7e8a071544a9083a0fd6) ) - ROM_LOAD( "ax0503m01.ic13", 0x2000000, 0x1000000, CRC(e5a3766b) SHA1(1fe6e072adad27ac43c0bff04e3c448678aabc18) ) - ROM_LOAD( "ax0504m01.ic14", 0x3000000, 0x1000000, CRC(7955b55a) SHA1(927f58d6961e702c2a8afce79bac5e5cff3dfed6) ) - ROM_LOAD( "ax0505m01.ic15", 0x4000000, 0x1000000, CRC(e8ccc660) SHA1(a5f414f200a0d41e958430d0fc2d4e1fda1cc67c) ) + ROM_LOAD( "ax0501m01.ic11", 0x1000000, 0x1000000, CRC(4a847a59) SHA1(7808bcd357b85861082b426dbe34a20ae7016f6a) ) + ROM_LOAD( "ax0502m01.ic12", 0x2000000, 0x1000000, CRC(2580237f) SHA1(2e92c940f95edae33d6a7e8a071544a9083a0fd6) ) + ROM_LOAD( "ax0503m01.ic13", 0x3000000, 0x1000000, CRC(e5a3766b) SHA1(1fe6e072adad27ac43c0bff04e3c448678aabc18) ) + ROM_LOAD( "ax0504m01.ic14", 0x4000000, 0x1000000, CRC(7955b55a) SHA1(927f58d6961e702c2a8afce79bac5e5cff3dfed6) ) + ROM_LOAD( "ax0505m01.ic15", 0x5000000, 0x1000000, CRC(e8ccc660) SHA1(a5f414f200a0d41e958430d0fc2d4e1fda1cc67c) ) ROM_REGION( 4, "rom_key", 0 ) ROM_LOAD( "ax0501f01.bin", 0, 4, CRC(c35d9a95) SHA1(bf260caf33821be51014b06480a11ec982fa4fcd) ) diff --git a/src/mame/drivers/ohmygod.cpp b/src/mame/drivers/ohmygod.cpp index 6eeae4c9b52..a77393d241a 100644 --- a/src/mame/drivers/ohmygod.cpp +++ b/src/mame/drivers/ohmygod.cpp @@ -24,13 +24,11 @@ WRITE16_MEMBER(ohmygod_state::ohmygod_ctrl_w) { if (ACCESSING_BITS_0_7) { - UINT8 *rom = memregion("oki")->base(); - /* ADPCM bank switch */ if (m_sndbank != ((data >> m_adpcm_bank_shift) & 0x0f)) { m_sndbank = (data >> m_adpcm_bank_shift) & 0x0f; - memcpy(rom + 0x20000, rom + 0x40000 + 0x20000 * m_sndbank, 0x20000); + membank("okibank")->set_entry(m_sndbank); } } if (ACCESSING_BITS_8_15) @@ -61,6 +59,10 @@ static ADDRESS_MAP_START( ohmygod_map, AS_PROGRAM, 16, ohmygod_state ) AM_RANGE(0xd00000, 0xd00001) AM_WRITE(ohmygod_spritebank_w) ADDRESS_MAP_END +static ADDRESS_MAP_START( oki_map, AS_0, 8, ohmygod_state ) + AM_RANGE(0x00000, 0x1ffff) AM_ROM + AM_RANGE(0x20000, 0x3ffff) AM_ROMBANK("okibank") +ADDRESS_MAP_END static INPUT_PORTS_START( ohmygod ) PORT_START("P1") @@ -297,6 +299,8 @@ GFXDECODE_END void ohmygod_state::machine_start() { + membank("okibank")->configure_entries(0, 16, memregion("oki")->base(), 0x20000); + save_item(NAME(m_spritebank)); save_item(NAME(m_scrollx)); save_item(NAME(m_scrolly)); @@ -305,11 +309,7 @@ void ohmygod_state::machine_start() void ohmygod_state::machine_reset() { - UINT8 *rom = memregion("oki")->base(); - m_sndbank = 0; - memcpy(rom + 0x20000, rom + 0x40000 + 0x20000 * m_sndbank, 0x20000); - m_spritebank = 0; m_scrollx = 0; m_scrolly = 0; @@ -344,6 +344,7 @@ static MACHINE_CONFIG_START( ohmygod, ohmygod_state ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_OKIM6295_ADD("oki", 14000000/8, OKIM6295_PIN7_HIGH) + MCFG_DEVICE_ADDRESS_MAP(AS_0, oki_map) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -364,10 +365,8 @@ ROM_START( ohmygod ) ROM_REGION( 0x80000, "gfx2", 0 ) ROM_LOAD( "omg-s.120", 0x00000, 0x80000, CRC(6413bd36) SHA1(52c455d727496eae80bfab9460127c4c5a874e32) ) - ROM_REGION( 0x240000, "oki", 0 ) - ROM_LOAD( "omg-g.107", 0x00000, 0x200000, CRC(7405573c) SHA1(f4e7318c0a58f43d3c6370490637aea53b28547e) ) - /* 00000-1ffff is fixed, 20000-3ffff is banked */ - ROM_RELOAD( 0x40000, 0x200000 ) + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "omg-g.107", 0x00000, 0x200000, CRC(7405573c) SHA1(f4e7318c0a58f43d3c6370490637aea53b28547e) ) /* 00000-1ffff is fixed, 20000-3ffff is banked */ ROM_END ROM_START( naname ) @@ -380,10 +379,8 @@ ROM_START( naname ) ROM_REGION( 0x80000, "gfx2", 0 ) ROM_LOAD( "036-spr.120", 0x00000, 0x80000, CRC(e36d8731) SHA1(652709d7884d40459c95761c8abcb394c4b712bf) ) - ROM_REGION( 0x240000, "oki", 0 ) - ROM_LOAD( "036-snd.107", 0x00000, 0x200000, CRC(a3e0caf4) SHA1(35b0eb4ae5b9df1b7c99ec2476a6d834ea50d2e3) ) - /* 00000-1ffff is fixed, 20000-3ffff is banked */ - ROM_RELOAD( 0x40000, 0x200000 ) + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "036-snd.107", 0x00000, 0x200000, CRC(a3e0caf4) SHA1(35b0eb4ae5b9df1b7c99ec2476a6d834ea50d2e3) ) /* 00000-1ffff is fixed, 20000-3ffff is banked */ ROM_END diff --git a/src/mame/drivers/othunder.cpp b/src/mame/drivers/othunder.cpp index 327af7a29a7..cff8f9ff9a5 100644 --- a/src/mame/drivers/othunder.cpp +++ b/src/mame/drivers/othunder.cpp @@ -751,6 +751,44 @@ MACHINE_CONFIG_END ROM_START( othunder ) ROM_REGION( 0x80000, "maincpu", 0 ) /* 512K for 68000 code */ + ROM_LOAD16_BYTE( "b67-20-1.ic63", 0x00000, 0x20000, CRC(851a453b) SHA1(48b8c379e78cd79463f1e24dc23816a97cf819b8) ) + ROM_LOAD16_BYTE( "b67-23-1.ic64", 0x00001, 0x20000, CRC(6e4f3d56) SHA1(99a29c0cbea0aea42355a036aa7f2174ca997872) ) + ROM_LOAD16_BYTE( "b67-14.ic61", 0x40000, 0x20000, CRC(7f3dd724) SHA1(2f2eeae0ee31e20082237b9a947c6848771eb73c) ) + ROM_LOAD16_BYTE( "b67-15.ic62", 0x40001, 0x20000, CRC(e84f62d0) SHA1(3b4a55a14dee7d592467fde9a75bde64deabd27d) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* sound cpu */ + ROM_LOAD( "b67-13.ic40", 0x00000, 0x10000, CRC(2936b4b1) SHA1(39b41643464dd89e456ab6eb15a0ff0aef30afde) ) + + ROM_REGION( 0x80000, "gfx1", 0 ) + ROM_LOAD( "b67-06.ic66", 0x00000, 0x80000, CRC(b9a38d64) SHA1(7ae8165b444d9da6ccdbc4a769535bcbb6738aaa) ) /* SCN */ + + ROM_REGION( 0x200000, "gfx2", 0 ) + ROM_LOAD32_BYTE( "b67-01.ic1", 0x00000, 0x80000, CRC(81ad9acb) SHA1(d9ad3f6332c6ca6b9872da57526a8158a3cf5b2f) ) /* OBJ: each rom has 1 bitplane, forming 16x8 tiles */ + ROM_LOAD32_BYTE( "b67-02.ic2", 0x00001, 0x80000, CRC(c20cd2fb) SHA1(b015e1fe167e19826aa451b45cd143d66a6db83c) ) + ROM_LOAD32_BYTE( "b67-03.ic3", 0x00002, 0x80000, CRC(bc9019ed) SHA1(7eddc83d71be97ce6637e6b35c226d58e6c39c3f) ) + ROM_LOAD32_BYTE( "b67-04.ic4", 0x00003, 0x80000, CRC(2af4c8af) SHA1(b2ae7aad0c59ffc368811f4bd5546dbb6860f9a9) ) + + ROM_REGION16_LE( 0x80000, "user1", 0 ) + ROM_LOAD16_WORD( "b67-05.ic43", 0x00000, 0x80000, CRC(9593e42b) SHA1(54b5538c302a1734ff4b752ab87a8c45d5c6b23d) ) /* index used to create 64x64 sprites on the fly */ + + ROM_REGION( 0x80000, "ymsnd", 0 ) /* ADPCM samples */ + ROM_LOAD( "b67-08.ic67", 0x00000, 0x80000, CRC(458f41fb) SHA1(acca7c95acd1ae7a1cc51fb7fe644ad6d00ff5ac) ) + + ROM_REGION( 0x80000, "ymsnd.deltat", 0 ) /* Delta-T samples */ + ROM_LOAD( "b67-07.ic44", 0x00000, 0x80000, CRC(4f834357) SHA1(f34705ce64870a8b24ec2639505079cc031fb719) ) + + ROM_REGION( 0x0800, "plds", 0 ) + ROM_LOAD( "plhs18p8b-b67-09.ic15", 0x0000, 0x0149, CRC(62035487) SHA1(5d9538ea9eabff324d274772b1e1fc9a9aec9100) ) + ROM_LOAD( "pal16l8a-b67-11.ic36", 0x0200, 0x0104, CRC(3177fb06) SHA1(c128277fe03342d9ec8da3c6e08a404a3f010547) ) + ROM_LOAD( "pal20l8b-b67-12.ic37", 0x0400, 0x0144, CRC(a47c2798) SHA1(8c963efd416b3f6586cb12afb9417dc95c2bc574) ) + ROM_LOAD( "pal20l8b-b67-10.ic33", 0x0600, 0x0144, CRC(4ced09c7) SHA1(519e6152cc5e4cb3ec24c4dc09101dddf22988aa) ) + + ROM_REGION16_BE( 0x80, "eeprom", 0 ) + ROM_LOAD16_WORD( "93c46_eeprom-othunder.ic86", 0x0000, 0x0080, CRC(3729b844) SHA1(f6bb41d293d1e47214f8b2d147991404f3278ebf) ) +ROM_END + +ROM_START( othundero ) + ROM_REGION( 0x80000, "maincpu", 0 ) /* 512K for 68000 code */ ROM_LOAD16_BYTE( "b67-20.ic63", 0x00000, 0x20000, CRC(21439ea2) SHA1(d5b5a194e9698cf43513c0d56146772e8132ab07) ) ROM_LOAD16_BYTE( "b67-23.ic64", 0x00001, 0x20000, CRC(789e9daa) SHA1(15bb0eec68aeea0b9f55889566338c9ce0ac9b5e) ) ROM_LOAD16_BYTE( "b67-14.ic61", 0x40000, 0x20000, CRC(7f3dd724) SHA1(2f2eeae0ee31e20082237b9a947c6848771eb73c) ) @@ -903,7 +941,8 @@ ROM_END -GAME( 1988, othunder, 0, othunder, othunder, driver_device, 0, ORIENTATION_FLIP_X, "Taito Corporation Japan", "Operation Thunderbolt (World)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, othunderu, othunder, othunder, othundu, driver_device, 0, ORIENTATION_FLIP_X, "Taito America Corporation", "Operation Thunderbolt (US)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, othunderuo, othunder, othunder, othundu, driver_device, 0, ORIENTATION_FLIP_X, "Taito America Corporation", "Operation Thunderbolt (US, older)", MACHINE_SUPPORTS_SAVE ) -GAME( 1988, othunderj, othunder, othunder, othundrj, driver_device, 0, ORIENTATION_FLIP_X, "Taito Corporation", "Operation Thunderbolt (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, othunder, 0, othunder, othunder, driver_device, 0, ORIENTATION_FLIP_X, "Taito Corporation Japan", "Operation Thunderbolt (World, rev 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, othundero, othunder, othunder, othunder, driver_device, 0, ORIENTATION_FLIP_X, "Taito Corporation Japan", "Operation Thunderbolt (World)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, othunderu, othunder, othunder, othundu, driver_device, 0, ORIENTATION_FLIP_X, "Taito America Corporation", "Operation Thunderbolt (US, rev 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, othunderuo, othunder, othunder, othundu, driver_device, 0, ORIENTATION_FLIP_X, "Taito America Corporation", "Operation Thunderbolt (US)", MACHINE_SUPPORTS_SAVE ) +GAME( 1988, othunderj, othunder, othunder, othundrj, driver_device, 0, ORIENTATION_FLIP_X, "Taito Corporation", "Operation Thunderbolt (Japan)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/pasopia.cpp b/src/mame/drivers/pasopia.cpp index f76d73402ad..a83adb8872b 100644 --- a/src/mame/drivers/pasopia.cpp +++ b/src/mame/drivers/pasopia.cpp @@ -22,26 +22,18 @@ class pasopia_state : public driver_device { public: pasopia_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_ppi0(*this, "ppi8255_0"), - m_ppi1(*this, "ppi8255_1"), - m_ppi2(*this, "ppi8255_2"), - m_ctc(*this, "z80ctc"), - m_pio(*this, "z80pio"), - m_crtc(*this, "crtc"), - m_palette(*this, "palette") + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_ppi0(*this, "ppi8255_0") + , m_ppi1(*this, "ppi8255_1") + , m_ppi2(*this, "ppi8255_2") + , m_ctc(*this, "z80ctc") + , m_pio(*this, "z80pio") + , m_crtc(*this, "crtc") + , m_palette(*this, "palette") + , m_keyboard(*this, "KEY") { } - required_device<cpu_device> m_maincpu; - required_device<i8255_device> m_ppi0; - required_device<i8255_device> m_ppi1; - required_device<i8255_device> m_ppi2; - required_device<z80ctc_device> m_ctc; - required_device<z80pio_device> m_pio; - required_device<mc6845_device> m_crtc; - required_device<palette_device> m_palette; - DECLARE_WRITE8_MEMBER(pasopia_ctrl_w); DECLARE_WRITE8_MEMBER(vram_addr_lo_w); DECLARE_WRITE8_MEMBER(vram_latch_w); @@ -50,11 +42,13 @@ public: DECLARE_WRITE8_MEMBER(vram_addr_hi_w); DECLARE_WRITE8_MEMBER(screen_mode_w); DECLARE_READ8_MEMBER(rombank_r); - DECLARE_READ8_MEMBER(mux_r); DECLARE_READ8_MEMBER(keyb_r); DECLARE_WRITE8_MEMBER(mux_w); MC6845_UPDATE_ROW(crtc_update_row); + DECLARE_DRIVER_INIT(pasopia); + TIMER_CALLBACK_MEMBER(pio_timer); +private: UINT8 m_hblank; UINT16 m_vram_addr; UINT8 m_vram_latch; @@ -64,15 +58,23 @@ public: bool m_video_wl; bool m_ram_bank; UINT8 *m_p_vram; - DECLARE_DRIVER_INIT(pasopia); - TIMER_CALLBACK_MEMBER(pio_timer); virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; + + required_device<cpu_device> m_maincpu; + required_device<i8255_device> m_ppi0; + required_device<i8255_device> m_ppi1; + required_device<i8255_device> m_ppi2; + required_device<z80ctc_device> m_ctc; + required_device<z80pio_device> m_pio; + required_device<mc6845_device> m_crtc; + required_device<palette_device> m_palette; + required_ioport_array<12> m_keyboard; }; // needed to scan the keyboard, as the pio emulation doesn't do it. -TIMER_CALLBACK_MEMBER(pasopia_state::pio_timer) +TIMER_CALLBACK_MEMBER( pasopia_state::pio_timer ) { m_pio->port_b_write(keyb_r(generic_space(),0,0xff)); } @@ -93,8 +95,8 @@ MC6845_UPDATE_ROW( pasopia_state::crtc_update_row ) { UINT8 inv=0; if (x == cursor_x) inv=0xff; - mem = (ma + x) & 0xfff; - chr = m_p_vram[mem]; + mem = ma + x; + chr = m_p_vram[mem & 0x7ff]; /* get pattern of pixels for that character scanline */ gfx = m_p_chargen[(chr<<3) | ra] ^ inv; @@ -214,28 +216,17 @@ READ8_MEMBER( pasopia_state::rombank_r ) return (m_ram_bank) ? 4 : 0; } -READ8_MEMBER( pasopia_state::mux_r ) -{ - return m_mux_data; -} - READ8_MEMBER( pasopia_state::keyb_r ) { - const char *const keynames[3][4] = { { "KEY0", "KEY1", "KEY2", "KEY3" }, - { "KEY4", "KEY5", "KEY6", "KEY7" }, - { "KEY8", "KEY9", "KEYA", "KEYB" } }; - int i,j; - UINT8 res; - - res = 0; + UINT8 i,j,res = 0; for(j=0;j<3;j++) { - if(m_mux_data & 0x10 << j) + if BIT(m_mux_data, 4+j) { for(i=0;i<4;i++) { - if(m_mux_data & 1 << i) - res |= ioport(keynames[j][i])->read(); + if BIT(m_mux_data, i) + res |= m_keyboard[j*4+i]->read(); } } } @@ -279,11 +270,11 @@ DRIVER_INIT_MEMBER(pasopia_state,pasopia) We preset all banks here, so that bankswitching will incur no speed penalty. 0000 indicates ROMs, 10000 indicates RAM. */ - UINT8 *p_ram = memregion("maincpu")->base(); - membank("bank1")->configure_entries(0, 2, &p_ram[0x00000], 0x10000); - membank("bank2")->configure_entry(0, &p_ram[0x10000]); + UINT8 *ram = memregion("maincpu")->base(); + membank("bank1")->configure_entries(0, 2, &ram[0x00000], 0x10000); + membank("bank2")->configure_entry(0, &ram[0x10000]); - machine().scheduler().timer_pulse(attotime::from_hz(500), timer_expired_delegate(FUNC(pasopia_state::pio_timer),this)); + machine().scheduler().timer_pulse(attotime::from_hz(50), timer_expired_delegate(FUNC(pasopia_state::pio_timer),this)); } static MACHINE_CONFIG_START( pasopia, pasopia_state ) @@ -330,7 +321,6 @@ static MACHINE_CONFIG_START( pasopia, pasopia_state ) MCFG_DEVICE_ADD("z80pio", Z80PIO, XTAL_4MHz) MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) - MCFG_Z80PIO_IN_PA_CB(READ8(pasopia_state, mux_r)) MCFG_Z80PIO_OUT_PA_CB(WRITE8(pasopia_state, mux_w)) MCFG_Z80PIO_IN_PB_CB(READ8(pasopia_state, keyb_r)) MACHINE_CONFIG_END diff --git a/src/mame/drivers/pasopia7.cpp b/src/mame/drivers/pasopia7.cpp index eaf0bce140e..9111e712156 100644 --- a/src/mame/drivers/pasopia7.cpp +++ b/src/mame/drivers/pasopia7.cpp @@ -7,6 +7,9 @@ preliminary driver by Angelo Salese TODO: + - fix problems with keyboard + - can't type the same character more than once + - shift key doesn't work - floppy support (but floppy images are unobtainable at current time) - cassette device; - beeper @@ -33,34 +36,22 @@ class pasopia7_state : public driver_device { public: pasopia7_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_ppi0(*this, "ppi8255_0"), - m_ppi1(*this, "ppi8255_1"), - m_ppi2(*this, "ppi8255_2"), - m_ctc(*this, "z80ctc"), - m_pio(*this, "z80pio"), - m_crtc(*this, "crtc"), - m_fdc(*this, "fdc"), - m_floppy(*this, "fdc:0:525hd"), - m_sn1(*this, "sn1"), - m_sn2(*this, "sn2"), - m_palette(*this, "palette") + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_ppi0(*this, "ppi8255_0") + , m_ppi1(*this, "ppi8255_1") + , m_ppi2(*this, "ppi8255_2") + , m_ctc(*this, "z80ctc") + , m_pio(*this, "z80pio") + , m_crtc(*this, "crtc") + , m_fdc(*this, "fdc") + , m_floppy(*this, "fdc:0:525hd") + , m_sn1(*this, "sn1") + , m_sn2(*this, "sn2") + , m_palette(*this, "palette") + , m_keyboard(*this, "KEY") { } - required_device<cpu_device> m_maincpu; - required_device<i8255_device> m_ppi0; - required_device<i8255_device> m_ppi1; - required_device<i8255_device> m_ppi2; - required_device<z80ctc_device> m_ctc; - required_device<z80pio_device> m_pio; - required_device<mc6845_device> m_crtc; - required_device<upd765a_device> m_fdc; - required_device<floppy_image_device> m_floppy; - required_device<sn76489a_device> m_sn1; - required_device<sn76489a_device> m_sn2; - required_device<palette_device> m_palette; - DECLARE_READ8_MEMBER(vram_r); DECLARE_WRITE8_MEMBER(vram_w); DECLARE_WRITE8_MEMBER(pasopia7_memory_ctrl_w); @@ -72,7 +63,6 @@ public: DECLARE_WRITE8_MEMBER(pasopia7_io_w); DECLARE_READ8_MEMBER(pasopia7_fdc_r); DECLARE_WRITE8_MEMBER(pasopia7_fdc_w); - DECLARE_READ8_MEMBER(mux_r); DECLARE_READ8_MEMBER(keyb_r); DECLARE_WRITE8_MEMBER(mux_w); DECLARE_READ8_MEMBER(crtc_portb_r); @@ -86,6 +76,14 @@ public: DECLARE_WRITE8_MEMBER(nmi_reg_w); DECLARE_READ8_MEMBER(nmi_porta_r); DECLARE_READ8_MEMBER(nmi_portb_r); + TIMER_CALLBACK_MEMBER(pio_timer); + DECLARE_DRIVER_INIT(p7_lcd); + DECLARE_DRIVER_INIT(p7_raster); + DECLARE_VIDEO_START(pasopia7); + DECLARE_PALETTE_INIT(p7_lcd); + UINT32 screen_update_pasopia7(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + +private: UINT8 m_vram_sel; UINT8 m_mio_sel; std::unique_ptr<UINT8[]> m_p7_pal; @@ -111,25 +109,32 @@ public: int m_addr_latch; void pasopia_nmi_trap(); UINT8 m_mux_data; - DECLARE_DRIVER_INIT(p7_lcd); - DECLARE_DRIVER_INIT(p7_raster); virtual void machine_reset() override; - DECLARE_VIDEO_START(pasopia7); - DECLARE_PALETTE_INIT(p7_lcd); - UINT32 screen_update_pasopia7(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void fdc_irq(bool state); - TIMER_CALLBACK_MEMBER(pio_timer); void draw_cg4_screen(bitmap_ind16 &bitmap,const rectangle &cliprect,int width); void draw_tv_screen(bitmap_ind16 &bitmap,const rectangle &cliprect,int width); void draw_mixed_screen(bitmap_ind16 &bitmap,const rectangle &cliprect,int width); + + required_device<cpu_device> m_maincpu; + required_device<i8255_device> m_ppi0; + required_device<i8255_device> m_ppi1; + required_device<i8255_device> m_ppi2; + required_device<z80ctc_device> m_ctc; + required_device<z80pio_device> m_pio; + required_device<mc6845_device> m_crtc; + required_device<upd765a_device> m_fdc; + required_device<floppy_image_device> m_floppy; + required_device<sn76489a_device> m_sn1; + required_device<sn76489a_device> m_sn2; + required_device<palette_device> m_palette; + required_ioport_array<12> m_keyboard; }; #define VDP_CLOCK XTAL_3_579545MHz/4 #define LCD_CLOCK VDP_CLOCK/10 // needed to scan the keyboard, as the pio emulation doesn't do it. -TIMER_CALLBACK_MEMBER(pasopia7_state::pio_timer) +TIMER_CALLBACK_MEMBER( pasopia7_state::pio_timer ) { m_pio->port_b_write(keyb_r(generic_space(),0,0xff)); } @@ -728,28 +733,17 @@ static GFXDECODE_START( pasopia7 ) GFXDECODE_ENTRY( "kanji", 0x00000, p7_chars_16x16, 0, 0x10 ) GFXDECODE_END -READ8_MEMBER( pasopia7_state::mux_r ) -{ - return m_mux_data; -} - READ8_MEMBER( pasopia7_state::keyb_r ) { - const char *const keynames[3][4] = { { "KEY0", "KEY1", "KEY2", "KEY3" }, - { "KEY4", "KEY5", "KEY6", "KEY7" }, - { "KEY8", "KEY9", "KEYA", "KEYB" } }; - int i,j; - UINT8 res; - - res = 0; + UINT8 i,j,res = 0; for(j=0;j<3;j++) { - if(m_mux_data & 0x10 << j) + if BIT(m_mux_data, 4+j) { for(i=0;i<4;i++) { - if(m_mux_data & 1 << i) - res |= ioport(keynames[j][i])->read(); + if BIT(m_mux_data, i) + res |= m_keyboard[j*4+i]->read(); } } } @@ -934,7 +928,6 @@ static MACHINE_CONFIG_START( p7_base, pasopia7_state ) MCFG_DEVICE_ADD("z80pio", Z80PIO, XTAL_4MHz) MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) - MCFG_Z80PIO_IN_PA_CB(READ8(pasopia7_state, mux_r)) MCFG_Z80PIO_OUT_PA_CB(WRITE8(pasopia7_state, mux_w)) MCFG_Z80PIO_IN_PB_CB(READ8(pasopia7_state, keyb_r)) @@ -1050,13 +1043,13 @@ ROM_END DRIVER_INIT_MEMBER(pasopia7_state,p7_raster) { m_screen_type = 1; - machine().scheduler().timer_pulse(attotime::from_hz(500), timer_expired_delegate(FUNC(pasopia7_state::pio_timer),this)); + machine().scheduler().timer_pulse(attotime::from_hz(50), timer_expired_delegate(FUNC(pasopia7_state::pio_timer),this)); } DRIVER_INIT_MEMBER(pasopia7_state,p7_lcd) { m_screen_type = 0; - machine().scheduler().timer_pulse(attotime::from_hz(500), timer_expired_delegate(FUNC(pasopia7_state::pio_timer),this)); + machine().scheduler().timer_pulse(attotime::from_hz(50), timer_expired_delegate(FUNC(pasopia7_state::pio_timer),this)); } diff --git a/src/mame/drivers/seibuspi.cpp b/src/mame/drivers/seibuspi.cpp index b663acc99af..fac077ac3f9 100644 --- a/src/mame/drivers/seibuspi.cpp +++ b/src/mame/drivers/seibuspi.cpp @@ -945,21 +945,15 @@ READ8_MEMBER(seibuspi_state::sb_coin_r) READ32_MEMBER(seibuspi_state::ejsakura_keyboard_r) { - switch (m_ejsakura_input_port) - { - case 0x01: - return ioport("INPUT01")->read(); - case 0x02: - return ioport("INPUT02")->read(); - case 0x04: - return ioport("INPUT04")->read(); - case 0x08: - return ioport("INPUT08")->read(); - case 0x10: - return ioport("INPUT10")->read(); - default: - return ioport("SYSTEM")->read(); - } + // coins/eeprom data + UINT32 ret = m_special->read(); + + // multiplexed inputs + for (int i = 0; i < 5; i++) + if (m_ejsakura_input_port >> i & 1) + ret &= m_key[i]->read(); + + return ret; } WRITE32_MEMBER(seibuspi_state::ejsakura_input_select_w) @@ -977,7 +971,7 @@ static ADDRESS_MAP_START( base_map, AS_PROGRAM, 32, seibuspi_state ) AM_RANGE(0x00000498, 0x0000049b) AM_WRITENOP // ? dma address high bits? (always writes 0) AM_RANGE(0x00000600, 0x00000603) AM_READ8(spi_status_r, 0x000000ff) AM_RANGE(0x00000604, 0x00000607) AM_READ_PORT("INPUTS") - AM_RANGE(0x00000608, 0x0000060b) AM_READ_PORT("UNKNOWN") + AM_RANGE(0x00000608, 0x0000060b) AM_READ_PORT("EXCH") AM_RANGE(0x0000060c, 0x0000060f) AM_READ_PORT("SYSTEM") AM_RANGE(0x00000000, 0x0003ffff) AM_RAM AM_SHARE("mainram") AM_RANGE(0x00200000, 0x003fffff) AM_ROM AM_SHARE("share1") @@ -1074,7 +1068,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( sys386f_map, AS_PROGRAM, 32, seibuspi_state ) AM_IMPORT_FROM( rise_map ) AM_RANGE(0x00000010, 0x00000013) AM_READ8(spi_status_r, 0x000000ff) - AM_RANGE(0x00000400, 0x00000403) AM_WRITE(ejsakura_input_select_w) + AM_RANGE(0x00000400, 0x00000403) AM_READ_PORT("SYSTEM") AM_WRITE(ejsakura_input_select_w) AM_RANGE(0x00000404, 0x00000407) AM_WRITE8(eeprom_w, 0x000000ff) AM_RANGE(0x00000408, 0x0000040f) AM_DEVWRITE8("ymz", ymz280b_device, write, 0x000000ff) AM_RANGE(0x00000484, 0x00000487) AM_WRITE(palette_dma_start_w) @@ -1144,7 +1138,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( spi_soundmap, AS_PROGRAM, 8, seibuspi_state ) AM_RANGE(0x4008, 0x4008) AM_DEVWRITE("soundfifo2", fifo7200_device, data_byte_w) - AM_RANGE(0x400a, 0x400a) AM_READ_PORT("JP1") // is JP1 physically really here? + AM_RANGE(0x400a, 0x400a) AM_READ_PORT("JUMPERS") // TO DO: get these to actually work AM_IMPORT_FROM( sxx2e_soundmap ) ADDRESS_MAP_END @@ -1180,30 +1174,30 @@ WRITE_LINE_MEMBER(seibuspi_state::ymf_irqhandler) CUSTOM_INPUT_MEMBER(seibuspi_state::ejanhs_encode) { /* E-Jan Highschool has a keyboard with the following keys - The keys are encoded with 6 bits - A - 000010 port 0 - B - 010000 port 0 - C - 000010 port 1 - D - 010000 port 1 - E - 000011 port 0 - F - 011000 port 0 - G - 000011 port 1 - H - 011000 port 1 - I - 000100 port 0 - J - 100000 port 0 - K - 000100 port 1 - L - 100000 port 1 - M - 000101 port 0 - N - 101000 port 0 - CHI - 000101 port 1 - PON - 101000 port 1 - KAN - 000110 port 0 - REACH - 110000 port 0 - RON - 000110 port 1 - Start - 000111 port 0 + The keys are encoded with 3 bits for each input port + A - 010 port A + B - 010 port B + C - 010 port C + D - 010 port D + E - 011 port A + F - 011 port B + G - 011 port C + H - 011 port D + I - 100 port A + J - 100 port B + K - 100 port C + L - 100 port D + M - 101 port A + N - 101 port B + CHI - 101 port C + PON - 101 port D + KAN - 110 port A + REACH - 110 port B + RON - 110 port C + Start - 111 port A */ - static const UINT8 encoding[] = { 0x02, 0x10, 0x03, 0x18, 0x04, 0x20, 0x05, 0x28, 0x06, 0x30, 0x07 }; - ioport_value state = ioport((const char *)param)->read(); + static const UINT8 encoding[] = { 6, 5, 4, 3, 2, 7 }; + ioport_value state = ~m_key[(FPTR)param]->read(); for (int bit = 0; bit < ARRAY_LENGTH(encoding); bit++) if (state & (1 << bit)) @@ -1231,7 +1225,7 @@ static INPUT_PORTS_START( sxx2e ) PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) - PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_SPECIAL_ONOFF_DIPLOC( 0x00008000, 0x00000000, Flip_Screen, "SW1:1" ) PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("SYSTEM") @@ -1245,7 +1239,8 @@ static INPUT_PORTS_START( sxx2e ) PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("UNKNOWN") + // Some sets still read unused 3P and 4P inputs from here as in Zero Team + PORT_START("EXCH") PORT_BIT( 0xffffffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("COIN") @@ -1258,11 +1253,11 @@ INPUT_PORTS_END static INPUT_PORTS_START( spi_3button ) PORT_INCLUDE( sxx2e ) - PORT_START("JP1") - PORT_CONFNAME( 0x03, 0x03, "JP1" ) - PORT_CONFSETTING( 0x03, "Update" ) - PORT_CONFSETTING( 0x01, DEF_STR( Off ) ) - PORT_CONFSETTING( 0x00, DEF_STR( On ) ) + PORT_START("JUMPERS") + PORT_DIPNAME( 0x03, 0x03, "JP1" ) + PORT_DIPSETTING( 0x03, "Update" ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END @@ -1291,6 +1286,9 @@ INPUT_PORTS_END static INPUT_PORTS_START( sys386i ) PORT_INCLUDE( sxx2f ) + PORT_MODIFY("INPUTS") + PORT_BIT( 0x00008000, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_MODIFY("SYSTEM") PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_COIN2 ) @@ -1300,61 +1298,8 @@ static INPUT_PORTS_START( sys386i ) INPUT_PORTS_END -static INPUT_PORTS_START( spi_ejanhs ) - PORT_START("INPUTS") - PORT_BIT( 0x0000003f, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, "IN0BITS") - PORT_BIT( 0x00003f00, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, "IN1BITS") - PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("SYSTEM") - PORT_SERVICE_NO_TOGGLE( 0x00000004, IP_ACTIVE_LOW ) - PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_SERVICE1 ) - PORT_BIT( 0x000000f3, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("UNKNOWN") - PORT_BIT( 0xffffffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("JP1") - PORT_CONFNAME( 0x03, 0x03, "JP1" ) - PORT_CONFSETTING( 0x03, "Update" ) - PORT_CONFSETTING( 0x01, DEF_STR( Off ) ) - PORT_CONFSETTING( 0x00, DEF_STR( On ) ) - PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("COIN") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("IN0BITS") - PORT_BIT( 0x001, IP_ACTIVE_HIGH, IPT_MAHJONG_A ) - PORT_BIT( 0x002, IP_ACTIVE_HIGH, IPT_MAHJONG_B ) - PORT_BIT( 0x004, IP_ACTIVE_HIGH, IPT_MAHJONG_E ) - PORT_BIT( 0x008, IP_ACTIVE_HIGH, IPT_MAHJONG_F ) - PORT_BIT( 0x010, IP_ACTIVE_HIGH, IPT_MAHJONG_I ) - PORT_BIT( 0x020, IP_ACTIVE_HIGH, IPT_MAHJONG_J ) - PORT_BIT( 0x040, IP_ACTIVE_HIGH, IPT_MAHJONG_M ) - PORT_BIT( 0x080, IP_ACTIVE_HIGH, IPT_MAHJONG_N ) - PORT_BIT( 0x100, IP_ACTIVE_HIGH, IPT_MAHJONG_KAN ) - PORT_BIT( 0x200, IP_ACTIVE_HIGH, IPT_MAHJONG_REACH ) - PORT_BIT( 0x400, IP_ACTIVE_HIGH, IPT_START1 ) - - PORT_START("IN1BITS") - PORT_BIT( 0x001, IP_ACTIVE_HIGH, IPT_MAHJONG_C ) - PORT_BIT( 0x002, IP_ACTIVE_HIGH, IPT_MAHJONG_D ) - PORT_BIT( 0x004, IP_ACTIVE_HIGH, IPT_MAHJONG_G ) - PORT_BIT( 0x008, IP_ACTIVE_HIGH, IPT_MAHJONG_H ) - PORT_BIT( 0x010, IP_ACTIVE_HIGH, IPT_MAHJONG_K ) - PORT_BIT( 0x020, IP_ACTIVE_HIGH, IPT_MAHJONG_L ) - PORT_BIT( 0x040, IP_ACTIVE_HIGH, IPT_MAHJONG_CHI ) - PORT_BIT( 0x080, IP_ACTIVE_HIGH, IPT_MAHJONG_PON ) - PORT_BIT( 0x100, IP_ACTIVE_HIGH, IPT_MAHJONG_RON ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( sys386f ) - PORT_START("INPUT01") +static INPUT_PORTS_START( spi_mahjong_keyboard ) + PORT_START("KEY.0") PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_L ) @@ -1362,7 +1307,7 @@ static INPUT_PORTS_START( sys386f ) PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_BIT( 0xffffffe0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("INPUT02") + PORT_START("KEY.1") PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) @@ -1371,7 +1316,7 @@ static INPUT_PORTS_START( sys386f ) PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_BIT( 0xffffffc0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("INPUT04") + PORT_START("KEY.2") PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_K ) @@ -1379,7 +1324,7 @@ static INPUT_PORTS_START( sys386f ) PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_BIT( 0xffffffe0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("INPUT08") + PORT_START("KEY.3") PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_I ) @@ -1388,28 +1333,75 @@ static INPUT_PORTS_START( sys386f ) PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0xffffffc0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("INPUT10") + PORT_START("KEY.4") PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) + PORT_BIT( 0xffffffc0, IP_ACTIVE_LOW, IPT_UNUSED ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( spi_ejanhs ) + PORT_INCLUDE( spi_mahjong_keyboard ) + + PORT_START("INPUTS") + PORT_BIT( 0x00000007, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (FPTR)3) + PORT_BIT( 0x00000038, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (FPTR)4) + PORT_BIT( 0x00000700, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (FPTR)2) + PORT_BIT( 0x00003800, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (FPTR)0) + PORT_SPECIAL_ONOFF_DIPLOC( 0x00008000, 0x00000000, Flip_Screen, "SW1:1" ) + PORT_BIT( 0xffff4000, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("SYSTEM") + // These need a noncontiguous encoding, but are nonfunctional in any case + //PORT_BIT( 0x00000013, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (FPTR)1) + PORT_SERVICE_NO_TOGGLE( 0x00000004, IP_ACTIVE_LOW ) + PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BIT( 0x000000f3, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_MODIFY("KEY.1") + PORT_BIT( 0x0000003f, IP_ACTIVE_LOW, IPT_UNUSED ) // Decoded but not recognized + + PORT_MODIFY("KEY.4") + PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNUSED ) // Decoded but not recognized + + PORT_START("EXCH") // Another set of mahjong inputs is decoded from here but not used + PORT_BIT( 0xffffffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("JUMPERS") + PORT_DIPNAME( 0x03, 0x03, "JP1" ) + PORT_DIPSETTING( 0x03, "Update" ) + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("COIN") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( ejsakura ) + PORT_INCLUDE( spi_mahjong_keyboard ) + + PORT_MODIFY("KEY.4") PORT_SERVICE_NO_TOGGLE( 0x00000200, IP_ACTIVE_LOW) PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Payout") PORT_CODE(KEYCODE_Q) PORT_BIT( 0xfffff5c0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("SYSTEM") + PORT_START("SPECIAL") PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x00004000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) PORT_BIT( 0xffffbf3f, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("INPUTS") + PORT_START("SYSTEM") PORT_BIT( 0xffffffff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("UNKNOWN") - PORT_BIT( 0xffffffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END @@ -3979,9 +3971,6 @@ GAME( 1997, rdft2jb, rdft2, rdft2, spi_2button, seibuspi_state, rdft2, GAME( 1997, rdft2t, rdft2, rdft2, spi_2button, seibuspi_state, rdft2, ROT270, "Seibu Kaihatsu", "Raiden Fighters 2 - Operation Hell Dive (Taiwan)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) GAME( 1997, rdft2u, rdft2, rdft2, spi_2button, seibuspi_state, rdft2, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden Fighters 2 - Operation Hell Dive (US)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) - - - GAME( 1998, rfjet, 0, rdft2, spi_2button, seibuspi_state, rfjet, ROT270, "Seibu Kaihatsu (Tuning license)", "Raiden Fighters Jet (Germany)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) GAME( 1998, rfjetu, rfjet, rdft2, spi_2button, seibuspi_state, rfjet, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden Fighters Jet (US)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) GAME( 1998, rfjetj, rfjet, rdft2, spi_2button, seibuspi_state, rfjet, ROT270, "Seibu Kaihatsu", "Raiden Fighters Jet (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) @@ -4003,5 +3992,5 @@ GAME( 2000, rdft22kc, rdft2, sys386i, sys386i, seibuspi_state, rdft2, GAME( 2000, rfjet2kc, rfjet, sys386i, sys386i, seibuspi_state, rfjet, ROT270, "Seibu Kaihatsu", "Raiden Fighters Jet 2000 (China, SYS386I)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) /* SYS386F */ -GAME( 1999, ejsakura, 0, sys386f, sys386f, seibuspi_state, sys386f, ROT0, "Seibu Kaihatsu", "E-Jan Sakurasou (Japan, SYS386F V2.0)", MACHINE_SUPPORTS_SAVE ) -GAME( 1999, ejsakura12, ejsakura, sys386f, sys386f, seibuspi_state, sys386f, ROT0, "Seibu Kaihatsu", "E-Jan Sakurasou (Japan, SYS386F V1.2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, ejsakura, 0, sys386f, ejsakura, seibuspi_state, sys386f, ROT0, "Seibu Kaihatsu", "E-Jan Sakurasou (Japan, SYS386F V2.0)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, ejsakura12, ejsakura, sys386f, ejsakura, seibuspi_state, sys386f, ROT0, "Seibu Kaihatsu", "E-Jan Sakurasou (Japan, SYS386F V1.2)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/spdodgeb.cpp b/src/mame/drivers/spdodgeb.cpp index 66dc17c3f38..ca263f17eab 100644 --- a/src/mame/drivers/spdodgeb.cpp +++ b/src/mame/drivers/spdodgeb.cpp @@ -262,7 +262,7 @@ static ADDRESS_MAP_START( spdodgeb_sound_map, AS_PROGRAM, 8, spdodgeb_state ) AM_RANGE(0x1000, 0x1000) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_RANGE(0x2800, 0x2801) AM_DEVWRITE("ymsnd", ym3812_device, write) AM_RANGE(0x3800, 0x3807) AM_WRITE(spd_adpcm_w) - AM_RANGE(0x8000, 0xffff) AM_ROM + AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION("audiocpu", 0) ADDRESS_MAP_END @@ -374,8 +374,8 @@ static const gfx_layout spritelayout = }; static GFXDECODE_START( spdodgeb ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0x000, 32 ) /* colors 0x000-0x1ff */ - GFXDECODE_ENTRY( "gfx2", 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 @@ -453,22 +453,21 @@ MACHINE_CONFIG_END ROM_START( spdodgeb ) - ROM_REGION( 0x18000, "maincpu", 0 ) - ROM_LOAD( "22a-04.139", 0x10000, 0x08000, CRC(66071fda) SHA1(4a239295900e6234a2a693321ca821671747a58e) ) /* Two banks */ - ROM_CONTINUE( 0x08000, 0x08000 ) /* Static code */ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "22a-04.139", 0x00000, 0x10000, CRC(66071fda) SHA1(4a239295900e6234a2a693321ca821671747a58e) ) /* First 0x8000: Two banks, second 0x8000: Static */ - ROM_REGION( 0x10000, "audiocpu", 0 ) /* audio cpu */ - ROM_LOAD( "22j5-0.33", 0x08000, 0x08000, CRC(c31e264e) SHA1(0828a2094122e3934b784ec9ad7c2b89d91a83bb) ) + ROM_REGION( 0x08000, "audiocpu", 0 ) /* audio cpu */ + ROM_LOAD( "22j5-0.33", 0x00000, 0x08000, CRC(c31e264e) SHA1(0828a2094122e3934b784ec9ad7c2b89d91a83bb) ) ROM_REGION( 0x10000, "mcu", 0 ) /* I/O mcu */ /* Not hooked up yet, we need to add HD63701Y0 support to the hd63701 core (with extra io ports, serial ports, and timers). */ ROM_LOAD( "22ja-0.162", 0x0c000, 0x04000, CRC(7162a97b) SHA1(d6d4ee025e73a340428345f08711cd32f9169a8c) ) - ROM_REGION( 0x40000, "gfx1", 0 ) /* text */ + ROM_REGION( 0x40000, "text", 0 ) /* text */ ROM_LOAD( "22a-4.121", 0x00000, 0x20000, CRC(acc26051) SHA1(445224238cce420990894824d95447e3f63a9ef0) ) ROM_LOAD( "22a-3.107", 0x20000, 0x20000, CRC(10bb800d) SHA1(265a3d67669034d17713b505ef55cd1c90f8d205) ) - ROM_REGION( 0x40000, "gfx2", 0 ) + ROM_REGION( 0x40000, "sprites", 0 ) ROM_LOAD( "22a-1.2", 0x00000, 0x20000, CRC(3bd1c3ec) SHA1(40f61552ea6f7a81915fe3e13f75dc1dc69da33e) ) ROM_LOAD( "22a-2.35", 0x20000, 0x20000, CRC(409e1be1) SHA1(35a77fc8fe6fc212734e2f452dbde9b8cf696f61) ) @@ -513,22 +512,21 @@ TJ22J2-0.35 / */ ROM_START( nkdodge ) - ROM_REGION( 0x18000, "maincpu", 0 ) - ROM_LOAD( "22j4-0.139", 0x10000, 0x08000, CRC(aa674fd8) SHA1(4e8d3e07b54d23b221cb39cf10389bc7a56c4021) ) /* Two banks */ - ROM_CONTINUE( 0x08000, 0x08000 ) /* Static code */ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "22j4-0.139", 0x00000, 0x10000, CRC(aa674fd8) SHA1(4e8d3e07b54d23b221cb39cf10389bc7a56c4021) ) /* First 0x8000: Two banks, second 0x8000: Static */ - ROM_REGION( 0x10000, "audiocpu", 0 ) /* audio cpu */ - ROM_LOAD( "22j5-0.33", 0x08000, 0x08000, CRC(c31e264e) SHA1(0828a2094122e3934b784ec9ad7c2b89d91a83bb) ) + ROM_REGION( 0x08000, "audiocpu", 0 ) /* audio cpu */ + ROM_LOAD( "22j5-0.33", 0x00000, 0x08000, CRC(c31e264e) SHA1(0828a2094122e3934b784ec9ad7c2b89d91a83bb) ) ROM_REGION( 0x10000, "mcu", 0 ) /* I/O mcu */ /* Not hooked up yet, we need to add HD63701Y0 support to the hd63701 core (with extra io ports, serial ports, and timers). */ ROM_LOAD( "22ja-0.162", 0x0c000, 0x04000, CRC(7162a97b) SHA1(d6d4ee025e73a340428345f08711cd32f9169a8c) ) - ROM_REGION( 0x40000, "gfx1", 0 ) /* text */ + ROM_REGION( 0x40000, "text", 0 ) /* text */ ROM_LOAD( "tj22j4-0.121", 0x00000, 0x20000, CRC(d2922b3f) SHA1(30ad37f8355c732b545017c2fc56879256b650be) ) ROM_LOAD( "tj22j3-0.107", 0x20000, 0x20000, CRC(79cd1315) SHA1(2d7a877e59f704b10b5f609e60fa565c68f5fdb0) ) - ROM_REGION( 0x40000, "gfx2", 0 ) + ROM_REGION( 0x40000, "sprites", 0 ) ROM_LOAD( "tj22j1-0.2", 0x00000, 0x20000, CRC(9ed27a8d) SHA1(d80d275bbe91f3e1bd0495a2d7a3be0280a7cda1) ) ROM_LOAD( "tj22j2-0.35", 0x20000, 0x20000, CRC(768934f9) SHA1(922f3154dcfb29c2e5c1bebc53247136160f1229) ) @@ -544,23 +542,22 @@ ROM_END /* the bootleg just seems to have the gfx roms in a different format, program is identical */ ROM_START( nkdodgeb ) - ROM_REGION( 0x18000, "maincpu", 0 ) - ROM_LOAD( "12.bin", 0x10000, 0x08000, CRC(aa674fd8) SHA1(4e8d3e07b54d23b221cb39cf10389bc7a56c4021) ) /* Two banks */ - ROM_CONTINUE( 0x08000, 0x08000 ) /* Static code */ + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "12.bin", 0x00000, 0x10000, CRC(aa674fd8) SHA1(4e8d3e07b54d23b221cb39cf10389bc7a56c4021) ) /* First 0x8000: Two banks, second 0x8000: Static */ - ROM_REGION( 0x10000, "audiocpu", 0 ) /* audio cpu */ - ROM_LOAD( "22j5-0.33", 0x08000, 0x08000, CRC(c31e264e) SHA1(0828a2094122e3934b784ec9ad7c2b89d91a83bb) ) + ROM_REGION( 0x08000, "audiocpu", 0 ) /* audio cpu */ + ROM_LOAD( "22j5-0.33", 0x00000, 0x08000, CRC(c31e264e) SHA1(0828a2094122e3934b784ec9ad7c2b89d91a83bb) ) ROM_REGION( 0x10000, "mcu", 0 ) /* I/O mcu */ ROM_LOAD( "63701.bin", 0xc000, 0x4000, NO_DUMP ) /* missing; does this bootleg board use an i/o mcu at all? */ - ROM_REGION( 0x40000, "gfx1", 0 ) /* text */ + ROM_REGION( 0x40000, "text", 0 ) /* text */ 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) ) ROM_LOAD( "8.bin", 0x30000, 0x10000, CRC(5caae3c9) SHA1(f81a1c4ce2117d41e81542d417ff3573ea0f5313) ) - ROM_REGION( 0x40000, "gfx2", 0 ) + ROM_REGION( 0x40000, "sprites", 0 ) ROM_LOAD( "2.bin", 0x00000, 0x10000, CRC(1271583e) SHA1(98a597f2be1abdac6c4de811cfa8a53549bc6904) ) ROM_LOAD( "1.bin", 0x10000, 0x10000, CRC(5ae6cccf) SHA1(6bd385d6559b54c681d05eed2e91bfc2aa3e6844) ) ROM_LOAD( "4.bin", 0x20000, 0x10000, CRC(f5022822) SHA1(fa67b1f70da80365f14776b712df6f656e603fb0) ) diff --git a/src/mame/drivers/sun3.cpp b/src/mame/drivers/sun3.cpp index eb76ef1adbb..e5c4bf5437b 100644 --- a/src/mame/drivers/sun3.cpp +++ b/src/mame/drivers/sun3.cpp @@ -186,12 +186,14 @@ fefc34a - start of mem_size, which queries ECC registers for each memory board #include "machine/bankdev.h" #include "machine/nvram.h" #include "bus/rs232/rs232.h" +#include "bus/sunkbd/sunkbd.h" #define TIMEKEEPER_TAG "timekpr" #define SCC1_TAG "scc1" #define SCC2_TAG "scc2" #define RS232A_TAG "rs232a" #define RS232B_TAG "rs232b" +#define KEYBOARD_TAG "keyboard" // page table entry constants #define PM_VALID (0x80000000) // page is valid @@ -992,6 +994,11 @@ static MACHINE_CONFIG_START( sun3, sun3_state ) MCFG_TIMER_DRIVER_ADD_PERIODIC("timer", sun3_state, sun3_timer, attotime::from_hz(100)) MCFG_SCC8530_ADD(SCC1_TAG, XTAL_4_9152MHz, 0, 0, 0, 0) + MCFG_Z80SCC_OUT_TXDA_CB(DEVWRITELINE(KEYBOARD_TAG, sun_keyboard_port_device, write_txd)) + + MCFG_SUNKBD_PORT_ADD(KEYBOARD_TAG, default_sun_keyboard_devices, "type3hle") + MCFG_SUNKBD_RXD_HANDLER(DEVWRITELINE(SCC1_TAG, z80scc_device, rxa_w)) + MCFG_SCC8530_ADD(SCC2_TAG, XTAL_4_9152MHz, 0, 0, 0, 0) MCFG_Z80SCC_OUT_TXDA_CB(DEVWRITELINE(RS232A_TAG, rs232_port_device, write_txd)) MCFG_Z80SCC_OUT_TXDB_CB(DEVWRITELINE(RS232B_TAG, rs232_port_device, write_txd)) @@ -1089,6 +1096,11 @@ static MACHINE_CONFIG_START( sun3_50, sun3_state ) MCFG_ADDRESS_MAP_BANK_STRIDE(0x80000000) MCFG_SCC8530_ADD(SCC1_TAG, XTAL_4_9152MHz, 0, 0, 0, 0) + MCFG_Z80SCC_OUT_TXDA_CB(DEVWRITELINE(KEYBOARD_TAG, sun_keyboard_port_device, write_txd)) + + MCFG_SUNKBD_PORT_ADD(KEYBOARD_TAG, default_sun_keyboard_devices, "type3hle") + MCFG_SUNKBD_RXD_HANDLER(DEVWRITELINE(SCC1_TAG, z80scc_device, rxa_w)) + MCFG_SCC8530_ADD(SCC2_TAG, XTAL_4_9152MHz, 0, 0, 0, 0) MCFG_Z80SCC_OUT_TXDA_CB(DEVWRITELINE(RS232A_TAG, rs232_port_device, write_txd)) MCFG_Z80SCC_OUT_TXDB_CB(DEVWRITELINE(RS232B_TAG, rs232_port_device, write_txd)) diff --git a/src/mame/drivers/sun4.cpp b/src/mame/drivers/sun4.cpp index 1487420fdb1..ecb44cc56f7 100644 --- a/src/mame/drivers/sun4.cpp +++ b/src/mame/drivers/sun4.cpp @@ -417,8 +417,12 @@ #include "machine/bankdev.h" #include "machine/nvram.h" #include "bus/rs232/rs232.h" -#include "bus/rs232/sparckbd.h" +#include "bus/sunkbd/sunkbd.h" #include "machine/timekpr.h" +#include "machine/nscsi_bus.h" +#include "machine/nscsi_cd.h" +#include "machine/nscsi_hd.h" +#include "machine/ncr5390.h" #include "machine/upd765.h" #include "formats/pc_dsk.h" #include "formats/mfi_dsk.h" @@ -444,13 +448,41 @@ #define ENA_DIAG (0x01) // page table entry constants -#define PM_VALID (0x80000000) // page is valid -#define PM_WRITEMASK (0x40000000) // writable? -#define PM_SYSMASK (0x20000000) // system use only? -#define PM_CACHE (0x10000000) // cachable? -#define PM_TYPEMASK (0x0c000000) // type mask -#define PM_ACCESSED (0x02000000) // accessed flag -#define PM_MODIFIED (0x01000000) // modified flag +#define PM_VALID (0x80000000) // page is valid +#define PM_WRITEMASK (0x40000000) // writable? +#define PM_SYSMASK (0x20000000) // system use only? +#define PM_CACHE (0x10000000) // cachable? +#define PM_TYPEMASK (0x0c000000) // type mask +#define PM_ACCESSED (0x02000000) // accessed flag +#define PM_MODIFIED (0x01000000) // modified flag + +#define PAGE_SIZE (0x00000400) + +// DMA controller constants +#define DMA_DEV_ID (0x80000000) +#define DMA_L (0x00008000) // use ILACC +#define DMA_TC (0x00004000) // terminal count +#define DMA_EN_CNT (0x00002000) // enable count +#define DMA_BYTE_ADDR (0x00001800) // next byte number to be accessed +#define DMA_BYTE_ADDR_SHIFT (11) +#define DMA_REQ_PEND (0x00000400) // request pending +#define DMA_EN_DMA (0x00000200) // enable DMA +#define DMA_WRITE (0x00000100) // DMA device->mem if 1, otherwise mem->device +#define DMA_RESET (0x00000080) // DMA hardware reset +#define DMA_DRAIN (0x00000040) // force remaining pack bytes to memory +#define DMA_FLUSH (0x00000020) // force PACK_CNT and ERR_PEND to 0 +#define DMA_INT_EN (0x00000010) // interrupt enable +#define DMA_PACK_CNT (0x0000000c) // number of bytes in pack register +#define DMA_PACK_CNT_SHIFT (2) +#define DMA_ERR_PEND (0x00000002) // error pending, set when memory exception occurs +#define DMA_INT_PEND (0x00000001) // interrupt pending, set when TC=1 +#define DMA_READ_ONLY (DMA_TC | DMA_BYTE_ADDR | DMA_REQ_PEND | DMA_PACK_CNT | DMA_ERR_PEND | DMA_INT_PEND) +#define DMA_WRITE_ONLY (DMA_FLUSH) +#define DMA_READ_WRITE (DMA_EN_CNT | DMA_EN_DMA | DMA_WRITE | DMA_RESET | DMA_INT_EN) +#define DMA_CTRL (0) +#define DMA_ADDR (1) +#define DMA_BYTE_COUNT (2) +#define DMA_XTAL (XTAL_25MHz) namespace { @@ -485,11 +517,6 @@ const sparc_disassembler::asi_desc_map::value_type sun4c_asi_desc[] = { { 0x0d, { nullptr, "Flush Cache (Page)" } }, { 0x0e, { nullptr, "Flush Cache (Context)" } } }; - -// TODO: put this somewhere common when sun4m, sun4d, sun4u, etc. are split out -SLOT_INTERFACE_START(keyboard_devices) - SLOT_INTERFACE("keyboard", SPARC_KEYBOARD) -SLOT_INTERFACE_END } enum @@ -505,9 +532,12 @@ public: sun4_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") + , m_timekpr(*this, TIMEKEEPER_TAG) , m_scc1(*this, SCC1_TAG) , m_scc2(*this, SCC2_TAG) , m_fdc(*this, FDC_TAG) + , m_scsibus(*this, "scsibus") + , m_scsi(*this, "scsibus:7:ncr5390") , m_type0space(*this, "type0") , m_type1space(*this, "type1") , m_ram(*this, RAM_TAG) @@ -524,6 +554,8 @@ public: static const device_timer_id TIMER_0 = 0; static const device_timer_id TIMER_1 = 1; + static const device_timer_id TIMER_DMA = 2; + static const device_timer_id TIMER_RESET = 3; DECLARE_READ32_MEMBER( sun4_mmu_r ); DECLARE_WRITE32_MEMBER( sun4_mmu_w ); @@ -539,6 +571,11 @@ public: DECLARE_WRITE8_MEMBER( irq_w ); DECLARE_READ8_MEMBER( fdc_r ); DECLARE_WRITE8_MEMBER( fdc_w ); + DECLARE_READ32_MEMBER( dma_r ); + DECLARE_WRITE32_MEMBER( dma_w ); + + DECLARE_WRITE_LINE_MEMBER( scsi_irq ); + DECLARE_WRITE_LINE_MEMBER( scsi_drq ); DECLARE_WRITE_LINE_MEMBER( scc1_int ); DECLARE_WRITE_LINE_MEMBER( scc2_int ); @@ -553,9 +590,16 @@ public: protected: required_device<mb86901_device> m_maincpu; + + required_device<mk48t12_device> m_timekpr; + required_device<z80scc_device> m_scc1; required_device<z80scc_device> m_scc2; + required_device<n82077aa_device> m_fdc; + required_device<nscsi_bus_device> m_scsibus; + required_device<ncr5390_device> m_scsi; + optional_device<address_map_bank_device> m_type0space, m_type1space; required_device<ram_device> m_ram; required_memory_region m_rom; @@ -566,6 +610,9 @@ protected: UINT8 m_system_enable; UINT32 m_buserr[4]; UINT32 m_counter[4]; + UINT32 m_dma[4]; + int m_scsi_irq; + int m_scsi_drq; private: UINT32 *m_ram_ptr; @@ -582,8 +629,21 @@ private: int m_arch; emu_timer *m_c0_timer, *m_c1_timer; + emu_timer *m_dma_timer; + emu_timer *m_reset_timer; + + UINT32 read_insn_data(UINT8 asi, address_space &space, UINT32 offset, UINT32 mem_mask); + void write_insn_data(UINT8 asi, address_space &space, UINT32 offset, UINT32 data, UINT32 mem_mask); + UINT32 read_insn_data_4c(UINT8 asi, address_space &space, UINT32 offset, UINT32 mem_mask); + void write_insn_data_4c(UINT8 asi, address_space &space, UINT32 offset, UINT32 data, UINT32 mem_mask); + + void dma_set_int_pend(int state); + void dma_update_irq(); + void dma_tick(); + void dma_setup_timer(bool continuing); void start_timer(int num); + void l2p_command(int ref, int params, const char **param); void fcodes_command(int ref, int params, const char **param); }; @@ -617,6 +677,102 @@ UINT32 sun4_state::bw2_update(screen_device &screen, bitmap_rgb32 &bitmap, const return 0; } +UINT32 sun4_state::read_insn_data_4c(UINT8 asi, address_space &space, UINT32 offset, UINT32 mem_mask) +{ + // it's translation time + UINT8 pmeg = m_segmap[m_context & m_ctx_mask][(offset >> 16) & 0xfff] & m_pmeg_mask; + UINT32 entry = (pmeg << 6) + ((offset >> 10) & 0x3f); + + if (m_pagemap[entry] & PM_VALID) + { + m_pagemap[entry] |= PM_ACCESSED; + + UINT32 tmp = (m_pagemap[entry] & 0xffff) << 10; + tmp |= (offset & 0x3ff); + + //printf("sun4: read translated vaddr %08x to phys %08x type %d, PTE %08x, PC=%x\n", offset<<2, tmp<<2, (m_pagemap[entry]>>26) & 3, m_pagemap[entry], m_maincpu->pc()); + + switch ((m_pagemap[entry] >> 26) & 3) + { + case 0: // type 0 space + return m_type0space->read32(space, tmp, mem_mask); + + case 1: // type 1 space + // magic EPROM bypass + if ((tmp >= (0x6000000>>2)) && (tmp <= (0x6ffffff>>2))) + { + return m_rom_ptr[offset & 0x1ffff]; + } + //printf("Read type 1 @ VA %08x, phys %08x\n", offset<<2, tmp<<2); + return m_type1space->read32(space, tmp, mem_mask); + + default: + printf("sun4c: access to memory type not defined in sun4c\n"); + return 0; + } + } + else + { + if (!space.debugger_access()) + { + printf("sun4c: INVALID PTE entry %d %08x accessed! vaddr=%x PC=%x\n", entry, m_pagemap[entry], offset <<2, m_maincpu->pc()); + //m_maincpu->trap(SPARC_DATA_ACCESS_EXCEPTION); + //m_buserr[0] = 0x88; // read, invalid PTE + //m_buserr[1] = offset<<2; + } + return 0; + } +} + +void sun4_state::write_insn_data_4c(UINT8 asi, address_space &space, UINT32 offset, UINT32 data, UINT32 mem_mask) +{ + // it's translation time + UINT8 pmeg = m_segmap[m_context & m_ctx_mask][(offset >> 16) & 0xfff] & m_pmeg_mask; + UINT32 entry = (pmeg << 6) + ((offset >> 10) & 0x3f); + + if (m_pagemap[entry] & PM_VALID) + { + if ((!(m_pagemap[entry] & PM_WRITEMASK)) || ((m_pagemap[entry] & PM_SYSMASK) && !(asi & 1))) + { + printf("sun4c: write protect MMU error (PC=%x)\n", m_maincpu->pc()); + m_buserr[0] = 0x8040; // write, protection error + m_buserr[1] = offset<<2; + m_maincpu->set_input_line(SPARC_MAE, ASSERT_LINE); + return; + } + + m_pagemap[entry] |= (PM_ACCESSED | PM_MODIFIED); + + UINT32 tmp = (m_pagemap[entry] & 0xffff) << 10; + tmp |= (offset & 0x3ff); + + //printf("sun4: write translated vaddr %08x to phys %08x type %d, PTE %08x, ASI %d, PC=%x\n", offset<<2, tmp<<2, (m_pagemap[entry]>>26) & 3, m_pagemap[entry], asi, m_maincpu->pc()); + + switch ((m_pagemap[entry] >> 26) & 3) + { + case 0: // type 0 + m_type0space->write32(space, tmp, data, mem_mask); + return; + + case 1: // type 1 + //printf("write device space @ %x\n", tmp<<1); + m_type1space->write32(space, tmp, data, mem_mask); + return; + default: + printf("sun4c: access to memory type not defined\n"); + return; + } + } + else + { + printf("sun4c: INVALID PTE entry %d %08x accessed! vaddr=%x PC=%x\n", entry, m_pagemap[entry], offset <<2, m_maincpu->pc()); + //m_maincpu->trap(SPARC_DATA_ACCESS_EXCEPTION); + //m_buserr[0] = 0x8; // invalid PTE + //m_buserr[1] = offset<<2; + } +} + + READ32_MEMBER( sun4_state::sun4c_mmu_r ) { UINT8 asi = m_maincpu->get_asi(); @@ -695,58 +851,12 @@ READ32_MEMBER( sun4_state::sun4c_mmu_r ) page += (offset >> 10) & 0x3f; //printf("sun4: read page map @ %x (entry %d, seg %d, PMEG %d, mem_mask %08x, PC=%x)\n", offset << 2, page, (offset >> 16) & 0xfff, m_segmap[m_context & m_ctx_mask][(offset >> 16) & 0xfff] & m_pmeg_mask, mem_mask, m_maincpu->pc()); return m_pagemap[page]; - break; case 8: case 9: case 10: case 11: - { - // it's translation time - UINT8 pmeg = m_segmap[m_context & m_ctx_mask][(offset >> 16) & 0xfff] & m_pmeg_mask; - UINT32 entry = (pmeg << 6) + ((offset >> 10) & 0x3f); - - if (m_pagemap[entry] & PM_VALID) - { - m_pagemap[entry] |= PM_ACCESSED; - - UINT32 tmp = (m_pagemap[entry] & 0xffff) << 10; - tmp |= (offset & 0x3ff); - - //printf("sun4: read translated vaddr %08x to phys %08x type %d, PTE %08x, PC=%x\n", offset<<2, tmp<<2, (m_pagemap[entry]>>26) & 3, m_pagemap[entry], m_maincpu->pc()); - - switch ((m_pagemap[entry] >> 26) & 3) - { - case 0: // type 0 space - return m_type0space->read32(space, tmp, mem_mask); - - case 1: // type 1 space - // magic EPROM bypass - if ((tmp >= (0x6000000>>2)) && (tmp <= (0x6ffffff>>2))) - { - return m_rom_ptr[offset & 0x1ffff]; - } - //printf("Read type 1 @ VA %08x, phys %08x\n", offset<<2, tmp<<2); - return m_type1space->read32(space, tmp, mem_mask); - - default: - printf("sun4c: access to memory type not defined in sun4c\n"); - return 0; - } - } - else - { - if (!space.debugger_access()) - { - printf("sun4c: INVALID PTE entry %d %08x accessed! vaddr=%x PC=%x\n", entry, m_pagemap[entry], offset <<2, m_maincpu->pc()); - //m_maincpu->trap(SPARC_DATA_ACCESS_EXCEPTION); - //m_buserr[0] = 0x88; // read, invalid PTE - //m_buserr[1] = offset<<2; - } - return 0; - } - } - break; + return read_insn_data_4c(asi, space, offset, mem_mask); default: if (!space.debugger_access()) printf("sun4c: ASI %d unhandled read @ %x (PC=%x)\n", asi, offset<<2, m_maincpu->pc()); @@ -777,6 +887,13 @@ WRITE32_MEMBER( sun4_state::sun4c_mmu_w ) case 4: // system enable reg m_system_enable = data>>24; + + if (m_system_enable & ENA_RESET) + { + m_reset_timer->adjust(attotime::from_usec(1)); + m_maincpu->set_input_line(SPARC_RESET, ASSERT_LINE); + printf("Asserting reset line\n"); + } //printf("%08x to system enable, mask %08x\n", data, mem_mask); if (m_system_enable & ENA_RESET) { @@ -785,7 +902,7 @@ WRITE32_MEMBER( sun4_state::sun4c_mmu_w ) m_maincpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); } return; - + case 6: // bus error printf("%08x to bus error @ %x, mask %08x\n", data, offset, mem_mask); m_buserr[offset & 0xf] = data; @@ -836,64 +953,107 @@ WRITE32_MEMBER( sun4_state::sun4c_mmu_w ) COMBINE_DATA(&m_pagemap[page]); m_pagemap[page] &= 0xff00ffff; // these 8 bits are cleared when written and tested as such return; + case 8: case 9: case 10: case 11: - // it's translation time - UINT8 pmeg = m_segmap[m_context & m_ctx_mask][(offset >> 16) & 0xfff] & m_pmeg_mask; - UINT32 entry = (pmeg << 6) + ((offset >> 10) & 0x3f); + write_insn_data_4c(asi, space, offset, data, mem_mask); + return; - if (m_pagemap[entry] & PM_VALID) - { - if ((!(m_pagemap[entry] & PM_WRITEMASK)) || - ((m_pagemap[entry] & PM_SYSMASK) && !(asi & 1))) - { - printf("sun4c: write protect MMU error (PC=%x)\n", m_maincpu->pc()); - m_buserr[0] = 0x8040; // write, protection error - m_buserr[1] = offset<<2; - m_maincpu->set_input_line(SPARC_MAE, ASSERT_LINE); - return; - } + } + + printf("sun4c: %08x to asi %d byte offset %x, PC = %x, mask = %08x\n", data, asi, offset << 2, m_maincpu->pc(), mem_mask); +} - m_pagemap[entry] |= (PM_ACCESSED | PM_MODIFIED); +// ----------------------------------------------------------------- - UINT32 tmp = (m_pagemap[entry] & 0xffff) << 10; - tmp |= (offset & 0x3ff); +UINT32 sun4_state::read_insn_data(UINT8 asi, address_space &space, UINT32 offset, UINT32 mem_mask) +{ + // it's translation time + UINT8 pmeg = m_segmap[m_context][(offset >> 16) & 0xfff]; + UINT32 entry = (pmeg << 5) + ((offset >> 11) & 0x1f); - //printf("sun4: write translated vaddr %08x to phys %08x type %d, PTE %08x, ASI %d, PC=%x\n", offset<<2, tmp<<2, (m_pagemap[entry]>>26) & 3, m_pagemap[entry], asi, m_maincpu->pc()); + if (m_pagemap[entry] & PM_VALID) + { + m_pagemap[entry] |= PM_ACCESSED; - switch ((m_pagemap[entry] >> 26) & 3) - { - case 0: // type 0 - m_type0space->write32(space, tmp, data, mem_mask); - return; + UINT32 tmp = (m_pagemap[entry] & 0x7ffff) << 11; + tmp |= (offset & 0x7ff); - case 1: // type 1 - //printf("write device space @ %x\n", tmp<<1); - m_type1space->write32(space, tmp, data, mem_mask); - return; - default: - printf("sun4c: access to memory type not defined\n"); - return; + //printf("sun4: read translated vaddr %08x to phys %08x type %d, PTE %08x, PC=%x\n", offset<<2, tmp<<2, (m_pagemap[entry]>>26) & 3, m_pagemap[entry], m_maincpu->pc()); + + switch ((m_pagemap[entry] >> 26) & 3) + { + case 0: // type 0 space + return m_type0space->read32(space, tmp, mem_mask); + + case 1: // type 1 space + // magic EPROM bypass + if ((tmp >= (0x6000000>>2)) && (tmp <= (0x6ffffff>>2))) + { + return m_rom_ptr[offset & 0x1ffff]; } + //printf("Read type 1 @ VA %08x, phys %08x\n", offset<<2, tmp<<2); + return m_type1space->read32(space, tmp, mem_mask); + + default: + printf("sun4: access to unhandled memory type\n"); + return 0; } - else + } + else + { + if (!space.debugger_access()) { - printf("sun4c: INVALID PTE entry %d %08x accessed! vaddr=%x PC=%x\n", entry, m_pagemap[entry], offset <<2, m_maincpu->pc()); + printf("sun4: INVALID PTE entry %d %08x accessed! vaddr=%x PC=%x\n", entry, m_pagemap[entry], offset <<2, m_maincpu->pc()); //m_maincpu->trap(SPARC_DATA_ACCESS_EXCEPTION); - //m_buserr[0] = 0x8; // invalid PTE + //m_buserr[0] = 0x88; // read, invalid PTE //m_buserr[1] = offset<<2; - return; } - break; - + return 0; } - - printf("sun4c: %08x to asi %d byte offset %x, PC = %x, mask = %08x\n", data, asi, offset << 2, m_maincpu->pc(), mem_mask); } -// ----------------------------------------------------------------- +void sun4_state::write_insn_data(UINT8 asi, address_space &space, UINT32 offset, UINT32 data, UINT32 mem_mask) +{ + // it's translation time + UINT8 pmeg = m_segmap[m_context][(offset >> 16) & 0xfff]; + UINT32 entry = (pmeg << 5) + ((offset >> 11) & 0x1f); + + if (m_pagemap[entry] & PM_VALID) + { + m_pagemap[entry] |= PM_ACCESSED; + + UINT32 tmp = (m_pagemap[entry] & 0x7ffff) << 11; + tmp |= (offset & 0x7ff); + + //printf("sun4: write translated vaddr %08x to phys %08x type %d, PTE %08x, PC=%x\n", offset<<2, tmp<<2, (m_pagemap[entry]>>26) & 3, m_pagemap[entry], m_maincpu->pc()); + + switch ((m_pagemap[entry] >> 26) & 3) + { + case 0: // type 0 + m_type0space->write32(space, tmp, data, mem_mask); + return; + + case 1: // type 1 + //printf("write device space @ %x\n", tmp<<1); + m_type1space->write32(space, tmp, data, mem_mask); + return; + + default: + printf("sun4: access to memory type not defined in sun4c\n"); + return; + } + } + else + { + printf("sun4: INVALID PTE entry %d %08x accessed! vaddr=%x PC=%x\n", entry, m_pagemap[entry], offset <<2, m_maincpu->pc()); + //m_maincpu->trap(SPARC_DATA_ACCESS_EXCEPTION); + //m_buserr[0] = 0x8; // invalid PTE + //m_buserr[1] = offset<<2; + } +} READ32_MEMBER( sun4_state::sun4_mmu_r ) { @@ -977,52 +1137,7 @@ READ32_MEMBER( sun4_state::sun4_mmu_r ) case 9: case 10: case 11: - { - // it's translation time - UINT8 pmeg = m_segmap[m_context][(offset >> 16) & 0xfff]; - UINT32 entry = (pmeg << 5) + ((offset >> 11) & 0x1f); - - if (m_pagemap[entry] & PM_VALID) - { - m_pagemap[entry] |= PM_ACCESSED; - - UINT32 tmp = (m_pagemap[entry] & 0x7ffff) << 11; - tmp |= (offset & 0x7ff); - - //printf("sun4: read translated vaddr %08x to phys %08x type %d, PTE %08x, PC=%x\n", offset<<2, tmp<<2, (m_pagemap[entry]>>26) & 3, m_pagemap[entry], m_maincpu->pc()); - - switch ((m_pagemap[entry] >> 26) & 3) - { - case 0: // type 0 space - return m_type0space->read32(space, tmp, mem_mask); - - case 1: // type 1 space - // magic EPROM bypass - if ((tmp >= (0x6000000>>2)) && (tmp <= (0x6ffffff>>2))) - { - return m_rom_ptr[offset & 0x1ffff]; - } - //printf("Read type 1 @ VA %08x, phys %08x\n", offset<<2, tmp<<2); - return m_type1space->read32(space, tmp, mem_mask); - - default: - printf("sun4: access to unhandled memory type\n"); - return 0; - } - } - else - { - if (!space.debugger_access()) - { - printf("sun4: INVALID PTE entry %d %08x accessed! vaddr=%x PC=%x\n", entry, m_pagemap[entry], offset <<2, m_maincpu->pc()); - //m_maincpu->trap(SPARC_DATA_ACCESS_EXCEPTION); - //m_buserr2qor[0] = 0x88; // read, invalid PTE - //m_buserr[1] = offset<<2; - } - return 0; - } - } - break; + return read_insn_data(asi, space, offset, mem_mask); default: if (!space.debugger_access()) printf("sun4: ASI %d unhandled read @ %x (PC=%x)\n", asi, offset<<2, m_maincpu->pc()); @@ -1053,6 +1168,12 @@ WRITE32_MEMBER( sun4_state::sun4_mmu_w ) case 4: // system enable reg m_system_enable = data>>24; + + if (m_system_enable & ENA_RESET) + { + m_reset_timer->adjust(attotime::from_usec(1)); + m_maincpu->set_input_line(SPARC_RESET, ASSERT_LINE); + } //printf("%08x to system enable, mask %08x\n", data, mem_mask); if (m_system_enable & ENA_RESET) { @@ -1133,42 +1254,7 @@ WRITE32_MEMBER( sun4_state::sun4_mmu_w ) case 9: case 10: case 11: - // it's translation time - UINT8 pmeg = m_segmap[m_context][(offset >> 16) & 0xfff]; - UINT32 entry = (pmeg << 5) + ((offset >> 11) & 0x1f); - - if (m_pagemap[entry] & PM_VALID) - { - m_pagemap[entry] |= PM_ACCESSED; - - UINT32 tmp = (m_pagemap[entry] & 0x7ffff) << 11; - tmp |= (offset & 0x7ff); - - //printf("sun4: write translated vaddr %08x to phys %08x type %d, PTE %08x, PC=%x\n", offset<<2, tmp<<2, (m_pagemap[entry]>>26) & 3, m_pagemap[entry], m_maincpu->pc()); - - switch ((m_pagemap[entry] >> 26) & 3) - { - case 0: // type 0 - m_type0space->write32(space, tmp, data, mem_mask); - return; - - case 1: // type 1 - //printf("write device space @ %x\n", tmp<<1); - m_type1space->write32(space, tmp, data, mem_mask); - return; - default: - printf("sun4: access to memory type not defined in sun4c\n"); - return; - } - } - else - { - printf("sun4: INVALID PTE entry %d %08x accessed! vaddr=%x PC=%x\n", entry, m_pagemap[entry], offset <<2, m_maincpu->pc()); - //m_maincpu->trap(SPARC_DATA_ACCESS_EXCEPTION); - //m_buserror[0] = 0x8; // invalid PTE - //m_buserror[1] = offset<<2; - return; - } + write_insn_data(asi, space, offset, data, mem_mask); break; } @@ -1253,7 +1339,11 @@ void sun4_state::machine_reset() m_system_enable = 0; m_irq_reg = 0; m_scc1_int = m_scc2_int = 0; + m_scsi_irq = 0; + m_scsi_drq = 0; + memset(m_counter, 0, sizeof(m_counter)); + memset(m_dma, 0, sizeof(m_dma)); } void sun4_state::machine_start() @@ -1277,6 +1367,14 @@ void sun4_state::machine_start() m_c1_timer = timer_alloc(TIMER_1); m_c0_timer->adjust(attotime::never); m_c1_timer->adjust(attotime::never); + + // allocate timer for system reset + m_reset_timer = timer_alloc(TIMER_RESET); + m_reset_timer->adjust(attotime::never); + + // allocate timer for DMA controller + m_dma_timer = timer_alloc(TIMER_DMA); + m_dma_timer->adjust(attotime::never); } READ32_MEMBER( sun4_state::ram_r ) @@ -1367,6 +1465,8 @@ static ADDRESS_MAP_START(type1space_map, AS_PROGRAM, 32, sun4_state) AM_RANGE(0x06000000, 0x0607ffff) AM_ROM AM_REGION("user1", 0) AM_RANGE(0x07200000, 0x07200003) AM_READWRITE8(fdc_r, fdc_w, 0xffffffff) AM_RANGE(0x08000000, 0x08000003) AM_READ(ss1_sl0_id) // slot 0 contains SCSI/DMA/Ethernet + AM_RANGE(0x08400000, 0x0840000f) AM_READWRITE(dma_r, dma_w) + AM_RANGE(0x08800000, 0x0880001f) AM_DEVICE8("scsibus:7:ncr5390", ncr5390_device, map, 0xff0000) AM_RANGE(0x0e000000, 0x0e000003) AM_READ(ss1_sl3_id) // slot 3 contains video board AM_RANGE(0x0e800000, 0x0e8fffff) AM_RAM AM_SHARE("bw2_vram") ADDRESS_MAP_END @@ -1458,7 +1558,7 @@ void sun4_state::device_timer(emu_timer &timer, device_timer_id id, int param, v if ((m_irq_reg & 0x21) == 0x21) { m_maincpu->set_input_line(SPARC_IRQ10, ASSERT_LINE); - printf("Taking INT10\n"); + //printf("Taking INT10\n"); } break; @@ -1474,6 +1574,16 @@ void sun4_state::device_timer(emu_timer &timer, device_timer_id id, int param, v //printf("Taking INT14\n"); } break; + + case TIMER_DMA: + dma_tick(); + break; + + case TIMER_RESET: + m_reset_timer->adjust(attotime::never); + m_maincpu->set_input_line(SPARC_RESET, CLEAR_LINE); + printf("Clearing reset line\n"); + break; } } @@ -1484,11 +1594,11 @@ READ32_MEMBER( sun4_state::timer_r ) // reading limt 0 if (offset == 0) { - printf("Read timer counter 0 (%08x) @ %x, mask %08x\n", ret, m_maincpu->pc(), mem_mask); + //printf("Read timer counter 0 (%08x) @ %x, mask %08x\n", ret, m_maincpu->pc(), mem_mask); } if (offset == 1) { - printf("Read timer limit 0 (%08x) @ %x, mask %08x\n", ret, m_maincpu->pc(), mem_mask); + //printf("Read timer limit 0 (%08x) @ %x, mask %08x\n", ret, m_maincpu->pc(), mem_mask); m_counter[0] &= ~0x80000000; m_counter[1] &= ~0x80000000; m_maincpu->set_input_line(SPARC_IRQ10, CLEAR_LINE); @@ -1496,7 +1606,7 @@ READ32_MEMBER( sun4_state::timer_r ) if (offset == 2) { - printf("Read timer counter 1 (%08x) @ %x, mask %08x\n", ret, m_maincpu->pc(), mem_mask); + //printf("Read timer counter 1 (%08x) @ %x, mask %08x\n", ret, m_maincpu->pc(), mem_mask); } if (offset == 3) { @@ -1510,9 +1620,7 @@ READ32_MEMBER( sun4_state::timer_r ) void sun4_state::start_timer(int num) { - int shift = (num == 0 ? 10 : 20); - int mask = (num == 0 ? 0x1fffff : 0x7ff); - int period = (m_counter[num * 2 + 1] >> shift) & mask; + int period = (m_counter[num * 2 + 1] >> 10) & 0x1fffff; if (period == 0) period = 0x200000; @@ -1557,6 +1665,246 @@ WRITE32_MEMBER( sun4_state::timer_w ) } } +void sun4_state::dma_set_int_pend(int state) +{ + if (!state) + { + m_dma[DMA_CTRL] &= ~DMA_INT_PEND; + } + else + { + m_dma[DMA_CTRL] |= DMA_INT_PEND; + } + + dma_update_irq(); +} + +void sun4_state:: dma_update_irq() +{ + int irq_or_err_pending = (m_dma[DMA_CTRL] & (DMA_INT_PEND | DMA_ERR_PEND)) ? 1 : 0; + int irq_enabled = (m_dma[DMA_CTRL] & DMA_INT_EN) ? 1 : 0; + if (irq_or_err_pending && irq_enabled) + { + m_maincpu->set_input_line(SPARC_IRQ3, ASSERT_LINE); + } + else + { + m_maincpu->set_input_line(SPARC_IRQ3, CLEAR_LINE); + } +} + +void sun4_state::dma_tick() +{ + UINT32 transfer_size = (m_dma[DMA_BYTE_COUNT] > PAGE_SIZE ? PAGE_SIZE : m_dma[DMA_BYTE_COUNT]); + address_space &space = m_maincpu->space(AS_PROGRAM); + + if (m_dma[DMA_CTRL] & DMA_WRITE) + { + UINT32 data = 0; + UINT32 byte_cnt = 3; + UINT32 mem_mask = 0; + while (transfer_size > 0) + { + UINT8 value = m_scsi->dma_r(); + data |= value << (byte_cnt * 8); + mem_mask |= 0xff << (byte_cnt * 8); + transfer_size--; + + if (byte_cnt == 0) + { + if (m_arch == ARCH_SUN4C) + { + write_insn_data_4c(11, space, m_dma[DMA_ADDR] >> 2, data, mem_mask); + } + else + { + write_insn_data(11, space, m_dma[DMA_ADDR] >> 2, data, mem_mask); + } + m_dma[DMA_ADDR] += 4; + m_dma[DMA_BYTE_COUNT] -= 4; + + byte_cnt = 3; + data = 0; + mem_mask = 0; + } + else + { + byte_cnt--; + } + } + + if (byte_cnt != 0) + { + if (m_arch == ARCH_SUN4C) + { + write_insn_data_4c(11, space, m_dma[DMA_ADDR] >> 2, data, mem_mask); + } + else + { + write_insn_data(11, space, m_dma[DMA_ADDR] >> 2, data, mem_mask); + } + + m_dma[DMA_ADDR] += byte_cnt; + m_dma[DMA_BYTE_COUNT] -= byte_cnt; + } + } + else + { + UINT32 byte_cnt = 3; + UINT32 mem_mask = 0; + while (transfer_size > 0) + { + mem_mask |= 0xff << (byte_cnt * 8); + transfer_size--; + + if (byte_cnt == 0) + { + UINT32 data = 0; + if (m_arch == ARCH_SUN4C) + { + data = read_insn_data_4c(11, space, m_dma[DMA_ADDR] >> 2, mem_mask); + } + else + { + data = read_insn_data(11, space, m_dma[DMA_ADDR] >> 2, mem_mask); + } + + for (int i = 24; i >= 0; i -= 8) + { + m_scsi->dma_w((data >> i) & 0xff); + m_dma[DMA_BYTE_COUNT]--; + } + + byte_cnt = 3; + mem_mask = 0; + } + else + { + byte_cnt--; + } + } + + if (byte_cnt != 0) + { + byte_cnt++; + UINT32 data = 0; + if (m_arch == ARCH_SUN4C) + { + data = read_insn_data_4c(11, space, m_dma[DMA_ADDR] >> 2, mem_mask); + } + else + { + data = read_insn_data(11, space, m_dma[DMA_ADDR] >> 2, mem_mask); + } + + UINT32 initial_cnt = byte_cnt; + for (int i = 0; i < 4 - initial_cnt; i++) + { + UINT8 byte_val = (data >> (byte_cnt * 8)) & 0xff; + m_scsi->dma_w(byte_val); + + m_dma[DMA_BYTE_COUNT]--; + byte_cnt--; + } + } + } + + if (m_dma[DMA_BYTE_COUNT] == 0) + { + m_dma[DMA_CTRL] |= DMA_TC; + dma_set_int_pend(1); + m_dma_timer->adjust(attotime::never); + } + else + { + dma_setup_timer(true); + } +} + +void sun4_state::dma_setup_timer(bool continuing) +{ + const UINT32 remaining_bytes = m_dma[DMA_BYTE_COUNT]; + const UINT64 latency = (continuing ? 0 : 40); + const UINT64 transfer_size = (remaining_bytes < PAGE_SIZE ? remaining_bytes : PAGE_SIZE); + const UINT64 transfer_duration = ((transfer_size + 15) / 16) * 8; // 16 byte groupings, 8 clock cycles per group + const UINT64 total_ticks = latency + transfer_duration; + + m_dma_timer->adjust(attotime::from_ticks(total_ticks, DMA_XTAL)); + + if (!continuing) + { + m_dma[DMA_CTRL] &= DMA_TC; + } +} + +READ32_MEMBER( sun4_state::dma_r ) +{ + return m_dma[offset]; +} + +WRITE32_MEMBER( sun4_state::dma_w ) +{ + switch (offset) + { + case DMA_CTRL: + { + // clear write-only bits + UINT32 old_ctrl = m_dma[DMA_CTRL]; + + m_dma[DMA_CTRL] &= (DMA_READ_ONLY | DMA_READ_WRITE); + + m_dma[DMA_CTRL] |= (data & (DMA_WRITE_ONLY | DMA_READ_WRITE)); + + if (data & DMA_FLUSH) + { + m_dma[DMA_CTRL] &= ~DMA_PACK_CNT; + m_dma[DMA_CTRL] &= ~DMA_ERR_PEND; + m_dma[DMA_CTRL] &= ~DMA_TC; + + if (!m_scsi_irq) + { + dma_set_int_pend(0); + } + } + + if (data & DMA_EN_DMA && !(old_ctrl & DMA_EN_DMA)) + { + dma_setup_timer(false); + } + break; + } + + case DMA_ADDR: + case DMA_BYTE_COUNT: + m_dma[offset] = data; + break; + + default: + break; + } +} + +WRITE_LINE_MEMBER( sun4_state::scsi_irq ) +{ + if (!(m_dma[DMA_CTRL] & DMA_TC)) + { + dma_set_int_pend(state); + } + m_scsi_irq = state; +} + +WRITE_LINE_MEMBER( sun4_state::scsi_drq ) +{ + if (state) + { + if (m_dma[DMA_CTRL] & DMA_EN_DMA) + { + dma_setup_timer(false); + } + } + m_scsi_drq = state; +} + // indicate 4/60 SCSI/DMA/Ethernet card exists READ32_MEMBER( sun4_state::ss1_sl0_id ) { @@ -1577,6 +1925,18 @@ static SLOT_INTERFACE_START( sun_floppies ) SLOT_INTERFACE( "35hd", FLOPPY_35_HD ) SLOT_INTERFACE_END +static SLOT_INTERFACE_START( sun_scsi_devices ) + SLOT_INTERFACE("cdrom", NSCSI_CDROM) + SLOT_INTERFACE("harddisk", NSCSI_HARDDISK) + SLOT_INTERFACE_INTERNAL("ncr5390", NCR5390) +SLOT_INTERFACE_END + +static MACHINE_CONFIG_FRAGMENT( ncr5390 ) + MCFG_DEVICE_CLOCK(10000000) + MCFG_NCR5390_IRQ_HANDLER(DEVWRITELINE(":", sun4_state, scsi_irq)) + MCFG_NCR5390_DRQ_HANDLER(DEVWRITELINE(":", sun4_state, scsi_drq)) +MACHINE_CONFIG_END + static MACHINE_CONFIG_START( sun4, sun4_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", MB86901, 16670000) @@ -1587,7 +1947,7 @@ static MACHINE_CONFIG_START( sun4, sun4_state ) MCFG_RAM_DEFAULT_SIZE("16M") MCFG_RAM_DEFAULT_VALUE(0x00) - MCFG_M48T02_ADD(TIMEKEEPER_TAG) + MCFG_MK48T12_ADD(TIMEKEEPER_TAG) MCFG_N82077AA_ADD(FDC_TAG, n82077aa_device::MODE_PS2) MCFG_FLOPPY_DRIVE_ADD("fdc:0", sun_floppies, "35hd", sun4_state::floppy_formats) @@ -1609,10 +1969,10 @@ static MACHINE_CONFIG_START( sun4, sun4_state ) // Keyboard/mouse MCFG_SCC8530_ADD(SCC1_TAG, XTAL_4_9152MHz, 0, 0, 0, 0) MCFG_Z80SCC_OUT_INT_CB(WRITELINE(sun4_state, scc1_int)) - MCFG_Z80SCC_OUT_TXDA_CB(DEVWRITELINE(KEYBOARD_TAG, rs232_port_device, write_txd)) + MCFG_Z80SCC_OUT_TXDA_CB(DEVWRITELINE(KEYBOARD_TAG, sun_keyboard_port_device, write_txd)) - MCFG_RS232_PORT_ADD(KEYBOARD_TAG, keyboard_devices, "keyboard") - MCFG_RS232_RXD_HANDLER(DEVWRITELINE(SCC1_TAG, z80scc_device, rxa_w)) + MCFG_SUNKBD_PORT_ADD(KEYBOARD_TAG, default_sun_keyboard_devices, "type4hle") + MCFG_SUNKBD_RXD_HANDLER(DEVWRITELINE(SCC1_TAG, z80scc_device, rxa_w)) // RS232 serial ports MCFG_SCC8530_ADD(SCC2_TAG, XTAL_4_9152MHz, 0, 0, 0, 0) @@ -1629,6 +1989,17 @@ static MACHINE_CONFIG_START( sun4, sun4_state ) MCFG_RS232_RXD_HANDLER(DEVWRITELINE(SCC2_TAG, z80scc_device, rxb_w)) MCFG_RS232_DCD_HANDLER(DEVWRITELINE(SCC2_TAG, z80scc_device, dcdb_w)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE(SCC2_TAG, z80scc_device, ctsb_w)) + + MCFG_NSCSI_BUS_ADD("scsibus") + MCFG_NSCSI_ADD("scsibus:0", sun_scsi_devices, "harddisk", false) + MCFG_NSCSI_ADD("scsibus:1", sun_scsi_devices, "cdrom", false) + MCFG_NSCSI_ADD("scsibus:2", sun_scsi_devices, nullptr, false) + MCFG_NSCSI_ADD("scsibus:3", sun_scsi_devices, nullptr, false) + MCFG_NSCSI_ADD("scsibus:4", sun_scsi_devices, nullptr, false) + MCFG_NSCSI_ADD("scsibus:5", sun_scsi_devices, nullptr, false) + MCFG_NSCSI_ADD("scsibus:6", sun_scsi_devices, nullptr, false) + MCFG_NSCSI_ADD("scsibus:7", sun_scsi_devices, "ncr5390", true) + MCFG_DEVICE_CARD_MACHINE_CONFIG("ncr5390", ncr5390) MACHINE_CONFIG_END static MACHINE_CONFIG_START( sun4c, sun4_state ) @@ -1641,7 +2012,7 @@ static MACHINE_CONFIG_START( sun4c, sun4_state ) MCFG_RAM_DEFAULT_SIZE("16M") MCFG_RAM_DEFAULT_VALUE(0x00) - MCFG_M48T02_ADD(TIMEKEEPER_TAG) + MCFG_MK48T12_ADD(TIMEKEEPER_TAG) MCFG_N82077AA_ADD(FDC_TAG, n82077aa_device::MODE_PS2) MCFG_FLOPPY_DRIVE_ADD("fdc:0", sun_floppies, "35hd", sun4_state::floppy_formats) @@ -1663,10 +2034,10 @@ static MACHINE_CONFIG_START( sun4c, sun4_state ) // Keyboard/mouse MCFG_SCC8530_ADD(SCC1_TAG, XTAL_4_9152MHz, 0, 0, 0, 0) MCFG_Z80SCC_OUT_INT_CB(WRITELINE(sun4_state, scc1_int)) - MCFG_Z80SCC_OUT_TXDA_CB(DEVWRITELINE(KEYBOARD_TAG, rs232_port_device, write_txd)) + MCFG_Z80SCC_OUT_TXDA_CB(DEVWRITELINE(KEYBOARD_TAG, sun_keyboard_port_device, write_txd)) - MCFG_RS232_PORT_ADD(KEYBOARD_TAG, keyboard_devices, "keyboard") - MCFG_RS232_RXD_HANDLER(DEVWRITELINE(SCC1_TAG, z80scc_device, rxa_w)) + MCFG_SUNKBD_PORT_ADD(KEYBOARD_TAG, default_sun_keyboard_devices, "type5hle") + MCFG_SUNKBD_RXD_HANDLER(DEVWRITELINE(SCC1_TAG, z80scc_device, rxa_w)) // RS232 serial ports MCFG_SCC8530_ADD(SCC2_TAG, XTAL_4_9152MHz, 0, 0, 0, 0) @@ -1684,6 +2055,17 @@ static MACHINE_CONFIG_START( sun4c, sun4_state ) MCFG_RS232_DCD_HANDLER(DEVWRITELINE(SCC2_TAG, z80scc_device, dcdb_w)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE(SCC2_TAG, z80scc_device, ctsb_w)) + MCFG_NSCSI_BUS_ADD("scsibus") + MCFG_NSCSI_ADD("scsibus:0", sun_scsi_devices, "harddisk", false) + MCFG_NSCSI_ADD("scsibus:1", sun_scsi_devices, "cdrom", false) + MCFG_NSCSI_ADD("scsibus:2", sun_scsi_devices, nullptr, false) + MCFG_NSCSI_ADD("scsibus:3", sun_scsi_devices, nullptr, false) + MCFG_NSCSI_ADD("scsibus:4", sun_scsi_devices, nullptr, false) + MCFG_NSCSI_ADD("scsibus:5", sun_scsi_devices, nullptr, false) + MCFG_NSCSI_ADD("scsibus:6", sun_scsi_devices, nullptr, false) + MCFG_NSCSI_ADD("scsibus:7", sun_scsi_devices, "ncr5390", true) + MCFG_DEVICE_CARD_MACHINE_CONFIG("ncr5390", ncr5390) + MCFG_SCREEN_ADD("bwtwo", RASTER) MCFG_SCREEN_UPDATE_DRIVER(sun4_state, bw2_update) MCFG_SCREEN_SIZE(1152,900) @@ -1820,12 +2202,14 @@ ROM_START( sun4_400 ) ROM_END // SPARCstation IPC (Sun 4/40) +/* SCC init 1 for the keyboard is identical to Sun 4/75 init 3 */ ROM_START( sun4_40 ) ROM_REGION32_BE( 0x80000, "user1", ROMREGION_ERASEFF ) ROM_LOAD( "4.40_v2.9.rom", 0x0000, 0x40000, CRC(532fc20d) SHA1(d86d9e958017b3fecdf510d728a3e46a0ce3281d)) ROM_END // SPARCstation IPX (Sun 4/50) +/* SCC init 1-2 for the keyboard is identical to Sun 4/75 init 1-2 */ ROM_START( sun4_50 ) ROM_REGION32_BE( 0x80000, "user1", ROMREGION_ERASEFF ) ROM_SYSTEM_BIOS( 0, "v29", "V2.9") @@ -1835,12 +2219,31 @@ ROM_START( sun4_50 ) ROM_END // SPARCstation SLC (Sun 4/20) +/* SCC init 1 for the keyboard + * :scc1 A Reg 09 <- 02 Master Interrupt Control - No Reset, No vector + * :scc1 A Reg 04 <- 46 Setting up asynchronous frame format and clock, Parity Enable=0, Even Parity, Stop Bits 1, Clock Mode 16X + * :scc1 A Reg 03 <- c0 Setting up the receiver, Receiver Enable 0, Auto Enables 0, Receiver Bits/Character 8 + * :scc1 A Reg 05 <- e2 Setting up the transmitter, Transmitter Enable 0, Transmitter Bits/Character 8, Send Break 0, RTS=1 DTR=1 + * :scc1 A Reg 0e <- 82 Misc Control Bits Baudrate Generator Input DPLL Command - not implemented + * :scc1 A Reg 0b <- 55 Clock Mode Control 55 Clock type TTL level on RTxC pin, RCV CLK=BRG, TRA CLK=BRG, TRxC pin is Output, TRxC CLK=TRA CLK - not_implemented + * :scc1 A Reg 0c <- 0e Low byte of Time Constant for Baudrate generator -> 9600 baud + * :scc1 A Reg 0d <- 00 High byte of Time Constant for Baudrate generator + * :scc1 A Reg 03 <- c1 Setting up the receiver, Receiver Enable 1, Auto Enables 0, Receiver Bits/Character 8 + * :scc1 A Reg 05 <- ea Setting up the transmitter, Transmitter Enable 1, Transmitter Bits/Character 8, Send Break 0, RTS=1, DTR=1 + * :scc1 A Reg 0e <- 83 Misc Control Bits DPLL SRC=BRG Command - not implemented, BRG enabled SRC=PCLK, BRG SRC bps=38400=PCLK 4915200/128, BRG OUT 1200=38400/16 + * :scc1 A Reg 00 <- 10 Reset External/Status Interrupt + * :scc1 A Reg 00 <- 01 Null command, register resetted by read of WR0 + * :scc1 A Reg 0c <- 0e Low byte of Time Constant for Baudrate generator -> 9600 baud + * :scc1 A Reg 00 <- 01 Null command, register resetted by read of WR0 + * :scc1 A Reg 0f <- c0 External/Status Control Bits, DCD Interrupt=1, Status FIFO enable=1, Zero detect interrupt:1 WR7 Prime enable:1 - not implemented +*/ ROM_START( sun4_20 ) ROM_REGION32_BE( 0x80000, "user1", ROMREGION_ERASEFF ) ROM_LOAD( "520-2748-04.rom", 0x0000, 0x20000, CRC(e85b3fd8) SHA1(4cbc088f589375e2d5983f481f7d4261a408702e)) ROM_END // SPARCstation 1 (Sun 4/60) +/* SCC init 1 for the keyboard is identical to Sun 4/75 init 3 */ ROM_START( sun4_60 ) ROM_REGION32_BE( 0x80000, "user1", ROMREGION_ERASEFF ) ROM_LOAD( "ss1v29.rom", 0x0000, 0x20000, CRC(e3f103a9) SHA1(5e95835f1090ea94859bd005757f0e7b5e86181b)) @@ -1869,25 +2272,9 @@ ROM_END * :scc1 A Reg 0e <- 83 Misc Control Bits DPLL SRC=BRG Command - not implemented, BRG enabled SRC=PCLK, BRG SRC bps=38400=PCLK 4915200/128, BRG OUT 1200=38400/16 * :scc1 A Reg 00 <- 10 Reset External/Status Interrupt * :scc1 A Reg 00 <- 10 Reset External/Status Interrupt - - * SCC init 2 for the keyboard - * ------------------------------- - * :scc1 A Reg 09 <- c0 Master Interrupt Control - Device reset c0 A&B: RTS=1 DTR=1 INT=0 -scc1 int: 0 - * :scc1 A Reg 04 <- 46 Setting up asynchronous frame format and clock, Parity Enable=0, Even Parity, Stop Bits 1, Clock Mode 16X - * :scc1 A Reg 03 <- c0 Setting up the receiver, Receiver Enable 0, Auto Enables 0, Receiver Bits/Character 8 - * :scc1 A Reg 05 <- e2 Setting up the transmitter, Transmitter Enable 0, Transmitter Bits/Character 8, Send Break 0, RTS=1 DTR=1 - * :scc1 A Reg 09 <- 02 Master Interrupt Control - No reset 02 A&B: RTS=1 DTR=1 INT=0 - * :scc1 A Reg 0b <- 55 Clock Mode Control 55 Clock type TTL level on RTxC pin, RCV CLK=BRG, TRA CLK=BRG, TRxC pin is Output, TRxC CLK=TRA CLK - not_implemented - * :scc1 A Reg 0c <- 7e Low byte of Time Constant for Baudrate generator - * :scc1 A Reg 0d <- 00 High byte of Time Constant for Baudrate generator - * :scc1 A Reg 0e <- 82 Misc Control Bits Baudrate Generator Input DPLL Command - not implemented - * :scc1 A Reg 03 <- c1 Setting up the receiver, Receiver Enable 1, Auto Enables 0, Receiver Bits/Character 8 - * :scc1 A Reg 05 <- ea Setting up the transmitter, Transmitter Enable 1, Transmitter Bits/Character 8, Send Break 0, RTS=1, DTR=1 - * :scc1 A Reg 0e <- 83 Misc Control Bits DPLL SRC=BRG Command - not implemented, BRG enabled SRC=PCLK, BRG SRC bps=38400=PCLK 4915200/128, BRG OUT 1200=38400/16 - * :scc1 A Reg 00 <- 10 Reset External/Status Interrupt - * :scc1 A Reg 00 <- 10 Reset External/Status Interrupt - + * + * SCC init 2 for the keyboard - is Identical to init 1 + * * SCC init 3 for the keyboard - tricky one that reprogramms the baudrate constant as the last step. * ------------------------------------------------------------------------------------------------- * :scc1 A Reg 09 <- 02 Master Interrupt Control - No Reset, No vector @@ -1904,7 +2291,6 @@ scc1 int: 0 * :scc1 A Reg 00 <- 10 Reset External/Status Interrupt * :scc1 A Reg 00 <- 10 Reset External/Status Interrupt * :scc1 A Reg 0c <- 7e Low byte of Time Constant for Baudrate generator -> 1200 baud - */ ROM_START( sun4_75 ) ROM_REGION32_BE( 0x80000, "user1", ROMREGION_ERASEFF ) diff --git a/src/mame/drivers/tiamc1.cpp b/src/mame/drivers/tiamc1.cpp index 6edb584208b..77449e61fc1 100644 --- a/src/mame/drivers/tiamc1.cpp +++ b/src/mame/drivers/tiamc1.cpp @@ -114,12 +114,14 @@ - Check sprites priorities on the real hardware - Check vertical background scrolling on the real hardware - What charset control is used for? + - Kot Rybolov viewable area size likely controlled by pit8253 timers 0 and 1, used in test mode only */ -#define MASTER_CLOCK XTAL_16MHz -#define CPU_CLOCK MASTER_CLOCK / 9 -#define SND_CLOCK MASTER_CLOCK / 9 +#define MASTER_CLOCK (15750000) +#define CPU_CLOCK (MASTER_CLOCK / 9) +#define SND_CLOCK (MASTER_CLOCK / 9) +#define PIXEL_CLOCK (MASTER_CLOCK / 3) #include "emu.h" #include "cpu/i8085/i8085.h" @@ -138,25 +140,9 @@ WRITE8_MEMBER(tiamc1_state::tiamc1_control_w) machine().bookkeeping().coin_counter_w(0, data & 0x04); } -void tiamc1_state::update_speaker() -{ - int level = (!(pi8253_line_0 || pi8253_line_1) || pi8253_line_2) ? 1 : 0; // logic is guess - m_speaker->level_w(level); -} -WRITE_LINE_MEMBER(tiamc1_state::pit8253_0_w) -{ - pi8253_line_0 = state; - update_speaker(); -} -WRITE_LINE_MEMBER(tiamc1_state::pit8253_1_w) -{ - pi8253_line_1 = state; - update_speaker(); -} WRITE_LINE_MEMBER(tiamc1_state::pit8253_2_w) { - pi8253_line_2 = state; - update_speaker(); + m_speaker->level_w(state); } @@ -198,7 +184,7 @@ static ADDRESS_MAP_START( kotrybolov_io_map, AS_IO, 8, tiamc1_state ) AM_RANGE(0xe0, 0xef) AM_WRITE(tiamc1_palette_w) // color ram AM_RANGE(0xf0, 0xf0) AM_WRITE(tiamc1_bg_vshift_w) // background V scroll AM_RANGE(0xf4, 0xf4) AM_WRITE(tiamc1_bg_hshift_w) // background H scroll - AM_RANGE(0xf8, 0xf8) AM_WRITE(kot_bankswitch_w) // character rom offset, msb video on/off + AM_RANGE(0xf8, 0xf8) AM_WRITE(kot_bankswitch_w) // character rom offset AM_RANGE(0xc0, 0xc3) AM_DEVREADWRITE("pit8253", pit8253_device, read, write) AM_RANGE(0xd0, 0xd3) AM_DEVREADWRITE("kr580vv55a", i8255_device, read, write) /* input ports + coin counters & lockout */ ADDRESS_MAP_END @@ -238,7 +224,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( gorodki ) PORT_START("IN0") - PORT_BIT( 0xff, 152, IPT_PADDLE ) PORT_MINMAX(96, 208) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(1) + PORT_BIT( 0xff, 152, IPT_AD_STICK_X) PORT_MINMAX(96, 208) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(1) PORT_START("IN1") PORT_BIT( 0x7f, IP_ACTIVE_HIGH, IPT_UNUSED ) @@ -334,12 +320,10 @@ GFXDECODE_END static MACHINE_CONFIG_START( tiamc1, tiamc1_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", I8080, CPU_CLOCK) /* guess? */ + MCFG_CPU_ADD("maincpu", I8080, CPU_CLOCK) MCFG_CPU_PROGRAM_MAP(tiamc1_map) MCFG_CPU_IO_MAP(tiamc1_io_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", tiamc1_state, irq1_line_hold) - MCFG_DEVICE_ADD("kr580vv55a", I8255A, 0) /* soviet clone of i8255 */ MCFG_I8255_IN_PORTA_CB(IOPORT("IN0")) MCFG_I8255_IN_PORTB_CB(IOPORT("IN1")) @@ -348,10 +332,7 @@ static MACHINE_CONFIG_START( tiamc1, tiamc1_state ) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1600)) - MCFG_SCREEN_SIZE(256, 256) - MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1) + MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 336, 0, 256, 312, 0, 256) // pixel clock and htotal comes from docs/schematics, the rest is guess (determined by undumped PROM) MCFG_SCREEN_UPDATE_DRIVER(tiamc1_state, screen_update_tiamc1) MCFG_SCREEN_PALETTE("palette") @@ -362,7 +343,7 @@ static MACHINE_CONFIG_START( tiamc1, tiamc1_state ) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("2x8253", TIAMC1, SND_CLOCK) /* guess? */ + MCFG_SOUND_ADD("2x8253", TIAMC1, SND_CLOCK) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_CONFIG_END @@ -382,10 +363,7 @@ static MACHINE_CONFIG_DERIVED(kot, tiamc1) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MCFG_DEVICE_ADD("pit8253", PIT8253, 0) - MCFG_PIT8253_CLK0(SND_CLOCK) // guess - MCFG_PIT8253_OUT0_HANDLER(WRITELINE(tiamc1_state, pit8253_0_w)) - MCFG_PIT8253_CLK1(SND_CLOCK) // guess - MCFG_PIT8253_OUT1_HANDLER(WRITELINE(tiamc1_state, pit8253_1_w)) + MCFG_PIT8253_CLK0(PIXEL_CLOCK / 4) MCFG_PIT8253_CLK2(SND_CLOCK) // guess MCFG_PIT8253_OUT2_HANDLER(WRITELINE(tiamc1_state, pit8253_2_w)) MACHINE_CONFIG_END @@ -432,6 +410,12 @@ ROM_START( sosterm ) ROM_LOAD( "02.5a", 0x04000, 0x2000, CRC(9506cf9b) SHA1(3e54593d4452b956509877d9b6b26aa3e3a90beb) ) ROM_LOAD( "03.6a", 0x06000, 0x2000, CRC(5a0c14e1) SHA1(3eebe2c3ce114b87723fa6571623ee065a0b5646) ) + ROM_REGION( 0x0400, "proms", 0 ) + ROM_LOAD( "prom100.e10", 0x0000, 0x100, NO_DUMP ) /* i/o ports map 256x8 */ + ROM_LOAD( "prom101.a01", 0x0100, 0x100, NO_DUMP ) /* video sync 256x8 */ + ROM_LOAD( "prom102.b03", 0x0200, 0x080, NO_DUMP ) /* sprites rom index 256x4 */ + ROM_LOAD( "prom102.b06", 0x0280, 0x080, NO_DUMP ) /* buffer optimization logic 256x4 */ + ROM_LOAD( "prom102.b05", 0x0300, 0x100, NO_DUMP ) /* sprites rom index 256x8 */ ROM_END ROM_START( koroleva ) @@ -450,8 +434,15 @@ ROM_START( koroleva ) ROM_LOAD( "02.5a", 0x04000, 0x2000, CRC(97770b0f) SHA1(cf4605e31f8c57a76bfda6a7ea329058da8b8c9c) ) ROM_LOAD( "03.6a", 0x06000, 0x2000, CRC(9b0a686a) SHA1(f02910db9f862ec017bb3834c58e96e780fb6322) ) + ROM_REGION( 0x0400, "proms", 0 ) + ROM_LOAD( "prom100.e10", 0x0000, 0x100, NO_DUMP ) /* i/o ports map 256x8 */ + ROM_LOAD( "prom101.a01", 0x0100, 0x100, NO_DUMP ) /* video sync 256x8 */ + ROM_LOAD( "prom102.b03", 0x0200, 0x080, NO_DUMP ) /* sprites rom index 256x4 */ + ROM_LOAD( "prom102.b06", 0x0280, 0x080, NO_DUMP ) /* buffer optimization logic 256x4 */ + ROM_LOAD( "prom102.b05", 0x0300, 0x100, NO_DUMP ) /* sprites rom index 256x8 */ ROM_END +// this game ROM board have only one 2KB main CPU RAM IC populated ROM_START( bilyard ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "04.1g", 0x00000, 0x2000, CRC(a44f913d) SHA1(f01a0e931fb0f719bc7b3f1ca7802dd747c8a56f) ) @@ -467,8 +458,16 @@ ROM_START( bilyard ) ROM_LOAD( "01.3a", 0x02000, 0x2000, CRC(daddbbb5) SHA1(1460aebcbb57180e05930845703ff6325d85702a) ) ROM_LOAD( "02.5a", 0x04000, 0x2000, CRC(3d744d33) SHA1(f1375098e81986715d0497b09df0c6622bd75b9a) ) ROM_LOAD( "03.6a", 0x06000, 0x2000, CRC(8bfc0b15) SHA1(221efdce516274d3b1d9009d11dc9ed6cd67ef12) ) + + ROM_REGION( 0x0400, "proms", 0 ) + ROM_LOAD( "prom100.e10", 0x0000, 0x100, NO_DUMP ) /* i/o ports map 256x8 */ + ROM_LOAD( "prom101.a01", 0x0100, 0x100, NO_DUMP ) /* video sync 256x8 */ + ROM_LOAD( "prom102.b03", 0x0200, 0x080, NO_DUMP ) /* sprites rom index 256x4 */ + ROM_LOAD( "prom102.b06", 0x0280, 0x080, NO_DUMP ) /* buffer optimization logic 256x4 */ + ROM_LOAD( "prom102.b05", 0x0300, 0x100, NO_DUMP ) /* sprites rom index 256x8 */ ROM_END +// this game ROM board have only one 2KB main CPU RAM IC populated ROM_START( gorodki ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "70.1g", 0x00000, 0x2000, CRC(bd3eb624) SHA1(acfc7e7186daf399f858a0d0cf462b0eaabb3f9e) ) @@ -485,6 +484,12 @@ ROM_START( gorodki ) ROM_LOAD( "68.5a", 0x04000, 0x2000, CRC(0d64708d) SHA1(6a84b4293f0e983424ef361ab3ebf62ab5f8b21c) ) ROM_LOAD( "69.6a", 0x06000, 0x2000, CRC(57c8ae81) SHA1(c73bbfaa53195a19599dd2bbc3948c819597b035) ) + ROM_REGION( 0x0400, "proms", 0 ) + ROM_LOAD( "prom100.e10", 0x0000, 0x100, NO_DUMP ) /* i/o ports map 256x8 */ + ROM_LOAD( "prom101.a01", 0x0100, 0x100, NO_DUMP ) /* video sync 256x8 */ + ROM_LOAD( "prom102.b03", 0x0200, 0x080, NO_DUMP ) /* sprites rom index 256x4 */ + ROM_LOAD( "prom102.b06", 0x0280, 0x080, NO_DUMP ) /* buffer optimization logic 256x4 */ + ROM_LOAD( "prom102.b05", 0x0300, 0x100, NO_DUMP ) /* sprites rom index 256x8 */ ROM_END /* @@ -492,10 +497,10 @@ ROM_END ROM-based tile generator, sinle bank tile map RAM, single i8253 Specs: - 1x KR580VM80A (Russian: КР580ВМ80А. Soviet clone of i8080). - 1x KR580VV55A (Russian: КР580ВВ55A. Soviet clone of i8255). - 1x KR580VI53 (soviet clone of i8253). - 1x КR580ВК28 (Russian: KP580VK28. Soviet clone of i8228: bus controllers/drivers). + 1x KR580VM80A (Russian: KP580BM80A. Soviet clone of i8080). + 1x KR580VV55A (Russian: KP580BB55A. Soviet clone of i8255). + 1x KR580VI53 (Soviet clone of i8253) + 1x KR580VK28 (Russian: KP580BK28. Soviet clone of i8228: bus controllers/drivers). 1x K174YH7 (soviet clone of TBA810, 7W audio amplifier). @@ -507,7 +512,12 @@ ROM_END Sometimes the code tries to write through a port that was previously set as input. Not sure if it's a leftover, a bug, or just some differences against the i8255. Needs more research. - + + KR580VI53/i8253 timers usage: + 0 - used to blank part of display in horizontal direction, apparently it's CLK0 is PIXEL_CLOCK/4, GATE0 is HBlank, OUT0 - blank video + 1 - used to blank part of display in vertical direction, apparently it's CLK1 is HBlank or OUT0, GATE1 is VBlank, OUT1 - blank video + 2 - sound generation + */ ROM_START( kot ) ROM_REGION( 0xc000, "maincpu", ROMREGION_ERASE00) diff --git a/src/mame/drivers/tv990.cpp b/src/mame/drivers/tv990.cpp index 9ca2d4c61cf..574cf9eeee8 100644 --- a/src/mame/drivers/tv990.cpp +++ b/src/mame/drivers/tv990.cpp @@ -56,7 +56,8 @@ public: m_vram(*this, "vram"), m_fontram(*this, "fontram"), m_uart0(*this, UART0_TAG), - m_uart1(*this, UART1_TAG) + m_uart1(*this, UART1_TAG), + m_screen(*this, "screen") { } @@ -64,8 +65,11 @@ public: required_shared_ptr<UINT16> m_vram; required_shared_ptr<UINT16> m_fontram; required_device<ns16450_device> m_uart0, m_uart1; + required_device<screen_device> m_screen; virtual void machine_reset() override; + virtual void machine_start() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -79,7 +83,7 @@ public: DECLARE_WRITE_LINE_MEMBER(keyboard_clock_w); DECLARE_WRITE_LINE_MEMBER(keyboard_data_w); - + INTERRUPT_GEN_MEMBER(vblank); private: UINT16 tvi1111_regs[(0x100/2)+2]; @@ -88,8 +92,28 @@ private: UINT8 m_scancode; int m_kbit; int m_idstage; + emu_timer *m_rowtimer; }; +INTERRUPT_GEN_MEMBER(tv990_state::vblank) +{ + m_rowtimer->adjust(m_screen->time_until_pos(16)); + m_maincpu->set_input_line(M68K_IRQ_6, ASSERT_LINE); + tvi1111_regs[0x1d] |= 4; +} + +void tv990_state::machine_start() +{ + m_rowtimer = timer_alloc(); +} + +void tv990_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + m_rowtimer->adjust(m_screen->time_until_pos(m_screen->vpos() + 16)); + m_maincpu->set_input_line(M68K_IRQ_6, ASSERT_LINE); + m_screen->update_now(); +} + WRITE_LINE_MEMBER(tv990_state::uart0_irq) { m_maincpu->set_input_line(M68K_IRQ_5, state); @@ -106,6 +130,10 @@ READ16_MEMBER(tv990_state::tvi1111_r) { tvi1111_regs[offset] |= 8; // loop at 109ca wants this set } + else if(offset == 0x1d) + { + m_maincpu->set_input_line(M68K_IRQ_6, CLEAR_LINE); + } return tvi1111_regs[offset]; } @@ -130,11 +158,6 @@ WRITE16_MEMBER(tv990_state::tvi1111_w) } #endif COMBINE_DATA(&tvi1111_regs[offset]); - - if (offset == 0x1d) - { - tvi1111_regs[offset] |= 4; - } } UINT32 tv990_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) @@ -148,22 +171,25 @@ UINT32 tv990_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, c UINT8 *fontram = (UINT8 *)m_fontram.target(); UINT16 *curchar; UINT8 *fontptr; + int miny = cliprect.min_y / 16; + int maxy = cliprect.max_y / 16; + int minx = cliprect.min_x / 16; + int maxx = cliprect.max_x / 16; - for (y = 0; y < 50; y++) + for (y = miny; y <= maxy; y++) { // this isn't exactly right. - if (tvi1111_regs[y+0x50] != 0) - { - curchar = &vram[tvi1111_regs[y+0x50]]; - } - else + int i; + for(i = 0x50; i < 0x68; i++) { - curchar = &vram[(y * 144)+1]; + if(tvi1111_regs[i] != 0x1ad5) + break; } - - for (x = 0; x < 80; x++) + curchar = &vram[tvi1111_regs[i]]; + + for (x = minx; x <= maxx; x++) { - fontptr = (UINT8 *)&fontram[((curchar[x]>>8) & 0xff) * 64]; + fontptr = (UINT8 *)&fontram[(((curchar[x]>>8) & 0xff) + (curchar[x] & 0x40 ? 256 : 0)) * 64]; for (int chary = 0; chary < 16; chary++) { @@ -171,7 +197,12 @@ UINT32 tv990_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, c pixels = *fontptr++; pixels2 = *fontptr++; - + if((curchar[x] & 0x8) && (chary == 15)) + { + pixels = 0xff; + pixels2 = 0xff; + } + if (curchar[x] & 0x4) // inverse video? { *scanline++ = invpalette[(pixels>>7)&1]; @@ -339,6 +370,7 @@ void tv990_state::machine_reset() m_kbit = 0; m_scancode = 0; m_idstage = 0; + m_rowtimer->adjust(m_screen->time_until_pos(0)); memset(tvi1111_regs, 0, sizeof(tvi1111_regs)); } @@ -347,7 +379,7 @@ static MACHINE_CONFIG_START( tv990, tv990_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, 14967500) // verified (59.86992/4) MCFG_CPU_PROGRAM_MAP(tv990_mem) - MCFG_CPU_VBLANK_INT_DRIVER("screen", tv990_state, irq6_line_hold) + MCFG_CPU_VBLANK_INT_DRIVER("screen", tv990_state, vblank) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_UPDATE_DRIVER(tv990_state, screen_update) diff --git a/src/mame/includes/bbc.h b/src/mame/includes/bbc.h index e8c11b2c3ef..b8f217c7ee6 100644 --- a/src/mame/includes/bbc.h +++ b/src/mame/includes/bbc.h @@ -164,6 +164,7 @@ public: TIMER_CALLBACK_MEMBER(bbc_tape_timer_cb); DECLARE_WRITE_LINE_MEMBER(write_acia_clock); DECLARE_WRITE_LINE_MEMBER(bbcb_acia6850_irq_w); + DECLARE_WRITE_LINE_MEMBER(adlc_irq_w); DECLARE_WRITE_LINE_MEMBER(econet_clk_w); DECLARE_WRITE8_MEMBER(bbcb_via_system_write_porta); DECLARE_WRITE8_MEMBER(bbcb_via_system_write_portb); @@ -336,9 +337,12 @@ public: // HACK FOR MC6845 int m_MC146818_CE; // 6522 port b bit 6 int m_via_system_porta; + + // interrupt state int m_via_system_irq; int m_via_user_irq; int m_acia_irq; + int m_adlc_irq; int m_column; // this is a counter in the keyboard circuit diff --git a/src/mame/includes/osborne1.h b/src/mame/includes/osborne1.h index 7a7e6d64a84..6414cfa84c8 100644 --- a/src/mame/includes/osborne1.h +++ b/src/mame/includes/osborne1.h @@ -38,8 +38,8 @@ public: m_fdc(*this, "mb8877"), m_ram(*this, RAM_TAG), m_ieee(*this, IEEE488_TAG), - m_floppy0(*this, "mb8877:0:525ssdd"), - m_floppy1(*this, "mb8877:1:525ssdd"), + m_floppy0(*this, "mb8877:0"), + m_floppy1(*this, "mb8877:1"), m_keyb_row0(*this, "ROW0"), m_keyb_row1(*this, "ROW1"), m_keyb_row2(*this, "ROW2"), @@ -95,8 +95,8 @@ public: required_device<mb8877_t> m_fdc; required_device<ram_device> m_ram; required_device<ieee488_device> m_ieee; - required_device<floppy_image_device> m_floppy0; - required_device<floppy_image_device> m_floppy1; + required_device<floppy_connector> m_floppy0; + required_device<floppy_connector> m_floppy1; protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; diff --git a/src/mame/includes/pasopia.h b/src/mame/includes/pasopia.h index 80902e20682..2fdd22986c8 100644 --- a/src/mame/includes/pasopia.h +++ b/src/mame/includes/pasopia.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Angelo Salese #define PASOPIA_KEYBOARD \ - PORT_START("KEY0") \ + PORT_START("KEY.0") \ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_SHIFT_2) \ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) \ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CAPS LOCK") PORT_CODE(KEYCODE_CAPSLOCK) \ @@ -18,7 +18,7 @@ PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) \ PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) \ PORT_DIPSETTING( 0x80, DEF_STR( On ) ) \ - PORT_START("KEY1") \ + PORT_START("KEY.1") \ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0_PAD) \ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1_PAD) \ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2_PAD) \ @@ -27,7 +27,7 @@ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5_PAD) \ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6_PAD) \ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7_PAD) \ - PORT_START("KEY2") \ + PORT_START("KEY.2") \ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8_PAD) \ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9_PAD) \ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS_PAD) \ @@ -36,7 +36,7 @@ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_HOME) PORT_NAME("Home") \ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL_PAD) \ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) \ - PORT_START("KEY3") \ + PORT_START("KEY.3") \ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_RIGHT) PORT_NAME("RIGHT") \ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Status?") \ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("BACKSPACE") PORT_CHAR(8) \ @@ -53,7 +53,7 @@ PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) \ PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) \ PORT_DIPSETTING( 0x80, DEF_STR( On ) ) \ - PORT_START("KEY4") \ + PORT_START("KEY.4") \ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_END) PORT_NAME("StatusLine") \ PORT_DIPNAME( 0x02, 0x00, "4" ) \ PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) \ @@ -72,7 +72,7 @@ PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) \ PORT_DIPSETTING( 0x40, DEF_STR( On ) ) \ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_NAME("SPACE") PORT_CHAR(' ') \ - PORT_START("KEY5") \ + PORT_START("KEY.5") \ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F1) PORT_NAME("F1") \ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F2) PORT_NAME("F2") \ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F3) PORT_NAME("F3") \ @@ -81,16 +81,16 @@ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F6) PORT_NAME("F6") \ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F7) PORT_NAME("F7") \ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F8) PORT_NAME("F8") \ - PORT_START("KEY6") \ - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_NAME("1") PORT_CHAR('1') PORT_CHAR('1') \ + PORT_START("KEY.6") \ + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_NAME("1") PORT_CHAR('1') PORT_CHAR('!') \ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_NAME("0") PORT_CHAR('0') PORT_CHAR('0') \ - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_NAME("4") PORT_CHAR('4') PORT_CHAR('O') \ - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_NAME("R") PORT_CHAR('r') PORT_CHAR('O') \ - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_NAME("Y") PORT_CHAR('y') PORT_CHAR('O') \ + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_NAME("4") PORT_CHAR('4') PORT_CHAR('$') \ + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_NAME("R") PORT_CHAR('R') PORT_CHAR('r') \ + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_NAME("Y") PORT_CHAR('Y') PORT_CHAR('y') \ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("_") PORT_CHAR('_') \ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_NAME("^") \ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Yen") \ - PORT_START("KEY7") \ + PORT_START("KEY.7") \ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_NAME("2") PORT_CHAR('2') PORT_CHAR('"') \ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_NAME("3") PORT_CHAR('3') PORT_CHAR('#') \ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_NAME("8") PORT_CHAR('8') PORT_CHAR('(') \ @@ -99,7 +99,7 @@ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_NAME("7") PORT_CHAR('7') PORT_CHAR('\'') \ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_NAME("@") PORT_CHAR('@') \ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("[ {") PORT_CHAR('[') PORT_CHAR('{') \ - PORT_START("KEY8") \ + PORT_START("KEY.8") \ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_NAME("-") PORT_CHAR('-') PORT_CHAR('=') \ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_NAME("5") PORT_CHAR('5') PORT_CHAR('%') \ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_NAME("6") PORT_CHAR('6') PORT_CHAR('&') \ @@ -108,7 +108,7 @@ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_NAME("9") PORT_CHAR('9') PORT_CHAR(')') \ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_NAME(": *") PORT_CHAR(':') PORT_CHAR('*') \ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("] }") PORT_CHAR(']') PORT_CHAR('}') \ - PORT_START("KEY9") \ + PORT_START("KEY.9") \ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_NAME("Q") PORT_CHAR('Q') PORT_CHAR('q') \ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_NAME("W") PORT_CHAR('W') PORT_CHAR('w') \ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_NAME("E") PORT_CHAR('E') PORT_CHAR('e') \ @@ -117,7 +117,7 @@ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_NAME("I") PORT_CHAR('I') PORT_CHAR('i') \ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_NAME("O") PORT_CHAR('O') PORT_CHAR('o') \ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_NAME("P") PORT_CHAR('P') PORT_CHAR('p') \ - PORT_START("KEYA") \ + PORT_START("KEY.10") \ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_NAME("A") PORT_CHAR('A') PORT_CHAR('a') \ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_NAME("S") PORT_CHAR('S') PORT_CHAR('s') \ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_NAME("D") PORT_CHAR('D') PORT_CHAR('d') \ @@ -126,7 +126,7 @@ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_NAME("K") PORT_CHAR('K') PORT_CHAR('k') \ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_NAME("L") PORT_CHAR('L') PORT_CHAR('l') \ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_NAME("; +") PORT_CHAR(';') PORT_CHAR('+') \ - PORT_START("KEYB") \ + PORT_START("KEY.11") \ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_NAME("Z") PORT_CHAR('Z') PORT_CHAR('z') \ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_NAME("X") PORT_CHAR('X') PORT_CHAR('x') \ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_NAME("C") PORT_CHAR('C') PORT_CHAR('c') \ diff --git a/src/mame/includes/seibuspi.h b/src/mame/includes/seibuspi.h index e1a13238284..074a4a2a327 100644 --- a/src/mame/includes/seibuspi.h +++ b/src/mame/includes/seibuspi.h @@ -28,7 +28,9 @@ public: m_oki1(*this, "oki1"), m_oki2(*this, "oki2"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") + m_palette(*this, "palette"), + m_key(*this, "KEY"), + m_special(*this, "SPECIAL") { } required_device<cpu_device> m_maincpu; @@ -45,6 +47,9 @@ public: required_device<gfxdecode_device> m_gfxdecode; required_device<palette_device> m_palette; + optional_ioport_array<5> m_key; + optional_ioport m_special; + int m_z80_prg_transfer_pos; int m_z80_lastbank; UINT8 m_sb_coin_latch; diff --git a/src/mame/includes/tiamc1.h b/src/mame/includes/tiamc1.h index 9cbc19a6a58..2766b994339 100644 --- a/src/mame/includes/tiamc1.h +++ b/src/mame/includes/tiamc1.h @@ -40,8 +40,6 @@ public: DECLARE_WRITE8_MEMBER(tiamc1_palette_w); DECLARE_WRITE8_MEMBER(kot_bankswitch_w); DECLARE_WRITE8_MEMBER(kot_videoram_w); - DECLARE_WRITE_LINE_MEMBER(pit8253_0_w); - DECLARE_WRITE_LINE_MEMBER(pit8253_1_w); DECLARE_WRITE_LINE_MEMBER(pit8253_2_w); TILE_GET_INFO_MEMBER(get_bg1_tile_info); @@ -57,10 +55,6 @@ public: required_device<gfxdecode_device> m_gfxdecode; required_device<palette_device> m_palette; private: - bool pi8253_line_0; - bool pi8253_line_1; - bool pi8253_line_2; - void update_speaker(); optional_device<speaker_sound_device> m_speaker; }; diff --git a/src/mame/machine/amstrad.cpp b/src/mame/machine/amstrad.cpp index 9e2a4afb4a2..a26ebcbc07d 100644 --- a/src/mame/machine/amstrad.cpp +++ b/src/mame/machine/amstrad.cpp @@ -413,7 +413,7 @@ void amstrad_state::amstrad_vh_update_mode() break; case 3: /* Mode 3: 160x200, 4 colours */ - m_gate_array.mode_lookup = m_mode0_lookup; + m_gate_array.mode_lookup = m_mode1_lookup; m_gate_array.max_colour_ticks = 4; m_gate_array.ticks_increment = 1; break; @@ -475,7 +475,7 @@ void amstrad_state::amstrad_vh_update_mode() break; case 3: /* Mode 3: 160x200, 4 colours */ - m_gate_array.mode_lookup = m_mode0_lookup; + m_gate_array.mode_lookup = m_mode1_lookup; m_gate_array.max_colour_ticks = 4; m_gate_array.ticks_increment = 1; break; @@ -1996,6 +1996,16 @@ void amstrad_state::amstrad_plus_seqcheck(int data) m_asic.enabled = 1; } } + else + { + // last byte of ASIC sequence can be any value + if(m_asic.seqptr == 14) + { + m_asic.seqptr++; + logerror("SYS: ASIC unlocked\n"); + m_asic.enabled = 1; + } + } m_prev_data = data; } diff --git a/src/mame/machine/awboard.cpp b/src/mame/machine/awboard.cpp index 03cd59a9118..b2374e52858 100644 --- a/src/mame/machine/awboard.cpp +++ b/src/mame/machine/awboard.cpp @@ -89,8 +89,8 @@ ROM board internal layouts: Type 1: 00000000 - 00800000 IC18 flash ROM - 00800000 - 01000000 mirror of above - 01000000 - 02000000 IC10 \ + 00800000 - 01000000 IC10 or mirror of above + 01000000 - 02000000 IC11 \ ..... mask ROMs 07000000 - 08000000 IC17 / diff --git a/src/mame/machine/bbc.cpp b/src/mame/machine/bbc.cpp index 114a546eb95..7a9317feeb3 100644 --- a/src/mame/machine/bbc.cpp +++ b/src/mame/machine/bbc.cpp @@ -24,7 +24,9 @@ void bbc_state::check_interrupts() { - m_maincpu->set_input_line(M6502_IRQ_LINE, m_via_system_irq || m_via_user_irq || m_acia_irq || m_ACCCON_IRR); + int irq = (m_via_system_irq || m_via_user_irq || m_acia_irq || m_ACCCON_IRR) ? ASSERT_LINE : CLEAR_LINE; + + m_maincpu->set_input_line(M6502_IRQ_LINE, irq); } /************************* @@ -1344,6 +1346,14 @@ WRITE_LINE_MEMBER( bbc_state::bbc_txd_w ) } +WRITE_LINE_MEMBER( bbc_state::bbcb_acia6850_irq_w ) +{ + m_acia_irq = state; + + check_interrupts(); +} + + void bbc_state::BBC_Cassette_motor(unsigned char status) { if (status) diff --git a/src/mame/machine/microdrv.h b/src/mame/machine/microdrv.h index 7c4c79ba3da..0b7b69fcd90 100644 --- a/src/mame/machine/microdrv.h +++ b/src/mame/machine/microdrv.h @@ -50,7 +50,7 @@ public: // image-level overrides virtual bool call_load() override; virtual void call_unload() override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override { return load_software(swlist, swname, start_entry); } + virtual const software_list_loader &get_software_list_loader() const override { return image_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CASSETTE; } diff --git a/src/mame/machine/opwolf.cpp b/src/mame/machine/opwolf.cpp index 021c6e3f389..9bb86e05f0c 100644 --- a/src/mame/machine/opwolf.cpp +++ b/src/mame/machine/opwolf.cpp @@ -546,7 +546,7 @@ TIMER_CALLBACK_MEMBER(opwolf_state::opwolf_timer_callback) m_cchip_ram[0x1a] = 0; m_cchip_ram[0x7a] = 1; // Signal command complete - logerror("Signal level command complete\n"); + //logerror("Signal level command complete\n"); } m_current_cmd = 0; @@ -867,7 +867,7 @@ TIMER_CALLBACK_MEMBER(opwolf_state::cchip_timer) // starts the 'WARNING' sequences for the boss. else if (m_cchip_ram[0x1b] == 0x2) { - if (m_triggeredLevel2==0) + if (m_triggeredLevel2==0 && m_cchip_ram[0x5f]==0) // Don't write unless 68K is ready (0 at 0x5f) { m_cchip_ram[0x5f] = 4; // 0xBE at 68K side m_triggeredLevel2=1; @@ -879,6 +879,7 @@ TIMER_CALLBACK_MEMBER(opwolf_state::cchip_timer) { // Signal end of level m_cchip_ram[0x32] = 1; + m_cchip_ram[0x5d] = 0; // acknowledge 68K command } } else if (m_cchip_ram[0x1b] == 0x4) @@ -886,10 +887,11 @@ TIMER_CALLBACK_MEMBER(opwolf_state::cchip_timer) m_cchip_ram[0x32] = 1; // When level 4 (powder magazine) is complete the c-chip triggers an explosion animation. - if (m_triggeredLevel4==0) + if (m_triggeredLevel4==0 && m_cchip_ram[0x5f]==0) // Don't write unless 68K is ready (0 at 0x5f)) + { m_cchip_ram[0x5f]=10; - - m_triggeredLevel4=1; + m_triggeredLevel4=1; + } } else { @@ -905,21 +907,21 @@ TIMER_CALLBACK_MEMBER(opwolf_state::cchip_timer) if (m_cchip_ram[0x1c] == 0 && m_cchip_ram[0x1d] == 0) { // Compare code at 0x96DC in prototype with 0xC3A2 in protected version - if (m_cchip_ram[0x1b] == 0x1 && m_triggeredLevel1b==0) + if (m_cchip_ram[0x1b] == 0x1 && m_triggeredLevel1b==0 && m_cchip_ram[0x5f]==0) // Don't write unless 68K is ready (0 at 0x5f)) { m_cchip_ram[0x5f]=7; m_triggeredLevel1b=1; } // Compare code at 0x96BC in prototype with 0xC3B2 in protected version - if (m_cchip_ram[0x1b] == 0x3 && m_triggeredLevel3b==0) + if (m_cchip_ram[0x1b] == 0x3 && m_triggeredLevel3b==0 && m_cchip_ram[0x5f]==0) // Don't write unless 68K is ready (0 at 0x5f)) { m_cchip_ram[0x5f]=8; m_triggeredLevel3b=1; } // Compare code at 0x96BC in prototype with 0xC3C8 in protected version - if ((m_cchip_ram[0x1b] != 0x1 && m_cchip_ram[0x1b] != 0x3) && m_triggeredLevel13b==0) + if ((m_cchip_ram[0x1b] != 0x1 && m_cchip_ram[0x1b] != 0x3) && m_triggeredLevel13b==0 && m_cchip_ram[0x5f]==0) // Don't write unless 68K is ready (0 at 0x5f)) { m_cchip_ram[0x5f]=9; m_triggeredLevel13b=1; @@ -934,14 +936,15 @@ TIMER_CALLBACK_MEMBER(opwolf_state::cchip_timer) if (m_cchip_ram[0x1b] == 0x2) { // (Note: it's correct that 25 decimal is represented as 0x25 in hex here). - if (((m_cchip_ram[0x1d]<<8) + m_cchip_ram[0x1c])<0x25 && m_triggeredLevel2b==1 && m_triggeredLevel2c==0) + int numMen=(m_cchip_ram[0x1d]<<8) + m_cchip_ram[0x1c]; + if (numMen<0x25 && m_triggeredLevel2b==1 && m_triggeredLevel2c==0 && m_cchip_ram[0x5f]==0) // Don't write unless 68K is ready (0 at 0x5f)) { m_cchip_ram[0x5f]=6; m_triggeredLevel2c=1; } // (Note: it's correct that 45 decimal is represented as 0x45 in hex here). - if (((m_cchip_ram[0x1d]<<8) + m_cchip_ram[0x1c])<0x45 && m_triggeredLevel2b==0) + if (numMen<0x45 && m_triggeredLevel2b==0 && m_cchip_ram[0x5f]==0) // Don't write unless 68K is ready (0 at 0x5f)) { m_cchip_ram[0x5f]=5; m_triggeredLevel2b=1; @@ -1032,7 +1035,7 @@ TIMER_CALLBACK_MEMBER(opwolf_state::cchip_timer) //------------------------------------------------------------------------------------------------- // Start of level 7 - should trigger '1' in level thread table (compare 0xC164 in protected to 0x9468 in unprotected) - if (m_cchip_ram[0x1b] == 0x7 && m_triggeredLevel7==0) + if (m_cchip_ram[0x1b] == 0x7 && m_triggeredLevel7==0 && m_cchip_ram[0x5f]==0) // Don't write unless 68K is ready (0 at 0x5f)) { m_triggeredLevel7 = 1; m_cchip_ram[0x5f] = 1; @@ -1041,7 +1044,7 @@ TIMER_CALLBACK_MEMBER(opwolf_state::cchip_timer) //------------------------------------------------------------------------------------------------- // Start of level 8 - should trigger '2' in level thread table (compare 0xC18E in protected to 0x9358 in unprotected) // This controls the 'zoom in helicopters' enemy - if (m_cchip_ram[0x1b] == 0x8 && m_triggeredLevel8==0) + if (m_cchip_ram[0x1b] == 0x8 && m_triggeredLevel8==0 && m_cchip_ram[0x5f]==0) // Don't write unless 68K is ready (0 at 0x5f)) { m_triggeredLevel8 = 1; m_cchip_ram[0x5f] = 2; @@ -1050,7 +1053,7 @@ TIMER_CALLBACK_MEMBER(opwolf_state::cchip_timer) //------------------------------------------------------------------------------------------------- // Start of level 9 - should trigger '3' in level thread table (compare 0xC1B0 in protected to 0x9500 in unprotected) // This controls the 'zoom in helicopters' enemy - if (m_cchip_ram[0x1b] == 0x9 && m_triggeredLevel9==0) + if (m_cchip_ram[0x1b] == 0x9 && m_triggeredLevel9==0 && m_cchip_ram[0x5f]==0) // Don't write unless 68K is ready (0 at 0x5f)) { m_triggeredLevel9 = 1; m_cchip_ram[0x5f] = 3; diff --git a/src/mame/machine/osborne1.cpp b/src/mame/machine/osborne1.cpp index 7fc4029677b..7868323486a 100644 --- a/src/mame/machine/osborne1.cpp +++ b/src/mame/machine/osborne1.cpp @@ -221,13 +221,13 @@ WRITE8_MEMBER( osborne1_state::video_pia_port_b_w ) if (BIT(data, 6)) { - m_fdc->set_floppy(m_floppy0); - m_floppy0->mon_w(0); + m_fdc->set_floppy(m_floppy0->get_device()); + m_floppy0->get_device()->mon_w(0); } else if (BIT(data, 7)) { - m_fdc->set_floppy(m_floppy1); - m_floppy1->mon_w(0); + m_fdc->set_floppy(m_floppy1->get_device()); + m_floppy1->get_device()->mon_w(0); } else { diff --git a/src/mame/machine/psion_pack.h b/src/mame/machine/psion_pack.h index 708ec9a5dbd..9347b950c11 100644 --- a/src/mame/machine/psion_pack.h +++ b/src/mame/machine/psion_pack.h @@ -28,7 +28,7 @@ public: virtual bool call_load() override; virtual void call_unload() override; virtual bool call_create(int format_type, util::option_resolution *create_args) override; - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) override { return load_software(swlist, swname, start_entry); } + virtual const software_list_loader &get_software_list_loader() const override { return image_software_list_loader::instance(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } virtual bool is_readable() const override { return 1; } diff --git a/src/mame/machine/victor9k_fdc.cpp b/src/mame/machine/victor9k_fdc.cpp index 61bd336b47e..6b7ec9db758 100644 --- a/src/mame/machine/victor9k_fdc.cpp +++ b/src/mame/machine/victor9k_fdc.cpp @@ -226,8 +226,8 @@ victor_9000_fdc_t::victor_9000_fdc_t(const machine_config &mconfig, const char * m_via4(*this, M6522_4_TAG), m_via5(*this, M6522_5_TAG), m_via6(*this, M6522_6_TAG), - m_floppy0(*this, I8048_TAG":0:525qd"), - m_floppy1(*this, I8048_TAG":1:525qd"), + m_floppy0(*this, I8048_TAG":0"), + m_floppy1(*this, I8048_TAG":1"), m_gcr_rom(*this, "gcr"), m_da(0), m_da0(0), @@ -321,11 +321,17 @@ void victor_9000_fdc_t::device_reset() m_via6->reset(); // set floppy callbacks - m_floppy0->setup_load_cb(floppy_image_device::load_cb(FUNC(victor_9000_fdc_t::load0_cb), this)); - m_floppy0->setup_unload_cb(floppy_image_device::unload_cb(FUNC(victor_9000_fdc_t::unload0_cb), this)); + if (m_floppy0->get_device()) + { + m_floppy0->get_device()->setup_load_cb(floppy_image_device::load_cb(FUNC(victor_9000_fdc_t::load0_cb), this)); + m_floppy0->get_device()->setup_unload_cb(floppy_image_device::unload_cb(FUNC(victor_9000_fdc_t::unload0_cb), this)); + } - m_floppy1->setup_load_cb(floppy_image_device::load_cb(FUNC(victor_9000_fdc_t::load1_cb), this)); - m_floppy1->setup_unload_cb(floppy_image_device::unload_cb(FUNC(victor_9000_fdc_t::unload1_cb), this)); + if (m_floppy1->get_device()) + { + m_floppy1->get_device()->setup_load_cb(floppy_image_device::load_cb(FUNC(victor_9000_fdc_t::load1_cb), this)); + m_floppy1->get_device()->setup_unload_cb(floppy_image_device::unload_cb(FUNC(victor_9000_fdc_t::unload1_cb), this)); + } } @@ -491,16 +497,16 @@ WRITE8_MEMBER( victor_9000_fdc_t::floppy_p2_w ) m_start0 = start0; m_stop0 = stop0; m_sel0 = sel0; - //update_spindle_motor(m_floppy0, t_tach0, m_start0, m_stop0, m_sel0, m_da0); + //update_spindle_motor(m_floppy0->get_device(), t_tach0, m_start0, m_stop0, m_sel0, m_da0); m_start1 = start1; m_stop1 = stop1; m_sel1 = sel1; - //update_spindle_motor(m_floppy1, t_tach1, m_start1, m_stop1, m_sel1, m_da1); + //update_spindle_motor(m_floppy1->get_device(), t_tach1, m_start1, m_stop1, m_sel1, m_da1); checkpoint(); - if (!m_floppy0->mon_r() || !m_floppy1->mon_r()) { + if ((m_floppy0->get_device() && !m_floppy0->get_device()->mon_r()) || (m_floppy1->get_device() && !m_floppy1->get_device()->mon_r())) { if(cur_live.state == IDLE) { live_start(); } @@ -610,8 +616,8 @@ WRITE8_MEMBER( victor_9000_fdc_t::da_w ) { live_sync(); m_da = data; - update_spindle_motor(m_floppy0, t_tach0, m_start0, m_stop0, m_sel0, m_da0); - update_spindle_motor(m_floppy1, t_tach1, m_start1, m_stop1, m_sel1, m_da1); + if (m_floppy0->get_device()) update_spindle_motor(m_floppy0->get_device(), t_tach0, m_start0, m_stop0, m_sel0, m_da0); + if (m_floppy1->get_device()) update_spindle_motor(m_floppy1->get_device(), t_tach1, m_start1, m_stop1, m_sel1, m_da1); checkpoint(); live_run(); } @@ -657,8 +663,11 @@ WRITE8_MEMBER( victor_9000_fdc_t::via4_pa_w ) m_l0ms = data & 0x0f; { // HACK to bypass SCP - m_floppy0->mon_w((m_l0ms == 0xf) ? 1 : 0); - m_floppy0->set_rpm(victor9k_format::get_rpm(m_side, m_floppy0->get_cyl())); + if (m_floppy0->get_device()) + { + m_floppy0->get_device()->mon_w((m_l0ms == 0xf) ? 1 : 0); + m_floppy0->get_device()->set_rpm(victor9k_format::get_rpm(m_side, m_floppy0->get_device()->get_cyl())); + } m_rdy0 = (m_l0ms == 0xf) ? 0 : 1; m_via5->write_ca2(m_rdy0); } @@ -670,7 +679,7 @@ WRITE8_MEMBER( victor_9000_fdc_t::via4_pa_w ) if (m_st0 != st0) { live_sync(); - update_stepper_motor(m_floppy0, m_stp0, st0, m_st0); + if (m_floppy0->get_device()) update_stepper_motor(m_floppy0->get_device(), m_stp0, st0, m_st0); m_st0 = st0; checkpoint(); live_run(); @@ -717,8 +726,11 @@ WRITE8_MEMBER( victor_9000_fdc_t::via4_pb_w ) m_l1ms = data & 0x0f; { // HACK to bypass SCP - m_floppy1->mon_w((m_l1ms == 0xf) ? 1 : 0); - m_floppy1->set_rpm(victor9k_format::get_rpm(m_side, m_floppy1->get_cyl())); + if (m_floppy1->get_device()) + { + m_floppy1->get_device()->mon_w((m_l1ms == 0xf) ? 1 : 0); + m_floppy1->get_device()->set_rpm(victor9k_format::get_rpm(m_side, m_floppy1->get_device()->get_cyl())); + } m_rdy1 = (m_l1ms == 0xf) ? 0 : 1; m_via5->write_cb2(m_rdy1); } @@ -730,7 +742,7 @@ WRITE8_MEMBER( victor_9000_fdc_t::via4_pb_w ) if (m_st1 != st1) { live_sync(); - update_stepper_motor(m_floppy1, m_stp1, st1, m_st1); + if (m_floppy1->get_device()) update_stepper_motor(m_floppy1->get_device(), m_stp1, st1, m_st1); m_st1 = st1; checkpoint(); live_run(); @@ -830,18 +842,18 @@ READ8_MEMBER( victor_9000_fdc_t::via6_pa_r ) */ - if (LOG_VIA) logerror("%s %s TRK0D0 %u TRK0D1 %u SYNC %u\n", machine().time().as_string(), machine().describe_context(), m_floppy0->trk00_r(), m_floppy1->trk00_r(), checkpoint_live.sync); + if (LOG_VIA) logerror("%s %s TRK0D0 %u TRK0D1 %u SYNC %u\n", machine().time().as_string(), machine().describe_context(), m_floppy0->get_device() ? m_floppy0->get_device()->trk00_r() : 0, m_floppy1->get_device() ? m_floppy1->get_device()->trk00_r() : 0, checkpoint_live.sync); UINT8 data = 0; // track 0 drive A sense - data |= m_floppy0->trk00_r() << 1; + data |= (m_floppy0->get_device() ? m_floppy0->get_device()->trk00_r() : 0) << 1; // track 0 drive B sense - data |= m_floppy1->trk00_r() << 3; + data |= (m_floppy1->get_device() ? m_floppy1->get_device()->trk00_r() : 0) << 3; // write protect sense - data |= (m_drive ? m_floppy1->wpt_r() : m_floppy0->wpt_r()) << 6; + data |= (m_drive ? (m_floppy1->get_device() ? m_floppy1->get_device()->wpt_r() : 0) : (m_floppy0->get_device() ? m_floppy0->get_device()->wpt_r() : 0)) << 6; // disk sync detect data |= checkpoint_live.sync << 7; @@ -888,8 +900,8 @@ WRITE8_MEMBER( victor_9000_fdc_t::via6_pa_w ) m_side = side; cur_live.side = side; - m_floppy0->ss_w(side); - m_floppy1->ss_w(side); + if (m_floppy0->get_device()) m_floppy0->get_device()->ss_w(side); + if (m_floppy1->get_device()) m_floppy1->get_device()->ss_w(side); m_drive = drive; cur_live.drive = drive; @@ -927,10 +939,10 @@ READ8_MEMBER( victor_9000_fdc_t::via6_pb_r ) data |= m_rdy1 << 1; // door B sense - data |= (m_floppy1->exists() ? 0 : 1) << 3; + data |= ((m_floppy1->get_device() && m_floppy1->get_device()->exists()) ? 0 : 1) << 3; // door A sense - data |= (m_floppy0->exists() ? 0 : 1) << 4; + data |= ((m_floppy0->get_device() && m_floppy0->get_device()->exists()) ? 0 : 1) << 4; // single/double sided jumper //data |= 0x20; @@ -977,10 +989,10 @@ WRITE8_MEMBER( victor_9000_fdc_t::via6_pb_w ) live_sync(); m_stp0 = stp0; - update_stepper_motor(m_floppy0, m_stp0, m_st0, m_st0); + if (m_floppy0->get_device()) update_stepper_motor(m_floppy0->get_device(), m_stp0, m_st0, m_st0); m_stp1 = stp1; - update_stepper_motor(m_floppy1, m_stp1, m_st1, m_st1); + if (m_floppy1->get_device()) update_stepper_motor(m_floppy1->get_device(), m_stp1, m_st1, m_st1); if (LOG_VIA) logerror("%s %s STP0 %u STP1 %u\n", machine().time().as_string(), machine().describe_context(), stp0, stp1); @@ -1045,7 +1057,7 @@ WRITE8_MEMBER( victor_9000_fdc_t::cs7_w ) floppy_image_device* victor_9000_fdc_t::get_floppy() { - return m_drive ? m_floppy1 : m_floppy0; + return m_drive ? m_floppy1->get_device() : m_floppy0->get_device(); } void victor_9000_fdc_t::live_start() diff --git a/src/mame/machine/victor9k_fdc.h b/src/mame/machine/victor9k_fdc.h index 60935760748..9fae7c1e812 100644 --- a/src/mame/machine/victor9k_fdc.h +++ b/src/mame/machine/victor9k_fdc.h @@ -159,8 +159,8 @@ private: required_device<via6522_device> m_via4; required_device<via6522_device> m_via5; required_device<via6522_device> m_via6; - required_device<floppy_image_device> m_floppy0; - required_device<floppy_image_device> m_floppy1; + required_device<floppy_connector> m_floppy0; + required_device<floppy_connector> m_floppy1; required_memory_region m_gcr_rom; void update_stepper_motor(floppy_image_device *floppy, int stp, int old_st, int st); diff --git a/src/mame/mame.lst b/src/mame/mame.lst index fe9da0421f6..baa9538b3c8 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -10717,7 +10717,8 @@ bouldashj // (c) 1990 Data East Corporation (Japan) drgninja // EG (c) 1988 Data East Corporation (Japan) drgninjab // bootleg drgninjab2 // bootleg -ffantasy // EV (c) 1989 Data East Corporation (Japan) +ffantasy // EX (c) 1989 Data East Corporation (World) +ffantasyj // EV (c) 1989 Data East Corporation (Japan) ffantasya // EV (c) 1989 Data East Corporation (Japan) ffantasybl // bootleg hbarrel // (c) 1987 Data East USA (US) @@ -11038,6 +11039,9 @@ dm500 // dm5620 // dm7000 // +@source:dmax8000.cpp +dmax8000 // + @source:dmndrby.cpp dmndrby // G4001 'DD' (c) 1986 dmndrbya // G4001 'DD' (c) 1986 @@ -11221,6 +11225,7 @@ ougonpai // "62" (c) 1991 Dynax ougonpaib // "62" (c) 1991 bootleg quiztvqq // "64" Quiz TV Gassyuukoku Q&Q 1992 Dynax shpeng // (c) 1995 WSAC Systems +intrgirl // (c) 1995 Barko sprtmtch // "31" (c) 1989 Dynax + Fabtek license tenkai // (c) 1991 Dynax tenkai2b // (c) 1991 bootleg @@ -12133,6 +12138,7 @@ feasgla // EAS: Elite A/S Challenger (Glasgow program, E fexcel // fexcelv // fscc9 // +fscc9b // fscc12 // reversic // super9cc // SU9: Super 9 Sensory Chess Challenger (English) @@ -29051,9 +29057,10 @@ uk101 // othello // (c) 1984 Success. @source:othunder.cpp -othunder // B67 (c) 1988 Taito Corporation Japan (World) +othunder // B67 (c) 1988 Taito Corporation Japan (World, rev 1) othunderj // B67 (c) 1988 Taito Corporation (Japan) -othunderu // B67 (c) 1988 Taito America Corporation (US) +othundero // B67 (c) 1988 Taito Corporation Japan (World) +othunderu // B67 (c) 1988 Taito America Corporation (US, rev 1) othunderuo // B67 (c) 1988 Taito America Corporation (US) @source:overdriv.cpp diff --git a/src/mame/mess.flt b/src/mame/mess.flt index 0d4155e2a4a..504c1851b47 100644 --- a/src/mame/mess.flt +++ b/src/mame/mess.flt @@ -144,6 +144,7 @@ didact.cpp digel804.cpp dim68k.cpp dm7000.cpp +dmax8000.cpp dms5000.cpp dms86.cpp dmv.cpp diff --git a/src/mame/video/spdodgeb.cpp b/src/mame/video/spdodgeb.cpp index 79fdef1cfa6..f2f255c2df8 100644 --- a/src/mame/video/spdodgeb.cpp +++ b/src/mame/video/spdodgeb.cpp @@ -72,7 +72,7 @@ void spdodgeb_state::video_start() { m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(spdodgeb_state::get_bg_tile_info),this),tilemap_mapper_delegate(FUNC(spdodgeb_state::background_scan),this),8,8,64,32); - membank("mainbank")->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x4000); + membank("mainbank")->configure_entries(0, 2, memregion("maincpu")->base(), 0x4000); save_item(NAME(m_tile_palbank)); save_item(NAME(m_sprite_palbank)); diff --git a/src/mame/video/tiamc1.cpp b/src/mame/video/tiamc1.cpp index 09ebf7ae66a..d813b0030fb 100644 --- a/src/mame/video/tiamc1.cpp +++ b/src/mame/video/tiamc1.cpp @@ -38,8 +38,11 @@ WRITE8_MEMBER(tiamc1_state::tiamc1_videoram_w) WRITE8_MEMBER(tiamc1_state::kot_videoram_w) { - m_tileram[offset] = data; - m_bg_tilemap1->mark_tile_dirty(offset); + if ((m_layers_ctrl & 1) == 0) + { + m_tileram[offset] = data; + m_bg_tilemap1->mark_tile_dirty(offset); + } } WRITE8_MEMBER(tiamc1_state::tiamc1_bankswitch_w) @@ -53,8 +56,7 @@ WRITE8_MEMBER(tiamc1_state::tiamc1_bankswitch_w) WRITE8_MEMBER(tiamc1_state::kot_bankswitch_w) { m_gfxdecode->gfx(0)->set_source(m_charram + (data >> 1) * 0x100); - - m_layers_ctrl = data; // bit 0 - video enable/disable, unemulated + m_layers_ctrl = data; } WRITE8_MEMBER(tiamc1_state::tiamc1_sprite_x_w) diff --git a/src/osd/modules/debugger/debugimgui.cpp b/src/osd/modules/debugger/debugimgui.cpp index 0c4f16919f9..ebdf06bbe12 100644 --- a/src/osd/modules/debugger/debugimgui.cpp +++ b/src/osd/modules/debugger/debugimgui.cpp @@ -1177,7 +1177,7 @@ void debug_imgui::wait_for_debugger(device_t &device, bool firststop) void debug_imgui::debugger_update() { - if ((m_machine != nullptr) && (!m_machine->debugger().cpu().is_stopped()) && (m_machine->phase() == MACHINE_PHASE_RUNNING) && !m_hide) + if (m_machine && (m_machine->phase() == MACHINE_PHASE_RUNNING) && !m_machine->debugger().cpu().is_stopped() && !m_hide) { UINT32 width = m_machine->render().ui_target().width(); UINT32 height = m_machine->render().ui_target().height(); diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt/fs_crt-caligari.sc b/src/osd/modules/render/bgfx/shaders/chains/crt/fs_crt-caligari.sc new file mode 100644 index 00000000000..68d9908983f --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/chains/crt/fs_crt-caligari.sc @@ -0,0 +1,123 @@ +$input v_color0, v_texcoord0, v_texcoord1 + +// license:BSD-3-Clause +// copyright-holders:caligari + +/* + Phosphor shader - Copyright (C) 2011 caligari. + + Ported by Hyllian. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#define onex v_texcoord1.xy +#define oney v_texcoord1.zw + +#include "common.sh" + +// Autos +uniform vec4 u_source_size; + +// User-supplied +uniform vec4 SPOT_WIDTH; +uniform vec4 SPOT_HEIGHT; +uniform vec4 COLOR_BOOST; +uniform vec4 InputGamma; +uniform vec4 OutputGamma; + +// Samplers +SAMPLER2D(s_p, 0); + +#define GAMMA_IN(color) pow(color, InputGamma.xxxx) +#define GAMMA_OUT(color) pow(color, 1.0 / OutputGamma.xxxx) + +#define TEX2D(coords) GAMMA_IN( texture2D(s_p, coords) ) + +// Macro for weights computing +#define WEIGHT(w) \ + if(w > 1.0) w = 1.0; \ + w = 1.0 - w * w; \ + w = w * w; + +void main() +{ + vec2 coords = v_texcoord0 * u_source_size.xy; + vec2 pixel_center = floor(coords) + vec2(0.5, 0.5); + vec2 texture_coords = pixel_center / u_source_size.xy; + + vec4 color = TEX2D(texture_coords); + + float dx = coords.x - pixel_center.x; + + float h_weight_00 = dx / SPOT_WIDTH.x; + WEIGHT(h_weight_00); + + color *= vec4(h_weight_00, h_weight_00, h_weight_00, h_weight_00 ); + + // get closest horizontal neighbour to blend + vec2 coords01; + if (dx > 0.0) + { + coords01 = onex; + dx = 1.0 - dx; + } + else + { + coords01 = -onex; + dx = 1.0 + dx; + } + vec4 colorNB = TEX2D(texture_coords + coords01); + + float h_weight_01 = dx / SPOT_WIDTH.x; + WEIGHT(h_weight_01); + + color = color + colorNB * vec4(h_weight_01, h_weight_01, h_weight_01, h_weight_01); + + ////////////////////////////////////////////////////// + // Vertical Blending + float dy = coords.y - pixel_center.y; + float v_weight_00 = dy / SPOT_HEIGHT.x; + WEIGHT(v_weight_00); + color *= vec4(v_weight_00, v_weight_00, v_weight_00, v_weight_00); + + // get closest vertical neighbour to blend + vec2 coords10; + if (dy > 0.0) + { + coords10 = oney; + dy = 1.0 - dy; + } + else + { + coords10 = -oney; + dy = 1.0 + dy; + } + colorNB = TEX2D(texture_coords + coords10); + + float v_weight_10 = dy / SPOT_HEIGHT.x; + WEIGHT(v_weight_10); + + color = color + colorNB * vec4(v_weight_10 * h_weight_00, v_weight_10 * h_weight_00, v_weight_10 * h_weight_00, v_weight_10 * h_weight_00); + + colorNB = TEX2D(texture_coords + coords01 + coords10); + + color = color + colorNB * vec4(v_weight_10 * h_weight_01, v_weight_10 * h_weight_01, v_weight_10 * h_weight_01, v_weight_10 * h_weight_01); + + color *= COLOR_BOOST.xxxx; + + gl_FragColor = clamp(GAMMA_OUT(color), 0.0, 1.0); +} diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt/varying.def.sc b/src/osd/modules/render/bgfx/shaders/chains/crt/varying.def.sc new file mode 100644 index 00000000000..8404fc635e1 --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/chains/crt/varying.def.sc @@ -0,0 +1,7 @@ +vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0); +vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0); +vec4 v_texcoord1 : TEXCOORD1 = vec4(0.0, 0.0, 0.0, 0.0); + +vec3 a_position : POSITION; +vec4 a_color0 : COLOR0; +vec2 a_texcoord0 : TEXCOORD0; diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt/vs_crt-caligari.sc b/src/osd/modules/render/bgfx/shaders/chains/crt/vs_crt-caligari.sc new file mode 100644 index 00000000000..37a119ec7d4 --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/chains/crt/vs_crt-caligari.sc @@ -0,0 +1,45 @@ +$input a_position, a_texcoord0, a_color0 +$output v_texcoord0, v_texcoord1, v_color0 + +// license:BSD-3-Clause +// copyright-holders:caligari + +/* + Phosphor shader - Copyright (C) 2011 caligari. + + Ported by Hyllian. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#define onex v_texcoord1.xy +#define oney v_texcoord1.zw + +#include "common.sh" + +// Autos +uniform vec4 u_source_size; + +void main() +{ + gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); + v_texcoord0 = a_texcoord0; + + onex = vec2(1.0 / u_source_size.x, 0.0); + oney = vec2(0.0, 1.0 / u_source_size.y); + + v_color0 = a_color0; +} diff --git a/src/tools/chdman.cpp b/src/tools/chdman.cpp index 86b406a4393..0c557b03e4a 100644 --- a/src/tools/chdman.cpp +++ b/src/tools/chdman.cpp @@ -5,7 +5,7 @@ CHD compression frontend ****************************************************************************/ - +#include <stdio.h> // must be here otherwise issues with I64FMT in MINGW #include <assert.h> #include "osdcore.h" @@ -361,7 +361,7 @@ public: for (int tracknum = 0; tracknum < m_toc.numtrks; tracknum++) { const cdrom_track_info &trackinfo = m_toc.tracks[tracknum]; - UINT64 endoffs = startoffs + (trackinfo.frames + trackinfo.extraframes) * CD_FRAME_SIZE; + UINT64 endoffs = startoffs + (UINT64)(trackinfo.frames + trackinfo.extraframes) * CD_FRAME_SIZE; if (offset >= startoffs && offset < endoffs) { // if we don't already have this file open, open it now @@ -375,10 +375,10 @@ public: } // iterate over frames - UINT32 bytesperframe = trackinfo.datasize + trackinfo.subsize; + UINT64 bytesperframe = trackinfo.datasize + trackinfo.subsize; UINT64 src_track_start = m_info.track[tracknum].offset; - UINT64 src_track_end = src_track_start + bytesperframe * trackinfo.frames; - UINT64 pad_track_start = src_track_end - (m_toc.tracks[tracknum].padframes * bytesperframe); + UINT64 src_track_end = src_track_start + bytesperframe * (UINT64)trackinfo.frames; + UINT64 pad_track_start = src_track_end - ((UINT64)m_toc.tracks[tracknum].padframes * bytesperframe); while (length_remaining != 0 && offset < endoffs) { // determine start of current frame @@ -1399,15 +1399,15 @@ static void do_info(parameters_t ¶ms) printf("Ratio: %.1f%%\n", 100.0 * double(static_cast<util::core_file &>(input_chd).size()) / double(input_chd.logical_bytes())); // add SHA1 output - sha1_t overall = input_chd.sha1(); - if (overall != sha1_t::null) + util::sha1_t overall = input_chd.sha1(); + if (overall != util::sha1_t::null) { printf("SHA1: %s\n", overall.as_string().c_str()); if (input_chd.version() >= 4) printf("Data SHA1: %s\n", input_chd.raw_sha1().as_string().c_str()); } - sha1_t parent = input_chd.parent_sha1(); - if (parent != sha1_t::null) + util::sha1_t parent = input_chd.parent_sha1(); + if (parent != util::sha1_t::null) printf("Parent SHA1: %s\n", parent.as_string().c_str()); // print out metadata @@ -1530,15 +1530,15 @@ static void do_verify(parameters_t ¶ms) // only makes sense for compressed CHDs with valid SHA1's if (!input_chd.compressed()) report_error(0, "No verification to be done; CHD is uncompressed"); - sha1_t raw_sha1 = (input_chd.version() <= 3) ? input_chd.sha1() : input_chd.raw_sha1(); - if (raw_sha1 == sha1_t::null) + util::sha1_t raw_sha1 = (input_chd.version() <= 3) ? input_chd.sha1() : input_chd.raw_sha1(); + if (raw_sha1 == util::sha1_t::null) report_error(0, "No verification to be done; CHD has no checksum"); // create an array to read into dynamic_buffer buffer((TEMP_BUFFER_SIZE / input_chd.hunk_bytes()) * input_chd.hunk_bytes()); // read all the data and build up an SHA-1 - sha1_creator rawsha1; + util::sha1_creator rawsha1; for (UINT64 offset = 0; offset < input_chd.logical_bytes(); ) { progress(false, "Verifying, %.1f%% complete... \r", 100.0 * double(offset) / double(input_chd.logical_bytes())); @@ -1553,7 +1553,7 @@ static void do_verify(parameters_t ¶ms) rawsha1.append(&buffer[0], bytes_to_read); offset += bytes_to_read; } - sha1_t computed_sha1 = rawsha1.finish(); + util::sha1_t computed_sha1 = rawsha1.finish(); // finish up if (raw_sha1 != computed_sha1) @@ -1575,7 +1575,7 @@ static void do_verify(parameters_t ¶ms) // now include the metadata for >= v4 if (input_chd.version() >= 4) { - sha1_t computed_overall_sha1 = input_chd.compute_overall_sha1(computed_sha1); + util::sha1_t computed_overall_sha1 = input_chd.compute_overall_sha1(computed_sha1); if (input_chd.sha1() == computed_overall_sha1) printf("Overall SHA1 verification successful!\n"); else |