Previous 199869 Revisions Next

r39878 Tuesday 14th July, 2015 at 19:50:06 UTC by Thomas Klausner
Implement missing osd_truncate().

Fixes linking on Unix when SDL is disabled.

Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
[/trunk].travis.yml makefile
[3rdparty/mongoose]mongoose.c
[docs]newvideo.txt
[hash]msx1_cart.xml pet_rom.xml
[nl_examples]congo_bongo.c
[scripts/src]bus.lua machine.lua netlist.lua
[scripts/target/mame]mess.lua
[src/emu/bus/msx_cart]cartridge.c konami.c moonsound.c moonsound.h
[src/emu/bus/ti99_peb]hfdc.c
[src/emu/cpu/mips]mips3drc.c
[src/emu/cpu/sm510]sm510.c sm510op.c
[src/emu/cpu/ucom4]ucom4.c ucom4.h ucom4op.c
[src/emu/machine]68230pit.c 68230pit.h hdc9234.c netlist.c smpc.c stvcd.c ti99_hd.c ti99_hd.h tms6100.c tms6100.h
[src/emu/netlist]nl_dice_compat.h nl_factory.c nl_factory.h nl_parser.c nl_setup.c nl_setup.h
[src/emu/netlist/analog]nld_bjt.c nld_bjt.h nld_opamps.c nld_opamps.h nld_switches.h nld_twoterm.c nld_twoterm.h
[src/emu/netlist/devices]net_lib.c net_lib.h nld_4020.h nld_7400.h nld_7402.h nld_7404.h nld_7408.h nld_7410.h nld_74107.h nld_7411.h nld_74123.h nld_74153.h nld_74175.h nld_74192.h nld_74193.h nld_7420.h nld_7425.h nld_7427.h nld_74279.h nld_7430.h nld_7432.h nld_7437.h nld_7448.h nld_7450.h nld_7474.h nld_7483.h nld_7486.h nld_7490.h nld_7493.h nld_74ls629.h nld_82S16.h nld_9310.h nld_9312.h nld_9316.h nld_legacy.h nld_log.h nld_mm5837.h nld_ne555.h nld_r2r_dac.h nld_system.h
[src/emu/netlist/macro]nlm_cd4xxx.h nlm_opamp.c nlm_opamp.h nlm_ttl74xx.h
[src/emu/netlist/plib]plists.h pstate.c
[src/emu/netlist/solver]nld_solver.h
[src/emu/sound]c140.c c140.h scsp.c tms36xx.c ymf278b.c ymf278b.h
[src/emu/video]mb_vcu.c v9938.c v9938.h voodoo.c
[src/mame]arcade.lst mess.lst
[src/mame/audio]nl_kidniki.c poolshrk.c scramble.c
[src/mame/drivers]1942.c bmcpokr.c chihiro.c cps1.c csplayh5.c ddenlovr.c dec0.c destroyr.c dynax.c fcrash.c fuukifg3.c kurukuru.c mazerbla.c mcr3.c megatech.c meritm.c namcona1.c naomi.c naughtyb.c nl_breakout.c nl_pong.c paranoia.c poolshrk.c sangho.c sbowling.c scramble.c segas24.c seta2.c snk.c spbactn.c ssingles.c system1.c system16.c taito_x.c taitoair.c thedealr.c timeplt.c tmnt.c tnzs.c tonton.c ttchamp.c wecleman.c xyonix.c
[src/mame/includes]1942.h dynax.h namcona1.h naughtyb.h poolshrk.h scramble.h spbactn.h system1.h system16.h
[src/mame/machine]scramble.c
[src/mame/video]cps1.c namcona1.c naughtyb.c poolshrk.c
[src/mess/drivers]advision.c force68k.c hh_hmcs40.c hh_tms1k.c hh_ucom4.c monty.c msx.c sdk80.c smc777.c tb303.c vk100.c
[src/mess/includes]hh_ucom4.h
[src/mess/layout]tb303.lay
[src/mess/machine]msx.c
[src/osd/modules/render]drawogl.c
[src/osd/osdmini]minifile.c
[src/osd/sdl]sdlfile.c
[src/tools]nltool.c

trunk/.travis.yml
r248389r248390
1616  - sudo add-apt-repository ppa:shahar-evron/qt-backports -y
1717  - sudo apt-get update -qq
1818  - sudo apt-get install -y libsdl2-dev libsdl2-ttf-dev libasound2-dev libqt4-dev libqt4-dev-bin
19notifications:
20  email:
21    - secure: "sK8JJcn1A0yLnbDJ/7vmJgESuXmP6D4QlvQvsYLp1xAx5eTVSJ5Z+GSXLBJ9CnoeJ5AlPVPX4rXdRV93UyxYlTh1O97x8VZZQtYBNPRjk/VCflsOOg7C+jcJKX/knMu/QG2MVEDE5G2b8mHSAgWljG/7Z2N0rYZlWppwklYafOkyW4uE0E7PU5XpmKim4ra6Y1eDSbap+XJiDwgUm9moDZrgAv7eom9NIWGNMRIozSRyR2IkYimlWE92FOy5PzLJtFGK02iumbYN+39mTux59v/h/m6HD6cD7Wf10Lco9+Fnmi9Bs+VvIReJIP9pDABRvJ3MkUV4I9BjUT9xk48lzxqjGtdfUwOMDOTABd4Pb/5cmNtyNUQIosy5oiplR6USBnqD7/gmJw+mfn3A+jdQHGne+akypwzUjSM6XrezjTiZLlDDG+QpA0kwAnxSXw8H2SpVyynMSn4nu0iZmOiOZMtFY0jKlt/W7OFC5wTuJFrky+bBGlVIv3KGOTJNJNgasXV4u0NXOjHyeBFpFYCIf0FZLfYyf7ITu94JxUzXGcVi5D0lBwvKY9HfJ4yJxciyfH6V7yU1+o23E/Meqe/tjt6dTW8DM5xIokrnusfzE5b0zw5GFyg54nbpazXpcPnrMdxhp+t2C7xKrxcZXhBECRYegj+Z86D9BJP/yum1YrQ="
trunk/3rdparty/mongoose/mongoose.c
r248389r248390
54795479  (void) ev;
54805480
54815481  //DBG(("%p [%s]", conn, msg));
5482  if (sscanf(msg, "%p %n", (void **) &func, &n) && func != NULL && conn != NULL) {
5482  if (sscanf(msg, "%p %n", &func, &n) && func != NULL && conn != NULL) {
54835483    conn->mg_conn.callback_param = (void *) (msg + n);
54845484    func(&conn->mg_conn, MG_POLL);
54855485  }
trunk/docs/newvideo.txt
r248389r248390
105105So, I recommend starting with these initial options and then tweaking
106106from there. One additional option you might want to try in
107107combination with the above is the -prescale option. -prescale takes
108an integer parameter from 1 to 3, and specifies a magnification
108an integer parameter from 1 to 8, and specifies a magnification
109109amount by which the screen pixels are expanded before they are drawn
110110to the screen. Why is this useful? And how much of a performance
111111impact does it have? Well, that depends on the mode you are running
r248389r248390
117117small performance hit, but not too significant. The benefit is that
118118each prescale factor reduces the blurriness of the pixels.
119119-prescale 1 is the default, which does no scaling. -prescale 2 will
120double each pixel, and -prescale 3 will triple each pixel. For my
120double each pixel, -prescale 3 will triple each pixel, etc. For my
121121money, -prescale 2 is sufficient, but people with super high
122122resolution displays claim that larger -prescale factors work even
123123better.
trunk/hash/msx1_cart.xml
r248389r248390
13791379      <info name="serial" value="R48X5513" />
13801380      <info name="alt_title" value="アルカザール" />
13811381      <part name="cart" interface="msx_cart">
1382         <dataarea name="rom" size="65536">
1382         <dataarea name="rom" size="16384">
13831383            <rom name="alcazar - the forgotten fortress (japan).rom" size="16384" crc="3ee454b0" sha1="807676038cbba043b8099eba9c5840a4811a7e59" offset="0" />
1384            <rom size="16384" offset="0x4000" loadflag="reload" />
1385            <rom size="16384" offset="0x8000" loadflag="reload" />
1386            <rom size="16384" offset="0xc000" loadflag="reload" />
13871384         </dataarea>
13881385      </part>
13891386   </software>
r248389r248390
22142211      <info name="serial" value="R48X5502" />
22152212      <info name="alt_title" value="ビームライダー" />
22162213      <part name="cart" interface="msx_cart">
2217         <dataarea name="rom" size="65536">
2214         <dataarea name="rom" size="32768">
2215            <rom name="beam rider (japan).rom" size="32768" crc="1553e408" sha1="1231984ae24bf35f9f38596b864420d8ccd3f30b" offset="0" />
2216         </dataarea>
2217      </part>
2218   </software>
2219
2220   <software name="beamridra" cloneof="beamridr">
2221      <description>Beam Rider (Jpn, Alt)</description>
2222      <year>1984</year>
2223      <publisher>Pony Canyon</publisher>
2224      <info name="serial" value="R48X5502" />
2225      <info name="alt_title" value="ビームライダー" />
2226      <part name="cart" interface="msx_cart">
2227         <dataarea name="rom" size="16384">
22182228            <rom name="beam rider (japan) (alt 1).rom" size="16384" crc="d6a6bee6" sha1="f51f936887498d21f6ee9fe8a7701633be67e79d" offset="0" />
2219            <rom size="16384" offset="0x4000" loadflag="reload" />
2220            <rom size="16384" offset="0x8000" loadflag="reload" />
2221            <rom size="16384" offset="0xc000" loadflag="reload" />
22222229         </dataarea>
22232230      </part>
22242231   </software>
r248389r248390
41484155      <publisher>Pony Canyon</publisher>
41494156      <info name="serial" value="R48X5506" />
41504157      <part name="cart" interface="msx_cart">
4151         <dataarea name="rom" size="65536">
4152            <rom name="decathlon (japan).rom" size="16384" crc="f99b1c22" sha1="5d43cb6ca89f31d5f543e4dcd3fa9987b9769602" offset="0" />
4153            <rom size="16384" offset="0x4000" loadflag="reload" />
4154            <rom size="16384" offset="0x8000" loadflag="reload" />
4155            <rom size="16384" offset="0xc000" loadflag="reload" />
4158         <dataarea name="rom" size="32768">
4159            <rom name="decathlon (japan).rom" size="32768" crc="cd016b93" sha1="a1656f612360a126e09ef2baaa8002d92054125d" offset="0" />
41564160         </dataarea>
41574161      </part>
41584162   </software>
41594163
4164   <software name="decathlna" cloneof="decathln">
4165      <description>Decathlon (Jpn, Alt)</description>
4166      <year>1984</year>
4167      <publisher>Pony Canyon</publisher>
4168      <info name="serial" value="R48X5506" />
4169      <part name="cart" interface="msx_cart">
4170         <dataarea name="rom" size="16384">
4171            <rom name="decathlon (japan) (alt 1).rom" size="16384" crc="f99b1c22" sha1="5d43cb6ca89f31d5f543e4dcd3fa9987b9769602" offset="0" />
4172         </dataarea>
4173      </part>
4174   </software>
4175
41604176   <software name="deepdng" supported="partial">
41614177      <description>Deep Dungeon (Jpn)</description>
41624178      <year>1988</year>
r248389r248390
59675983      <info name="serial" value="R48X5505" />
59685984      <info name="alt_title" value="ヒーロー" />
59695985      <part name="cart" interface="msx_cart">
5970         <dataarea name="rom" size="65536">
5971            <rom name="h.e.r.o. (japan).rom" size="16384" crc="97ab0d70" sha1="6fbb385147a939a7e6b47f5945d8e3b671a8c065" offset="0" />
5972            <rom size="16384" offset="0x4000" loadflag="reload" />
5973            <rom size="16384" offset="0x8000" loadflag="reload" />
5974            <rom size="16384" offset="0xc000" loadflag="reload" />
5986         <dataarea name="rom" size="32768">
5987            <rom name="h.e.r.o. (japan).rom" size="32768" crc="8fdad3af" sha1="ebb70722f75279911cce79e6bd78b8f514561b0f" offset="0" />
59755988         </dataarea>
59765989      </part>
59775990   </software>
r248389r248390
70037016      <info name="serial" value="R48X5503" />
70047017      <info name="alt_title" value="キーストンケーパーズ" />
70057018      <part name="cart" interface="msx_cart">
7006         <dataarea name="rom" size="65536">
7007            <rom name="keystone kapers (japan).rom" size="16384" crc="b1cf2097" sha1="3d5160331beb1c5cc54ba6ecef6b3ce2ff4660b6" offset="0" />
7008            <rom size="16384" offset="0x4000" loadflag="reload" />
7009            <rom size="16384" offset="0x8000" loadflag="reload" />
7010            <rom size="16384" offset="0xc000" loadflag="reload" />
7019         <dataarea name="rom" size="32768">
7020            <rom name="keystone kapers (japan).rom" size="32768" crc="7ff117f9" sha1="fb4724b8159beae132f89f394f71ce3934a61ae2" offset="0" />
70117021         </dataarea>
70127022      </part>
70137023   </software>
70147024
7025   <software name="keykapera" cloneof="keykaper">
7026      <description>Keystone Kapers (Jpn, Alt)</description>
7027      <year>1984</year>
7028      <publisher>Pony Canyon</publisher>
7029      <info name="serial" value="R48X5503" />
7030      <info name="alt_title" value="キーストンケーパーズ" />
7031      <part name="cart" interface="msx_cart">
7032         <dataarea name="rom" size="16384">
7033            <rom name="keystone kapers (japan) (alt 1).rom" size="16384" crc="b1cf2097" sha1="3d5160331beb1c5cc54ba6ecef6b3ce2ff4660b6" offset="0" />
7034         </dataarea>
7035      </part>
7036   </software>
7037
70157038   <software name="kickit">
70167039      <description>Kick It (Jpn)</description>
70177040      <year>1986</year>
r248389r248390
96369659      <publisher>Pony Canyon</publisher>
96379660      <info name="alt_title" value="パストファインダー" />
96389661      <part name="cart" interface="msx_cart">
9639         <dataarea name="rom" size="65536">
9662         <dataarea name="rom" size="16384">
96409663            <rom name="pastfinder (japan).rom" size="16384" crc="d6d8d1d7" sha1="8117ec66c0645a54422841a632cfd6602f35c4f9" offset="0" />
9641            <rom size="16384" offset="0x4000" loadflag="reload" />
9642            <rom size="16384" offset="0x8000" loadflag="reload" />
9643            <rom size="16384" offset="0xc000" loadflag="reload" />
96449664         </dataarea>
96459665      </part>
96469666   </software>
r248389r248390
99619981      <info name="serial" value="R48X5508" />
99629982      <info name="alt_title" value="ピットフォールII" />
99639983      <part name="cart" interface="msx_cart">
9964         <dataarea name="rom" size="65536">
9984         <dataarea name="rom" size="16384">
99659985            <rom name="pitfall ii - lost caverns (japan).rom" size="16384" crc="d307a7b8" sha1="78079266711e60420480e4d95a39f0d7d974ad32" offset="0" />
9966            <rom size="16384" offset="0x4000" loadflag="reload" />
9967            <rom size="16384" offset="0x8000" loadflag="reload" />
9968            <rom size="16384" offset="0xc000" loadflag="reload" />
99699986         </dataarea>
99709987      </part>
99719988   </software>
r248389r248390
99779994      <info name="serial" value="R48X5508" />
99789995      <info name="alt_title" value="ピットフォールII" />
99799996      <part name="cart" interface="msx_cart">
9980         <dataarea name="rom" size="65536">
9997         <dataarea name="rom" size="16384">
99819998            <rom name="pitfall ii - lost caverns (japan) (alt 1).rom" size="16384" crc="71c59868" sha1="ae8c7355c829248305384243f78a870453367e77" offset="0" />
9982            <rom size="16384" offset="0x4000" loadflag="reload" />
9983            <rom size="16384" offset="0x8000" loadflag="reload" />
9984            <rom size="16384" offset="0xc000" loadflag="reload" />
99859999         </dataarea>
998610000      </part>
998710001   </software>
r248389r248390
999310007      <info name="serial" value="R48X5501" />
999410008      <info name="alt_title" value="ピットフォール" />
999510009      <part name="cart" interface="msx_cart">
9996         <dataarea name="rom" size="65536">
10010         <dataarea name="rom" size="16384">
999710011            <rom name="pitfall! (japan).rom" size="16384" crc="5a009c55" sha1="b88e9c548873dcfd190e0e38f7b279344eea41ec" offset="0" />
9998            <rom size="16384" offset="0x4000" loadflag="reload" />
9999            <rom size="16384" offset="0x8000" loadflag="reload" />
10000            <rom size="16384" offset="0xc000" loadflag="reload" />
1000110012         </dataarea>
1000210013      </part>
1000310014   </software>
r248389r248390
1000910020      <info name="serial" value="R48X5501" />
1001010021      <info name="alt_title" value="ピットフォール" />
1001110022      <part name="cart" interface="msx_cart">
10012         <dataarea name="rom" size="65536">
10023         <dataarea name="rom" size="16384">
1001310024            <rom name="pitfall! (japan) (alt 1).rom" size="16384" crc="930aeb2c" sha1="5fb4b6c3735e4d9415565a856bb69f9fb4857161" offset="0" />
10014            <rom size="16384" offset="0x4000" loadflag="reload" />
10015            <rom size="16384" offset="0x8000" loadflag="reload" />
10016            <rom size="16384" offset="0xc000" loadflag="reload" />
1001710025         </dataarea>
1001810026      </part>
1001910027   </software>
r248389r248390
1002510033      <info name="serial" value="R48X5501" />
1002610034      <info name="alt_title" value="ピットフォール" />
1002710035      <part name="cart" interface="msx_cart">
10028         <dataarea name="rom" size="65536">
10036         <dataarea name="rom" size="16384">
1002910037            <rom name="pitfall! (japan) (alt 2).rom" size="16384" crc="2cb24473" sha1="2fa9c0f016efc2d1752a272c632393f5063ea06c" offset="0" />
10030            <rom size="16384" offset="0x4000" loadflag="reload" />
10031            <rom size="16384" offset="0x8000" loadflag="reload" />
10032            <rom size="16384" offset="0xc000" loadflag="reload" />
1003310038         </dataarea>
1003410039      </part>
1003510040   </software>
r248389r248390
1050310508      <info name="serial" value="R48X5504" />
1050410509      <info name="alt_title" value="リバーレイド" />
1050510510      <part name="cart" interface="msx_cart">
10506         <dataarea name="rom" size="65536">
10507            <rom name="river raid (japan).rom" size="16384" crc="2fc1d75b" sha1="33be9017faf173eae04d0c91ca8d42d1c20596c0" offset="0" />
10508            <rom size="16384" offset="0x4000" loadflag="reload" />
10509            <rom size="16384" offset="0x8000" loadflag="reload" />
10510            <rom size="16384" offset="0xc000" loadflag="reload" />
10511         <dataarea name="rom" size="32768">
10512            <rom name="river raid (japan).rom" size="32768" crc="0f22a553" sha1="a1e14912d45944b9a6baef1d4d3a04c1ae8df923" offset="0" />
1051110513         </dataarea>
1051210514      </part>
1051310515   </software>
1051410516
10517   <software name="riveraida" cloneof="riveraid">
10518      <description>River Raid (Jpn, Alt)</description>
10519      <year>1985</year>
10520      <publisher>Pony Canyon</publisher>
10521      <info name="serial" value="R48X5504" />
10522      <info name="alt_title" value="リバーレイド" />
10523      <part name="cart" interface="msx_cart">
10524         <dataarea name="rom" size="16384">
10525            <rom name="river raid (japan) (alt 1).rom" size="16384" crc="2fc1d75b" sha1="33be9017faf173eae04d0c91ca8d42d1c20596c0" offset="0" />
10526         </dataarea>
10527      </part>
10528   </software>
10529
1051510530   <software name="roadfght">
1051610531      <description>Road Fighter (Jpn)</description>
1051710532      <year>1985</year>
r248389r248390
1059310608      <info name="serial" value="R48X5511" />
1059410609      <info name="alt_title" value="ロックンボルト" />
1059510610      <part name="cart" interface="msx_cart">
10596         <dataarea name="rom" size="65536">
10611         <dataarea name="rom" size="16384">
1059710612            <rom name="rock'n bolt (japan).rom" size="16384" crc="430e5789" sha1="1edabc3226648b54ae98d524b31f37ca47c8c88b" offset="0" />
10598            <rom size="16384" offset="0x4000" loadflag="reload" />
10599            <rom size="16384" offset="0x8000" loadflag="reload" />
10600            <rom size="16384" offset="0xc000" loadflag="reload" />
1060110613         </dataarea>
1060210614      </part>
1060310615   </software>
r248389r248390
1315913171      <publisher>Pony Canyon</publisher>
1316013172      <info name="alt_title" value="ゼンジー" />
1316113173      <part name="cart" interface="msx_cart">
13162         <dataarea name="rom" size="65536">
13163            <rom name="zenji (japan).rom" size="16384" crc="77b3b0b9" sha1="c9440172802818cc5b9ae559fbd3f346a263605c" offset="0" />
13164            <rom size="16384" offset="0x4000" loadflag="reload" />
13165            <rom size="16384" offset="0x8000" loadflag="reload" />
13166            <rom size="16384" offset="0xc000" loadflag="reload" />
13174         <dataarea name="rom" size="32768">
13175            <rom name="zenji (japan).rom" size="32768" crc="1a4aebb2" sha1="2f4404d141acc40e48af0b12c70cd44b066ece10" offset="0" />
1316713176         </dataarea>
1316813177      </part>
1316913178   </software>
1317013179
13180   <software name="zenjia" cloneof="zenji">
13181      <description>Zenji (Jpn, Alt)</description>
13182      <year>1984</year>
13183      <publisher>Pony Canyon</publisher>
13184      <info name="alt_title" value="ゼンジー" />
13185      <part name="cart" interface="msx_cart">
13186         <dataarea name="rom" size="16384">
13187            <rom name="zenji (japan) (alt 1).rom" size="16384" crc="77b3b0b9" sha1="c9440172802818cc5b9ae559fbd3f346a263605c" offset="0" />
13188         </dataarea>
13189      </part>
13190   </software>
13191
1317113192   <software name="zexasltd">
1317213193      <description>Zexas Limited (Jpn)</description>
1317313194      <year>1985</year>
r248389r248390
1326813289      <year>1984</year>
1326913290      <publisher>Activision?</publisher>
1327013291      <part name="cart" interface="msx_cart">
13271         <dataarea name="rom" size="65536">
13292         <dataarea name="rom" size="16384">
1327213293            <rom name="designer's pencil, the (europe) (program).rom" size="16384" crc="ce588c20" sha1="4b4a58a310a1138b95192d7fe0881bbdc45601d4" offset="0" />
13273            <rom size="16384" offset="0x4000" loadflag="reload" />
13274            <rom size="16384" offset="0x8000" loadflag="reload" />
13275            <rom size="16384" offset="0xc000" loadflag="reload" />
1327613294         </dataarea>
1327713295      </part>
1327813296   </software>
trunk/hash/pet_rom.xml
r248389r248390
290290      <publisher>Palo Alto ICs Inc.</publisher>
291291
292292      <part name="rom" interface="pet_b000_rom">
293      <!--
294      TODO: The screen fills with garbage when run like this:
295         $ mame64 pet2001n32 toolkit2
296      and started with:
297         SYS 45056
298      We need to check this and should add notes with the emulator
299      options required to run the various versions of Toolkit.
300      -->
301293         <dataarea name="rom" size="0x800">
302294            <rom name="toolkit2-b000.bin" size="0x800" crc="bf8d29f3" sha1="324508c0cec374c80387b4286ed1b0fee9159486" offset="0" />
303295         </dataarea>
trunk/makefile
r248389r248390
240240endif
241241
242242ifeq ($(findstring arm,$(UNAME)),arm)
243ARCHITECTURE :=
244243ifndef NOASM
245244   NOASM := 1
246245endif
r248389r248390
904903linux_x64: generate $(PROJECTDIR)/gmake-linux/Makefile
905904   $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-linux config=$(CONFIG)64
906905
906.PHONY: linux
907linux: linux_x86
908
907909.PHONY: linux_x86
908910linux_x86: generate $(PROJECTDIR)/gmake-linux/Makefile
909911   $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-linux config=$(CONFIG)32
910912
911.PHONY: linux
912linux: generate $(PROJECTDIR)/gmake-linux/Makefile
913   $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-linux config=$(CONFIG)
914
915913#-------------------------------------------------
916914# gmake-linux-clang
917915#-------------------------------------------------
trunk/nl_examples/congo_bongo.c
r248389r248390
99
1010#ifndef __PLIB_PREPROCESSOR__
1111
12#define MB3614_DIP(_name)                                                    \
13      NET_REGISTER_DEV_X(MB3614_DIP, _name)
14
1215#define LM358_DIP(_name)                                                    \
1316      NET_REGISTER_DEV_X(LM358_DIP, _name)
1417
r248389r248390
7578
7679   INCLUDE(CongoBongo_schematics)
7780
78   /* The opamp actually has an FPF of about 500k. This doesn't work here and causes oscillations.
79    * FPF here therefore about half the Solver clock.
80    */
81   PARAM(XU16.B.MODEL, "MB3614_SLOW")
82   PARAM(XU17.C.MODEL, "MB3614_SLOW")
83
8481   OPTIMIZE_FRONTIER(C51.1, RES_K(20), 50)
8582   OPTIMIZE_FRONTIER(R77.2, RES_K(20), 50)
8683
r248389r248390
229226   CD4538_DIP(XU19)
230227   MM5837_DIP(XU20)
231228   TTL_7416_DIP(XU6)
232
233229   NET_C(D1.A, C21.2, R23.1)
234230   NET_C(D1.K, C20.1, R22.1)
235231   NET_C(XU13.1, C37.2, C36.1, R48.1)
r248389r248390
414410
415411NETLIST_END()
416412
413NETLIST_START(MB3614_DIP)
414#if 0
415   SUBMODEL(opamp_mod, op1)
416   SUBMODEL(opamp_mod, op2)
417   SUBMODEL(opamp_mod, op3)
418   SUBMODEL(opamp_mod, op4)
419#else
420   /* The opamp actually has an FPF of about 500k. This doesn't work here and causes oscillations.
421    * FPF here therefore about half the Solver clock.
422    */
423   OPAMP(op1, ".model MB3614 OPAMP(TYPE=3 VLH=2.0 VLL=0.2 FPF=5 UGF=110k SLEW=0.6M RI=1000k RO=50 DAB=0.002)")
424   OPAMP(op2, ".model MB3614 OPAMP(TYPE=3 VLH=2.0 VLL=0.2 FPF=5 UGF=11k SLEW=0.6M RI=1000k RO=50 DAB=0.002)")
425   OPAMP(op3, ".model MB3614 OPAMP(TYPE=3 VLH=2.0 VLL=0.2 FPF=5 UGF=11k SLEW=0.6M RI=1000k RO=50 DAB=0.002)")
426   OPAMP(op4, ".model MB3614 OPAMP(TYPE=3 VLH=2.0 VLL=0.2 FPF=5 UGF=110k SLEW=0.6M RI=1000k RO=50 DAB=0.002)")
427#endif
428   ALIAS( 1, op1.OUT)
429   ALIAS( 2, op1.MINUS)
430   ALIAS( 3, op1.PLUS)
417431
432   ALIAS( 4, op1.VCC)
433
434   ALIAS( 5, op2.PLUS)
435   ALIAS( 6, op2.MINUS)
436   ALIAS( 7, op2.OUT)
437
438   ALIAS( 8, op3.OUT)
439   ALIAS( 9, op3.MINUS)
440   ALIAS(10, op3.PLUS)
441
442   ALIAS(11, op1.GND)
443
444   ALIAS(12, op4.PLUS)
445   ALIAS(13, op4.MINUS)
446   ALIAS(14, op4.OUT)
447
448   NET_C(op1.GND, op2.GND, op3.GND, op4.GND)
449   NET_C(op1.VCC, op2.VCC, op3.VCC, op4.VCC)
450
451NETLIST_END()
452
453
454
418455NETLIST_START(G501534_DIP)
419456   AFUNC(f, 2, "A0 A1 0.2 * *")
420457
r248389r248390
445482
446483NETLIST_START(congob_lib)
447484
485   //LOCAL_LIB_ENTRY(LM324_DIP)
486   //LOCAL_LIB_ENTRY(LM358_DIP)
487   LOCAL_LIB_ENTRY(MB3614_DIP)
448488   LOCAL_LIB_ENTRY(G501534_DIP)
449489
450490NETLIST_END()
trunk/scripts/src/bus.lua
r248389r248390
890890      MAME_DIR .. "src/emu/bus/msx_cart/korean.h",
891891      MAME_DIR .. "src/emu/bus/msx_cart/majutsushi.c",
892892      MAME_DIR .. "src/emu/bus/msx_cart/majutsushi.h",
893      MAME_DIR .. "src/emu/bus/msx_cart/moonsound.h",
894      MAME_DIR .. "src/emu/bus/msx_cart/moonsound.c",
895893      MAME_DIR .. "src/emu/bus/msx_cart/msx_audio.c",
896894      MAME_DIR .. "src/emu/bus/msx_cart/msx_audio.h",
897895      MAME_DIR .. "src/emu/bus/msx_cart/msx_audio_kb.c",
trunk/scripts/src/machine.lua
r248389r248390
188188
189189---------------------------------------------------
190190--
191--@src/emu/machine/68230pit.h,MACHINES["PIT68230"] = true
191--@src/emu/machine/68561mpcc.h,MACHINES["68561MPCC"] = true
192192---------------------------------------------------
193193
194if (MACHINES["PIT68230"]~=null) then
195   files {
196      MAME_DIR .. "src/emu/machine/68230pit.c",
197      MAME_DIR .. "src/emu/machine/68230pit.h",
198   }
199end
200
201---------------------------------------------------
202--
203--@src/emu/machine/68561mpcc.h,MACHINES += 68561MPCC
204---------------------------------------------------
205
206194if (MACHINES["68561MPCC"]~=null) then
207195   files {
208196      MAME_DIR .. "src/emu/machine/68561mpcc.c",
trunk/scripts/src/netlist.lua
r248389r248390
156156    MAME_DIR .. "src/emu/netlist/macro/nlm_ttl74xx.h",
157157    MAME_DIR .. "src/emu/netlist/macro/nlm_cd4xxx.c",
158158    MAME_DIR .. "src/emu/netlist/macro/nlm_cd4xxx.h",
159    MAME_DIR .. "src/emu/netlist/macro/nlm_opamp.c",
160    MAME_DIR .. "src/emu/netlist/macro/nlm_opamp.h",
161159}
trunk/scripts/target/mame/mess.lua
r248389r248390
156156SOUNDS["Y8950"] = true
157157SOUNDS["YMF262"] = true
158158--SOUNDS["YMF271"] = true
159SOUNDS["YMF278B"] = true
159--SOUNDS["YMF278B"] = true
160160--SOUNDS["YMZ280B"] = true
161161SOUNDS["SN76477"] = true
162162SOUNDS["SN76496"] = true
r248389r248390
485485MACHINES["PCF8593"] = true
486486MACHINES["PCKEYBRD"] = true
487487MACHINES["PIC8259"] = true
488MACHINES["PIT68230"] = true
489488MACHINES["PIT8253"] = true
490489MACHINES["PLA"] = true
491490--MACHINES["PROFILE"] = true
r248389r248390
723722      "exidy",
724723      "fairch",
725724      "fidelity",
726      "force",
727725      "fujitsu",
728726      "funtech",
729727      "galaxy",
r248389r248390
15111509   MAME_DIR .. "src/mess/drivers/fidelz80.c", 
15121510}
15131511
1514createMESSProjects(_target, _subtarget, "force")
1515files {         
1516   MAME_DIR .. "src/mess/drivers/force68k.c", 
1517}
1518
15191512createMESSProjects(_target, _subtarget, "fujitsu")
15201513files {           
15211514   MAME_DIR .. "src/mess/drivers/fmtowns.c",
r248389r248390
16371630   MAME_DIR .. "src/mess/drivers/isbc.c",
16381631   MAME_DIR .. "src/mess/machine/isbc_215g.c",
16391632   MAME_DIR .. "src/mess/drivers/rex6000.c",   
1640   MAME_DIR .. "src/mess/drivers/sdk80.c",     
16411633   MAME_DIR .. "src/mess/drivers/sdk85.c",     
16421634   MAME_DIR .. "src/mess/drivers/sdk86.c",   
16431635   MAME_DIR .. "src/mess/drivers/imds2.c", 
trunk/src/emu/bus/msx_cart/cartridge.c
r248389r248390
1616#include "konami.h"
1717#include "korean.h"
1818#include "majutsushi.h"
19#include "moonsound.h"
2019#include "msx_audio.h"
2120#include "msxdos2.h"
2221#include "nomapper.h"
r248389r248390
6261   SLOT_INTERFACE_INTERNAL("disk_fsfd1a", MSX_CART_FSFD1A)
6362   SLOT_INTERFACE_INTERNAL("disk_fscf351", MSX_CART_FSCF351)
6463   SLOT_INTERFACE("bm_012", MSX_CART_BM_012)
65   SLOT_INTERFACE("moonsound", MSX_CART_MOONSOUND)
6664SLOT_INTERFACE_END
6765
6866
trunk/src/emu/bus/msx_cart/konami.c
r248389r248390
1919{
2020   for (int i = 0; i < 4; i++)
2121   {
22      m_selected_bank[i] = i;
22      m_selected_bank[i] = 0;
2323   }
2424   for (int i = 0; i < 8; i++)
2525   {
r248389r248390
128128{
129129   for (int i = 0; i < 4; i++)
130130   {
131      m_selected_bank[i] = i;
131      m_selected_bank[i] = 0;
132132   }
133133   for (int i = 0; i < 8; i++)
134134   {
trunk/src/emu/bus/msx_cart/moonsound.c
r248389r248390
1// license:BSD-3-Clause
2// copyright-holders:Wilbert Pol
3/**********************************************************************************
4
5TODO:
6- Properly hook up correct SRAM sizes for different moonsound compatible
7  cartridges. (Original moonsound has 128KB SRAM)
8
9**********************************************************************************/
10
11#include "emu.h"
12#include "moonsound.h"
13
14
15#define VERBOSE 0
16#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
17
18
19const device_type MSX_CART_MOONSOUND = &device_creator<msx_cart_moonsound>;
20
21
22msx_cart_moonsound::msx_cart_moonsound(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
23   : device_t(mconfig, MSX_CART_MOONSOUND, "MSX Cartridge - MoonSound", tag, owner, clock, "msx_cart_moonsound", __FILE__)
24   , msx_cart_interface(mconfig, *this)
25   , m_ymf278b(*this, "ymf278b")
26{
27}
28
29
30static ADDRESS_MAP_START( ymf278b_map, AS_0, 8, msx_cart_moonsound )
31   AM_RANGE(0x000000, 0x1fffff) AM_ROM
32   AM_RANGE(0x200000, 0x3fffff) AM_RAM  // 2MB sram for testing
33ADDRESS_MAP_END
34
35
36static MACHINE_CONFIG_FRAGMENT( moonsound )
37   // The moonsound cartridge has a separate stereo output.
38   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
39   MCFG_SOUND_ADD("ymf278b", YMF278B, YMF278B_STD_CLOCK)
40   MCFG_DEVICE_ADDRESS_MAP(AS_0, ymf278b_map)
41   MCFG_YMF278B_IRQ_HANDLER(WRITELINE(msx_cart_moonsound,irq_w))
42   MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
43   MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
44    MCFG_SOUND_ROUTE(2, "lspeaker", 0.40)
45    MCFG_SOUND_ROUTE(3, "rspeaker", 0.40)
46    MCFG_SOUND_ROUTE(4, "lspeaker", 0.40)
47    MCFG_SOUND_ROUTE(5, "rspeaker", 0.40)
48MACHINE_CONFIG_END
49
50
51machine_config_constructor msx_cart_moonsound::device_mconfig_additions() const
52{
53   return MACHINE_CONFIG_NAME( moonsound );
54}
55
56
57ROM_START( msx_cart_moonsound )
58   ROM_REGION(0x400000, "ymf278b", 0)
59   ROM_LOAD("yrw801.rom", 0x0, 0x200000, CRC(2a9d8d43) SHA1(32760893ce06dbe3930627755ba065cc3d8ec6ca))
60ROM_END
61
62
63const rom_entry *msx_cart_moonsound::device_rom_region() const
64{
65   return ROM_NAME( msx_cart_moonsound );
66}
67
68
69void msx_cart_moonsound::device_start()
70{
71   m_out_irq_cb.resolve_safe();
72
73   // Install IO read/write handlers
74   address_space &space = machine().device<cpu_device>("maincpu")->space(AS_IO);
75   space.install_readwrite_handler(0x7e, 0x7f, read8_delegate(FUNC(msx_cart_moonsound::read_ymf278b_pcm), this), write8_delegate(FUNC(msx_cart_moonsound::write_ymf278b_pcm), this));
76   space.install_readwrite_handler(0xc4, 0xc7, read8_delegate(FUNC(msx_cart_moonsound::read_ymf278b_fm), this), write8_delegate(FUNC(msx_cart_moonsound::write_ymf278b_fm), this));
77   space.install_read_handler(0xc0, 0xc0, read8_delegate(FUNC(msx_cart_moonsound::read_c0), this));
78}
79
80
81void msx_cart_moonsound::device_reset()
82{
83}
84
85
86WRITE_LINE_MEMBER(msx_cart_moonsound::irq_w)
87{
88   LOG(("moonsound: irq state %d\n", state));
89   m_out_irq_cb(state);
90}
91
92
93WRITE8_MEMBER(msx_cart_moonsound::write_ymf278b_fm)
94{
95   LOG(("moonsound: write 0x%02x, data 0x%02x\n", 0xc4 + offset, data));
96   m_ymf278b->write(space, offset, data);
97}
98
99
100READ8_MEMBER(msx_cart_moonsound::read_ymf278b_fm)
101{
102   LOG(("moonsound: read 0x%02x\n", 0xc4 + offset));
103   return m_ymf278b->read(space, offset);
104}
105
106
107WRITE8_MEMBER(msx_cart_moonsound::write_ymf278b_pcm)
108{
109   LOG(("moonsound: write 0x%02x, data 0x%02x\n", 0x7e + offset, data));
110   m_ymf278b->write(space, 4 + offset, data);
111}
112
113
114READ8_MEMBER(msx_cart_moonsound::read_ymf278b_pcm)
115{
116   LOG(("moonsound: read 0x%02x\n", 0x7e + offset));
117   return m_ymf278b->read(space, 4 + offset);
118}
119
120
121// For detecting presence of moonsound cartridge
122READ8_MEMBER(msx_cart_moonsound::read_c0)
123{
124   LOG(("moonsound: read 0xc0\n"));
125   return 0x00;
126}
127
trunk/src/emu/bus/msx_cart/moonsound.h
r248389r248390
1// license:BSD-3-Clause
2// copyright-holders:Wilbert Pol
3#ifndef __MSX_CART_MOONSOUND_H
4#define __MSX_CART_MOONSOUND_H
5
6#include "bus/msx_cart/cartridge.h"
7#include "sound/ymf278b.h"
8
9
10extern const device_type MSX_CART_MOONSOUND;
11
12
13class msx_cart_moonsound : public device_t
14                  , public msx_cart_interface
15{
16public:
17   msx_cart_moonsound(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
18
19   // device-level overrides
20   virtual void device_start();
21   virtual void device_reset();
22   virtual machine_config_constructor device_mconfig_additions() const;
23   virtual const rom_entry *device_rom_region() const;
24
25   DECLARE_WRITE8_MEMBER(write_ymf278b_fm);
26   DECLARE_READ8_MEMBER(read_ymf278b_fm);
27   DECLARE_WRITE8_MEMBER(write_ymf278b_pcm);
28   DECLARE_READ8_MEMBER(read_ymf278b_pcm);
29   DECLARE_READ8_MEMBER(read_c0);
30   DECLARE_WRITE_LINE_MEMBER(irq_w);
31
32private:
33   required_device<ymf278b_device> m_ymf278b;
34};
35
36
37#endif
trunk/src/emu/bus/ti99_peb/hfdc.c
r248389r248390
10121012
10131013static SLOT_INTERFACE_START( hfdc_harddisks )
10141014   SLOT_INTERFACE( "generic", MFMHD_GENERIC )     // Generic high-level emulation
1015   SLOT_INTERFACE( "st213", MFMHD_ST213 )        // Seagate ST-213 (10 MB)
1016   SLOT_INTERFACE( "st225", MFMHD_ST225 )        // Seagate ST-225 (20 MB)
1017   SLOT_INTERFACE( "st251", MFMHD_ST251 )        // Seagate ST-251 (40 MB)
1015   SLOT_INTERFACE( "st225", MFMHD_ST225 )        // Seagate ST-225 and others
10181016SLOT_INTERFACE_END
10191017
10201018MACHINE_CONFIG_FRAGMENT( ti99_hfdc )
r248389r248390
10321030   MCFG_FLOPPY_DRIVE_ADD("f4", hfdc_floppies, NULL, myarc_hfdc_device::floppy_formats)
10331031
10341032   // NB: Hard disks don't go without image (other than floppy drives)
1035   MCFG_MFM_HARDDISK_CONN_ADD("h1", hfdc_harddisks, NULL, MFM_BYTE, 3000, 20, MFMHD_TI99_FORMAT)
1036   MCFG_MFM_HARDDISK_CONN_ADD("h2", hfdc_harddisks, NULL, MFM_BYTE, 2000, 20, MFMHD_TI99_FORMAT)
1037   MCFG_MFM_HARDDISK_CONN_ADD("h3", hfdc_harddisks, NULL, MFM_BYTE, 2000, 20, MFMHD_TI99_FORMAT)
1033   MCFG_MFM_HARDDISK_CONN_ADD("h1", hfdc_harddisks, NULL, MFM_BYTE, 3000, 20)
1034   MCFG_MFM_HARDDISK_CONN_ADD("h2", hfdc_harddisks, NULL, MFM_BYTE, 2000, 20)
1035   MCFG_MFM_HARDDISK_CONN_ADD("h3", hfdc_harddisks, NULL, MFM_BYTE, 2000, 20)
10381036
10391037   MCFG_DEVICE_ADD(CLOCK_TAG, MM58274C, 0)
10401038   MCFG_MM58274C_MODE24(1) // 24 hour
trunk/src/emu/cpu/mips/mips3drc.c
r248389r248390
27912791               else                /* NEG.D - MIPS I */
27922792               {
27932793                  UML_FDNEG(block, FPR64(FDREG), FPR64(FSREG));               // fdneg   <fdreg>,<fsreg>
2794                  UML_DCMP(block, FPR64(FSREG), 0);                            // cmp     <fsreg>,0.0
2794                  UML_CMP(block, FPR64(FSREG), 0);                            // cmp     <fsreg>,0.0
27952795                  UML_DMOVc(block, COND_E, FPR64(FDREG), U64(0x8000000000000000));// dmov    <fdreg>,-0.0,e
27962796               }
27972797               return TRUE;
trunk/src/emu/cpu/sm510/sm510.c
r248389r248390
88  - SM512: 4Kx8 ROM, 128x4 RAM(48x4 for LCD), melody controller
99 
1010  Other chips that may be in the same family, investigate more when one of
11  them needs to get emulated: SM500, SM530/31, SM4A, SM3903, ..
11  them needs to get emulated: SM500, SM530, SM531, ..
1212
1313  References:
1414  - 1990 Sharp Microcomputers Data Book
r248389r248390
1717  TODO:
1818  - proper support for LFSR program counter in debugger
1919  - callback for lcd screen as MAME bitmap (when needed)
20  - LCD bs pin blink mode via Y register (0.5s off, 0.5s on)
21  - LB/SBM is correct?
20  - LCD bs pin blink mode via Y register
21  - LB opcode
2222  - SM511 unknown opcodes
2323
2424*/
trunk/src/emu/cpu/sm510/sm510op.c
r248389r248390
5757void sm510_base_device::op_lb()
5858{
5959   // LB x: load BM/BL with 4-bit immediate value (partial)
60   
61   // SM510 WIP..
62   // bm and bl(low) are probably ok!
63   m_bm = (m_bm & 4) | (m_op & 3);
64   m_bl = (m_op >> 2 & 3);
65   
66   // bl(high) is still unclear, official doc is confusing
67   UINT8 hi = 0;
68   switch (m_bl)
69   {
70      case 0: hi = 3; break;
71      case 1: hi = 0; break;
72      case 2: hi = 0; break;
73      case 3: hi = 3; break;
74   }
75   m_bl |= (hi << 2 & 0xc);
60   op_illegal();
7661}
7762
7863void sm510_base_device::op_lbl()
trunk/src/emu/cpu/ucom4/ucom4.c
r248389r248390
1212  TODO:
1313  - what happens with uCOM-43 opcodes on an uCOM-44/45 MCU?
1414  - what's the data after the ROM data for? (eg. 2000-2047, official ROM size is 2000)
15  - is DPh internally 3-bit or 4-bit? (currently assume 4-bit, it could have effect
16    on specific uCOM-43 exchange opcodes)
17  - RAM access from 0x50-0x7f on data_96x4
18  - invalid port accesses via DPl
19  - documentation is conflicting if IRQ is level or edge triggered
2015
2116*/
2217
r248389r248390
121116   m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ucom4_cpu_device::simple_timer_cb), this));
122117
123118   // resolve callbacks
124   m_read_a.resolve_safe(0);
125   m_read_b.resolve_safe(0);
126   m_read_c.resolve_safe(0);
127   m_read_d.resolve_safe(0);
119   m_read_a.resolve_safe(0xf);
120   m_read_b.resolve_safe(0xf);
121   m_read_c.resolve_safe(0xf);
122   m_read_d.resolve_safe(0xf);
128123
129124   m_write_c.resolve_safe();
130125   m_write_d.resolve_safe();
trunk/src/emu/cpu/ucom4/ucom4.h
r248389r248390
216216   void ram_w(UINT8 data);
217217   void pop_stack();
218218   void push_stack();
219   virtual UINT8 input_r(int index);
220   virtual void output_w(int index, UINT8 data);
219   UINT8 input_r(int index);
220   void output_w(int index, UINT8 data);
221221
222222   bool check_op_43();
223223   TIMER_CALLBACK_MEMBER( simple_timer_cb );
r248389r248390
322322{
323323public:
324324   upd650_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
325
326protected:   
327   virtual UINT8 input_r(int index);
328325};
329326
330327
trunk/src/emu/cpu/ucom4/ucom4op.c
r248389r248390
4343   {
4444      case NEC_UCOM4_PORTA: inp = m_read_a(index, 0xff); break;
4545      case NEC_UCOM4_PORTB: inp = m_read_b(index, 0xff); break;
46      case NEC_UCOM4_PORTC: inp = m_read_c(index, 0xff) | m_port_out[index]; break;
47      case NEC_UCOM4_PORTD: inp = m_read_d(index, 0xff) | m_port_out[index]; break;
46      case NEC_UCOM4_PORTC: inp = m_read_c(index, 0xff); break;
47      case NEC_UCOM4_PORTD: inp = m_read_d(index, 0xff); break;
4848
4949      default:
5050         logerror("%s read from unknown port %c at $%03X\n", tag(), 'A' + index, m_prev_pc);
r248389r248390
5454   return inp & 0xf;
5555}
5656
57UINT8 upd650_cpu_device::input_r(int index)
58{
59   // bidirectional ports are 'push-pull', meaning it will output 0 when it's read
60   if ((index & 0xf) == NEC_UCOM4_PORTC || (index & 0xf) == NEC_UCOM4_PORTD)
61      output_w(index, 0);
62   
63   return ucom4_cpu_device::input_r(index);
64}
65
6657void ucom4_cpu_device::output_w(int index, UINT8 data)
6758{
6859   index &= 0xf;
trunk/src/emu/machine/68230pit.c
r248389r248390
1// license:BSD-3-Clause
2// copyright-holders:Joakim Larsson Edström
3/**********************************************************************
4
5    Motorola MC68230 PI/T Parallell Interface and Timer
6
7Revisions
8 2015-07-15 JLE initial
9
10Todo
11 - Add clock and timers
12 - Add all missing registers
13 - Add configuration
14**********************************************************************/
15
16/*
17Force CPU-1 init sequence
180801EA 0E0000 W 0000 PGCR  data_w: 0000 -> 0000 & 00ff
190801EA 0E0002 W 0000 PSRR  data_w: 0000 -> 0001 & 00ff
200801EA 0E0004 W FFFF PADDR data_w: 00ff -> 0002 & 00ff
210801EA 0E0006 W 0000 PBDDR data_w: 0000 -> 0003 & 00ff
220801F0 0E000C W 6060 PACR  data_w: 0060 -> 0006 & 00ff
230801F6 0E000E W A0A0 PBCR  data_w: 00a0 -> 0007 & 00ff
240801FC 0E0000 W 3030 PGCR  data_w: 0030 -> 0000 & 00ff
25080202 0E000E W A8A8 PBCR  data_w: 00a8 -> 0007 & 00ff
26080210 0E000E W A0A0 PBCR  data_w: 00a0 -> 0007 & 00ff
27
28Force CPU-1 after one keypress in terminal
29081DC0 0E000C W 6868 PACR
30081DC8 0E000C W 6060 PACR
31*/
32
33
34#include "emu.h"
35#include "68230pit.h"
36
37/***************************************************************************
38    IMPLEMENTATION
39***************************************************************************/
40
41// device type definition
42const device_type PIT68230 = &device_creator<pit68230_device>;
43
44//-------------------------------------------------
45//  pit68230_device - constructor
46//-------------------------------------------------
47
48pit68230_device::pit68230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
49        : device_t(mconfig, PIT68230, "Motorola 68230 PI/T", tag, owner, clock, "pit68230", __FILE__)
50{
51}
52
53void pit68230_device::device_start()
54{
55  printf("PIT68230 device started\n");
56}
57
58void pit68230_device::device_reset()
59{
60  printf("PIT68230 device reseted\n");
61  m_pgcr = 0;
62  m_psrr = 0;
63  m_paddr = 0;
64  m_pbddr = 0;
65  m_pcddr = 0;
66  m_pacr = 0;
67  m_pbcr = 0;
68  m_padr = 0;
69  m_pbdr = 0;
70  m_psr = 0;
71}
72
73WRITE8_MEMBER( pit68230_device::data_w )
74{
75  printf("data_w: %04x -> ", data);
76  switch (offset)
77  {
78  case PIT_68230_PGCR:
79    printf("PGCR");
80    m_pgcr = data;
81    break;
82  case PIT_68230_PSRR:
83    printf("PSRR");
84    m_psrr = data;
85    break;
86  case PIT_68230_PADDR:
87    printf("PADDR");
88    m_paddr = data;
89    break;
90  case PIT_68230_PBDDR:
91    printf("PBDDR");
92    m_pbddr = data;
93    break;
94  case PIT_68230_PACR:
95    printf("PACR");
96    m_pacr = data;
97    break;
98  case PIT_68230_PBCR:
99    printf("PBCR");
100    m_pbcr = data;
101    break;
102  case PIT_68230_PADR:
103    printf("PADR");
104    m_padr = data;
105    break;
106  case PIT_68230_PSR:
107    printf("PSR");
108    m_padr = data;
109    break;
110  default:
111    printf("unhandled register %02x", offset);
112  }
113  printf("\n");
114}
115
116READ8_MEMBER( pit68230_device::data_r )
117{
118  UINT8 data = 0;
119
120  printf("data_r: ");
121  switch (offset)
122  {
123  case PIT_68230_PGCR:
124    printf("PGCR");
125    data = m_pgcr;
126    break;
127  case PIT_68230_PSRR:
128    printf("PSRR");
129    data = m_psrr;
130    break;
131  case PIT_68230_PADDR:
132    printf("PADDR");
133    data = m_paddr;
134    break;
135  case PIT_68230_PBDDR:
136    printf("PBDDR");
137    data = m_pbddr;
138    break;
139  case PIT_68230_PACR:
140    printf("PACR");
141    data = m_pacr;
142    break;
143  case PIT_68230_PBCR:
144    printf("PBCR");
145    data = m_pbcr;
146    break;
147  case PIT_68230_PADR:
148    printf("PADR");
149    data = m_padr;
150    break;
151  case PIT_68230_PBDR:
152    /* 4.6.2. PORT B DATA REGISTER (PBDR). The port B data register is a holding register for moving data
153to and from port B pins. The port B data direction register determines whether each pin is an input (zero)
154or an output (one). This register is readable and writable at all times. Depending on the chosen mode/submode,
155reading or writing may affect the double-buffered handshake mechanism. The port B data register is not affected
156by the assertion of the RESET pin. PB0-PB7 sits on pins 17-24 on a 48 pin DIP package */
157    printf("PBDR");
158    data = m_pbdr;
159    //    data = (m_pbdr & 0xfc) | 1; // CPU-1 centronics interface expects to see 2 lowest bits equal 1 for printer
160    break;
161  case PIT_68230_PSR:
162    printf("PSR");
163    data = m_psr;
164    //    data = m_psr | 1; // CPU-1 centronics interface expects status to be non zero
165    break;
166  default:
167    printf("unhandled register %02x", offset);
168    data = 0;
169  }
170  printf("\n");
171
172  return data;
173}
174
175
trunk/src/emu/machine/68230pit.h
r248389r248390
1// license:BSD-3-Clause
2// copyright-holders:Joakim Larsson Edström
3/**********************************************************************
4
5    Motorola MC68230 PI/T Parallell Interface and Timer
6
7**********************************************************************/
8#pragma once
9
10#ifndef __68230PIT_H__
11#define __68230PIT_H__
12
13#include "emu.h"
14
15/*-----------------------------------------------------------------------
16  Registers                RS1-RS5   R/W Description
17-------------------------------------------------------------------------*/
18#define PIT_68230_PGCR        0x00 /* RW Port General Control register   */
19#define PIT_68230_PSRR        0x01 /* RW Port Service Request register   */
20#define PIT_68230_PADDR       0x02 /* RW Port A Data Direction register  */
21#define PIT_68230_PBDDR       0x03 /* RW Port B Data Direction register  */
22#define PIT_68230_PCDDR       0x04 /* RW Port C Data Direction register  */
23#define PIT_68230_PIVR        0x05 /* RW Port Interrupt vector register  */
24#define PIT_68230_PACR        0x06 /* RW Port A Control register         */
25#define PIT_68230_PBCR        0x07 /* RW Port B Control register         */
26#define PIT_68230_PADR        0x08 /* RW Port A Data register            */
27#define PIT_68230_PBDR        0x09 /* RW Port B Data register            */
28#define PIT_68230_PAAR        0x0a /* RO Port A Alternate register       */
29#define PIT_68230_PBAR        0x0b /* RO Port B Alternate register       */
30#define PIT_68230_PCDR        0x0c /* RW Port C Data register            */
31#define PIT_68230_PSR         0x0d /* RW Port Status register            */
32#define PIT_68230_TCR         0x10 /* RW Timer Control Register          */
33#define PIT_68230_TIVR        0x11 /* RW Timer Interrupt Vector Register */
34#define PIT_68230_CPRH        0x13 /* RW Counter Preload Register High   */
35#define PIT_68230_CPRM        0x14 /* RW Counter Preload Register Middle */
36#define PIT_68230_CPRL        0x15 /* RW Counter Preload Register Low    */
37#define PIT_68230_CNTRH       0x17 /* RO Counter Register High           */
38#define PIT_68230_CNTRM       0x18 /* RO Counter Register Middle         */
39#define PIT_68230_CNTRL       0x19 /* RO Counter Register Low            */
40#define PIT_68230_TSR         0x1A /* RW Timer Status Register           */
41
42//**************************************************************************
43//  TYPE DEFINITIONS
44//**************************************************************************
45class pit68230_device :  public device_t
46{
47public:
48   // construction/destruction
49   pit68230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
50   DECLARE_WRITE8_MEMBER( data_w );
51   DECLARE_READ8_MEMBER( data_r );
52
53protected:
54   // device-level overrides
55   virtual void device_start();
56   virtual void device_reset();
57
58private:
59        UINT8  m_pgcr;  // Port General Control register
60   UINT8  m_psrr;  // Port Service Request register
61   UINT8  m_paddr; // Port A Data Direction register
62   UINT8  m_pbddr; // Port B Data Direction register
63   UINT8  m_pcddr; // Port C Data Direction register
64   UINT8  m_pacr;  // Port A Control register
65   UINT8  m_pbcr;  // Port B Control register
66   UINT8  m_padr;  // Port A Data register
67   UINT8  m_pbdr;  // Port B Data register
68   UINT8  m_psr;   // Port Status Register
69};
70
71
72// device type definition
73extern const device_type PIT68230;
74
75#endif // __68230PIT__
trunk/src/emu/machine/hdc9234.c
r248389r248390
17401740      switch (m_substate)
17411741      {
17421742      case WAITINDEX0:
1743         if (TRACE_FORMAT && TRACE_DETAIL) logerror("%s: Format track; looking for track start\n", tag());
1743         if (TRACE_FORMAT && TRACE_DETAIL) logerror("%s: Format track - waiting for index hole\n", tag());
17441744         if (!index_hole())
17451745         {
17461746            m_substate = WAITINDEX1;
r248389r248390
17491749         else
17501750         {
17511751            // We're above the index hole right now, so wait for the line going down
1752            if (TRACE_FORMAT && TRACE_DETAIL) logerror("%s: Index hole just passing by ... \n", tag());
1753            wait_line(INDEX_LINE, CLEAR_LINE, WAITINDEX1, false);
1752            if (TRACE_FORMAT && TRACE_DETAIL) logerror("%s: Index hole just passing by ... waiting for next\n", tag());
1753            wait_line(INDEX_LINE, ASSERT_LINE, WAITINDEX1, false);
17541754            cont = WAIT;
17551755         }
17561756         break;
17571757      case WAITINDEX1:
17581758         // Waiting for the next rising edge
1759         if (TRACE_FORMAT && TRACE_DETAIL) logerror("%s: Waiting for next index hole\n", tag());
17601759         wait_line(INDEX_LINE, ASSERT_LINE, TRACKSTART, false);
17611760         cont = WAIT;
17621761         break;
r248389r248390
25042503            write_on_track(encode((m_live_state.crc >> 8) & 0xff), 1, WRITE_DATA_CRC);
25052504         }
25062505         else
2507            // Write a filler byte so that the last CRC bit is saved correctly (why actually?)
2508            // write_on_track(encode(0xff), 1, WRITE_DONE);
2509            m_live_state.state = WRITE_DONE;
2506            // Write a filler byte so that the last CRC bit is saved correctly
2507            write_on_track(encode(0xff), 1, WRITE_DONE);
25102508
25112509         break;
25122510
trunk/src/emu/machine/netlist.c
r248389r248390
100100   pstring dname = "OUT_" + m_in;
101101   m_delegate.bind_relative_to(owner()->machine().root_device());
102102   NETLIB_NAME(analog_callback) *dev = downcast<NETLIB_NAME(analog_callback) *>(
103         setup.register_dev("NETDEV_CALLBACK", dname));
103         setup.register_dev("nld_analog_callback", dname));
104104
105105   dev->register_callback(m_delegate);
106106   setup.register_link(dname + ".IN", m_in);
r248389r248390
173173{
174174   NETLIB_NAME(sound_in) *snd_in = setup.netlist().get_first_device<NETLIB_NAME(sound_in)>();
175175   if (snd_in == NULL)
176      snd_in = dynamic_cast<NETLIB_NAME(sound_in) *>(setup.register_dev("NETDEV_SOUND_IN", "STREAM_INPUT"));
176      snd_in = dynamic_cast<NETLIB_NAME(sound_in) *>(setup.register_dev("nld_sound_in", "STREAM_INPUT"));
177177
178178   pstring sparam = pstring::sprintf("STREAM_INPUT.CHAN%d", m_channel);
179179   setup.register_param(sparam, m_param_name);
r248389r248390
213213   pstring sname = pstring::sprintf("STREAM_OUT_%d", m_channel);
214214
215215   //snd_out = dynamic_cast<NETLIB_NAME(sound_out) *>(setup.register_dev("nld_sound_out", sname));
216   setup.register_dev("NETDEV_SOUND_OUT", sname);
216   setup.register_dev("nld_sound_out", sname);
217217
218218   setup.register_param(sname + ".CHAN" , m_channel);
219219   setup.register_param(sname + ".MULT",  m_mult);
trunk/src/emu/machine/smpc.c
r248389r248390
686686      case 0x0a:
687687      case 0x0b:
688688         popmessage ("SMPC: NETLINK %s, contact MAMEdev",(data & 1) ? "off" : "on");
689         break;      case 0x0d:
689         break;
690      case 0x0d:
690691         if(LOG_SMPC) printf ("SMPC: System Reset\n");
691692         smpc_system_reset();
692693         break;
r248389r248390
925926      case 2:
926927         res = th<<6;
927928         //  1 C B Right Left Down Up
928         //  WHP actually has a very specific code at 0x6015f30, doesn't like bits 0-1 active here ...
929929         res|= (((machine().root_device().ioport(padnames[pad_n])->read()>>4)) & 0x30); // C & B
930         res|= (((machine().root_device().ioport(padnames[pad_n])->read()>>12)) & 0xc);
930         res|= (((machine().root_device().ioport(padnames[pad_n])->read()>>12)) & 0xf);
931931         break;
932932      case 1:
933933         res = th<<6;
r248389r248390
939939         //  0 Start A 0 0    Down Up
940940         res|= (((machine().root_device().ioport(padnames[pad_n])->read()>>6)) & 0x30); // Start & A
941941         res|= (((machine().root_device().ioport(padnames[pad_n])->read()>>12)) & 0x3);
942         //  ... and actually wants bits 2 - 3 active here.
943         res|= 0xc;
944942         break;
945943   }
946   
944
947945   return res;
948946}
949947
r248389r248390
10271025      {
10281026         if(data & 0x40)
10291027         {
1030            if(LOG_PAD_CMD) printf("SMPC: BREAK request %02x\n",data);
1028            if(LOG_PAD_CMD) printf("SMPC: BREAK request\n");
10311029            m_smpc.SR &= 0x0f;
10321030            m_smpc.intback_stage = 0;
10331031         }
10341032         else if(data & 0x80)
10351033         {
1036            if(LOG_PAD_CMD) printf("SMPC: CONTINUE request %02x\n",data);
1034            if(LOG_PAD_CMD) printf("SMPC: CONTINUE request\n");
10371035            machine().scheduler().timer_set(attotime::from_usec(700), timer_expired_delegate(FUNC(saturn_state::intback_peripheral),this),0); /* TODO: is timing correct? */
10381036            m_smpc.OREG[31] = 0x10;
10391037            m_smpc.SF = 0x01; //TODO: set hand-shake flag?
trunk/src/emu/machine/stvcd.c
r248389r248390
862862               //printf("Partition %08x %04x\n",bufnum,cr4);
863863            }
864864
865            printf("%04x\n",cr4);
866            if(cr4 == 0)
867               hirqreg |= (CMOK);
868            else
869               hirqreg |= (CMOK|DRDY);               
865            hirqreg |= (CMOK|DRDY);
870866            status_type = 1;
871867         }
872868         break;
r248389r248390
19121908      cr1 = data;
19131909      cd_stat &= ~CD_STAT_PERI;
19141910      cmd_pending |= 1;
1915      sh1_timer->adjust(attotime::never);
19161911      break;
19171912   case 0x001c:
19181913   case 0x001e:
trunk/src/emu/machine/ti99_hd.c
r248389r248390
3434#define TRACE_TIMING 0
3535#define TRACE_IMAGE 0
3636#define TRACE_STATE 1
37#define TRACE_CONFIG 1
3837
3938enum
4039{
r248389r248390
5251};
5352
5453#define TRACKSLOTS 5
54#define TRACKIMAGE_SIZE 10416       // Provide the buffer for a complete track, including preambles and gaps
5555
5656#define OFFLIMIT -1
5757
r248389r248390
6969{
7070   m_spinupms = 10000;
7171   m_cachelines = TRACKSLOTS;
72   m_max_cylinders = 0;
73   m_phys_cylinders = 0;   // We will get this value for generic drives from the image
72   m_max_cylinder = 0;
7473   m_max_heads = 0;
75   m_cell_size = 100;
76   m_rpm = 3600;           // MFM drives have a revolution rate of 3600 rpm (i.e. 60/sec)
77   m_trackimage_size = (int)((60000000000L / (m_rpm * m_cell_size)) / 16 + 1);
78   m_cache = NULL;
79   // We will calculate default values from the time specs later.
80   m_seeknext_time = 0;
81   m_maxseek_time = 0;
82   m_actual_cylinders = 0;
83   m_park_pos = 0;
84   m_interleave = 0;
8574}
8675
8776mfm_harddisk_device::~mfm_harddisk_device()
r248389r248390
9584   m_seek_timer = timer_alloc(SEEK_TM);
9685   m_cache_timer = timer_alloc(CACHE_TM);
9786
98   m_rev_time = attotime::from_hz(m_rpm/60);
99   m_index_timer->adjust(attotime::from_hz(m_rpm/60), 0, attotime::from_hz(m_rpm/60));
87   m_rev_time = attotime::from_hz(60);
10088
101   m_current_cylinder = m_park_pos; // Park position
89   // MFM drives have a revolution rate of 3600 rpm (i.e. 60/sec)
90   m_index_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60));
91
92   m_current_cylinder = 615; // Park position
10293   m_spinup_timer->adjust(attotime::from_msec(m_spinupms));
10394
10495   m_cache = global_alloc(mfmhd_trackimage_cache);
10596
106   // In 5 second periods, check whether the cache has dirty lines
97   // In 5 second period, check whether the cache has dirty lines
10798   m_cache_timer->adjust(attotime::from_msec(5000), 0, attotime::from_msec(5000));
10899}
109100
r248389r248390
120111
121112void mfm_harddisk_device::device_stop()
122113{
123   if (m_cache!=NULL) global_free(m_cache);
114   global_free(m_cache);
124115}
125116
126/*
127    Load the image from the CHD. We also calculate the head timing here
128    because we need the number of cylinders, and for generic drives we get
129    them from the CHD.
130*/
131117bool mfm_harddisk_device::call_load()
132118{
133119   bool loaded = harddisk_image_device::call_load();
134120   if (loaded==IMAGE_INIT_PASS)
135121   {
136      std::string metadata;
137      chd_file* chdfile = get_chd_file();
138
139      if (chdfile==NULL)
140      {
141         logerror("%s: chdfile is null\n", tag());
142         return IMAGE_INIT_FAIL;
143      }
144
145      // Read the hard disk metadata
146      chd_error state = chdfile->read_metadata(HARD_DISK_METADATA_TAG, 0, metadata);
147      if (state != CHDERR_NONE)
148      {
149         logerror("%s: Failed to read CHD metadata\n", tag());
150         return IMAGE_INIT_FAIL;
151      }
152
153      if (TRACE_CONFIG) logerror("%s: CHD metadata: %s\n", tag(), metadata.c_str());
154
155      // Parse the metadata
156      int imagecyls;
157      int imageheads;
158      int imagesecpt;
159      int imagesecsz;
160
161      if (sscanf(metadata.c_str(), HARD_DISK_METADATA_FORMAT, &imagecyls, &imageheads, &imagesecpt, &imagesecsz) != 4)
162      {
163         logerror("%s: Invalid CHD metadata\n", tag());
164         return IMAGE_INIT_FAIL;
165      }
166
167      if (TRACE_CONFIG) logerror("%s: CHD image has geometry cyl=%d, head=%d, sect=%d, size=%d\n", tag(), imagecyls, imageheads, imagesecpt, imagesecsz);
168
169      if (m_max_cylinders != 0 && (imagecyls != m_max_cylinders || imageheads != m_max_heads))
170      {
171         throw emu_fatalerror("Image geometry does not fit this kind of hard drive: drive=(%d,%d), image=(%d,%d)", m_max_cylinders, m_max_heads, imagecyls, imageheads);
172      }
173
174      m_cache->init(chdfile, tag(), m_trackimage_size, imagecyls, imageheads, imagesecpt, m_cachelines, m_encoding, m_format);
175
176      // Head timing
177      // We assume that the real times are 80% of the max times
178      // The single-step time includes the settle time, so does the max time
179      // From that we calculate the actual cylinder-by-cylinder time and the settle time
180
181      m_actual_cylinders = m_cache->get_cylinders();
182      if (m_phys_cylinders == 0) m_phys_cylinders = m_actual_cylinders+1;
183
184      m_park_pos = m_phys_cylinders-1;
185
186      float realnext = (m_seeknext_time==0)? 10 : (m_seeknext_time * 0.8);
187      float realmax = (m_maxseek_time==0)? (m_actual_cylinders * 0.2) : (m_maxseek_time * 0.8);
188      float settle_us = ((m_actual_cylinders-1.0) * realnext - realmax) / (m_actual_cylinders-2.0) * 1000;
189      float step_us = realnext * 1000 - settle_us;
190      if (TRACE_CONFIG) logerror("%s: Calculated settle time: %0.2f ms, step: %d us\n", tag(), settle_us/1000, (int)step_us);
191
192      m_settle_time = attotime::from_usec((int)settle_us);
193      m_step_time = attotime::from_usec((int)step_us);
194
195      m_current_cylinder = m_park_pos;
196      m_interleave = m_format->get_interleave();
122      m_cache->init(get_chd_file(), tag(), m_max_cylinder, m_max_heads, m_cachelines, m_encoding);
197123   }
198124   else
199125   {
r248389r248390
204130
205131void mfm_harddisk_device::call_unload()
206132{
207   if (m_cache!=NULL)
208   {
209      m_cache->cleanup();
210
211      if (m_interleave != m_format->get_interleave())
212      {
213         logerror("%s: Interleave changed from %d to %d; committing to CHD\n", tag(), m_interleave, m_format->get_interleave());
214      }
215   }
216
217   // TODO: If interleave changed, commit that to CHD
133   m_cache->cleanup();
218134   harddisk_image_device::call_unload();
219135}
220136
r248389r248390
260176   switch (id)
261177   {
262178   case INDEX_TM:
263      // Simple index hole handling. We assume that there is only a short pulse.
179      /* Simple index hole handling. We assume that there is only a short pulse. */
264180      m_revolution_start_time = machine().time();
265181      if (!m_index_pulse_cb.isnull())
266182      {
r248389r248390
291207         {
292208            // Start the settle timer
293209            m_step_phase = STEP_SETTLE;
294            m_seek_timer->adjust(m_settle_time);
210            m_seek_timer->adjust(attotime::from_usec(16800));
295211            if (TRACE_STEPS && TRACE_DETAIL) logerror("%s: Arrived at target cylinder %d, settling ...\n", tag(), m_current_cylinder);
296212         }
297213         break;
r248389r248390
325241{
326242   if (TRACE_STEPS) logerror("%s: Recalibrate to track 0\n", tag());
327243   direction_in_w(CLEAR_LINE);
328   while (-m_track_delta  < m_phys_cylinders)
244   while (-m_track_delta  < 620)
329245   {
330246      step_w(ASSERT_LINE);
331247      step_w(CLEAR_LINE);
r248389r248390
338254   if (steps < 0) steps = -steps;
339255   if (TRACE_STEPS) logerror("%s: Moving head by %d step(s) %s\n", tag(), steps, (m_track_delta<0)? "outward" : "inward");
340256
341   // We simulate the head movement by pausing for n*step_time with n being the cylinder delta
257   int disttime = steps*200;
342258   m_step_phase = STEP_MOVING;
343   m_seek_timer->adjust(m_step_time * steps);
344
345   if (TRACE_TIMING) logerror("%s: Head movement takes %s time\n", tag(), tts(m_step_time * steps).c_str());
259   m_seek_timer->adjust(attotime::from_usec(disttime));
346260   // We pretend that we already arrived
347261   // TODO: Check auto truncation?
348262   m_current_cylinder += m_track_delta;
349263   if (m_current_cylinder < 0) m_current_cylinder = 0;
350   if (m_current_cylinder >= m_actual_cylinders) m_current_cylinder = m_actual_cylinders-1;
264   if (m_current_cylinder > 670) m_current_cylinder = 670;
351265   m_track_delta = 0;
352266}
353267
r248389r248390
389303        - When the timer expires (mode=settle)
390304          - When the counter is not zero, go to (1)
391305          - When the counter is zero, signal seek_complete; done
306
307      Step timing:
308        per track = 20 ms max, full seek: 150 ms max (615 tracks); both including settling time
309        We assume t(1) = 17; t(615)=140
310        t(i) = s+d*i
311        s=(615*t(1)-t(615))/614
312        d=t(1)-s
313        s=16800 us, d=200 us
392314*/
393315
394316void mfm_harddisk_device::step_w(line_state line)
r248389r248390
406328      // Counter will be adjusted according to the direction (+-1)
407329      m_track_delta += (m_seek_inward)? +1 : -1;
408330      if (TRACE_STEPS && TRACE_DETAIL) logerror("%s: Got seek pulse; track delta %d\n", tag(), m_track_delta);
409      if (m_track_delta < -m_phys_cylinders || m_track_delta > m_phys_cylinders)
331      if (m_track_delta < -670 || m_track_delta > 670)
410332      {
411333         if (TRACE_STEPS) logerror("%s: Excessive step pulses - doing auto-truncation\n", tag());
412334         m_autotruncation = true;
413335      }
414      m_seek_timer->adjust(attotime::from_usec(250));  // Start step collect timer
336      m_seek_timer->adjust(attotime::from_usec(250));
415337   }
416338   m_step_line = line;
417339}
r248389r248390
423345*/
424346bool mfm_harddisk_device::find_position(attotime &from_when, const attotime &limit, int &bytepos, int &bit)
425347{
426   // Frequency
427   UINT32 freq = 1000000000/m_cell_size;
428
429348   // As we stop some few cells early each track, we adjust our position
430349   // to the track start
431350   if (from_when < m_revolution_start_time) from_when = m_revolution_start_time;
432351
433352   // Calculate the position in the track, given the from_when time and the revolution_start_time.
434   int cell = (from_when - m_revolution_start_time).as_ticks(freq);
353   // Each cell takes 100 ns (@10 MHz)
354   int cell = (from_when - m_revolution_start_time).as_ticks(10000000);
435355
436   from_when += attotime::from_nsec((m_encoding==MFM_BITS)? m_cell_size : (16*m_cell_size));
356   from_when += attotime::from_nsec((m_encoding==MFM_BITS)? 100 : 1600);
437357   if (from_when > limit) return true;
438358
439359   bytepos = cell / 16;
440360
441361   // Reached the end
442   if (bytepos >= m_trackimage_size)
362   if (bytepos >= 10416)
443363   {
444364      if (TRACE_TIMING) logerror("%s: Reached end: rev_start = %s, live = %s\n", tag(), tts(m_revolution_start_time).c_str(), tts(from_when).c_str());
445365      m_revolution_start_time += m_rev_time;
446      cell = (from_when - m_revolution_start_time).as_ticks(freq);
366      cell = (from_when - m_revolution_start_time).as_ticks(10000000);
447367      bytepos = cell / 16;
448368   }
449369
r248389r248390
544464
545465const device_type MFMHD_GENERIC = &device_creator<mfm_hd_generic_device>;
546466
547/*
548    Various models.
549*/
550mfm_hd_st213_device::mfm_hd_st213_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
551: mfm_harddisk_device(mconfig, MFMHD_ST213, "Seagate ST-213 MFM hard disk", tag, owner, clock, "mfm_hd_st213", __FILE__)
552{
553   m_phys_cylinders = 670;
554   m_max_cylinders = 615;      // 0..614
555   m_park_pos = 620;
556   m_max_heads = 2;
557   m_seeknext_time = 20;       // time for one step including settle time
558   m_maxseek_time = 150;
559}
560
561const device_type MFMHD_ST213 = &device_creator<mfm_hd_st213_device>;
562
563467mfm_hd_st225_device::mfm_hd_st225_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
564468: mfm_harddisk_device(mconfig, MFMHD_ST225, "Seagate ST-225 MFM hard disk", tag, owner, clock, "mfm_hd_st225", __FILE__)
565469{
566   m_phys_cylinders = 670;
567   m_max_cylinders = 615;
568   m_park_pos = 620;
470   m_max_cylinder = 615;
569471   m_max_heads = 4;
570   m_seeknext_time = 20;
571   m_maxseek_time = 150;
572472}
573473
574474const device_type MFMHD_ST225 = &device_creator<mfm_hd_st225_device>;
575475
576mfm_hd_st251_device::mfm_hd_st251_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
577: mfm_harddisk_device(mconfig, MFMHD_ST251, "Seagate ST-251 MFM hard disk", tag, owner, clock, "mfm_hd_st251", __FILE__)
578{
579   m_phys_cylinders = 821;
580   m_max_cylinders = 820;
581   m_park_pos = 820;
582   m_max_heads = 6;
583   m_seeknext_time = 8;
584   m_maxseek_time = 70;
585}
586
587const device_type MFMHD_ST251 = &device_creator<mfm_hd_st251_device>;
588
589476// ===========================================================
590477//   Track cache
591478//   The cache holds track images to be read by the controller.
r248389r248390
596483   m_tracks(NULL)
597484{
598485   m_current_crc = 0;
599   m_tracksize = 0;
600486}
601487
602488mfmhd_trackimage_cache::~mfmhd_trackimage_cache()
r248389r248390
621507   {
622508      if (current->dirty)
623509      {
624         // write_track(m_chd, current->encdata, m_tracksize, current->cylinder, current->head);
625         m_format->save(tag(), m_chd, current->encdata, m_encoding, m_tracksize, current->cylinder, current->head, m_cylinders, m_heads, m_sectors_per_track);
626         current->dirty = false;
510         if (TRACE_CACHE) logerror("%s: MFM HD cache: write back line c=%d h=%d\n", tag(), current->cylinder, current->head);
511         write_back(current);
627512         break;
628513      }
629514      mfmhd_trackimage* currenttmp = current->next;
r248389r248390
640525   while (current != NULL)
641526   {
642527      if (TRACE_CACHE) logerror("%s: MFM HD cache: evict line cylinder=%d head=%d\n", tag(), current->cylinder, current->head);
643      if (current->dirty)
644      {
645         // write_track(m_chd, current->encdata, m_tracksize, current->cylinder, current->head);
646         m_format->save(tag(), m_chd, current->encdata, m_encoding, m_tracksize, current->cylinder, current->head, m_cylinders, m_heads, m_sectors_per_track);
647         current->dirty = false;
648      }
528      if (current->dirty) write_back(current);
649529      mfmhd_trackimage* currenttmp = current->next;
650530      current = currenttmp;
651531   }
r248389r248390
665545/*
666546    Initialize the cache by loading the first <trackslots> tracks.
667547*/
668void mfmhd_trackimage_cache::init(chd_file* chdfile, const char* dtag, int tracksize, int imagecyl, int imageheads, int imagesecpt, int trackslots, mfmhd_enc_t encoding, mfmhd_image_format_t* format)
548void mfmhd_trackimage_cache::init(chd_file* chdfile, const char* dtag, int maxcyl, int maxhead, int trackslots, mfmhd_enc_t encoding)
669549{
670550   m_encoding = encoding;
671551   m_tagdev = dtag;
r248389r248390
675555   mfmhd_trackimage* previous = NULL;
676556   mfmhd_trackimage* current = NULL;
677557   std::string metadata;
558   m_calc_interleave = 0;
678559
679   m_tracksize = tracksize;
680560   m_chd = chdfile;
681   m_format = format;
682   m_cylinders = imagecyl;
683   m_heads = imageheads;
684   m_sectors_per_track = imagesecpt;
685561
562   if (chdfile==NULL)
563   {
564      logerror("%s: chdfile is null\n", tag());
565      return;
566   }
567
568   // Read the hard disk metadata
569   state = chdfile->read_metadata(HARD_DISK_METADATA_TAG, 0, metadata);
570   if (state != CHDERR_NONE)
571   {
572      throw emu_fatalerror("Failed to read CHD metadata");
573   }
574
575   // Parse the metadata
576   if (sscanf(metadata.c_str(), HARD_DISK_METADATA_FORMAT, &m_cylinders, &m_heads, &m_sectors_per_track, &m_sectorsize) != 4)
577   {
578      throw emu_fatalerror("Invalid metadata");
579   }
580
581   if (maxcyl != 0 && m_cylinders > maxcyl)
582   {
583      throw emu_fatalerror("Image geometry does not fit this kind of hard drive: drive=(%d,%d), image=(%d,%d)", maxcyl, maxhead, m_cylinders, m_heads);
584   }
585
686586   // Load some tracks into the cache
687587   int track = 0;
688588   int head = 0;
r248389r248390
692592      if (TRACE_CACHE && TRACE_DETAIL) logerror("%s: MFM HD allocate cache slot\n", tag());
693593      previous = current;
694594      current = global_alloc(mfmhd_trackimage);
695      current->encdata = global_alloc_array(UINT16, tracksize);
595      current->encdata = global_alloc_array(UINT16, TRACKIMAGE_SIZE);
696596
697597      // Load the first tracks into the slots
698      // state = load_track(m_chd, current->encdata, m_tracksize, cylinder, head);
598      state = load_track(current, cylinder, head, 32, 256, 4);
699599
700      state = m_format->load(tag(), m_chd, current->encdata, m_encoding, m_tracksize, cylinder, head, m_cylinders, m_heads, m_sectors_per_track);
701
702      current->dirty = false;
703      current->cylinder = cylinder;
704      current->head = head;
705
706600      if (state != CHDERR_NONE) throw emu_fatalerror("Cannot load (c=%d,h=%d) from hard disk", cylinder, head);
707601
708602      // We will read all heads per cylinder first, then go to the next cylinder.
r248389r248390
725619}
726620
727621/*
622    Returns the linear sector number, given the CHS data.
623
624      C,H,S
625    | 0,0,0 | 0,0,1 | 0,0,2 | ...
626    | 0,1,0 | 0,1,1 | 0,1,2 | ...
627    ...
628    | 1,0,0 | ...
629    ...
630*/
631int mfmhd_trackimage_cache::chs_to_lba(int cylinder, int head, int sector)
632{
633   if ((cylinder < m_cylinders) && (head < m_heads) && (sector < m_sectors_per_track))
634   {
635      return (cylinder * m_heads + head) * m_sectors_per_track + sector;
636   }
637   else return -1;
638}
639
640/*
641    Calculate the ident byte from the cylinder. The specification does not
642    define idents beyond cylinder 1023, but formatting programs seem to
643    continue with 0xfd for cylinders between 1024 and 2047.
644*/
645UINT8 mfmhd_trackimage_cache::cylinder_to_ident(int cylinder)
646{
647   if (cylinder < 256) return 0xfe;
648   if (cylinder < 512) return 0xff;
649   if (cylinder < 768) return 0xfc;
650   return 0xfd;
651}
652
653
654/*
728655    Delivers the track image.
729656    First look up the track image in the cache. If not present, load it from
730657    the CHD, convert it, and evict the least recently used line.
r248389r248390
773700      current = previous->next;
774701      if (TRACE_CACHE) logerror("%s: MFM HD cache: evict line (c=%d,h=%d)\n", tag(), current->cylinder, current->head);
775702
776      if (current->dirty)
777      {
778         // write_track(m_chd, current->encdata, m_tracksize, current->cylinder, current->head);
779         m_format->save(tag(), m_chd, current->encdata, m_encoding, m_tracksize, current->cylinder, current->head, m_cylinders, m_heads, m_sectors_per_track);
780         current->dirty = false;
781      }
782
783      // state = load_track(m_chd, current->encdata, m_tracksize, cylinder, head);
784      state = m_format->load(tag(), m_chd, current->encdata, m_encoding, m_tracksize, cylinder, head, m_cylinders, m_heads, m_sectors_per_track);
785
786      current->dirty = false;
787      current->cylinder = cylinder;
788      current->head = head;
703      if (current->dirty) write_back(current);
704      state = load_track(current, cylinder, head, 32, 256, 4);
789705   }
790706   // If we are here we have a CHD error.
791707   return NULL;
792708}
793709
794// ================================================================
795
796mfm_harddisk_connector::mfm_harddisk_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock):
797   device_t(mconfig, MFM_HD_CONNECTOR, "MFM hard disk connector", tag, owner, clock, "mfm_hd_connector", __FILE__),
798   device_slot_interface(mconfig, *this)
710/*
711    Create MFM encoding.
712*/
713void mfmhd_trackimage_cache::mfm_encode(mfmhd_trackimage* slot, int& position, UINT8 byte, int count)
799714{
715   mfm_encode_mask(slot, position, byte, count, 0x00);
800716}
801717
802mfm_harddisk_connector::~mfm_harddisk_connector()
718void mfmhd_trackimage_cache::mfm_encode_a1(mfmhd_trackimage* slot, int& position)
803719{
804}
805
806mfm_harddisk_device* mfm_harddisk_connector::get_device()
807{
808   return dynamic_cast<mfm_harddisk_device *>(get_card_device());
809}
810
811void mfm_harddisk_connector::configure(mfmhd_enc_t encoding, int spinupms, int cache, const mfmhd_format_type format)
812{
813   m_encoding = encoding;
814   m_spinupms = spinupms;
815   m_cachesize = cache;
816   m_format = format();
817}
818
819void mfm_harddisk_connector::device_config_complete()
820{
821   mfm_harddisk_device *dev = get_device();
822   if (dev != NULL)
823   {
824      dev->set_encoding(m_encoding);
825      dev->set_spinup_time(m_spinupms);
826      dev->set_cache_size(m_cachesize);
827      dev->set_format(m_format);
828   }
829}
830
831const device_type MFM_HD_CONNECTOR = &device_creator<mfm_harddisk_connector>;
832
833// ================================================================
834
835mfmhd_image_format_t::mfmhd_image_format_t()
836{
837};
838
839mfmhd_image_format_t::~mfmhd_image_format_t()
840{
841};
842
843void mfmhd_image_format_t::mfm_encode(UINT16* trackimage, int& position, UINT8 byte, int count)
844{
845   mfm_encode_mask(trackimage, position, byte, count, 0x00);
846}
847
848void mfmhd_image_format_t::mfm_encode_a1(UINT16* trackimage, int& position)
849{
850720   m_current_crc = 0xffff;
851   mfm_encode_mask(trackimage, position, 0xa1, 1, 0x04);
721   mfm_encode_mask(slot, position, 0xa1, 1, 0x04);
852722   // 0x443b; CRC for A1
853723}
854724
855void mfmhd_image_format_t::mfm_encode_mask(UINT16* trackimage, int& position, UINT8 byte, int count, int mask)
725void mfmhd_trackimage_cache::mfm_encode_mask(mfmhd_trackimage* slot, int& position, UINT8 byte, int count, int mask)
856726{
857727   UINT16 encclock = 0;
858728   UINT16 encdata = 0;
r248389r248390
898768   else
899769      encclock <<= 8;
900770
901   trackimage[position++] = (encclock | encdata);
771   slot->encdata[position++] = (encclock | encdata);
902772
903773   // When we write the byte multiple times, check whether the next encoding
904774   // differs from the previous because of the last bit
r248389r248390
911781
912782   for (int j=1; j < count; j++)
913783   {
914      trackimage[position++] = (encclock | encdata);
784      slot->encdata[position++] = (encclock | encdata);
915785      m_current_crc = ccitt_crc16_one(m_current_crc, byte);
916786   }
917787}
918788
919UINT8 mfmhd_image_format_t::mfm_decode(UINT16 raw)
920{
921   unsigned int value = 0;
922
923   for (int i=0; i < 8; i++)
924   {
925      value <<= 1;
926
927      value |= (raw & 0x4000);
928      raw <<= 2;
929   }
930   return (value >> 14) & 0xff;
931}
932
933789/*
934    For debugging. Outputs the byte array in a xxd-like way.
790    Load a track from the CHD.
791    TODO: Isolate the encoding into a separate format definition
935792*/
936void mfmhd_image_format_t::showtrack(UINT16* enctrack, int length)
793chd_error mfmhd_trackimage_cache::load_track(mfmhd_trackimage* slot, int cylinder, int head, int sectorcount, int size, int interleave)
937794{
938   for (int i=0; i < length; i+=16)
939   {
940      logerror("%07x: ", i);
941      for (int j=0; j < 16; j++)
942      {
943         logerror("%04x ", enctrack[i+j]);
944      }
945      logerror(" ");
946      logerror("\n");
947   }
948}
949
950// ======================================================================
951//    TI-99-specific format
952// ======================================================================
953
954const mfmhd_format_type MFMHD_TI99_FORMAT = &mfmhd_image_format_creator<ti99_mfmhd_format>;
955
956enum
957{
958   SEARCH_A1=0,
959   FOUND_A1,
960   DAM_FOUND,
961   CHECK_CRC
962};
963
964
965/*
966    Calculate the ident byte from the cylinder. The specification does not
967    define idents beyond cylinder 1023, but formatting programs seem to
968    continue with 0xfd for cylinders between 1024 and 2047.
969*/
970UINT8 ti99_mfmhd_format::cylinder_to_ident(int cylinder)
971{
972   if (cylinder < 256) return 0xfe;
973   if (cylinder < 512) return 0xff;
974   if (cylinder < 768) return 0xfc;
975   return 0xfd;
976}
977
978/*
979    Returns the linear sector number, given the CHS data.
980
981      C,H,S
982    | 0,0,0 | 0,0,1 | 0,0,2 | ...
983    | 0,1,0 | 0,1,1 | 0,1,2 | ...
984    ...
985    | 1,0,0 | ...
986    ...
987*/
988int ti99_mfmhd_format::chs_to_lba(int cylinder, int head, int sector)
989{
990   if ((cylinder < m_cylinders) && (head < m_heads) && (sector < m_sectors_per_track))
991   {
992      return (cylinder * m_heads + head) * m_sectors_per_track + sector;
993   }
994   else return -1;
995}
996
997chd_error ti99_mfmhd_format::load(const char* tagdev, chd_file* chdfile, UINT16* trackimage, mfmhd_enc_t encoding, int tracksize, int cylinder, int head, int cylcnt, int headcnt, int sect_per_track)
998{
999795   chd_error state = CHDERR_NONE;
1000796
1001   int sectorcount = 32;
1002   int size = 256;
1003   int interleave = 4;
1004
1005   m_encoding = encoding;
1006   m_cylinders = cylcnt;
1007   m_heads = headcnt;
1008   m_sectors_per_track = sect_per_track;
1009   m_tagdev = tagdev;
1010
1011797   UINT8 sector_content[1024];
1012798
1013799   if (TRACE_RWTRACK) logerror("%s: MFM HD cache: load track (c=%d,h=%d) from CHD\n", tag(), cylinder, head);
r248389r248390
1022808   // both be set to the same number and loaded in the appropriate registers.
1023809
1024810   // Gap 1
1025   mfm_encode(trackimage, position, 0x4e, 16);
811   mfm_encode(slot, position, 0x4e, 16);
1026812
1027813   int sec_il_start = 0;
1028814   int sec_number = 0;
r248389r248390
1040826      if (TRACE_DETAIL) logerror("%02d ", sec_number);
1041827
1042828      // Sync gap
1043      mfm_encode(trackimage, position, 0x00, 13);
829      mfm_encode(slot, position, 0x00, 13);
1044830
1045831      // Write IDAM
1046      mfm_encode_a1(trackimage, position);
832      mfm_encode_a1(slot, position);
1047833
1048834      // Write header
1049835      identfield = cylinder_to_ident(cylinder);
1050836      cylfield = cylinder & 0xff;
1051837      headfield = ((cylinder & 0x700)>>4) | (head&0x0f);
1052838
1053      mfm_encode(trackimage, position, identfield);
1054      mfm_encode(trackimage, position, cylfield);
1055      mfm_encode(trackimage, position, headfield);
1056      mfm_encode(trackimage, position, sec_number);
1057      mfm_encode(trackimage, position, sizefield);
839      mfm_encode(slot, position, identfield);
840      mfm_encode(slot, position, cylfield);
841      mfm_encode(slot, position, headfield);
842      mfm_encode(slot, position, sec_number);
843      mfm_encode(slot, position, sizefield);
1058844      // logerror("%s: Created header (%02x,%02x,%02x,%02x)\n", tag(), identfield, cylfield, headfield, sector);
1059845
1060846      // Write CRC for header.
1061847      int crc = m_current_crc;
1062      mfm_encode(trackimage, position, (crc >> 8) & 0xff);
1063      mfm_encode(trackimage, position, crc & 0xff);
848      mfm_encode(slot, position, (crc >> 8) & 0xff);
849      mfm_encode(slot, position, crc & 0xff);
1064850
1065851      // Gap 2
1066      mfm_encode(trackimage, position, 0x4e, 3);
852      mfm_encode(slot, position, 0x4e, 3);
1067853
1068854      // Sync
1069      mfm_encode(trackimage, position, 0x00, 13);
855      mfm_encode(slot, position, 0x00, 13);
1070856
1071857      // Write DAM
1072      mfm_encode_a1(trackimage, position);
1073      mfm_encode(trackimage, position, 0xfb);
858      mfm_encode_a1(slot, position);
859      mfm_encode(slot, position, 0xfb);
1074860
1075861      // Get sector content from CHD
1076862      int lbaposition = chs_to_lba(cylinder, head, sec_number);
1077863      if (lbaposition>=0)
1078864      {
1079         chd_error state = chdfile->read_units(lbaposition, sector_content);
865         chd_error state = m_chd->read_units(lbaposition, sector_content);
1080866         if (state != CHDERR_NONE) break;
1081867      }
1082868      else
r248389r248390
1085871      }
1086872
1087873      for (int i=0; i < size; i++)
1088         mfm_encode(trackimage, position, sector_content[i]);
874         mfm_encode(slot, position, sector_content[i]);
1089875
1090876      // Write CRC for content.
1091877      crc = m_current_crc;
1092      mfm_encode(trackimage, position, (crc >> 8) & 0xff);
1093      mfm_encode(trackimage, position, crc & 0xff);
878      mfm_encode(slot, position, (crc >> 8) & 0xff);
879      mfm_encode(slot, position, crc & 0xff);
1094880
1095881      // Gap 3
1096      mfm_encode(trackimage, position, 0x00, 3);
1097      mfm_encode(trackimage, position, 0x4e, 19);
882      mfm_encode(slot, position, 0x00, 3);
883      mfm_encode(slot, position, 0x4e, 19);
1098884
1099885      // Calculate next sector number
1100886      sec_number += delta;
r248389r248390
1106892   if (state == CHDERR_NONE)
1107893   {
1108894      // Fill the rest with 0x4e
1109      mfm_encode(trackimage, position, 0x4e, tracksize-position);
895      mfm_encode(slot, position, 0x4e, TRACKIMAGE_SIZE-position);
1110896      if (TRACE_IMAGE)
1111897      {
1112         showtrack(trackimage, tracksize);
898         showtrack(slot->encdata, TRACKIMAGE_SIZE);
1113899      }
1114900   }
901
902   slot->dirty = false;
903   slot->cylinder = cylinder;
904   slot->head = head;
905
1115906   return state;
1116907}
1117908
1118chd_error ti99_mfmhd_format::save(const char* tagdev, chd_file* chdfile, UINT16* trackimage, mfmhd_enc_t encoding, int tracksize, int current_cylinder, int current_head, int cylcnt, int headcnt, int sect_per_track)
909enum
1119910{
1120   if (TRACE_CACHE) logerror("%s: MFM HD cache: write back (c=%d,h=%d) to CHD\n", tag(), current_cylinder, current_head);
911   SEARCH_A1=0,
912   FOUND_A1,
913   DAM_FOUND,
914   CHECK_CRC
915};
1121916
917UINT8 mfmhd_trackimage_cache::mfm_decode(UINT16 raw)
918{
919   unsigned int value = 0;
920
921   for (int i=0; i < 8; i++)
922   {
923      value <<= 1;
924
925      value |= (raw & 0x4000);
926      raw <<= 2;
927   }
928   return (value >> 14) & 0xff;
929}
930
931/*
932    TODO: The CHD/track conversion should go in a separate format definition (see floppy)
933    (can also handle different header formats there)
934*/
935void mfmhd_trackimage_cache::write_back(mfmhd_trackimage* slot)
936{
937   if (TRACE_CACHE) logerror("%s: MFM HD cache: write back (c=%d,h=%d) to CHD\n", tag(), slot->cylinder, slot->head);
938
1122939   UINT8 buffer[1024]; // for header or sector content
1123940
941   UINT16 *track = slot->encdata;
942
1124943   int bytepos = 0;
1125944   int state = SEARCH_A1;
1126945   int count = 0;
r248389r248390
1140959   int interleave_prec = -1;
1141960   bool check_interleave = true;
1142961
1143   chd_error chdstate = CHDERR_NONE;
1144
1145   m_encoding = encoding;
1146   m_cylinders = cylcnt;
1147   m_heads = headcnt;
1148   m_sectors_per_track = sect_per_track;
1149   m_tagdev = tagdev;
1150
1151962   if (TRACE_IMAGE)
1152963   {
1153      for (int i=0; i < tracksize; i++)
964      for (int i=0; i < TRACKIMAGE_SIZE; i++)
1154965      {
1155966         if ((i % 16)==0) logerror("\n%04x: ", i);
1156         logerror("%02x ", (m_encoding==MFM_BITS || m_encoding==MFM_BYTE)? mfm_decode(trackimage[i]) : (trackimage[i]&0xff));
967         logerror("%02x ", (m_encoding==MFM_BITS || m_encoding==MFM_BYTE)? mfm_decode(track[i]) : (track[i]&0xff));
1157968      }
1158969      logerror("\n");
1159970   }
1160971
1161972   // We have to go through the bytes of the track and save a sector as soon as one shows up
1162   while (bytepos < tracksize)
973   while (bytepos < TRACKIMAGE_SIZE)
1163974   {
1164975      switch (state)
1165976      {
1166977      case SEARCH_A1:
1167         if (((m_encoding==MFM_BITS || m_encoding==MFM_BYTE) && trackimage[bytepos]==0x4489)
1168            || (m_encoding==SEPARATED && trackimage[bytepos]==0x0aa1)
1169            || (m_encoding==SEPARATED_SIMPLE && trackimage[bytepos]==0xffa1))
978         if (((m_encoding==MFM_BITS || m_encoding==MFM_BYTE) && track[bytepos]==0x4489)
979            || (m_encoding==SEPARATED && track[bytepos]==0x0aa1)
980            || (m_encoding==SEPARATED_SIMPLE && track[bytepos]==0xffa1))
1170981         {
1171982            state = FOUND_A1;
1172983            count = search_header? 7 : 259;
r248389r248390
1180991         // read next values into array
1181992         if (m_encoding==MFM_BITS || m_encoding==MFM_BYTE)
1182993         {
1183            byte = mfm_decode(trackimage[bytepos]);
994            byte = mfm_decode(track[bytepos]);
1184995         }
1185         else byte = (trackimage[bytepos] & 0xff);
996         else byte = (track[bytepos] & 0xff);
1186997
1187998         crc = ccitt_crc16_one(crc, byte);
1188999         // logerror("%s: MFM HD: Byte = %02x, CRC=%04x\n", tag(), byte, crc);
r248389r248390
12101021                     logerror("%s: MFM HD: Field error; ident = %02x (expected %02x) for sector chs=(%d,%d,%d)\n", tag(), ident, identexp, cylinder, head, sector);
12111022                  }
12121023
1213                  if (cylinder != current_cylinder)
1214                  {
1215                     logerror("%s: MFM HD: Sector header of sector %d defines cylinder = %02x (should be %02x)\n", tag(), sector, cylinder, current_cylinder);
1216                  }
1217
1218                  if (head != current_head)
1219                  {
1220                     logerror("%s: MFM HD: Sector header of sector %d defines head = %02x (should be %02x)\n", tag(), sector, head, current_head);
1221                  }
1222
12231024                  // Count the sectors for the interleave
12241025                  if (check_interleave)
12251026                  {
r248389r248390
12441045                  int lbaposition = chs_to_lba(cylinder, head, sector);
12451046                  if (lbaposition>=0)
12461047                  {
1247                     if (TRACE_DETAIL) logerror("%s: MFM HD: Writing sector chs=(%d,%d,%d) to CHD\n", tag(), current_cylinder, current_head, sector);
1248                     chdstate = chdfile->write_units(chs_to_lba(current_cylinder, current_head, sector), buffer);
1048                     if (TRACE_DETAIL) logerror("%s: MFM HD: Writing sector chs=(%d,%d,%d) to CHD\n", tag(), cylinder, head, sector);
1049                     chd_error state = m_chd->write_units(chs_to_lba(cylinder, head, sector), buffer);
12491050
1250                     if (chdstate != CHDERR_NONE)
1051                     if (state != CHDERR_NONE)
12511052                     {
12521053                        logerror("%s: MFM HD: Write error while writing sector chs=(%d,%d,%d)\n", tag(), cylinder, head, sector);
12531054                     }
r248389r248390
12781079         break;
12791080      }
12801081   }
1082   // Clear the dirty flag
1083   slot->dirty = false;
12811084
12821085   if (check_interleave == false)
12831086   {
12841087      // Successfully determined the interleave
1285      m_interleave = calc_interleave;
1088      m_calc_interleave = calc_interleave;
12861089   }
12871090
12881091   if (TRACE_CACHE)
12891092   {
1290      logerror("%s: MFM HD cache: write back complete (c=%d,h=%d), interleave = %d\n", tag(), current_cylinder, current_head, m_interleave);
1093      logerror("%s: MFM HD cache: write back complete (c=%d,h=%d), interleave = %d\n", tag(), slot->cylinder, slot->head, m_calc_interleave);
12911094   }
1095}
12921096
1293   return chdstate;
1097/*
1098    For debugging. Outputs the byte array in a xxd-like way.
1099*/
1100void mfmhd_trackimage_cache::showtrack(UINT16* enctrack, int length)
1101{
1102   for (int i=0; i < length; i+=16)
1103   {
1104      logerror("%07x: ", i);
1105      for (int j=0; j < 16; j++)
1106      {
1107         logerror("%04x ", enctrack[i+j]);
1108      }
1109      logerror(" ");
1110      logerror("\n");
1111   }
12941112}
1113
1114// ================================================================
1115
1116mfm_harddisk_connector::mfm_harddisk_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock):
1117   device_t(mconfig, MFM_HD_CONNECTOR, "MFM hard disk connector", tag, owner, clock, "mfm_hd_connector", __FILE__),
1118   device_slot_interface(mconfig, *this)
1119{
1120}
1121
1122mfm_harddisk_connector::~mfm_harddisk_connector()
1123{
1124}
1125
1126mfm_harddisk_device* mfm_harddisk_connector::get_device()
1127{
1128   return dynamic_cast<mfm_harddisk_device *>(get_card_device());
1129}
1130
1131void mfm_harddisk_connector::configure(mfmhd_enc_t encoding, int spinupms, int cache)
1132{
1133   m_encoding = encoding;
1134   m_spinupms = spinupms;
1135   m_cachesize = cache;
1136}
1137
1138void mfm_harddisk_connector::device_config_complete()
1139{
1140   mfm_harddisk_device *dev = get_device();
1141   if (dev != NULL)
1142   {
1143      dev->set_encoding(m_encoding);
1144      dev->set_spinup_time(m_spinupms);
1145      dev->set_cache_size(m_cachesize);
1146   }
1147}
1148
1149const device_type MFM_HD_CONNECTOR = &device_creator<mfm_harddisk_connector>;
trunk/src/emu/machine/ti99_hd.h
r248389r248390
2929   SEPARATED_SIMPLE        // MSB: 00/FF (standard / mark) clock, LSB: one data byte
3030};
3131
32class mfmhd_image_format_t;
33
34// Pointer to its alloc function
35typedef mfmhd_image_format_t *(*mfmhd_format_type)();
36
37template<class _FormatClass>
38mfmhd_image_format_t *mfmhd_image_format_creator()
39{
40   return new _FormatClass();
41}
42
4332class mfmhd_trackimage
4433{
4534public:
r248389r248390
5544public:
5645   mfmhd_trackimage_cache();
5746   ~mfmhd_trackimage_cache();
58   void        init(chd_file* chdfile, const char* tag, int tracksize, int imagecyls, int imageheads, int imagesecpt, int trackslots, mfmhd_enc_t encoding, mfmhd_image_format_t* format);
47   void        init(chd_file* chdfile, const char* tag, int maxcyl, int maxhead, int trackslots, mfmhd_enc_t encoding);
5948   UINT16*     get_trackimage(int cylinder, int head);
6049   void        mark_current_as_dirty();
6150   void        cleanup();
6251   void        write_back_one();
63   int         get_cylinders() { return m_cylinders; }
6452
6553private:
66   chd_file*   m_chd;
54   void        mfm_encode(mfmhd_trackimage* slot, int& position, UINT8 byte, int count=1);
55   void        mfm_encode_a1(mfmhd_trackimage* slot, int& position);
56   void        mfm_encode_mask(mfmhd_trackimage* slot, int& position, UINT8 byte, int count, int mask);
57   UINT8       mfm_decode(UINT16 raw);
6758
68   const char*             m_tagdev;
69   mfmhd_trackimage*       m_tracks;
70   mfmhd_enc_t             m_encoding;
71   mfmhd_image_format_t*   m_format;
59   chd_error   load_track(mfmhd_trackimage* slot, int cylinder, int head, int sectorcount, int size, int interleave);
60   void        write_back(mfmhd_trackimage* timg);
61   int         chs_to_lba(int cylinder, int head, int sector);
62   UINT8       cylinder_to_ident(int cylinder);
7263
64   chd_file*   m_chd;
65
66   const char* m_tagdev;
67   mfmhd_trackimage* m_tracks;
68   mfmhd_enc_t m_encoding;
7369   bool        m_lastbit;
7470   int         m_current_crc;
7571   int         m_cylinders;
7672   int         m_heads;
7773   int         m_sectors_per_track;
7874   int         m_sectorsize;
79   int         m_tracksize;
8075
76   int         m_calc_interleave;
8177   void        showtrack(UINT16* enctrack, int length);
8278   const char* tag() { return m_tagdev; }
8379};
r248389r248390
10197   void set_encoding(mfmhd_enc_t encoding) { m_encoding = encoding; }
10298   void set_spinup_time(int spinupms) { m_spinupms = spinupms; }
10399   void set_cache_size(int tracks) { m_cachelines = tracks;    }
104   void set_format(mfmhd_image_format_t* format) { m_format = format; }
105100
106101   mfmhd_enc_t get_encoding() { return m_encoding; }
107102
r248389r248390
145140   ready_cb            m_ready_cb;
146141   seek_complete_cb    m_seek_complete_cb;
147142
148   int         m_max_cylinders;
149   int         m_phys_cylinders;
150   int         m_actual_cylinders;  // after reading the CHD
151   int         m_max_heads;
152   int         m_park_pos;
153   int         m_maxseek_time;
154   int         m_seeknext_time;
143   int m_max_cylinder;
144   int m_max_heads;
155145
156146private:
157147   mfmhd_enc_t m_encoding;
158   int         m_cell_size;    // nanoseconds
159   int         m_trackimage_size;  // number of 16-bit cell blocks (data bytes)
160148   int         m_spinupms;
161   int         m_rpm;
162   int         m_interleave;
163149   int         m_cachelines;
164150   bool        m_ready;
165151   int         m_current_cylinder;
r248389r248390
168154   int         m_step_phase;
169155   bool        m_seek_complete;
170156   bool        m_seek_inward;
157   //bool      m_seeking;
171158   bool        m_autotruncation;
172159   bool        m_recalibrated;
173160   line_state  m_step_line;    // keep the last state
r248389r248390
176163   attotime    m_revolution_start_time;
177164   attotime    m_rev_time;
178165
179   attotime    m_settle_time;
180   attotime    m_step_time;
181
182166   mfmhd_trackimage_cache* m_cache;
183   mfmhd_image_format_t*   m_format;
184167
185168   void        prepare_track(int cylinder, int head);
186169   void        head_move();
187170   void        recalibrate();
188171};
189172
190/*
191    The Generic drive is a MFM drive that has just enough heads and cylinders
192    to handle the CHD image.
193
194    Specific Seagate models:
195
196    ST-213: 10 MB
197    ST-225: 20 MB
198    ST-251: 40 MB
199*/
200173class mfm_hd_generic_device : public mfm_harddisk_device
201174{
202175public:
r248389r248390
205178
206179extern const device_type MFMHD_GENERIC;
207180
208class mfm_hd_st213_device : public mfm_harddisk_device
209{
210public:
211   mfm_hd_st213_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
212};
213
214extern const device_type MFMHD_ST213;
215
216181class mfm_hd_st225_device : public mfm_harddisk_device
217182{
218183public:
r248389r248390
221186
222187extern const device_type MFMHD_ST225;
223188
224class mfm_hd_st251_device : public mfm_harddisk_device
225{
226public:
227   mfm_hd_st251_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
228};
229
230extern const device_type MFMHD_ST251;
231
232
233189/* Connector for a MFM hard disk. See also floppy.c */
234190class mfm_harddisk_connector : public device_t,
235191                        public device_slot_interface
r248389r248390
240196
241197   mfm_harddisk_device *get_device();
242198
243   void configure(mfmhd_enc_t encoding, int spinupms, int cache, mfmhd_format_type format);
199   void configure(mfmhd_enc_t encoding, int spinupms, int cache);
244200
245201protected:
246202   void device_start() { };
r248389r248390
250206   mfmhd_enc_t m_encoding;
251207   int m_spinupms;
252208   int m_cachesize;
253   mfmhd_image_format_t* m_format;
254209};
255210
256211extern const device_type MFM_HD_CONNECTOR;
r248389r248390
267222    emulate this, so we allow for shorter times)
268223    _cache = number of cached MFM tracks
269224*/
270#define MCFG_MFM_HARDDISK_CONN_ADD(_tag, _slot_intf, _def_slot, _enc, _spinupms, _cache, _format)  \
225#define MCFG_MFM_HARDDISK_CONN_ADD(_tag, _slot_intf, _def_slot, _enc, _spinupms, _cache)  \
271226   MCFG_DEVICE_ADD(_tag, MFM_HD_CONNECTOR, 0) \
272227   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
273   static_cast<mfm_harddisk_connector *>(device)->configure(_enc, _spinupms, _cache, _format);
228   static_cast<mfm_harddisk_connector *>(device)->configure(_enc, _spinupms, _cache);
274229
275
276/*
277    Hard disk format
278*/
279class mfmhd_image_format_t
280{
281public:
282   mfmhd_image_format_t();
283   virtual ~mfmhd_image_format_t();
284
285   // Load the image.
286   virtual chd_error load(const char* tagdev, chd_file* chdfile, UINT16* trackimage, mfmhd_enc_t encoding, int tracksize, int cylinder, int head, int cylcnt, int headcnt, int sect_per_track) = 0;
287
288   // Save the image.
289   virtual chd_error save(const char* tagdev, chd_file* chdfile, UINT16* trackimage, mfmhd_enc_t encoding, int tracksize, int cylinder, int head, int cylcnt, int headcnt, int sect_per_track) = 0;
290
291   // Return the recent interleave of the image
292   int get_interleave() { return m_interleave; }
293
294protected:
295   bool        m_lastbit;
296   int         m_current_crc;
297   mfmhd_enc_t m_encoding;
298   const char* m_tagdev;
299   int         m_cylinders;
300   int         m_heads;
301   int         m_sectors_per_track;
302   int         m_interleave;
303
304   void    mfm_encode(UINT16* trackimage, int& position, UINT8 byte, int count=1);
305   void    mfm_encode_a1(UINT16* trackimage, int& position);
306   void    mfm_encode_mask(UINT16* trackimage, int& position, UINT8 byte, int count, int mask);
307   UINT8   mfm_decode(UINT16 raw);
308   const char* tag() { return m_tagdev; }
309   void    showtrack(UINT16* enctrack, int length);
310};
311
312class ti99_mfmhd_format : public mfmhd_image_format_t
313{
314public:
315   ti99_mfmhd_format() {};
316   chd_error load(const char* tagdev, chd_file* chdfile, UINT16* trackimage, mfmhd_enc_t encoding, int tracksize, int cylinder, int head, int cylcnt, int headcnt, int sect_per_track);
317   chd_error save(const char* tagdev, chd_file* chdfile, UINT16* trackimage, mfmhd_enc_t encoding, int tracksize, int cylinder, int head, int cylcnt, int headcnt, int sect_per_track);
318private:
319   UINT8   cylinder_to_ident(int cylinder);
320   int     chs_to_lba(int cylinder, int head, int sector);
321};
322
323extern const mfmhd_format_type MFMHD_TI99_FORMAT;
324
325230#endif
trunk/src/emu/machine/tms6100.c
r248389r248390
136136   save_item(NAME(m_m0));
137137   save_item(NAME(m_m1));
138138   save_item(NAME(m_state));
139   //save_item(NAME(m_variant));
140   //tms6100_set_variant(tms, TMS6110_IS_TMS6100);
141139
142140}
143141
144142void m58819_device::device_start()
145143{
144   //tms5110_set_variant(tms, TMS5110_IS_5100);
146145   tms6100_device::device_start();
147   //tms6100_set_variant(tms, TMS6110_IS_M58819);
148146}
149147
150148//-------------------------------------------------
r248389r248390
199197            else
200198            {
201199               /* read bit at address */
202               /* if (m_variant == TMS6110_IS_M58819)
203               {
204                  m_data = (m_rom[m_address >> 3] >> (7-(m_address & 0x07))) & 1;
205               }
206               else // m_variant == (TMS6110_IS_TMS6100 || TMS6110_IS_TMS6125)
207               {
208                  */
209200               m_data = (m_rom[m_address >> 3] >> (m_address & 0x07)) & 1;
210               /* } */
211201               m_address++;
212202            }
213203            m_state &= ~TMS6100_READ_PENDING;
trunk/src/emu/machine/tms6100.h
r248389r248390
3737   UINT8  m_tms_clock;
3838   UINT8  m_data;
3939   UINT8  m_state;
40   //UINT8  m_variant;
4140
4241};
4342
trunk/src/emu/netlist/analog/nld_bjt.c
r248389r248390
5555
5656NETLIB_START(Q)
5757{
58   register_param("MODEL", m_model, "");
58   register_param("model", m_model, "");
5959}
6060
6161NETLIB_RESET(Q)
trunk/src/emu/netlist/analog/nld_bjt.h
r248389r248390
1111#include "../nl_base.h"
1212#include "nld_twoterm.h"
1313
14// -----------------------------------------------------------------------------
14// ----------------------------------------------------------------------------------------
1515// Macros
16// -----------------------------------------------------------------------------
16// ----------------------------------------------------------------------------------------
1717
18#define QBJT_SW(_name, _model)                                                 \
19      NET_REGISTER_DEV(QBJT_SW, _name)                                       \
20      NETDEV_PARAMI(_name,  MODEL,   _model)
18#define QBJT_SW(_name, _model)                                           \
19      NET_REGISTER_DEV(QBJT_switch, _name)                             \
20      NETDEV_PARAMI(_name,  model,   _model)
2121
22#define QBJT_EB(_name, _model)                                                 \
23      NET_REGISTER_DEV(QBJT_EB, _name)                                       \
24      NETDEV_PARAMI(_name,  MODEL,   _model)
22#define QBJT_EB(_name, _model)                                           \
23      NET_REGISTER_DEV(QBJT_EB, _name)                                 \
24      NETDEV_PARAMI(_name,  model,   _model)
2525
2626
2727NETLIB_NAMESPACE_DEVICES_START()
2828
29// -----------------------------------------------------------------------------
29// ----------------------------------------------------------------------------------------
3030// nld_Q - Base classes
31// -----------------------------------------------------------------------------
31// ----------------------------------------------------------------------------------------
3232
3333// Have a common start for transistors
3434
r248389r248390
7373
7474
7575
76// -----------------------------------------------------------------------------
76// ----------------------------------------------------------------------------------------
7777// nld_QBJT_switch
78// -----------------------------------------------------------------------------
78// ----------------------------------------------------------------------------------------
7979
8080
8181/*
r248389r248390
126126private:
127127};
128128
129// -----------------------------------------------------------------------------
129// ----------------------------------------------------------------------------------------
130130// nld_QBJT_EB
131// -----------------------------------------------------------------------------
131// ----------------------------------------------------------------------------------------
132132
133133
134134class NETLIB_NAME(QBJT_EB) : public NETLIB_NAME(QBJT)
trunk/src/emu/netlist/analog/nld_opamps.c
r248389r248390
6464   register_output("VH", m_VH);
6565   register_output("VREF", m_VREF);
6666
67   register_param("MODEL", m_model, "");
67   register_param("model", m_model, "");
6868
6969   m_type = m_model.model_value("TYPE");
7070
trunk/src/emu/netlist/analog/nld_opamps.h
r248389r248390
2121
2222#define OPAMP(_name, _model)                                                   \
2323      NET_REGISTER_DEV(OPAMP, _name)                                         \
24      NETDEV_PARAMI(_name, MODEL, _model)
24      NETDEV_PARAMI(_name, model, _model)
2525
2626#define LM3900(_name)                                                          \
2727   SUBMODEL(opamp_lm3900, _name)
trunk/src/emu/netlist/analog/nld_switches.h
r248389r248390
1818// ----------------------------------------------------------------------------------------
1919
2020#define SWITCH(_name)                                                              \
21      NET_REGISTER_DEV(SWITCH, _name)
21      NET_REGISTER_DEV(switch1, _name)
2222
2323#define SWITCH2(_name)                                                              \
24      NET_REGISTER_DEV(SWITCH2, _name)
24      NET_REGISTER_DEV(switch2, _name)
2525
2626// ----------------------------------------------------------------------------------------
2727// Devices ...
trunk/src/emu/netlist/analog/nld_twoterm.c
r248389r248390
264264{
265265   register_terminal("A", m_P);
266266   register_terminal("K", m_N);
267   register_param("MODEL", m_model, "");
267   register_param("model", m_model, "");
268268
269269   m_D.save("m_D", *this);
270270
trunk/src/emu/netlist/analog/nld_twoterm.h
r248389r248390
2424 *  +-----T-----+
2525 *       (l)
2626 *
27 *  This is a resistance in series to a voltage source and paralleled by a
28 *  current source. This is suitable to model voltage sources, current sources,
29 *  resistors, capacitors, inductances and diodes.
27 *  This is a resistance in series to a voltage source and paralleled by a current source.
28 *  This is suitable to model voltage sources, current sources, resistors, capacitors,
29 *  inductances and diodes.
3030 *
3131 */
3232
r248389r248390
3535
3636#include "../nl_base.h"
3737
38// -----------------------------------------------------------------------------
38// ----------------------------------------------------------------------------------------
3939// Macros
40// -----------------------------------------------------------------------------
40// ----------------------------------------------------------------------------------------
4141
4242#define RES(_name, _R)                                                         \
43      NET_REGISTER_DEV(RES, _name)                                           \
43      NET_REGISTER_DEV(R, _name)                                             \
4444      NETDEV_PARAMI(_name, R, _R)
4545
4646#define POT(_name, _R)                                                         \
r248389r248390
5454
5555
5656#define CAP(_name, _C)                                                         \
57      NET_REGISTER_DEV(CAP, _name)                                           \
57      NET_REGISTER_DEV(C, _name)                                             \
5858      NETDEV_PARAMI(_name, C, _C)
5959
6060/* Generic Diode */
6161#define DIODE(_name,  _model)                                                  \
62      NET_REGISTER_DEV(DIODE, _name)                                         \
63      NETDEV_PARAMI(_name, MODEL, _model)
62      NET_REGISTER_DEV(D, _name)                                             \
63      NETDEV_PARAMI(_name, model, _model)
6464
6565#define VS(_name, _V)                                                          \
6666      NET_REGISTER_DEV(VS, _name)                                            \
r248389r248390
7070      NET_REGISTER_DEV(CS, _name)                                            \
7171      NETDEV_PARAMI(_name, I, _I)
7272
73// -----------------------------------------------------------------------------
73// ----------------------------------------------------------------------------------------
7474// Generic macros
75// -----------------------------------------------------------------------------
75// ----------------------------------------------------------------------------------------
7676
7777
7878#ifdef RES_R
r248389r248390
9090#define IND_N(ind) ((double)(ind) * 1e-9)
9191#define IND_P(ind) ((double)(ind) * 1e-12)
9292
93// -----------------------------------------------------------------------------
93// ----------------------------------------------------------------------------------------
9494// Implementation
95// -----------------------------------------------------------------------------
95// ----------------------------------------------------------------------------------------
9696
9797NETLIB_NAMESPACE_DEVICES_START()
9898
99// -----------------------------------------------------------------------------
99// ----------------------------------------------------------------------------------------
100100// nld_twoterm
101// -----------------------------------------------------------------------------
101// ----------------------------------------------------------------------------------------
102102
103103class NETLIB_NAME(twoterm) : public device_t
104104{
r248389r248390
140140private:
141141};
142142
143// -----------------------------------------------------------------------------
143// ----------------------------------------------------------------------------------------
144144// nld_R
145// -----------------------------------------------------------------------------
145// ----------------------------------------------------------------------------------------
146146
147147class NETLIB_NAME(R_base) : public NETLIB_NAME(twoterm)
148148{
r248389r248390
164164   param_double_t m_R;
165165);
166166
167// -----------------------------------------------------------------------------
167// ----------------------------------------------------------------------------------------
168168// nld_POT
169// -----------------------------------------------------------------------------
169// ----------------------------------------------------------------------------------------
170170
171171NETLIB_DEVICE_WITH_PARAMS(POT,
172172   NETLIB_NAME(R_base) m_R1;
r248389r248390
187187);
188188
189189
190// -----------------------------------------------------------------------------
190// ----------------------------------------------------------------------------------------
191191// nld_C
192// -----------------------------------------------------------------------------
192// ----------------------------------------------------------------------------------------
193193
194194class NETLIB_NAME(C) : public NETLIB_NAME(twoterm)
195195{
r248389r248390
212212};
213213
214214
215// -----------------------------------------------------------------------------
215// ----------------------------------------------------------------------------------------
216216// A generic diode model to be used in other devices (Diode, BJT ...)
217// -----------------------------------------------------------------------------
217// ----------------------------------------------------------------------------------------
218218
219219class generic_diode
220220{
r248389r248390
285285   nl_double m_Vcrit;
286286};
287287
288// -----------------------------------------------------------------------------
288// ----------------------------------------------------------------------------------------
289289// nld_D
290// -----------------------------------------------------------------------------
290// ----------------------------------------------------------------------------------------
291291
292292class NETLIB_NAME(D) : public NETLIB_NAME(twoterm)
293293{
r248389r248390
306306   generic_diode m_D;
307307};
308308
309// -----------------------------------------------------------------------------
309// ----------------------------------------------------------------------------------------
310310// nld_VS - Voltage source
311311//
312312// netlist voltage source must have inner resistance
313// -----------------------------------------------------------------------------
313// ----------------------------------------------------------------------------------------
314314
315315class NETLIB_NAME(VS) : public NETLIB_NAME(twoterm)
316316{
r248389r248390
326326   param_double_t m_V;
327327};
328328
329// -----------------------------------------------------------------------------
329// ----------------------------------------------------------------------------------------
330330// nld_CS - Current source
331// -----------------------------------------------------------------------------
331// ----------------------------------------------------------------------------------------
332332
333333class NETLIB_NAME(CS) : public NETLIB_NAME(twoterm)
334334{
trunk/src/emu/netlist/devices/net_lib.c
r248389r248390
5959   ENTRY(POT,                  POT,                    "R")
6060   ENTRY(POT2,                 POT2,                   "R")
6161   ENTRY(C,                    CAP,                    "C")
62   ENTRY(D,                    DIODE,                  "MODEL")
62   ENTRY(D,                    DIODE,                  "model")
6363   ENTRY(VCVS,                 VCVS,                   "-")
6464   ENTRY(VCCS,                 VCCS,                   "-")
6565   ENTRY(CCCS,                 CCCS,                   "-")
6666   ENTRY(LVCCS,                LVCCS,                  "-")
6767   ENTRY(VS,                   VS,                     "V")
6868   ENTRY(CS,                   CS,                     "I")
69   ENTRY(OPAMP,                OPAMP,                  "MODEL")
69   ENTRY(OPAMP,                OPAMP,                  "model")
7070   ENTRY(dummy_input,          DUMMY_INPUT,            "-")
7171   ENTRY(frontier,             FRONTIER_DEV,           "+I,G,Q")   // not intended to be used directly
7272   ENTRY(function,             AFUNC,                   "N,FUNC")   // only for macro devices - NO FEEDBACK loops
73   ENTRY(QBJT_EB,              QBJT_EB,                "MODEL")
74   ENTRY(QBJT_switch,          QBJT_SW,                "MODEL")
73   ENTRY(QBJT_EB,              QBJT_EB,                "model")
74   ENTRY(QBJT_switch,          QBJT_SW,                "model")
7575   ENTRY(logic_input,          TTL_INPUT,              "IN")
7676   ENTRY(logic_input,          LOGIC_INPUT,            "IN,FAMILY")
7777   ENTRY(analog_input,         ANALOG_INPUT,           "IN")
trunk/src/emu/netlist/devices/net_lib.h
r248389r248390
5656
5757#include "nld_log.h"
5858
59#include "../macro/nlm_cd4xxx.h"
60#include "../macro/nlm_ttl74xx.h"
61#include "../macro/nlm_opamp.h"
62
6359#include "../analog/nld_bjt.h"
6460#include "../analog/nld_fourterm.h"
6561#include "../analog/nld_switches.h"
6662#include "../analog/nld_twoterm.h"
6763#include "../analog/nld_opamps.h"
64#include "../macro/nlm_cd4xxx.h"
65#include "../macro/nlm_ttl74xx.h"
6866#include "../solver/nld_solver.h"
6967
7068#include "nld_legacy.h"
trunk/src/emu/netlist/devices/nld_4020.h
r248389r248390
3232
3333/* FIXME: only used in mario.c */
3434#define CD4020_WI(_name, _IP, _RESET, _VDD, _VSS)                              \
35      NET_REGISTER_DEV(CD4020_WI, _name)                                        \
35      NET_REGISTER_DEV(CD4020, _name)                                        \
3636      NET_CONNECT(_name, IP, _IP)                                            \
3737      NET_CONNECT(_name, RESET,  _RESET)                                     \
3838      NET_CONNECT(_name, VDD,  _VDD)                                         \
trunk/src/emu/netlist/devices/nld_7400.h
r248389r248390
3636#include "nld_truthtable.h"
3737
3838#define TTL_7400_NAND(_name, _A, _B)                                                \
39      NET_REGISTER_DEV(TTL_7400_NAND, _name)                                               \
39      NET_REGISTER_DEV(7400, _name)                                               \
4040      NET_CONNECT(_name, A, _A)                                                   \
4141      NET_CONNECT(_name, B, _B)
4242
4343#define TTL_7400_DIP(_name)                                                         \
44      NET_REGISTER_DEV(TTL_7400_DIP, _name)
44      NET_REGISTER_DEV(7400_dip, _name)
4545
4646NETLIB_NAMESPACE_DEVICES_START()
4747
trunk/src/emu/netlist/devices/nld_7402.h
r248389r248390
3636#include "nld_truthtable.h"
3737
3838#define TTL_7402_NOR(_name, _I1, _I2)                                               \
39      NET_REGISTER_DEV(TTL_7402_NOR, _name)                                               \
39      NET_REGISTER_DEV(7402, _name)                                               \
4040      NET_CONNECT(_name, A, _I1)                                                  \
4141      NET_CONNECT(_name, B, _I2)
4242
4343#define TTL_7402_DIP(_name)                                                         \
44      NET_REGISTER_DEV(TTL_7402_DIP, _name)
44      NET_REGISTER_DEV(7402_dip, _name)
4545
4646
4747NETLIB_NAMESPACE_DEVICES_START()
trunk/src/emu/netlist/devices/nld_7404.h
r248389r248390
3434#include "nld_truthtable.h"
3535
3636#define TTL_7404_INVERT(_name, _A)                                                  \
37      NET_REGISTER_DEV(TTL_7404_INVERT, _name)                                               \
37      NET_REGISTER_DEV(7404, _name)                                               \
3838      NET_CONNECT(_name, A, _A)
3939
4040#define TTL_7404_DIP(_name)                                                         \
41      NET_REGISTER_DEV(TTL_7404_DIP, _name)
41      NET_REGISTER_DEV(7404_dip, _name)
4242
4343NETLIB_NAMESPACE_DEVICES_START()
4444
trunk/src/emu/netlist/devices/nld_7408.h
r248389r248390
3636#include "nld_truthtable.h"
3737
3838#define TTL_7408_AND(_name, _A, _B)                                                 \
39      NET_REGISTER_DEV(TTL_7408_AND, _name)                                               \
39      NET_REGISTER_DEV(7408, _name)                                               \
4040      NET_CONNECT(_name, A, _A)                                                   \
4141      NET_CONNECT(_name, B, _B)
4242
4343#define TTL_7408_DIP(_name)                                                         \
44      NET_REGISTER_DEV(TTL_7408_DIP, _name)
44      NET_REGISTER_DEV(7408_dip, _name)
4545
4646NETLIB_NAMESPACE_DEVICES_START()
4747
trunk/src/emu/netlist/devices/nld_7410.h
r248389r248390
3636#include "nld_truthtable.h"
3737
3838#define TTL_7410_NAND(_name, _I1, _I2, _I3)                                         \
39      NET_REGISTER_DEV(TTL_7410_NAND, _name)                                               \
39      NET_REGISTER_DEV(7410, _name)                                               \
4040      NET_CONNECT(_name, A, _I1)                                                  \
4141      NET_CONNECT(_name, B, _I2)                                                  \
4242      NET_CONNECT(_name, C, _I3)
4343
4444#define TTL_7410_DIP(_name)                                                         \
45      NET_REGISTER_DEV(TTL_7410_DIP, _name)
45      NET_REGISTER_DEV(7410_dip, _name)
4646
4747NETLIB_NAMESPACE_DEVICES_START()
4848
trunk/src/emu/netlist/devices/nld_74107.h
r248389r248390
6262#include "../nl_base.h"
6363
6464#define TTL_74107A(_name, _CLK, _J, _K, _CLRQ)                                      \
65      NET_REGISTER_DEV(TTL_74107A, _name)                                             \
65      NET_REGISTER_DEV(74107A, _name)                                             \
6666      NET_CONNECT(_name, CLK, _CLK)                                               \
6767      NET_CONNECT(_name, J,  _J)                                                  \
6868      NET_CONNECT(_name, K,  _K)                                                  \
r248389r248390
7272      TTL_74107A(_name, _CLK, _J, _K, _CLRQ)
7373
7474#define TTL_74107_DIP(_name)                                                         \
75      NET_REGISTER_DEV(TTL_74107_DIP, _name)
75      NET_REGISTER_DEV(74107_dip, _name)
7676
7777NETLIB_NAMESPACE_DEVICES_START()
7878
trunk/src/emu/netlist/devices/nld_7411.h
r248389r248390
3636#include "nld_truthtable.h"
3737
3838#define TTL_7411_AND(_name, _I1, _I2, _I3)                                         \
39      NET_REGISTER_DEV(TTL_7411_AND, _name)                                               \
39      NET_REGISTER_DEV(7411, _name)                                               \
4040      NET_CONNECT(_name, A, _I1)                                                  \
4141      NET_CONNECT(_name, B, _I2)                                                  \
4242      NET_CONNECT(_name, C, _I3)
4343
4444#define TTL_7411_DIP(_name)                                                         \
45      NET_REGISTER_DEV(TTL_7411_DIP, _name)
45      NET_REGISTER_DEV(7411_dip, _name)
4646
4747NETLIB_NAMESPACE_DEVICES_START()
4848
trunk/src/emu/netlist/devices/nld_74123.h
r248389r248390
5454#include "../analog/nld_twoterm.h"
5555
5656#define TTL_74123(_name)                                                        \
57      NET_REGISTER_DEV(TTL_74123, _name)
57      NET_REGISTER_DEV(74123, _name)
5858
5959NETLIB_NAMESPACE_DEVICES_START()
6060
r248389r248390
8585);
8686
8787#define TTL_74123_DIP(_name)                                                         \
88      NET_REGISTER_DEV(TTL_74123_DIP, _name)
88      NET_REGISTER_DEV(74123_dip, _name)
8989
9090NETLIB_DEVICE(74123_dip,
9191
r248389r248390
9999 */
100100
101101#define TTL_9602_DIP(_name)                                                         \
102      NET_REGISTER_DEV(TTL_9602_DIP, _name)
102      NET_REGISTER_DEV(9602_dip, _name)
103103
104104NETLIB_DEVICE(9602_dip,
105105
r248389r248390
113113 */
114114
115115#define CD4538_DIP(_name)                                                         \
116      NET_REGISTER_DEV(CD4538_DIP, _name)
116      NET_REGISTER_DEV(4538_dip, _name)
117117
118118NETLIB_DEVICE(4538_dip,
119119   NETLIB_LOGIC_FAMILY(CD4XXX)
trunk/src/emu/netlist/devices/nld_74153.h
r248389r248390
4848#include "../nl_base.h"
4949
5050#define TTL_74153(_name, _C0, _C1, _C2, _C3, _A, _B, _G)                            \
51      NET_REGISTER_DEV(TTL_74153, _name)                                              \
51      NET_REGISTER_DEV(74153, _name)                                              \
5252      NET_CONNECT(_name, C0, _C0)                                                 \
5353      NET_CONNECT(_name, C1, _C1)                                                 \
5454      NET_CONNECT(_name, C2, _C2)                                                 \
r248389r248390
5858      NET_CONNECT(_name, G, _G)
5959
6060#define TTL_74153_DIP(_name)                                                         \
61      NET_REGISTER_DEV(TTL_74153_DIP, _name)
61      NET_REGISTER_DEV(74153_dip, _name)
6262
6363NETLIB_NAMESPACE_DEVICES_START()
6464
trunk/src/emu/netlist/devices/nld_74175.h
r248389r248390
3939#include "nld_signal.h"
4040
4141#define TTL_74175(_name)                                     \
42      NET_REGISTER_DEV(TTL_74175, _name)
42      NET_REGISTER_DEV(74175, _name)
4343#define TTL_74175_DIP(_name)                                 \
44      NET_REGISTER_DEV(TTL_74175_DIP, _name)
44      NET_REGISTER_DEV(74175_dip, _name)
4545
4646NETLIB_NAMESPACE_DEVICES_START()
4747
trunk/src/emu/netlist/devices/nld_74192.h
r248389r248390
3333#include "nld_9316.h"
3434
3535#define TTL_74192(_name)                                              \
36      NET_REGISTER_DEV(TTL_74192, _name)
36      NET_REGISTER_DEV(74192, _name)
3737
3838#define TTL_74192_DIP(_name)                                                         \
39      NET_REGISTER_DEV(TTL_74192_DIP, _name)
39      NET_REGISTER_DEV(74192_dip, _name)
4040
4141NETLIB_NAMESPACE_DEVICES_START()
4242
trunk/src/emu/netlist/devices/nld_74193.h
r248389r248390
2929#include "../nl_base.h"
3030
3131#define TTL_74193(_name)                                              \
32      NET_REGISTER_DEV(TTL_74193, _name)
32      NET_REGISTER_DEV(74193, _name)
3333
3434#define TTL_74193_DIP(_name)                                                         \
35      NET_REGISTER_DEV(TTL_74193_DIP, _name)
35      NET_REGISTER_DEV(74193_dip, _name)
3636
3737NETLIB_NAMESPACE_DEVICES_START()
3838
trunk/src/emu/netlist/devices/nld_7420.h
r248389r248390
3737#include "nld_truthtable.h"
3838
3939#define TTL_7420_NAND(_name, _I1, _I2, _I3, _I4)                                    \
40      NET_REGISTER_DEV(TTL_7420_NAND, _name)                                               \
40      NET_REGISTER_DEV(7420, _name)                                               \
4141      NET_CONNECT(_name, A, _I1)                                                  \
4242      NET_CONNECT(_name, B, _I2)                                                  \
4343      NET_CONNECT(_name, C, _I3)                                                  \
r248389r248390
4545
4646
4747#define TTL_7420_DIP(_name)                                                         \
48      NET_REGISTER_DEV(TTL_7420_DIP, _name)
48      NET_REGISTER_DEV(7420_dip, _name)
4949
5050NETLIB_NAMESPACE_DEVICES_START()
5151
trunk/src/emu/netlist/devices/nld_7425.h
r248389r248390
3939#include "nld_signal.h"
4040
4141#define TTL_7425_NOR(_name, _I1, _I2, _I3, _I4)                                     \
42      NET_REGISTER_DEV(TTL_7425_NOR, _name)                                               \
42      NET_REGISTER_DEV(7425, _name)                                               \
4343      NET_CONNECT(_name, A, _I1)                                                  \
4444      NET_CONNECT(_name, B, _I2)                                                  \
4545      NET_CONNECT(_name, C, _I3)                                                  \
4646      NET_CONNECT(_name, D, _I4)
4747
4848#define TTL_7425_DIP(_name)                                                         \
49      NET_REGISTER_DEV(TTL_7425_DIP, _name)
49      NET_REGISTER_DEV(7425_dip, _name)
5050
5151NETLIB_NAMESPACE_DEVICES_START()
5252
trunk/src/emu/netlist/devices/nld_7427.h
r248389r248390
3636#include "nld_truthtable.h"
3737
3838#define TTL_7427_NOR(_name, _I1, _I2, _I3)                                          \
39      NET_REGISTER_DEV(TTL_7427_NOR, _name)                                               \
39      NET_REGISTER_DEV(7427, _name)                                               \
4040      NET_CONNECT(_name, A, _I1)                                                  \
4141      NET_CONNECT(_name, B, _I2)                                                  \
4242      NET_CONNECT(_name, C, _I3)
4343
4444#define TTL_7427_DIP(_name)                                                         \
45      NET_REGISTER_DEV(TTL_7427_DIP, _name)
45      NET_REGISTER_DEV(7427_dip, _name)
4646
4747NETLIB_NAMESPACE_DEVICES_START()
4848
trunk/src/emu/netlist/devices/nld_74279.h
r248389r248390
3939#include "nld_truthtable.h"
4040
4141#define TTL_74279_DIP(_name)                                                         \
42      NET_REGISTER_DEV(TTL_74279_DIP, _name)
42      NET_REGISTER_DEV(74279_dip, _name)
4343
4444NETLIB_NAMESPACE_DEVICES_START()
4545
trunk/src/emu/netlist/devices/nld_7430.h
r248389r248390
4141#include "nld_truthtable.h"
4242
4343#define TTL_7430_NAND(_name, _I1, _I2, _I3, _I4, _I5, _I6, _I7, _I8)                \
44      NET_REGISTER_DEV(TTL_7430_NAND, _name)                                               \
44      NET_REGISTER_DEV(7430, _name)                                               \
4545      NET_CONNECT(_name, A, _I1)                                                  \
4646      NET_CONNECT(_name, B, _I2)                                                  \
4747      NET_CONNECT(_name, C, _I3)                                                  \
r248389r248390
5353
5454
5555#define TTL_7430_DIP(_name)                                                         \
56      NET_REGISTER_DEV(TTL_7430_DIP, _name)
56      NET_REGISTER_DEV(7430_dip, _name)
5757
5858NETLIB_NAMESPACE_DEVICES_START()
5959
trunk/src/emu/netlist/devices/nld_7432.h
r248389r248390
3535#include "nld_signal.h"
3636#include "nld_truthtable.h"
3737
38#define TTL_7432_OR(_name, _I1, _I2)                                           \
39      NET_REGISTER_DEV(TTL_7432_OR, _name)                                   \
40      NET_CONNECT(_name, A, _I1)                                             \
38#define TTL_7432_OR(_name, _I1, _I2)                                               \
39      NET_REGISTER_DEV(7432, _name)                                               \
40      NET_CONNECT(_name, A, _I1)                                                  \
4141      NET_CONNECT(_name, B, _I2)
4242
43#define TTL_7432_DIP(_name)                                                    \
44      NET_REGISTER_DEV(TTL_7432_DIP, _name)
43#define TTL_7432_DIP(_name)                                                         \
44      NET_REGISTER_DEV(7432_dip, _name)
4545
4646NETLIB_NAMESPACE_DEVICES_START()
4747
trunk/src/emu/netlist/devices/nld_7437.h
r248389r248390
3939#include "nld_truthtable.h"
4040
4141#define TTL_7437_NAND(_name, _A, _B)                                                \
42      NET_REGISTER_DEV(TTL_7437_NAND, _name)                                               \
42      NET_REGISTER_DEV(7437, _name)                                               \
4343      NET_CONNECT(_name, A, _A)                                                   \
4444      NET_CONNECT(_name, B, _B)
4545
4646#define TTL_7437_DIP(_name)                                                         \
47      NET_REGISTER_DEV(TTL_7437_DIP, _name)
47      NET_REGISTER_DEV(7437_dip, _name)
4848
4949NETLIB_NAMESPACE_DEVICES_START()
5050
trunk/src/emu/netlist/devices/nld_7448.h
r248389r248390
2727#include "../nl_base.h"
2828
2929#define TTL_7448(_name, _A0, _A1, _A2, _A3, _LTQ, _BIQ, _RBIQ)                      \
30      NET_REGISTER_DEV(TTL_7448, _name)                                               \
30      NET_REGISTER_DEV(7448, _name)                                               \
3131      NET_CONNECT(_name, A, _A0)                                                  \
3232      NET_CONNECT(_name, B, _A1)                                                  \
3333      NET_CONNECT(_name, C, _A2)                                                  \
r248389r248390
3737      NET_CONNECT(_name, RBIQ, _RBIQ)
3838
3939#define TTL_7448_DIP(_name)                                                         \
40      NET_REGISTER_DEV(TTL_7448_DIP, _name)
40      NET_REGISTER_DEV(7448_dip, _name)
4141
4242/*
4343 * FIXME: Using truthtable is a lot slower than the explicit device
trunk/src/emu/netlist/devices/nld_7450.h
r248389r248390
2727#include "nld_signal.h"
2828
2929#define TTL_7450_ANDORINVERT(_name, _I1, _I2, _I3, _I4)                             \
30      NET_REGISTER_DEV(TTL_7450_ANDORINVERT, _name)                                               \
30      NET_REGISTER_DEV(7450, _name)                                               \
3131      NET_CONNECT(_name, A, _I1)                                                  \
3232      NET_CONNECT(_name, B, _I2)                                                  \
3333      NET_CONNECT(_name, C, _I3)                                                  \
3434      NET_CONNECT(_name, D, _I4)
3535
3636#define TTL_7450_DIP(_name)                                                         \
37      NET_REGISTER_DEV(TTL_7450_DIP, _name)
37      NET_REGISTER_DEV(7450_dip, _name)
3838
3939NETLIB_NAMESPACE_DEVICES_START()
4040
trunk/src/emu/netlist/devices/nld_7474.h
r248389r248390
4545#include "nld_signal.h"
4646
4747#define TTL_7474(_name, _CLK, _D, _CLRQ, _PREQ)                                     \
48      NET_REGISTER_DEV(TTL_7474, _name)                                               \
48      NET_REGISTER_DEV(7474, _name)                                               \
4949      NET_CONNECT(_name, CLK, _CLK)                                               \
5050      NET_CONNECT(_name, D,  _D)                                                  \
5151      NET_CONNECT(_name, CLRQ,  _CLRQ)                                            \
5252      NET_CONNECT(_name, PREQ,  _PREQ)
5353
5454#define TTL_7474_DIP(_name)                                                         \
55      NET_REGISTER_DEV(TTL_7474_DIP, _name)
55      NET_REGISTER_DEV(7474_dip, _name)
5656
5757NETLIB_NAMESPACE_DEVICES_START()
5858
trunk/src/emu/netlist/devices/nld_7483.h
r248389r248390
3030#include "../nl_base.h"
3131
3232#define TTL_7483(_name, _A1, _A2, _A3, _A4, _B1, _B2, _B3, _B4, _CI)                \
33      NET_REGISTER_DEV(TTL_7483, _name)                                               \
33      NET_REGISTER_DEV(7483, _name)                                               \
3434      NET_CONNECT(_name, A1, _A1)                                                 \
3535      NET_CONNECT(_name, A2, _A2)                                                 \
3636      NET_CONNECT(_name, A3, _A3)                                                 \
r248389r248390
4242      NET_CONNECT(_name, C0, _CI)
4343
4444#define TTL_7483_DIP(_name)                                                         \
45      NET_REGISTER_DEV(TTL_7483_DIP, _name)
45      NET_REGISTER_DEV(7483_dip, _name)
4646
4747NETLIB_NAMESPACE_DEVICES_START()
4848
trunk/src/emu/netlist/devices/nld_7486.h
r248389r248390
3636#include "nld_truthtable.h"
3737
3838#define TTL_7486_XOR(_name, _A, _B)                                                 \
39      NET_REGISTER_DEV(TTL_7486_XOR, _name)                                               \
39      NET_REGISTER_DEV(7486, _name)                                               \
4040      NET_CONNECT(_name, A, _A)                                                   \
4141      NET_CONNECT(_name, B, _B)
4242
4343
4444#define TTL_7486_DIP(_name)                                                         \
45      NET_REGISTER_DEV(TTL_7486_DIP, _name)
45      NET_REGISTER_DEV(7486_dip, _name)
4646
4747NETLIB_NAMESPACE_DEVICES_START()
4848
trunk/src/emu/netlist/devices/nld_7490.h
r248389r248390
5858#include "../nl_base.h"
5959
6060#define TTL_7490(_name, _A, _B, _R1, _R2, _R91, _R92)                               \
61      NET_REGISTER_DEV(TTL_7490, _name)                                               \
61      NET_REGISTER_DEV(7490, _name)                                               \
6262      NET_CONNECT(_name, A, _A)                                                   \
6363      NET_CONNECT(_name, B, _B)                                                   \
6464      NET_CONNECT(_name, R1,  _R1)                                                \
r248389r248390
6767      NET_CONNECT(_name, R92, _R92)
6868
6969#define TTL_7490_DIP(_name)                                                         \
70      NET_REGISTER_DEV(TTL_7490_DIP, _name)
70      NET_REGISTER_DEV(7490_dip, _name)
7171
7272NETLIB_NAMESPACE_DEVICES_START()
7373
trunk/src/emu/netlist/devices/nld_7493.h
r248389r248390
6060#include "../nl_base.h"
6161
6262#define TTL_7493(_name, _CLKA, _CLKB, _R1, _R2)                                     \
63      NET_REGISTER_DEV(TTL_7493, _name)                                               \
63      NET_REGISTER_DEV(7493, _name)                                               \
6464      NET_CONNECT(_name, CLKA, _CLKA)                                             \
6565      NET_CONNECT(_name, CLKB, _CLKB)                                             \
6666      NET_CONNECT(_name, R1,  _R1)                                                \
6767      NET_CONNECT(_name, R2,  _R2)
6868
6969#define TTL_7493_DIP(_name)                                                         \
70      NET_REGISTER_DEV(TTL_7493_DIP, _name)
70      NET_REGISTER_DEV(7493_dip, _name)
7171
7272NETLIB_NAMESPACE_DEVICES_START()
7373
trunk/src/emu/netlist/devices/nld_74ls629.h
r248389r248390
6060);
6161
6262#define SN74LS629_DIP(_name, _cap1, _cap2)                                        \
63      NET_REGISTER_DEV(SN74LS629_DIP, _name)                                    \
63      NET_REGISTER_DEV(SN74LS629_dip, _name)                                    \
6464      NETDEV_PARAMI(_name, 1.CAP, _cap1)                                        \
6565      NETDEV_PARAMI(_name, 2.CAP, _cap2)
6666
trunk/src/emu/netlist/devices/nld_82S16.h
r248389r248390
2727#include "../nl_base.h"
2828
2929#define TTL_82S16(_name)                                     \
30      NET_REGISTER_DEV(TTL_82S16, _name)
30      NET_REGISTER_DEV(82S16, _name)
3131#define TTL_82S16_DIP(_name)                                 \
32      NET_REGISTER_DEV(TTL_82S16_DIP, _name)
32      NET_REGISTER_DEV(82S16_dip, _name)
3333
3434NETLIB_NAMESPACE_DEVICES_START()
3535
trunk/src/emu/netlist/devices/nld_9310.h
r248389r248390
4848#include "../nl_base.h"
4949
5050#define TTL_9310(_name, _CLK, _ENP, _ENT, _CLRQ, _LOADQ, _A, _B, _C, _D)            \
51      NET_REGISTER_DEV(TTL_9310, _name)                                               \
51      NET_REGISTER_DEV(9310, _name)                                               \
5252      NET_CONNECT(_name, CLK, _CLK)                                               \
5353      NET_CONNECT(_name, ENP,  _ENP)                                              \
5454      NET_CONNECT(_name, ENT,  _ENT)                                              \
r248389r248390
6060      NET_CONNECT(_name, D,    _D)
6161
6262#define TTL_9310_DIP(_name)                                                         \
63      NET_REGISTER_DEV(TTL_9310_DIP, _name)
63      NET_REGISTER_DEV(9310_dip, _name)
6464
6565NETLIB_NAMESPACE_DEVICES_START()
6666
trunk/src/emu/netlist/devices/nld_9312.h
r248389r248390
4141#include "nld_truthtable.h"
4242
4343#define TTL_9312(_name)                                                \
44      NET_REGISTER_DEV(TTL_9312, _name)
44      NET_REGISTER_DEV(9312, _name)
4545
4646#define TTL_9312_DIP(_name)                                            \
47      NET_REGISTER_DEV(TTL_9312_DIP, _name)
47      NET_REGISTER_DEV(9312_dip, _name)
4848
4949NETLIB_NAMESPACE_DEVICES_START()
5050
trunk/src/emu/netlist/devices/nld_9316.h
r248389r248390
5252#include "../nl_base.h"
5353
5454#define TTL_9316(_name, _CLK, _ENP, _ENT, _CLRQ, _LOADQ, _A, _B, _C, _D)            \
55      NET_REGISTER_DEV(TTL_9316, _name)                                               \
55      NET_REGISTER_DEV(9316, _name)                                               \
5656      NET_CONNECT(_name, CLK, _CLK)                                               \
5757      NET_CONNECT(_name, ENP,  _ENP)                                              \
5858      NET_CONNECT(_name, ENT,  _ENT)                                              \
r248389r248390
6464      NET_CONNECT(_name, D,    _D)
6565
6666#define TTL_9316_DIP(_name)                                                         \
67      NET_REGISTER_DEV(TTL_9316_DIP, _name)
67      NET_REGISTER_DEV(9316_dip, _name)
6868
6969NETLIB_NAMESPACE_DEVICES_START()
7070
trunk/src/emu/netlist/devices/nld_legacy.h
r248389r248390
2222// ----------------------------------------------------------------------------------------
2323
2424#define NETDEV_RSFF(_name)                                                          \
25      NET_REGISTER_DEV(NETDEV_RSFF, _name)
25      NET_REGISTER_DEV(nicRSFF, _name)
2626
2727#define NETDEV_DELAY(_name)                                                         \
28      NET_REGISTER_DEV(NETDEV_DELAY, _name)
28      NET_REGISTER_DEV(nicDelay, _name)
2929
3030// ----------------------------------------------------------------------------------------
3131// Devices ...
trunk/src/emu/netlist/devices/nld_log.h
r248389r248390
2121#include "../nl_base.h"
2222
2323#define LOG(_name, _I)                                                       \
24      NET_REGISTER_DEV(ÖPG, _name)                                         \
24      NET_REGISTER_DEV(log, _name)                                         \
2525      NET_CONNECT(_name, I, _I)
2626
2727NETLIB_NAMESPACE_DEVICES_START()
r248389r248390
3434);
3535
3636#define LOGD(_name, _I, _I2)                                                 \
37      NET_REGISTER_DEV(LOGD, _name)                                        \
37      NET_REGISTER_DEV(logD, _name)                                        \
3838      NET_CONNECT(_name, I, _I)                                            \
3939      NET_CONNECT(_name, I2, _I2)
4040
trunk/src/emu/netlist/devices/nld_mm5837.h
r248389r248390
2323#include "../analog/nld_twoterm.h"
2424
2525#define MM5837_DIP(_name)                                                        \
26      NET_REGISTER_DEV(MM5837_DIP, _name)
26      NET_REGISTER_DEV(MM5837, _name)
2727
2828NETLIB_NAMESPACE_DEVICES_START()
2929
trunk/src/emu/netlist/devices/nld_ne555.h
r248389r248390
4646);
4747
4848#define NE555_DIP(_name)                                                         \
49      NET_REGISTER_DEV(NE555_DIP, _name)
49      NET_REGISTER_DEV(NE555_dip, _name)
5050
5151NETLIB_DEVICE_DERIVED_PURE(NE555_dip, NE555);
5252
trunk/src/emu/netlist/devices/nld_r2r_dac.h
r248389r248390
5050#include "../analog/nld_twoterm.h"
5151
5252#define R2R_DAC(_name, _VIN, _R, _N)                                            \
53      NET_REGISTER_DEV(R2R_DAC, _name)                                       \
53      NET_REGISTER_DEV(r2r_dac, _name)                                       \
5454      NETDEV_PARAMI(_name, VIN, _VIN)                                        \
5555      NETDEV_PARAMI(_name, R,   _R)                                          \
5656      NETDEV_PARAMI(_name, N,   _N)
trunk/src/emu/netlist/devices/nld_system.h
r248389r248390
1919// -----------------------------------------------------------------------------
2020
2121#define TTL_INPUT(_name, _v)                                                   \
22      NET_REGISTER_DEV(TTL_INPUT, _name)                                   \
22      NET_REGISTER_DEV(logic_input, _name)                                   \
2323      PARAM(_name.IN, _v)
2424
2525#define LOGIC_INPUT(_name, _v, _family)                                        \
26      NET_REGISTER_DEV(LOGIC_INPUT, _name)                                   \
26      NET_REGISTER_DEV(logic_input, _name)                                   \
2727      PARAM(_name.IN, _v)                                          \
2828      PARAM(_name.FAMILY, _family)
2929
3030#define ANALOG_INPUT(_name, _v)                                                \
31      NET_REGISTER_DEV(ANALOG_INPUT, _name)                                  \
31      NET_REGISTER_DEV(analog_input, _name)                                  \
3232      PARAM(_name.IN, _v)
3333
3434#define MAINCLOCK(_name, _freq)                                                \
35      NET_REGISTER_DEV(MAINCLOCK, _name)                                     \
35      NET_REGISTER_DEV(mainclock, _name)                                     \
3636      PARAM(_name.FREQ, _freq)
3737
3838#define CLOCK(_name, _freq)                                                    \
39      NET_REGISTER_DEV(CLOCK, _name)                                         \
39      NET_REGISTER_DEV(clock, _name)                                         \
4040      PARAM(_name.FREQ, _freq)
4141
4242#define EXTCLOCK(_name, _freq, _pattern)                                       \
43      NET_REGISTER_DEV(EXTCLOCK, _name)                                      \
43      NET_REGISTER_DEV(extclock, _name)                                      \
4444      PARAM(_name.FREQ, _freq)                                               \
4545      PARAM(_name.PATTERN, _pattern)
4646
4747#define GNDA()                                                                 \
48      NET_REGISTER_DEV(GNDA, GND)
48      NET_REGISTER_DEV(gnd, GND)
4949
5050#define DUMMY_INPUT(_name)                                                     \
51      NET_REGISTER_DEV(DUMMY_INPUT, _name)
51      NET_REGISTER_DEV(dummy_input, _name)
5252
5353//FIXME: Usage discouraged, use OPTIMIZE_FRONTIER instead
5454#define FRONTIER_DEV(_name, _IN, _G, _OUT)                                     \
55      NET_REGISTER_DEV(FRONTIER_DEV, _name)                                      \
55      NET_REGISTER_DEV(frontier, _name)                                      \
5656      NET_C(_IN, _name.I)                                                    \
5757      NET_C(_G,  _name.G)                                                    \
5858      NET_C(_OUT, _name.Q)
r248389r248390
6161      setup.register_frontier(# _attach, _r_in, _r_out);
6262
6363#define RES_SWITCH(_name, _IN, _P1, _P2)                                       \
64      NET_REGISTER_DEV(RES_SWITCH, _name)                                        \
64      NET_REGISTER_DEV(res_sw, _name)                                        \
6565      NET_C(_IN, _name.I)                                                    \
6666      NET_C(_P1, _name.1)                                                    \
6767      NET_C(_P2, _name.2)
6868
6969/* Default device to hold netlist parameters */
7070#define PARAMETERS(_name)                                                      \
71      NET_REGISTER_DEV(PARAMETERS, _name)
71      NET_REGISTER_DEV(netlistparams, _name)
7272
7373#define AFUNC(_name, _N, _F)                                                \
74      NET_REGISTER_DEV(AFUNC, _name)                                      \
74      NET_REGISTER_DEV(function, _name)                                      \
7575      PARAM(_name.N, _N)                                          \
7676      PARAM(_name.FUNC, _F)
7777
r248389r248390
294294      SUB,
295295      DIV,
296296      PUSH_CONST,
297      PUSH_INPUT
297      PUSH_INPUT,
298298   };
299299
300300   struct rpn_inst
trunk/src/emu/netlist/macro/nlm_cd4xxx.h
r248389r248390
33
44#include "../nl_setup.h"
55
6/*
7 * Devices:
8 *
9 * CD4001_NOR : single gate
10 * CD4001_DIP : dip package
11 * CD4020_DIP : dip package (device model in core)
12 * CD4016_DIP : dip package (device model in core)
13 * CD4066_DIP : dip package (device model in core)
14 *
15 */
16
176#ifndef __PLIB_PREPROCESSOR__
187
198/* ----------------------------------------------------------------------------
r248389r248390
2110 * ---------------------------------------------------------------------------*/
2211
2312#define CD4001_NOR(_name)                                                      \
24      NET_REGISTER_DEV(CD4001_NOR, _name)
13      NET_REGISTER_DEV_X(CD4001_NOR, _name)
2514
2615#define CD4001_DIP(_name)                                                      \
27      NET_REGISTER_DEV(CD4001_DIP, _name)
16      NET_REGISTER_DEV_X(CD4001_DIP, _name)
2817
2918/* ----------------------------------------------------------------------------
3019 *  DIP only macros
3120 * ---------------------------------------------------------------------------*/
3221
3322#define CD4020_DIP(_name)                                                      \
34      NET_REGISTER_DEV(CD4020_DIP, _name)
23      NET_REGISTER_DEV_X(CD4020_DIP, _name)
3524
3625#define CD4066_DIP(_name)                                                      \
37      NET_REGISTER_DEV(CD4066_DIP, _name)
26      NET_REGISTER_DEV_X(CD4066_DIP, _name)
3827
3928#define CD4016_DIP(_name)                                                      \
40      NET_REGISTER_DEV(CD4016_DIP, _name)
29      NET_REGISTER_DEV_X(CD4016_DIP, _name)
4130
4231/* ----------------------------------------------------------------------------
4332 *  External declarations
trunk/src/emu/netlist/macro/nlm_opamp.c
r248389r248390
1
2#include "nlm_opamp.h"
3
4#include "analog/nld_opamps.h"
5#include "devices/nld_system.h"
6
7/*
8 *   Generic layout with 4 opamps, VCC on pint 4 and GND on pin 11
9 */
10
11NETLIST_START(opamp_layout_4_4_11)
12   DIPPINS(      /*   +--------------+   */
13      A.OUT,    /*   |1     ++    14|   */ D.OUT,
14      A.MINUS,  /*   |2           13|   */ D.MINUS,
15      A.PLUS,   /*   |3           12|   */ D.PLUS,
16      A.VCC,    /*   |4           11|   */ A.GND,
17      B.PLUS,   /*   |5           10|   */ C.PLUS,
18      B.MINUS,  /*   |6            9|   */ C.MINUS,
19      B.OUT,    /*   |7            8|   */ C.OUT
20              /*   +--------------+   */
21   )
22   NET_C(A.GND, B.GND, C.GND, D.GND)
23   NET_C(A.VCC, B.VCC, C.VCC, D.VCC)
24NETLIST_END()
25
26NETLIST_START(MB3614_DIP)
27   /* The opamp actually has an FPF of about 500k. This doesn't work here and causes oscillations.
28    * FPF here therefore about half the Solver clock.
29    */
30   OPAMP(A, "MB3614")
31   OPAMP(B, "MB3614")
32   OPAMP(C, "MB3614")
33   OPAMP(D, "MB3614")
34
35   INCLUDE(opamp_layout_4_4_11)
36
37NETLIST_END()
38
39NETLIST_START(OPAMP_lib)
40   LOCAL_LIB_ENTRY(opamp_layout_4_4_11)
41
42   NET_MODEL(".model MB3614      OPAMP(TYPE=3 VLH=2.0 VLL=0.2 FPF=5 UGF=500k SLEW=0.6M RI=1000k RO=50 DAB=0.002)")
43   NET_MODEL(".model MB3614_SLOW OPAMP(TYPE=3 VLH=2.0 VLL=0.2 FPF=5 UGF=11k  SLEW=0.6M RI=1000k RO=50 DAB=0.002)")
44   LOCAL_LIB_ENTRY(MB3614_DIP)
45
46
47NETLIST_END()
trunk/src/emu/netlist/macro/nlm_opamp.h
r248389r248390
1#ifndef NLM_OPAMP_H_
2#define NLM_OPAMP_H_
3
4#include "../nl_setup.h"
5
6#ifndef __PLIB_PREPROCESSOR__
7
8/* ----------------------------------------------------------------------------
9 *  Netlist Macros
10 * ---------------------------------------------------------------------------*/
11
12#define MB3614_DIP(_name)                                                    \
13      NET_REGISTER_DEV(MB3614_DIP, _name)
14
15/* ----------------------------------------------------------------------------
16 *  External declarations
17 * ---------------------------------------------------------------------------*/
18
19NETLIST_EXTERNAL(OPAMP_lib)
20
21#endif
22
23#endif
trunk/src/emu/netlist/macro/nlm_ttl74xx.h
r248389r248390
1010 * ---------------------------------------------------------------------------*/
1111
1212#define TTL_7416_GATE(_name)                                                 \
13      NET_REGISTER_DEV(TTL_7416_GATE, _name)
13      NET_REGISTER_DEV_X(TTL_7416_GATE, _name)
1414
1515#define TTL_7416_DIP(_name)                                                    \
16      NET_REGISTER_DEV(TTL7416_DIP, _name)
16      NET_REGISTER_DEV_X(TTL7416_DIP, _name)
1717
1818/* ----------------------------------------------------------------------------
1919 *  External declarations
trunk/src/emu/netlist/nl_dice_compat.h
r248389r248390
4040 */
4141
4242#ifndef NL_CONVERT_CPP
43#ifndef NETLIST_DEVELOPMENT
44#define NETLIST_DEVELOPMENT 0
45#endif
46#if (NETLIST_DEVELOPMENT)
43#ifdef NETLIST_DEVELOPMENT
4744#define CHIP(_n, _t) setup.register_dev( palloc(netlist::devices::nld_ ## _t ## _dip), _n);
4845#else
49#define CHIP(_n, _t) setup.register_dev(NETLIB_NAME_STR_S(TTL_ ## _t ## _DIP), _n);
50//#define CHIP(_n, _t) TTL_ ## _t ## _DIP(_n)
46#define CHIP(_n, _t) setup.register_dev(NETLIB_NAME_STR(_t ## _dip), _n);
5147#endif
5248
5349#define CONNECTION( ... ) CONNECTIONY( CONNECTIONX( __VA_ARGS__ ) )
r248389r248390
118114#define CIRCUIT_LAYOUT_END NETLIST_END()
119115
120116#define CHIP_555_Mono(_name,  _pdesc)   \
121   NE555_DIP(_name) \
117   CHIP(# _name, NE555) \
122118   NET_C(_name.6, _name.7) \
123119   RES(_name ## _R, (_pdesc)->r) \
124120   CAP(_name ## _C, (_pdesc)->c) \
r248389r248390
130126   NET_CSTR(# _name ".1", "GND")
131127
132128#define CHIP_555_Astable(_name,  _pdesc)   \
133   NE555_DIP(_name) \
129   CHIP(# _name, NE555) \
134130   RES(_name ## _R1, (_pdesc)->r1) \
135131   RES(_name ## _R2, (_pdesc)->r2) \
136132   CAP(_name ## _C, (_pdesc)->c) \
trunk/src/emu/netlist/nl_factory.c
r248389r248390
3434}
3535
3636
37factory_list_t::factory_list_t(   setup_t &setup)
38: m_setup(setup)
37factory_list_t::factory_list_t()
3938{
4039}
4140
4241factory_list_t::~factory_list_t()
4342{
44   for (std::size_t i=0; i < size(); i++)
43   for (std::size_t i=0; i < m_list.size(); i++)
4544   {
46      base_factory_t *p = value_at(i);
45      base_factory_t *p = m_list[i];
4746      pfree(p);
4847   }
49   clear();
48   m_list.clear();
5049}
5150
52#if 0
5351device_t *factory_list_t::new_device_by_classname(const pstring &classname) const
5452{
5553   for (std::size_t i=0; i < m_list.size(); i++)
r248389r248390
6462   }
6563   return NULL; // appease code analysis
6664}
67#endif
6865
69void factory_list_t::error(const pstring &s)
66device_t *factory_list_t::new_device_by_name(const pstring &name, setup_t &setup) const
7067{
71   m_setup.netlist().error("%s", s.cstr());
72}
73
74device_t *factory_list_t::new_device_by_name(const pstring &name)
75{
76   base_factory_t *f = factory_by_name(name);
68   base_factory_t *f = factory_by_name(name, setup);
7769   return f->Create();
7870}
7971
80base_factory_t * factory_list_t::factory_by_name(const pstring &name)
72base_factory_t * factory_list_t::factory_by_name(const pstring &name, setup_t &setup) const
8173{
82   if (contains(name))
83      return (*this)[name];
84   else
74   for (std::size_t i=0; i < m_list.size(); i++)
8575   {
86      m_setup.netlist().error("Class %s not found!\n", name.cstr());
87      return NULL; // appease code analysis
76      base_factory_t *p = m_list[i];
77      if (p->name() == name)
78      {
79         return p;
80      }
81      p++;
8882   }
83   setup.netlist().error("Class %s not found!\n", name.cstr());
84   return NULL; // appease code analysis
8985}
9086
9187}
trunk/src/emu/netlist/nl_factory.h
r248389r248390
6262      }
6363   };
6464
65   class factory_list_t : public phashmap_t<pstring, base_factory_t *>
65   class factory_list_t
6666   {
6767   public:
68      factory_list_t(setup_t &m_setup);
68      typedef plist_t<base_factory_t *> list_t;
69
70      factory_list_t();
6971      ~factory_list_t();
7072
7173      template<class _C>
7274      ATTR_COLD void register_device(const pstring &name, const pstring &classname,
7375            const pstring &def_param)
7476      {
75         if (!add(name, palloc(factory_t< _C >(name, classname, def_param))))
76            error(pstring::sprintf("factory already contains %s", name.cstr()));
77         m_list.add(palloc(factory_t< _C >(name, classname, def_param)));
7778      }
7879
7980      ATTR_COLD void register_device(base_factory_t *factory)
8081      {
81         if (!add(factory->name(), factory))
82            error(pstring::sprintf("factory already contains %s", factory->name().cstr()));
82         m_list.add(factory);
8383      }
8484
85      //ATTR_COLD device_t *new_device_by_classname(const pstring &classname) const;
86      ATTR_COLD device_t *new_device_by_name(const pstring &name);
87      ATTR_COLD base_factory_t * factory_by_name(const pstring &name);
85      ATTR_COLD device_t *new_device_by_classname(const pstring &classname) const;
86      ATTR_COLD device_t *new_device_by_name(const pstring &name, setup_t &setup) const;
87      ATTR_COLD base_factory_t * factory_by_name(const pstring &name, setup_t &setup) const;
8888
89      const list_t &list() { return m_list; }
90
8991   private:
90      void error(const pstring &s);
92      list_t m_list;
9193
92      setup_t &m_setup;
9394   };
9495
9596}
trunk/src/emu/netlist/nl_parser.c
r248389r248390
360360   }
361361   else
362362   {
363      base_factory_t *f = m_setup.factory().factory_by_name(dev_type);
363      base_factory_t *f = m_setup.factory().factory_by_name(dev_type, m_setup);
364364      device_t *dev;
365365      pstring_list_t termlist = f->term_param_list();
366366      pstring_list_t def_params = f->def_params();
trunk/src/emu/netlist/nl_setup.c
r248389r248390
2121static NETLIST_START(base)
2222   TTL_INPUT(ttlhigh, 1)
2323   TTL_INPUT(ttllow, 0)
24   NET_REGISTER_DEV(GND, GND)
25   NET_REGISTER_DEV(PARAMETER, NETLIST)
24   NET_REGISTER_DEV(gnd, GND)
25   NET_REGISTER_DEV(netlistparams, NETLIST)
2626
2727   LOCAL_SOURCE(diode_models)
2828   LOCAL_SOURCE(bjt_models)
2929   LOCAL_SOURCE(family_models)
3030   LOCAL_SOURCE(TTL74XX_lib)
3131   LOCAL_SOURCE(CD4XXX_lib)
32   LOCAL_SOURCE(OPAMP_lib)
3332
33
3434   INCLUDE(diode_models);
3535   INCLUDE(bjt_models);
3636   INCLUDE(family_models);
3737   INCLUDE(TTL74XX_lib);
3838   INCLUDE(CD4XXX_lib);
39   INCLUDE(OPAMP_lib);
4039
4140NETLIST_END()
4241
r248389r248390
5251   , m_proxy_cnt(0)
5352{
5453   netlist->set_setup(this);
55   m_factory = palloc(factory_list_t(*this));
54   m_factory = palloc(factory_list_t);
5655}
5756
5857void setup_t::init()
r248389r248390
129128   }
130129   else
131130   {
132      device_t *dev = factory().new_device_by_name(classname);
133      //device_t *dev = factory().new_device_by_classname(classname);
131      device_t *dev = factory().new_device_by_classname(classname);
134132      if (dev == NULL)
135133         netlist().error("Class %s not found!\n", classname.cstr());
136134      return register_dev(dev, name);
137135   }
138136}
139137
138void setup_t::remove_dev(const pstring &name)
139{
140   device_t *dev = netlist().m_devices.find_by_name(name);
141   pstring temp = name + ".";
142   if (dev == NULL)
143      netlist().error("Device %s does not exist\n", name.cstr());
144
145   remove_start_with<tagmap_terminal_t>(m_terminals, temp);
146   remove_start_with<tagmap_param_t>(m_params, temp);
147
148   const link_t *p = m_links.data();
149   while (p != NULL)
150   {
151      const link_t *n = p+1;
152      if (temp.equals(p->e1.substr(0,temp.len())) || temp.equals(p->e2.substr(0,temp.len())))
153         m_links.remove(*p);
154      p = n;
155   }
156   netlist().m_devices.remove_by_name(name);
157}
158
140159void setup_t::register_model(const pstring &model)
141160{
142161   m_models.add(model);
r248389r248390
144163
145164void setup_t::register_alias_nofqn(const pstring &alias, const pstring &out)
146165{
147   if (!m_alias.add(alias, out))
166   if (!(m_alias.add(link_t(alias, out), false)==true))
148167      netlist().error("Error adding alias %s to alias list\n", alias.cstr());
149168}
150169
r248389r248390
235254            else
236255               term.init_object(dev, dev.name() + "." + name);
237256
238            if (!m_terminals.add(term.name(), &term))
257            if (!(m_terminals.add(&term, false)==true))
239258               netlist().error("Error adding %s %s to terminal list\n", objtype_as_astr(term).cstr(), term.name().cstr());
240259            NL_VERBOSE_OUT(("%s %s\n", objtype_as_astr(term).cstr(), name.cstr()));
241260         }
r248389r248390
246265         {
247266            param_t &param = dynamic_cast<param_t &>(obj);
248267            //printf("name: %s\n", name.cstr());
249            if (m_params_temp.contains(name))
268            const pstring val = m_params_temp.find_by_name(name).e2;
269            if (val != "")
250270            {
251               const pstring val = m_params_temp[name];
252271               switch (param.param_type())
253272               {
254273                  case param_t::DOUBLE:
r248389r248390
282301                     netlist().error("Parameter is not supported %s : %s\n", name.cstr(), val.cstr());
283302               }
284303            }
285            if (!m_params.add(param.name(), &param))
304            if (!(m_params.add(&param, false)==true))
286305               netlist().error("Error adding parameter %s to parameter list\n", name.cstr());
287306         }
288307         break;
r248389r248390
345364   static int frontier_cnt = 0;
346365   pstring frontier_name = pstring::sprintf("frontier_%d", frontier_cnt);
347366   frontier_cnt++;
348   device_t *front = register_dev("FRONTIER_DEV", frontier_name);
367   device_t *front = register_dev("nld_frontier", frontier_name);
349368   register_param(frontier_name + ".RIN", r_IN);
350369   register_param(frontier_name + ".ROUT", r_OUT);
351370   register_link(frontier_name + ".G", "GND");
r248389r248390
380399{
381400   pstring fqn = build_fqn(param);
382401
383   int idx = m_params_temp.index_of(fqn);
384   if (idx < 0)
385   {
386      if (!m_params_temp.add(fqn, value))
387         netlist().error("Unexpected error adding parameter %s to parameter list\n", param.cstr());
388   }
389   else
390   {
391      netlist().warning("Overwriting %s old <%s> new <%s>\n", fqn.cstr(), m_params_temp.value_at(idx).cstr(), value.cstr());
392      m_params_temp[fqn] = value;
393   }
402   if (!(m_params_temp.add(link_t(fqn, value), false)==true))
403      netlist().error("Error adding parameter %s to parameter list\n", param.cstr());
394404}
395405
396406const pstring setup_t::resolve_alias(const pstring &name) const
r248389r248390
401411   /* FIXME: Detect endless loop */
402412   do {
403413      ret = temp;
404      int p = m_alias.index_of(ret);
405      temp = (p>=0 ? m_alias.value_at(p) : "");
414      temp = m_alias.find_by_name(ret).e2;
406415   } while (temp != "");
407416
408417   NL_VERBOSE_OUT(("%s==>%s\n", name.cstr(), ret.cstr()));
r248389r248390
412421core_terminal_t *setup_t::find_terminal(const pstring &terminal_in, bool required)
413422{
414423   const pstring &tname = resolve_alias(terminal_in);
415   int ret;
424   core_terminal_t *ret;
416425
417   ret = m_terminals.index_of(tname);
426   ret = m_terminals.find_by_name(tname);
418427   /* look for default */
419   if (ret < 0)
428   if (ret == NULL)
420429   {
421430      /* look for ".Q" std output */
422      ret = m_terminals.index_of(tname + ".Q");
431      pstring s = tname + ".Q";
432      ret = m_terminals.find_by_name(s);
423433   }
424
425   core_terminal_t *term = (ret < 0 ? NULL : m_terminals.value_at(ret));
426
427   if (term == NULL && required)
434   if (ret == NULL && required)
428435      netlist().error("terminal %s(%s) not found!\n", terminal_in.cstr(), tname.cstr());
429   if (term != NULL)
436   if (ret != NULL)
430437      NL_VERBOSE_OUT(("Found input %s\n", tname.cstr()));
431   return term;
438   return ret;
432439}
433440
434441core_terminal_t *setup_t::find_terminal(const pstring &terminal_in, object_t::type_t atype, bool required)
435442{
436443   const pstring &tname = resolve_alias(terminal_in);
437   int ret;
444   core_terminal_t *ret;
438445
439   ret = m_terminals.index_of(tname);
446   ret = m_terminals.find_by_name(tname);
440447   /* look for default */
441   if (ret < 0 && atype == object_t::OUTPUT)
448   if (ret == NULL && atype == object_t::OUTPUT)
442449   {
443450      /* look for ".Q" std output */
444      ret = m_terminals.index_of(tname + ".Q");
451      pstring s = tname + ".Q";
452      ret = m_terminals.find_by_name(s);
445453   }
446   if (ret < 0 && required)
454   if (ret == NULL && required)
447455      netlist().error("terminal %s(%s) not found!\n", terminal_in.cstr(), tname.cstr());
448
449   core_terminal_t *term = (ret < 0 ? NULL : m_terminals.value_at(ret));
450
451   if (term != NULL && term->type() != atype)
456   if (ret != NULL && ret->type() != atype)
452457   {
453458      if (required)
454459         netlist().error("object %s(%s) found but wrong type\n", terminal_in.cstr(), tname.cstr());
455460      else
456         term = NULL;
461         ret = NULL;
457462   }
458   if (term != NULL)
463   if (ret != NULL)
459464      NL_VERBOSE_OUT(("Found input %s\n", tname.cstr()));
460
461   return term;
465   return ret;
462466}
463467
464468param_t *setup_t::find_param(const pstring &param_in, bool required)
r248389r248390
466470   const pstring param_in_fqn = build_fqn(param_in);
467471
468472   const pstring &outname = resolve_alias(param_in_fqn);
469   int ret;
473   param_t *ret;
470474
471   ret = m_params.index_of(outname);
472   if (ret < 0 && required)
475   ret = m_params.find_by_name(outname);
476   if (ret == NULL && required)
473477      netlist().error("parameter %s(%s) not found!\n", param_in_fqn.cstr(), outname.cstr());
474   if (ret != -1)
478   if (ret != NULL)
475479      NL_VERBOSE_OUT(("Found parameter %s\n", outname.cstr()));
476   return (ret == -1 ? NULL : m_params.value_at(ret));
480   return ret;
477481}
478482
479483// FIXME avoid dynamic cast here
r248389r248390
812816   netlist().log("looking for terminals not connected ...");
813817   for (std::size_t i = 0; i < m_terminals.size(); i++)
814818   {
815      core_terminal_t *term = m_terminals.value_at(i);
816      if (!term->has_net())
819      if (!m_terminals[i]->has_net())
817820         errstr += pstring::sprintf("Found terminal %s without a net\n",
818               term->name().cstr());
819      else if (term->net().num_cons() == 0)
821               m_terminals[i]->name().cstr());
822      else if (m_terminals[i]->net().num_cons() == 0)
820823         netlist().warning("Found terminal %s without connections",
821               term->name().cstr());
824               m_terminals[i]->name().cstr());
822825   }
823826   if (errstr != "")
824827      netlist().error("%s", errstr.cstr());
r248389r248390
867870      {
868871         NL_VERBOSE_OUT(("%d: <%s>\n",i, ll[i].cstr()));
869872         NL_VERBOSE_OUT(("%d: <%s>\n",i, ll[i].cstr()));
870         device_t *nc = factory().new_device_by_name("LOG");
873         device_t *nc = factory().new_device_by_classname("nld_log");
871874         pstring name = "log_" + ll[i];
872875         register_dev(nc, name);
873876         register_link(name + ".I", ll[i]);
trunk/src/emu/netlist/nl_setup.h
r248389r248390
2525#define DIPPINS(_pin1, ...)                                                          \
2626      setup.register_dippins_arr( #_pin1 ", " # __VA_ARGS__);
2727
28#define NET_REGISTER_DEV(_type, _name)                                              \
29      setup.register_dev(NETLIB_NAME_STR(_type), # _name);
30
2831/* to be used to reference new library truthtable devices */
29#define NET_REGISTER_DEV(_type, _name)                                            \
32#define NET_REGISTER_DEV_X(_type, _name)                                            \
3033      setup.register_dev(# _type, # _name);
3134
35#define NET_REMOVE_DEV(_name)                                                       \
36      setup.remove_dev(# _name);
37
3238#define NET_REGISTER_SIGNAL(_type, _name)                                           \
3339      NET_REGISTER_DEV(_type ## _ ## sig, _name)
3440
r248389r248390
127133         const pstring &name() const { return e1; }
128134      };
129135
136      typedef pnamedlist_t<link_t> tagmap_nstring_t;
137      typedef pnamedlist_t<param_t *> tagmap_param_t;
138      typedef pnamedlist_t<core_terminal_t *> tagmap_terminal_t;
139      typedef plist_t<link_t> tagmap_link_t;
140
130141      setup_t(netlist_t *netlist);
131142      ~setup_t();
132143
r248389r248390
190201
191202      bool is_library_item(const pstring &name) const { return m_lib.contains(name); }
192203
204      /* not ideal, but needed for save_state */
205      tagmap_terminal_t  m_terminals;
206
193207      void print_stats() const;
194208
195209      /* static support functions */
r248389r248390
201215
202216   private:
203217
204      void connect_terminals(core_terminal_t &in, core_terminal_t &out);
205      void connect_input_output(core_terminal_t &in, core_terminal_t &out);
206      void connect_terminal_output(terminal_t &in, core_terminal_t &out);
207      void connect_terminal_input(terminal_t &term, core_terminal_t &inp);
208      bool connect_input_input(core_terminal_t &t1, core_terminal_t &t2);
209
210      // helpers
211      pstring objtype_as_astr(object_t &in) const;
212
213      const pstring resolve_alias(const pstring &name) const;
214      devices::nld_base_proxy *get_d_a_proxy(core_terminal_t &out);
215
216218      netlist_t *m_netlist;
217219
218      phashmap_t<pstring, pstring> m_alias;
219      phashmap_t<pstring, param_t *>  m_params;
220      phashmap_t<pstring, pstring> m_params_temp;
221      phashmap_t<pstring, core_terminal_t *> m_terminals;
220      tagmap_nstring_t m_alias;
221      tagmap_param_t  m_params;
222      tagmap_link_t   m_links;
223      tagmap_nstring_t m_params_temp;
222224
223      plist_t<link_t> m_links;
224
225225      factory_list_t *m_factory;
226226
227227      plist_t<pstring> m_models;
r248389r248390
232232      source_t::list_t m_sources;
233233      plist_t<pstring> m_lib;
234234
235#if 0
235
236      void connect_terminals(core_terminal_t &in, core_terminal_t &out);
237      void connect_input_output(core_terminal_t &in, core_terminal_t &out);
238      void connect_terminal_output(terminal_t &in, core_terminal_t &out);
239      void connect_terminal_input(terminal_t &term, core_terminal_t &inp);
240      bool connect_input_input(core_terminal_t &t1, core_terminal_t &t2);
241
242      // helpers
243      pstring objtype_as_astr(object_t &in) const;
244
245      const pstring resolve_alias(const pstring &name) const;
246      devices::nld_base_proxy *get_d_a_proxy(core_terminal_t &out);
247
236248      template <class T>
237249      void remove_start_with(T &hm, pstring &sw)
238250      {
r248389r248390
246258            }
247259         }
248260      }
249#endif
250261   };
251262
252263   // ----------------------------------------------------------------------------------------
trunk/src/emu/netlist/plib/plists.h
r248389r248390
1212
1313#include <cstring>
1414#include <algorithm>
15#include <cmath>
1615
1716#include "palloc.h"
1817#include "pstring.h"
r248389r248390
6766
6867   ATTR_HOT  std::size_t size() const { return m_capacity; }
6968
70   void resize(const std::size_t new_size)
71   {
72      set_capacity(new_size);
73   }
74
7569protected:
7670   ATTR_COLD void set_capacity(const std::size_t new_capacity)
7771   {
r248389r248390
370364      return _ListClass(NULL);
371365   }
372366
373   int index_by_name(const pstring &name) const
374   {
375      for (std::size_t i=0; i < this->size(); i++)
376         if (get_name((*this)[i]) == name)
377            return (int) i;
378      return -1;
379   }
380
381367   void remove_by_name(const pstring &name)
382368   {
383369      plist_t<_ListClass>::remove(find_by_name(name));
r248389r248390
613599};
614600
615601// ----------------------------------------------------------------------------------------
616// hashmap list
617// ----------------------------------------------------------------------------------------
618
619
620template <class C>
621struct phash_functor
622{
623   phash_functor()
624   {}
625   phash_functor(const C &v)
626   {
627      m_hash = v;
628   }
629   friend unsigned operator%(const phash_functor &lhs, const unsigned &rhs) { return lhs.m_hash % rhs; }
630   bool operator==(const phash_functor &lhs) const { return (m_hash == lhs.m_hash); }
631private:
632   unsigned m_hash;
633};
634
635template <>
636struct phash_functor<pstring>
637{
638   phash_functor()
639   {}
640   phash_functor(const pstring &v)
641   {
642      /* modified djb2 */
643      const char *string = v.cstr();
644      unsigned result = 5381;
645      for (UINT8 c = *string; c != 0; c = *string++)
646         result = ((result << 5) + result ) ^ (result >> (32 - 5)) ^ c;
647         //result = (result*33) ^ c;
648      m_hash = result;
649   }
650   friend unsigned operator%(const phash_functor<pstring> &lhs, const unsigned &rhs) { return lhs.m_hash % rhs; }
651   bool operator==(const phash_functor<pstring> &lhs) const { return (m_hash == lhs.m_hash); }
652private:
653   unsigned m_hash;
654};
655
656#if 0
657#if 0
658   unsigned hash(const pstring &v) const
659   {
660      /* Fowler–Noll–Vo hash - FNV-1 */
661      const char *string = v.cstr();
662      unsigned result = 2166136261;
663      for (UINT8 c = *string++; c != 0; c = *string++)
664         result = (result * 16777619) ^ c;
665         // result = (result ^ c) * 16777619; FNV 1a
666      return result;
667   }
668#else
669   unsigned hash(const pstring &v) const
670   {
671      /* jenkins one at a time algo */
672      unsigned result = 0;
673      const char *string = v.cstr();
674       while (*string)
675       {
676           result += *string;
677           string++;
678           result += (result << 10);
679           result ^= (result >> 6);
680       }
681       result += (result << 3);
682       result ^= (result >> 11);
683       result += (result << 15);
684       return result;
685   }
686#endif
687#endif
688
689template <class K, class V, class H = phash_functor<K> >
690class phashmap_t
691{
692public:
693   phashmap_t() : m_hash(37)
694   {
695      for (unsigned i=0; i<m_hash.size(); i++)
696         m_hash[i] = -1;
697   }
698
699   ~phashmap_t()
700   {
701   }
702
703   struct element_t
704   {
705      element_t() { }
706      element_t(const K &key, const H &hash, const V &value)
707      : m_key(key), m_hash(hash), m_value(value), m_next(-1)
708      {}
709      K m_key;
710      H m_hash;
711      V m_value;
712      int m_next;
713   };
714
715   void clear()
716   {
717      if (0)
718      {
719         unsigned cnt = 0;
720         for (unsigned i=0; i<m_hash.size(); i++)
721            if (m_hash[i] >= 0)
722               cnt++;
723         const unsigned s = m_values.size();
724         if (s>0)
725            printf("phashmap: %d elements %d hashsize, percent in overflow: %d\n", s, (unsigned) m_hash.size(),  (s - cnt) * 100 / s);
726         else
727            printf("phashmap: No elements .. \n");
728      }
729      m_values.clear();
730      for (unsigned i=0; i<m_hash.size(); i++)
731         m_hash[i] = -1;
732   }
733
734   bool contains(const K &key) const
735   {
736      return (get_idx(key) >= 0);
737   }
738
739   int index_of(const K &key) const
740   {
741      return get_idx(key);
742   }
743
744   unsigned size() const { return m_values.size(); }
745
746   bool add(const K &key, const V &value)
747   {
748      /*
749       * we are using the Euler prime function here
750       *
751       * n * n + n + 41 | 40 >= n >=0
752       *
753       * and accept that outside we will not have a prime
754       *
755       */
756      if (m_values.size() * 3 / 2 > m_hash.size())
757      {
758         unsigned n = std::sqrt( 2 * m_hash.size());
759         n = n * n + n + 41;
760         m_hash.resize(n);
761         rebuild();
762      }
763      const H hash(key);
764      const unsigned pos = hash % m_hash.size();
765      if (m_hash[pos] == -1)
766      {
767         unsigned vpos = m_values.size();
768         m_values.add(element_t(key, hash, value));
769         m_hash[pos] = vpos;
770      }
771      else
772      {
773         int ep = m_hash[pos];
774
775         for (; ep != -1; ep = m_values[ep].m_next)
776         {
777            if (m_values[ep].m_hash == hash && m_values[ep].m_key == key )
778               return false; /* duplicate */
779         }
780         unsigned vpos = m_values.size();
781         m_values.add(element_t(key, hash, value));
782         m_values[vpos].m_next = m_hash[pos];
783         m_hash[pos] = vpos;
784      }
785      return true;
786   }
787
788   V& operator[](const K &key)
789   {
790      int p = get_idx(key);
791      if (p == -1)
792      {
793         p = m_values.size();
794         add(key, V());
795      }
796      return m_values[p].m_value;
797   }
798
799   V& value_at(const unsigned pos) { return m_values[pos].m_value; }
800   const V& value_at(const unsigned pos) const { return m_values[pos].m_value; }
801
802   V& key_at(const unsigned pos) const { return m_values[pos].m_key; }
803private:
804
805   int get_idx(const K &key) const
806   {
807      H hash(key);
808      const unsigned pos = hash % m_hash.size();
809
810      for (int ep = m_hash[pos]; ep != -1; ep = m_values[ep].m_next)
811         if (m_values[ep].m_hash == hash && m_values[ep].m_key == key )
812            return ep;
813      return -1;
814   }
815
816   void rebuild()
817   {
818      for (unsigned i=0; i<m_hash.size(); i++)
819         m_hash[i] = -1;
820      for (unsigned i=0; i<m_values.size(); i++)
821      {
822         unsigned pos = m_values[i].m_hash % m_hash.size();
823         m_values[i].m_next = m_hash[pos];
824         m_hash[pos] = i;
825      }
826
827   }
828   plist_t<element_t> m_values;
829   parray_t<int> m_hash;
830};
831
832// ----------------------------------------------------------------------------------------
833602// sort a list ... slow, I am lazy
834603// elements must support ">" operator.
835604// ----------------------------------------------------------------------------------------
trunk/src/emu/netlist/plib/pstate.c
r248389r248390
7575   m_save.add(p);
7676   state.register_state(*this, stname);
7777}
78
trunk/src/emu/netlist/solver/nld_solver.h
r248389r248390
2222// ----------------------------------------------------------------------------------------
2323
2424#define SOLVER(_name, _freq)                                                 \
25      NET_REGISTER_DEV(SOLVER, _name)                                      \
25      NET_REGISTER_DEV(solver, _name)                                      \
2626      PARAM(_name.FREQ, _freq)
2727
2828// ----------------------------------------------------------------------------------------
trunk/src/emu/sound/c140.c
r248389r248390
134134   /* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
135135   m_mixer_buffer_left = auto_alloc_array(machine(), INT16, 2 * m_sample_rate);
136136   m_mixer_buffer_right = m_mixer_buffer_left + m_sample_rate;
137   
138   save_item(NAME(m_REG));
139   
140   for (int i = 0; i < C140_MAX_VOICE; i++)
141   {   
142      save_item(NAME(m_voi[i].ptoffset), i);
143      save_item(NAME(m_voi[i].pos), i);
144      save_item(NAME(m_voi[i].key), i);
145      save_item(NAME(m_voi[i].lastdt), i);
146      save_item(NAME(m_voi[i].prevdt), i);
147      save_item(NAME(m_voi[i].dltdt), i);
148      save_item(NAME(m_voi[i].rvol), i);
149      save_item(NAME(m_voi[i].lvol), i);
150      save_item(NAME(m_voi[i].frequency), i);
151      save_item(NAME(m_voi[i].bank), i);
152      save_item(NAME(m_voi[i].mode), i);
153      save_item(NAME(m_voi[i].sample_start), i);
154      save_item(NAME(m_voi[i].sample_end), i);
155      save_item(NAME(m_voi[i].sample_loop), i);
156   }
157137}
158138
159139
trunk/src/emu/sound/c140.h
r248389r248390
5151      sample_end(0),
5252      sample_loop(0) {}
5353
54   INT32    ptoffset;
55   INT32    pos;
56   INT32    key;
54   long    ptoffset;
55   long    pos;
56   long    key;
5757   //--work
58   INT32    lastdt;
59   INT32    prevdt;
60   INT32    dltdt;
58   long    lastdt;
59   long    prevdt;
60   long    dltdt;
6161   //--reg
62   INT32    rvol;
63   INT32    lvol;
64   INT32    frequency;
65   INT32    bank;
66   INT32    mode;
62   long    rvol;
63   long    lvol;
64   long    frequency;
65   long    bank;
66   long    mode;
6767
68   INT32    sample_start;
69   INT32    sample_end;
70   INT32    sample_loop;
68   long    sample_start;
69   long    sample_end;
70   long    sample_loop;
7171};
7272
7373
trunk/src/emu/sound/scsp.c
r248389r248390
3030*/
3131
3232#include "emu.h"
33#include "sound/cdda.h"
3433#include "scsp.h"
3534
3635
r248389r248390
10111010         v= *((unsigned short *) (m_DSP.EFREG+(addr-0xec0)/2));
10121011      else
10131012      {
1014         /**!
1015         @todo Kyuutenkai reads from 0xee0/0xee2, it's tied with EXTS register(s) also used for CD-Rom Player equalizer.
1016         This port is actually an external parallel port, directly connected from the CD Block device, hence code is a bit of an hack.
1017         Kyuutenkai code snippet for reference:
1013         /*
1014         TODO: Kyuutenkai reads from 0xee0/0xee2, it's an undocumented "DSP internal buffer" register ...
10181015         004A3A: 207C 0010 0EE0             movea.l #$100ee0, A0
10191016         004A40: 43EA 0090                  lea     ($90,A2), A1 ;A2=0x700
10201017         004A44: 6100 0254                  bsr     $4c9a
r248389r248390
10471044             004CB0: 4CDF 0002                  movem.l (A7)+, D1
10481045             004CB4: 4E75                       rts
10491046         */
1050         logerror("SCSP: Reading from EXTS register %08x\n",addr);
1047         logerror("SCSP: Reading from unmapped register %08x\n",addr);
10511048         if(addr == 0xee0)
1052            v =   space.machine().device<cdda_device>("cdda")->get_channel_volume(0);
1049            v= m_DSP.TEMP[0] >> 16;
10531050         if(addr == 0xee2)
1054            v = space.machine().device<cdda_device>("cdda")->get_channel_volume(1);
1051            v= m_DSP.TEMP[0] & 0xffff;
10551052      }
10561053   }
10571054   return v;
trunk/src/emu/sound/tms36xx.c
r248389r248390
375375      m_decay[0], m_decay[1], m_decay[2],
376376      m_decay[3], m_decay[4], m_decay[5]));
377377   LOG(("TMS36xx speed         %d\n", m_speed));
378   
379   save_item(NAME(m_octave));
380   save_item(NAME(m_tune_counter));
381   save_item(NAME(m_note_counter));
382   save_item(NAME(m_voices));
383   save_item(NAME(m_shift));
384   save_item(NAME(m_vol));
385   save_item(NAME(m_vol_counter));
386   save_item(NAME(m_counter));
387   save_item(NAME(m_frequency));
388   save_item(NAME(m_output));
389   save_item(NAME(m_enable));
390   save_item(NAME(m_tune_num));
391   save_item(NAME(m_tune_ofs));
392   save_item(NAME(m_tune_max));
393378}
394379
395380
trunk/src/emu/sound/ymf278b.c
r248389r248390
4343   TODO:
4444   - accurate timing of envelopes
4545   - LFO (vibrato, tremolo)
46   - integrate YMF262 mixing (used by Fuuki games, not used by Psikyo and Metro games)
46   - integrate YMF262 (used by Fuuki games, not used by Psikyo and Metro games)
47   - able to hook up "Moonsound", supporting mixed ROM+RAM (for MSX driver in MESS)
48     (this should be possible now by using a custom address map?)
4749*/
4850
4951#include "emu.h"
5052#include "ymf278b.h"
51#include "ymf262.h"
5253
5354#define VERBOSE 0
5455#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
r248389r248390
225226   INT32 *mixp;
226227   INT32 vl, vr;
227228
228   if (&stream == m_stream_ymf262)
229   {
230      ymf262_update_one(m_ymf262, outputs, samples);
231      return;
232   }
233
234229   memset(m_mix_buffer, 0, sizeof(m_mix_buffer[0])*samples*2);
235230
236231   for (i = 0; i < 24; i++)
r248389r248390
688683         timer_busy_start(0);
689684         m_port_AB = data;
690685         m_lastport = offset>>1 & 1;
691         ymf262_write(m_ymf262, offset, data);
692686         break;
693687
694688      case 1:
r248389r248390
696690         timer_busy_start(0);
697691         if (m_lastport) B_w(m_port_AB, data);
698692         else A_w(m_port_AB, data);
699         m_last_fm_data = data;
700         ymf262_write(m_ymf262, offset, data);
701693         break;
702694
703695      case 4:
r248389r248390
745737      case 1:
746738      case 3:
747739         // but they're not implemented here yet
748         // This may be incorrect, but it makes the mbwave moonsound detection in msx drivers pass.
749         ret = m_last_fm_data;
750740         break;
751741
752742      // PCM regs
r248389r248390
837827   m_current_irq = 0;
838828   if (!m_irq_handler.isnull())
839829      m_irq_handler(0);
840
841   ymf262_reset_chip(m_ymf262);
842830}
843831
844void ymf278b_device::device_stop()
845{
846   ymf262_shutdown(m_ymf262);
847   m_ymf262 = NULL;
848}
849
850832void ymf278b_device::precompute_rate_tables()
851833{
852834   int i;
r248389r248390
897879   save_item(NAME(m_port_AB));
898880   save_item(NAME(m_port_C));
899881   save_item(NAME(m_lastport));
900   save_item(NAME(m_last_fm_data));
901882
902883   for (i = 0; i < 24; ++i)
903884   {
r248389r248390
943924//  device_start - device-specific startup
944925//-------------------------------------------------
945926
946static void ymf278b_ymf262_irq_handler(void *param,int irq)
947{
948}
949
950
951static void ymf278b_ymf262_timer_handler(void *param, int c, const attotime &period)
952{
953}
954
955static void ymf278b_ymf262_update_request(void *param, int interval)
956{
957   ymf278b_device *ymf278b = (ymf278b_device *) param;
958   ymf278b->ymf262_update_request();
959}
960
961
962void ymf278b_device::ymf262_update_request()
963{
964   m_stream_ymf262->update();
965}
966
967
968927void ymf278b_device::device_start()
969928{
970929   int i;
r248389r248390
1010969
1011970   // Register state for saving
1012971   register_save_state();
1013
1014   // YMF262 related
1015
1016   /* stream system initialize */
1017   int ymf262_clock = clock() / (19/8.0);
1018   m_ymf262 = ymf262_init(this, ymf262_clock, ymf262_clock / 288);
1019   assert_always(m_ymf262 != NULL, "Error creating YMF262 chip");
1020
1021   m_stream_ymf262 = machine().sound().stream_alloc(*this, 0, 4, ymf262_clock / 288);
1022
1023   /* YMF262 setup */
1024   ymf262_set_timer_handler (m_ymf262, ymf278b_ymf262_timer_handler, this);
1025   ymf262_set_irq_handler   (m_ymf262, ymf278b_ymf262_irq_handler, this);
1026   ymf262_set_update_handler(m_ymf262, ymf278b_ymf262_update_request, this);
1027972}
1028973
1029974
r248389r248390
1034979      device_sound_interface(mconfig, *this),
1035980      device_memory_interface(mconfig, *this),
1036981      m_space_config("samples", ENDIANNESS_BIG, 8, 22, 0, NULL),
1037      m_irq_handler(*this),
1038      m_last_fm_data(0)
982      m_irq_handler(*this)
1039983{
1040984   m_address_map[0] = *ADDRESS_MAP_NAME(ymf278b);
1041985}
trunk/src/emu/sound/ymf278b.h
r248389r248390
2525   DECLARE_READ8_MEMBER( read );
2626   DECLARE_WRITE8_MEMBER( write );
2727
28   void ymf262_update_request();
29
3028protected:
3129   // device-level overrides
3230   virtual void device_config_complete();
3331   virtual void device_start();
3432   virtual void device_reset();
35   virtual void device_stop();
3633
3734   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
3835
r248389r248390
134131   direct_read_data * m_direct;
135132   const address_space_config m_space_config;
136133   devcb_write_line m_irq_handler;
137   UINT8 m_last_fm_data;
138
139   // ymf262
140   void *m_ymf262;
141   sound_stream * m_stream_ymf262;
142134};
143135
144136extern const device_type YMF278B;
trunk/src/emu/video/mb_vcu.c
r248389r248390
191191            3,  resistances_gb, m_weights_b,    3600,   0,
192192            2,  resistances_r,  m_weights_r,    3600,   0);
193193   }
194   
195   save_item(NAME(m_status));
196   save_pointer(NAME(m_ram), 0x800);
197   save_pointer(NAME(m_palram), 0x100);
198   save_item(NAME(m_param_offset_latch));
199   save_item(NAME(m_xpos));
200   save_item(NAME(m_ypos));
201   save_item(NAME(m_color1));
202   save_item(NAME(m_color2));
203   save_item(NAME(m_mode));
204   save_item(NAME(m_pix_xsize));
205   save_item(NAME(m_pix_ysize));
206   save_item(NAME(m_vregs));
207   save_item(NAME(m_bk_color));
208   save_item(NAME(m_vbank));
209   save_item(NAME(m_weights_r));
210   save_item(NAME(m_weights_g));
211   save_item(NAME(m_weights_b));
212194}
213195
214196
trunk/src/emu/video/v9938.c
r248389r248390
3737   V9938_MODE_UNKNOWN
3838};
3939
40#define MODEL_V9938 (0)
41#define MODEL_V9958 (1)
42
4340#define EXPMEM_OFFSET 0x20000
4441
45#define LONG_WIDTH (512 + 32)
46
4742static const char *const v9938_modes[] = {
4843   "TEXT 1", "MULTICOLOR", "GRAPHIC 1", "GRAPHIC 2", "GRAPHIC 3",
4944   "GRAPHIC 4", "GRAPHIC 5", "GRAPHIC 6", "GRAPHIC 7", "TEXT 2",
r248389r248390
9186   m_scanline(0),
9287   m_blink(0),
9388   m_blink_count(0),
89   m_size(0),
90   m_size_old(0),
91   m_size_auto(0),
92   m_size_now(0),
9493   m_mx_delta(0),
9594   m_my_delta(0),
9695   m_button_state(0),
r248389r248390
167166   return m_int_state;
168167}
169168
169void v99x8_device::set_resolution (int i)
170{
171   if (i == RENDER_AUTO)
172   {
173      m_size_auto = 1;
174   }
175   else
176   {
177      m_size = i;
178      m_size_auto = 0;
179   }
180}
181
170182/*
171183    Not really right... won't work with sprites in graphics 7
172184    and with palette updated mid-screen
r248389r248390
557569   m_vdp_engine = NULL;
558570
559571   m_screen->register_screen_bitmap(m_bitmap);
572   m_size_old = -1;
560573
561574   // Video RAM is allocated as an own address space
562575   m_vram_space = &space(AS_DATA);
r248389r248390
589602   save_item(NAME(m_scanline));
590603   save_item(NAME(m_blink));
591604   save_item(NAME(m_blink_count));
605   save_item(NAME(m_size));
606   save_item(NAME(m_size_old));
607   save_item(NAME(m_size_auto));
608   save_item(NAME(m_size_now));
592609   save_item(NAME(m_mx_delta));
593610   save_item(NAME(m_my_delta));
594611   save_item(NAME(m_button_state));
r248389r248390
859876   return !(((m_cont_reg[9] & 0x04) && !(m_stat_reg[2] & 2)) || m_blink);
860877}
861878
879/*
880* This file is included for a number of different situations:
881* _Width : can be 512 + 32 or 256 + 16
882* V9938_BPP : can be 8 or 16
883*/
862884
863void v99x8_device::default_border(const pen_t *pens, UINT16 *ln)
885
886template<typename _PixelType, int _Width>
887void v99x8_device::default_border(const pen_t *pens, _PixelType *ln)
864888{
865   UINT16 pen;
889   _PixelType pen;
866890   int i;
867891
868892   pen = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]];
869   i = LONG_WIDTH;
893   i = _Width;
870894   while (i--) *ln++ = pen;
895
896   if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW;
871897}
872898
873void v99x8_device::graphic7_border(const pen_t *pens, UINT16 *ln)
899template<typename _PixelType, int _Width>
900void v99x8_device::graphic7_border(const pen_t *pens, _PixelType *ln)
874901{
875   UINT16 pen;
902   _PixelType pen;
876903   int i;
877904
878905   pen = pens[m_pal_ind256[m_cont_reg[7]]];
879   i = LONG_WIDTH;
906   i = _Width;
880907   while (i--) *ln++ = pen;
908
909   if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW;
881910}
882911
883void v99x8_device::graphic5_border(const pen_t *pens, UINT16 *ln)
912template<typename _PixelType, int _Width>
913void v99x8_device::graphic5_border(const pen_t *pens, _PixelType *ln)
884914{
885915   int i;
886   UINT16 pen0;
887   UINT16 pen1;
916   _PixelType pen0;
917   if (_Width > 512)
918   {
919      _PixelType pen1;
888920
889   pen1 = pens[m_pal_ind16[(m_cont_reg[7]&0x03)]];
890   pen0 = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]];
891   i = LONG_WIDTH / 2;
892   while (i--) { *ln++ = pen0; *ln++ = pen1; }
921      pen1 = pens[m_pal_ind16[(m_cont_reg[7]&0x03)]];
922      pen0 = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]];
923      i = (_Width) / 2;
924      while (i--) { *ln++ = pen0; *ln++ = pen1; }
925   }
926   else
927   {
928      pen0 = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]];
929      i = _Width;
930      while (i--) *ln++ = pen0;
931   }
932   m_size_now = RENDER_HIGH;
893933}
894934
895void v99x8_device::mode_text1(const pen_t *pens, UINT16 *ln, int line)
935template<typename _PixelType, int _Width>
936void v99x8_device::mode_text1(const pen_t *pens, _PixelType *ln, int line)
896937{
897938   int pattern, x, xx, name, xxx;
898   UINT16 fg, bg, pen;
939   _PixelType fg, bg, pen;
899940   int nametbl_addr, patterntbl_addr;
900941
901942   patterntbl_addr = m_cont_reg[4] << 11;
r248389r248390
908949
909950   pen = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]];
910951
911   xxx = (m_offset_x + 8) * 2;
952   xxx = m_offset_x + 8;
953   if (_Width > 512)
954      xxx *= 2;
912955   while (xxx--) *ln++ = pen;
913956
914957   for (x=0;x<40;x++)
r248389r248390
918961      for (xx=0;xx<6;xx++)
919962      {
920963         *ln++ = (pattern & 0x80) ? fg : bg;
921         *ln++ = (pattern & 0x80) ? fg : bg;
964         if (_Width > 512)
965            *ln++ = (pattern & 0x80) ? fg : bg;
922966         pattern <<= 1;
923967      }
924968      /* width height 212, characters start repeating at the bottom */
925969      name = (name + 1) & 0x3ff;
926970   }
927971
928   xxx = ((16 - m_offset_x) + 8) * 2;
972   xxx = (16 - m_offset_x) + 8;
973   if (_Width > 512)
974      xxx *= 2;
929975   while (xxx--) *ln++ = pen;
976   if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW;
930977}
931978
932void v99x8_device::mode_text2(const pen_t *pens, UINT16 *ln, int line)
979template<typename _PixelType, int _Width>
980void v99x8_device::mode_text2(const pen_t *pens, _PixelType *ln, int line)
933981{
934982   int pattern, x, charcode, name, xxx, patternmask, colourmask;
935   UINT16 fg, bg, fg0, bg0, pen;
983   _PixelType fg, bg, fg0, bg0, pen;
936984   int nametbl_addr, patterntbl_addr, colourtbl_addr;
937985
938986   patterntbl_addr = m_cont_reg[4] << 11;
r248389r248390
9521000
9531001   name = (line/8)*80;
9541002
955   xxx = (m_offset_x + 8) * 2;
1003   xxx = m_offset_x + 8;
9561004   pen = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]];
1005   if (_Width > 512)
1006      xxx *= 2;
9571007   while (xxx--) *ln++ = pen;
9581008
9591009   for (x=0;x<80;x++)
r248389r248390
9671017            pattern = m_vram_space->read_byte(patterntbl_addr + ((charcode * 8) +
9681018               ((line + m_cont_reg[23]) & 7)));
9691019
970            *ln++ = (pattern & 0x80) ? fg0 : bg0;
971            *ln++ = (pattern & 0x40) ? fg0 : bg0;
972            *ln++ = (pattern & 0x20) ? fg0 : bg0;
973            *ln++ = (pattern & 0x10) ? fg0 : bg0;
974            *ln++ = (pattern & 0x08) ? fg0 : bg0;
975            *ln++ = (pattern & 0x04) ? fg0 : bg0;
1020            if (_Width > 512)
1021            {
1022               *ln++ = (pattern & 0x80) ? fg0 : bg0;
1023               *ln++ = (pattern & 0x40) ? fg0 : bg0;
1024               *ln++ = (pattern & 0x20) ? fg0 : bg0;
1025               *ln++ = (pattern & 0x10) ? fg0 : bg0;
1026               *ln++ = (pattern & 0x08) ? fg0 : bg0;
1027               *ln++ = (pattern & 0x04) ? fg0 : bg0;
1028            }
1029            else
1030            {
1031               *ln++ = (pattern & 0x80) ? fg0 : bg0;
1032               *ln++ = (pattern & 0x20) ? fg0 : bg0;
1033               *ln++ = (pattern & 0x08) ? fg0 : bg0;
1034            }
9761035
9771036            name++;
9781037            continue;
r248389r248390
9821041      pattern = m_vram_space->read_byte(patterntbl_addr + ((charcode * 8) +
9831042         ((line + m_cont_reg[23]) & 7)));
9841043
985      *ln++ = (pattern & 0x80) ? fg : bg;
986      *ln++ = (pattern & 0x40) ? fg : bg;
987      *ln++ = (pattern & 0x20) ? fg : bg;
988      *ln++ = (pattern & 0x10) ? fg : bg;
989      *ln++ = (pattern & 0x08) ? fg : bg;
990      *ln++ = (pattern & 0x04) ? fg : bg;
1044      if (_Width > 512)
1045      {
1046         *ln++ = (pattern & 0x80) ? fg : bg;
1047         *ln++ = (pattern & 0x40) ? fg : bg;
1048         *ln++ = (pattern & 0x20) ? fg : bg;
1049         *ln++ = (pattern & 0x10) ? fg : bg;
1050         *ln++ = (pattern & 0x08) ? fg : bg;
1051         *ln++ = (pattern & 0x04) ? fg : bg;
1052      }
1053      else
1054      {
1055         *ln++ = (pattern & 0x80) ? fg : bg;
1056         *ln++ = (pattern & 0x20) ? fg : bg;
1057         *ln++ = (pattern & 0x08) ? fg : bg;
1058      }
9911059
9921060      name++;
9931061   }
9941062
995   xxx = (16 - m_offset_x + 8) * 2;
1063   xxx = 16  - m_offset_x + 8;
1064   if (_Width > 512)
1065      xxx *= 2;
9961066   while (xxx--) *ln++ = pen;
1067   m_size_now = RENDER_HIGH;
9971068}
9981069
999void v99x8_device::mode_multi(const pen_t *pens, UINT16 *ln, int line)
1070template<typename _PixelType, int _Width>
1071void v99x8_device::mode_multi(const pen_t *pens, _PixelType *ln, int line)
10001072{
10011073   int nametbl_addr, patterntbl_addr, colour;
10021074   int name, line2, x, xx;
1003   UINT16 pen, pen_bg;
1075   _PixelType pen, pen_bg;
10041076
10051077   nametbl_addr = (m_cont_reg[2] << 10);
10061078   patterntbl_addr = (m_cont_reg[4] << 11);
r248389r248390
10091081   name = (line2/8)*32;
10101082
10111083   pen_bg = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]];
1012   xx = m_offset_x * 2;
1084   if (_Width < 512)
1085      xx = m_offset_x;
1086   else
1087      xx = m_offset_x * 2;
10131088   while (xx--) *ln++ = pen_bg;
10141089
10151090   for (x=0;x<32;x++)
r248389r248390
10211096      *ln++ = pen;
10221097      *ln++ = pen;
10231098      *ln++ = pen;
1024      *ln++ = pen;
1025      *ln++ = pen;
1026      *ln++ = pen;
1027      *ln++ = pen;
1099      if (_Width > 512)
1100      {
1101         *ln++ = pen;
1102         *ln++ = pen;
1103         *ln++ = pen;
1104         *ln++ = pen;
1105      }
10281106      pen = pens[m_pal_ind16[colour&15]];
10291107      /* eight pixels */
10301108      *ln++ = pen;
10311109      *ln++ = pen;
10321110      *ln++ = pen;
10331111      *ln++ = pen;
1034      *ln++ = pen;
1035      *ln++ = pen;
1036      *ln++ = pen;
1037      *ln++ = pen;
1112      if (_Width > 512)
1113      {
1114         *ln++ = pen;
1115         *ln++ = pen;
1116         *ln++ = pen;
1117         *ln++ = pen;
1118      }
10381119      name++;
10391120   }
10401121
1041   xx = (16 - m_offset_x) * 2;
1122   xx = 16 - m_offset_x;
1123   if (_Width > 512)
1124      xx *= 2;
10421125   while (xx--) *ln++ = pen_bg;
1126   if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW;
10431127}
10441128
1045void v99x8_device::mode_graphic1(const pen_t *pens, UINT16 *ln, int line)
1129template<typename _PixelType, int _Width>
1130void v99x8_device::mode_graphic1(const pen_t *pens, _PixelType *ln, int line)
10461131{
1047   UINT16 fg, bg, pen;
1132   _PixelType fg, bg, pen;
10481133   int nametbl_addr, patterntbl_addr, colourtbl_addr;
10491134   int pattern, x, xx, line2, name, charcode, colour, xxx;
10501135
r248389r248390
10571142   name = (line2/8)*32;
10581143
10591144   pen = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]];
1060   xxx = m_offset_x * 2;
1145   if (_Width < 512)
1146      xxx = m_offset_x;
1147   else
1148      xxx = m_offset_x * 2;
10611149   while (xxx--) *ln++ = pen;
10621150
10631151   for (x=0;x<32;x++)
r248389r248390
10711159      for (xx=0;xx<8;xx++)
10721160      {
10731161         *ln++ = (pattern & 0x80) ? fg : bg;
1074         *ln++ = (pattern & 0x80) ? fg : bg;
1162         if (_Width > 512)
1163            *ln++ = (pattern & 0x80) ? fg : bg;
10751164         pattern <<= 1;
10761165      }
10771166      name++;
10781167   }
10791168
1080   xx = (16 - m_offset_x) * 2;
1169   xx = 16 - m_offset_x;
1170   if (_Width > 512)
1171      xx *= 2;
10811172   while (xx--) *ln++ = pen;
1173   if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW;
10821174}
10831175
1084void v99x8_device::mode_graphic23(const pen_t *pens, UINT16 *ln, int line)
1176template<typename _PixelType, int _Width>
1177void v99x8_device::mode_graphic23(const pen_t *pens, _PixelType *ln, int line)
10851178{
1086   UINT16 fg, bg, pen;
1179   _PixelType fg, bg, pen;
10871180   int nametbl_addr, patterntbl_addr, colourtbl_addr;
10881181   int pattern, x, xx, line2, name, charcode,
10891182   colour, colourmask, patternmask, xxx;
10901183
1091   colourmask = ((m_cont_reg[3] & 0x7f) * 8) | 7;
1092   patternmask = ((m_cont_reg[4] & 0x03) * 256) | 0xff;
1184   colourmask = (m_cont_reg[3] & 0x7f) * 8 | 7;
1185   patternmask = (m_cont_reg[4] & 0x03) * 256 | (colourmask & 255);
10931186
10941187   nametbl_addr =  (m_cont_reg[2] << 10);
10951188   colourtbl_addr =  ((m_cont_reg[3] & 0x80) << 6) + (m_cont_reg[10] << 14);
r248389r248390
10991192   name = (line2/8)*32;
11001193
11011194   pen = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]];
1102   xxx = m_offset_x * 2;
1195   if (_Width < 512)
1196      xxx = m_offset_x;
1197   else
1198      xxx = m_offset_x * 2;
11031199   while (xxx--) *ln++ = pen;
11041200
11051201   for (x=0;x<32;x++)
r248389r248390
11121208      for (xx=0;xx<8;xx++)
11131209      {
11141210         *ln++ = (pattern & 0x80) ? fg : bg;
1115         *ln++ = (pattern & 0x80) ? fg : bg;
1211         if (_Width > 512)
1212            *ln++ = (pattern & 0x80) ? fg : bg;
11161213         pattern <<= 1;
11171214      }
11181215      name++;
11191216   }
11201217
1121   xx = (16 - m_offset_x) * 2;
1218   xx = 16 - m_offset_x;
1219   if (_Width > 512)
1220      xx *= 2;
11221221   while (xx--) *ln++ = pen;
1222   if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW;
11231223}
11241224
1125void v99x8_device::mode_graphic4(const pen_t *pens, UINT16 *ln, int line)
1225template<typename _PixelType, int _Width>
1226void v99x8_device::mode_graphic4(const pen_t *pens, _PixelType *ln, int line)
11261227{
11271228   int nametbl_addr, colour;
11281229   int line2, linemask, x, xx;
1129   UINT16 pen, pen_bg;
1230   _PixelType pen, pen_bg;
11301231
11311232   linemask = ((m_cont_reg[2] & 0x1f) << 3) | 7;
11321233
r248389r248390
11371238      nametbl_addr += 0x8000;
11381239
11391240   pen_bg = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]];
1140   xx = m_offset_x * 2;
1241   if (_Width < 512)
1242      xx = m_offset_x;
1243   else
1244      xx = m_offset_x * 2;
11411245   while (xx--) *ln++ = pen_bg;
11421246
11431247   for (x=0;x<128;x++)
r248389r248390
11451249      colour = m_vram_space->read_byte(nametbl_addr++);
11461250      pen = pens[m_pal_ind16[colour>>4]];
11471251      *ln++ = pen;
1148      *ln++ = pen;
1252      if (_Width > 512)
1253         *ln++ = pen;
11491254      pen = pens[m_pal_ind16[colour&15]];
11501255      *ln++ = pen;
1151      *ln++ = pen;
1256      if (_Width > 512)
1257         *ln++ = pen;
11521258   }
11531259
1154   xx = (16 - m_offset_x) * 2;
1260   xx = 16 - m_offset_x;
1261   if (_Width > 512)
1262      xx *= 2;
11551263   while (xx--) *ln++ = pen_bg;
1264   if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW;
11561265}
11571266
1158void v99x8_device::mode_graphic5(const pen_t *pens, UINT16 *ln, int line)
1267template<typename _PixelType, int _Width>
1268void v99x8_device::mode_graphic5(const pen_t *pens, _PixelType *ln, int line)
11591269{
11601270   int nametbl_addr, colour;
11611271   int line2, linemask, x, xx;
1162   UINT16 pen_bg0[4];
1163   UINT16 pen_bg1[4];
1272   _PixelType pen_bg0[4];
1273   _PixelType pen_bg1[4];
11641274
11651275   linemask = ((m_cont_reg[2] & 0x1f) << 3) | 7;
11661276
r248389r248390
11701280   if ( (m_cont_reg[2] & 0x20) && v9938_second_field() )
11711281      nametbl_addr += 0x8000;
11721282
1173   pen_bg1[0] = pens[m_pal_ind16[(m_cont_reg[7]&0x03)]];
1174   pen_bg0[0] = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]];
1283   if (_Width > 512)
1284   {
1285      pen_bg1[0] = pens[m_pal_ind16[(m_cont_reg[7]&0x03)]];
1286      pen_bg0[0] = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]];
11751287
1176   xx = m_offset_x;
1177   while (xx--) { *ln++ = pen_bg0[0]; *ln++ = pen_bg1[0]; }
1288      xx = m_offset_x;
1289      while (xx--) { *ln++ = pen_bg0[0]; *ln++ = pen_bg1[0]; }
11781290
1179   x = (m_cont_reg[8] & 0x20) ? 0 : 1;
1291      x = (m_cont_reg[8] & 0x20) ? 0 : 1;
11801292
1181   for (;x<4;x++)
1182   {
1183      pen_bg0[x] = pens[m_pal_ind16[x]];
1184      pen_bg1[x] = pens[m_pal_ind16[x]];
1293      for (;x<4;x++)
1294      {
1295         pen_bg0[x] = pens[m_pal_ind16[x]];
1296         pen_bg1[x] = pens[m_pal_ind16[x]];
1297      }
1298
1299      for (x=0;x<128;x++)
1300      {
1301         colour = m_vram_space->read_byte(nametbl_addr++);
1302
1303         *ln++ = pen_bg0[colour>>6];
1304         *ln++ = pen_bg1[(colour>>4)&3];
1305         *ln++ = pen_bg0[(colour>>2)&3];
1306         *ln++ = pen_bg1[(colour&3)];
1307      }
1308
1309      pen_bg1[0] = pens[m_pal_ind16[(m_cont_reg[7]&0x03)]];
1310      pen_bg0[0] = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]];
1311      xx = 16 - m_offset_x;
1312      while (xx--) { *ln++ = pen_bg0[0]; *ln++ = pen_bg1[0]; }
11851313   }
1186
1187   for (x=0;x<128;x++)
1314   else
11881315   {
1189      colour = m_vram_space->read_byte(nametbl_addr++);
1316      pen_bg0[0] = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]];
11901317
1191      *ln++ = pen_bg0[colour>>6];
1192      *ln++ = pen_bg1[(colour>>4)&3];
1193      *ln++ = pen_bg0[(colour>>2)&3];
1194      *ln++ = pen_bg1[(colour&3)];
1318      x = (m_cont_reg[8] & 0x20) ? 0 : 1;
1319
1320      for (;x<4;x++)
1321         pen_bg0[x] = pens[m_pal_ind16[x]];
1322
1323      xx = m_offset_x;
1324      while (xx--) *ln++ = pen_bg0[0];
1325
1326      for (x=0;x<128;x++)
1327      {
1328         colour = m_vram_space->read_byte(nametbl_addr++);
1329         *ln++ = pen_bg0[colour>>6];
1330         *ln++ = pen_bg0[(colour>>2)&3];
1331      }
1332
1333      pen_bg0[0] = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]];
1334      xx = 16 - m_offset_x;
1335      while (xx--) *ln++ = pen_bg0[0];
11951336   }
1196
1197   pen_bg1[0] = pens[m_pal_ind16[(m_cont_reg[7]&0x03)]];
1198   pen_bg0[0] = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]];
1199   xx = 16 - m_offset_x;
1200   while (xx--) { *ln++ = pen_bg0[0]; *ln++ = pen_bg1[0]; }
1337   m_size_now = RENDER_HIGH;
12011338}
12021339
1203void v99x8_device::mode_graphic6(const pen_t *pens, UINT16 *ln, int line)
1340template<typename _PixelType, int _Width>
1341void v99x8_device::mode_graphic6(const pen_t *pens, _PixelType *ln, int line)
12041342{
12051343   UINT8 colour;
12061344   int line2, linemask, x, xx, nametbl_addr;
1207   UINT16 pen_bg, fg0;
1208   UINT16 fg1;
1345   _PixelType pen_bg, fg0;
1346   _PixelType fg1;
12091347
12101348   linemask = ((m_cont_reg[2] & 0x1f) << 3) | 7;
12111349
r248389r248390
12161354      nametbl_addr += 0x10000;
12171355
12181356   pen_bg = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]];
1219   xx = m_offset_x * 2;
1357   if (_Width < 512)
1358      xx = m_offset_x;
1359   else
1360      xx = m_offset_x * 2;
12201361   while (xx--) *ln++ = pen_bg;
12211362
12221363   if (m_cont_reg[2] & 0x40)
r248389r248390
12261367         nametbl_addr++;
12271368         colour = m_vram_space->read_byte(((nametbl_addr&1) << 16) | (nametbl_addr>>1));
12281369         fg0 = pens[m_pal_ind16[colour>>4]];
1229         fg1 = pens[m_pal_ind16[colour&15]];
1230         *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1;
1231         *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1;
1232         *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1;
1233         *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1;
1370         if (_Width < 512)
1371         {
1372            *ln++ = fg0; *ln++ = fg0;
1373            *ln++ = fg0; *ln++ = fg0;
1374            *ln++ = fg0; *ln++ = fg0;
1375            *ln++ = fg0; *ln++ = fg0;
1376         }
1377         else
1378         {
1379            fg1 = pens[m_pal_ind16[colour&15]];
1380            *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1;
1381            *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1;
1382            *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1;
1383            *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1;
1384         }
12341385         nametbl_addr += 7;
12351386      }
12361387   }
r248389r248390
12401391      {
12411392         colour = m_vram_space->read_byte(((nametbl_addr&1) << 16) | (nametbl_addr>>1));
12421393         *ln++ = pens[m_pal_ind16[colour>>4]];
1243         *ln++ = pens[m_pal_ind16[colour&15]];
1394         if (_Width > 512)
1395            *ln++ = pens[m_pal_ind16[colour&15]];
12441396         nametbl_addr++;
12451397      }
12461398   }
12471399
1248   xx = (16 - m_offset_x) * 2;
1400   xx = 16 - m_offset_x;
1401   if (_Width > 512)
1402      xx *= 2;
12491403   while (xx--) *ln++ = pen_bg;
1404   m_size_now = RENDER_HIGH;
12501405}
12511406
1252void v99x8_device::mode_graphic7(const pen_t *pens, UINT16 *ln, int line)
1407template<typename _PixelType, int _Width>
1408void v99x8_device::mode_graphic7(const pen_t *pens, _PixelType *ln, int line)
12531409{
12541410   UINT8 colour;
12551411   int line2, linemask, x, xx, nametbl_addr;
1256   UINT16 pen, pen_bg;
1412   _PixelType pen, pen_bg;
12571413
12581414   linemask = ((m_cont_reg[2] & 0x1f) << 3) | 7;
12591415
r248389r248390
12641420      nametbl_addr += 0x10000;
12651421
12661422   pen_bg = pens[m_pal_ind256[m_cont_reg[7]]];
1267   xx = m_offset_x * 2;
1423   if (_Width < 512)
1424      xx = m_offset_x;
1425   else
1426      xx = m_offset_x * 2;
12681427   while (xx--) *ln++ = pen_bg;
12691428
12701429   if ((m_v9958_sp_mode & 0x18) == 0x08) // v9958 screen 12, puzzle star title screen
r248389r248390
12861445         (colour[2] & 7) << 5 | (colour[3] & 7) << 8;
12871446
12881447         *ln++ = s_pal_indYJK[ind | ((colour[0] >> 3) & 31)];
1289         *ln++ = s_pal_indYJK[ind | ((colour[0] >> 3) & 31)];
1448         if (_Width > 512)
1449            *ln++ = s_pal_indYJK[ind | ((colour[0] >> 3) & 31)];
12901450
12911451         *ln++ = s_pal_indYJK[ind | ((colour[1] >> 3) & 31)];
1292         *ln++ = s_pal_indYJK[ind | ((colour[1] >> 3) & 31)];
12931452
1453         if (_Width > 512)
1454            *ln++ = s_pal_indYJK[ind | ((colour[1] >> 3) & 31)];
1455
12941456         *ln++ = s_pal_indYJK[ind | ((colour[2] >> 3) & 31)];
1295         *ln++ = s_pal_indYJK[ind | ((colour[2] >> 3) & 31)];
12961457
1458         if (_Width > 512)
1459            *ln++ = s_pal_indYJK[ind | ((colour[2] >> 3) & 31)];
1460
12971461         *ln++ = s_pal_indYJK[ind | ((colour[3] >> 3) & 31)];
1298         *ln++ = s_pal_indYJK[ind | ((colour[3] >> 3) & 31)];
12991462
1463         if (_Width > 512)
1464            *ln++ = s_pal_indYJK[ind | ((colour[3] >> 3) & 31)];
1465
13001466         nametbl_addr++;
13011467      }
13021468   }
r248389r248390
13191485         (colour[2] & 7) << 5 | (colour[3] & 7) << 8;
13201486
13211487         *ln++ = colour[0] & 8 ? m_pal_ind16[colour[0] >> 4] : s_pal_indYJK[ind | ((colour[0] >> 3) & 30)];
1322         *ln++ = colour[0] & 8 ? m_pal_ind16[colour[0] >> 4] : s_pal_indYJK[ind | ((colour[0] >> 3) & 30)];
1488         if (_Width > 512)
1489            *ln++ = colour[0] & 8 ? m_pal_ind16[colour[0] >> 4] : s_pal_indYJK[ind | ((colour[0] >> 3) & 30)];
13231490
13241491         *ln++ = colour[1] & 8 ? m_pal_ind16[colour[1] >> 4] : s_pal_indYJK[ind | ((colour[1] >> 3) & 30)];
1325         *ln++ = colour[1] & 8 ? m_pal_ind16[colour[1] >> 4] : s_pal_indYJK[ind | ((colour[1] >> 3) & 30)];
13261492
1493         if (_Width > 512)
1494            *ln++ = colour[1] & 8 ? m_pal_ind16[colour[1] >> 4] : s_pal_indYJK[ind | ((colour[1] >> 3) & 30)];
1495
13271496         *ln++ = colour[2] & 8 ? m_pal_ind16[colour[2] >> 4] : s_pal_indYJK[ind | ((colour[2] >> 3) & 30)];
1328         *ln++ = colour[2] & 8 ? m_pal_ind16[colour[2] >> 4] : s_pal_indYJK[ind | ((colour[2] >> 3) & 30)];
13291497
1498         if (_Width > 512)
1499            *ln++ = colour[2] & 8 ? m_pal_ind16[colour[2] >> 4] : s_pal_indYJK[ind | ((colour[2] >> 3) & 30)];
1500
13301501         *ln++ = colour[3] & 8 ? m_pal_ind16[colour[3] >> 4] : s_pal_indYJK[ind | ((colour[3] >> 3) & 30)];
1331         *ln++ = colour[3] & 8 ? m_pal_ind16[colour[3] >> 4] : s_pal_indYJK[ind | ((colour[3] >> 3) & 30)];
13321502
1503         if (_Width > 512)
1504            *ln++ = colour[3] & 8 ? m_pal_ind16[colour[3] >> 4] : s_pal_indYJK[ind | ((colour[3] >> 3) & 30)];
1505
13331506         nametbl_addr++;
13341507      }
13351508   }
r248389r248390
13441517         *ln++ = pen; *ln++ = pen;
13451518         *ln++ = pen; *ln++ = pen;
13461519         *ln++ = pen; *ln++ = pen;
1347         *ln++ = pen; *ln++ = pen;
1348         *ln++ = pen; *ln++ = pen;
1349         *ln++ = pen; *ln++ = pen;
1350         *ln++ = pen; *ln++ = pen;
1520         if (_Width > 512)
1521         {
1522            *ln++ = pen; *ln++ = pen;
1523            *ln++ = pen; *ln++ = pen;
1524            *ln++ = pen; *ln++ = pen;
1525            *ln++ = pen; *ln++ = pen;
1526         }
13511527         nametbl_addr++;
13521528      }
13531529   }
r248389r248390
13581534         colour = m_vram_space->read_byte(((nametbl_addr&1) << 16) | (nametbl_addr>>1));
13591535         pen = pens[m_pal_ind256[colour]];
13601536         *ln++ = pen;
1361         *ln++ = pen;
1537         if (_Width > 512)
1538            *ln++ = pen;
13621539         nametbl_addr++;
13631540      }
13641541   }
13651542
1366   xx = (16 - m_offset_x) * 2;
1543   xx = 16 - m_offset_x;
1544   if (_Width > 512)
1545      xx *= 2;
13671546   while (xx--) *ln++ = pen_bg;
1547   if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW;
13681548}
13691549
1370void v99x8_device::mode_unknown(const pen_t *pens, UINT16 *ln, int line)
1550template<typename _PixelType, int _Width>
1551void v99x8_device::mode_unknown(const pen_t *pens, _PixelType *ln, int line)
13711552{
1372   UINT16 fg, bg;
1553   _PixelType fg, bg;
13731554   int x;
13741555
13751556   fg = pens[m_pal_ind16[m_cont_reg[7] >> 4]];
13761557   bg = pens[m_pal_ind16[m_cont_reg[7] & 15]];
13771558
1378   x = m_offset_x * 2;
1379   while (x--) *ln++ = bg;
1559   if (_Width < 512)
1560   {
1561      x = m_offset_x;
1562      while (x--) *ln++ = bg;
13801563
1381   x = 512;
1382   while (x--) *ln++ = fg;
1564      x = 256;
1565      while (x--) *ln++ = fg;
13831566
1384   x = (16 - m_offset_x) * 2;
1385   while (x--) *ln++ = bg;
1567      x = 16 - m_offset_x;
1568      while (x--) *ln++ = bg;
1569   }
1570   else
1571   {
1572      x = m_offset_x * 2;
1573      while (x--) *ln++ = bg;
1574
1575      x = 512;
1576      while (x--) *ln++ = fg;
1577
1578      x = (16 - m_offset_x) * 2;
1579      while (x--) *ln++ = bg;
1580   }
1581   if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW;
13861582}
13871583
1388void v99x8_device::default_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col)
1584template<typename _PixelType, int _Width>
1585void v99x8_device::default_draw_sprite(const pen_t *pens, _PixelType *ln, UINT8 *col)
13891586{
13901587   int i;
1391   ln += m_offset_x * 2;
1588   if (_Width > 512)
1589      ln += m_offset_x * 2;
1590   else
1591      ln += m_offset_x;
13921592
13931593   for (i=0;i<256;i++)
13941594   {
13951595      if (col[i] & 0x80)
13961596      {
13971597         *ln++ = pens[m_pal_ind16[col[i]&0x0f]];
1398         *ln++ = pens[m_pal_ind16[col[i]&0x0f]];
1598         if (_Width > 512)
1599            *ln++ = pens[m_pal_ind16[col[i]&0x0f]];
13991600      }
14001601      else
14011602      {
1402         ln += 2;
1603         if (_Width > 512)
1604            ln += 2;
1605         else
1606            ln++;
14031607      }
14041608   }
14051609}
1406
1407void v99x8_device::graphic5_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col)
1610template<typename _PixelType, int _Width>
1611void v99x8_device::graphic5_draw_sprite(const pen_t *pens, _PixelType *ln, UINT8 *col)
14081612{
14091613   int i;
1410   ln += m_offset_x * 2;
1614   if (_Width > 512)
1615      ln += m_offset_x * 2;
1616   else
1617      ln += m_offset_x;
14111618
14121619   for (i=0;i<256;i++)
14131620   {
14141621      if (col[i] & 0x80)
14151622      {
14161623         *ln++ = pens[m_pal_ind16[(col[i]>>2)&0x03]];
1417         *ln++ = pens[m_pal_ind16[col[i]&0x03]];
1624         if (_Width > 512)
1625            *ln++ = pens[m_pal_ind16[col[i]&0x03]];
14181626      }
14191627      else
14201628      {
1421         ln += 2;
1629         if (_Width > 512)
1630            ln += 2;
1631         else
1632            ln++;
14221633      }
14231634   }
14241635}
14251636
14261637
1427void v99x8_device::graphic7_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col)
1638template<typename _PixelType, int _Width>
1639void v99x8_device::graphic7_draw_sprite(const pen_t *pens, _PixelType *ln, UINT8 *col)
14281640{
14291641   static const UINT16 g7_ind16[16] = {
14301642      0, 2, 192, 194, 48, 50, 240, 242,
14311643   482, 7, 448, 455, 56, 63, 504, 511  };
14321644   int i;
14331645
1434   ln += m_offset_x * 2;
1646   if (_Width > 512)
1647      ln += m_offset_x * 2;
1648   else
1649      ln += m_offset_x;
14351650
14361651   for (i=0;i<256;i++)
14371652   {
14381653      if (col[i] & 0x80)
14391654      {
14401655         *ln++ = pens[g7_ind16[col[i]&0x0f]];
1441         *ln++ = pens[g7_ind16[col[i]&0x0f]];
1656         if (_Width > 512)
1657            *ln++ = pens[g7_ind16[col[i]&0x0f]];
14421658      }
14431659      else
14441660      {
1445         ln += 2;
1661         if (_Width > 512)
1662            ln += 2;
1663         else
1664            ln++;
14461665      }
14471666   }
14481667}
r248389r248390
16981917      m_stat_reg[0] = (m_stat_reg[0] & 0xa0) | p;
16991918}
17001919
1920#define SHORT_WIDTH (256 + 16)
1921#define LONG_WIDTH (512 + 32)
17011922
17021923const v99x8_device::v99x8_mode v99x8_device::s_modes[] = {
17031924   { 0x02,
1704      &v99x8_device::mode_text1,
1705      &v99x8_device::default_border,
1925      &v99x8_device::mode_text1<UINT16, LONG_WIDTH>,
1926      &v99x8_device::mode_text1<UINT16, SHORT_WIDTH>,
1927      &v99x8_device::default_border<UINT16, LONG_WIDTH>,
1928      &v99x8_device::default_border<UINT16, SHORT_WIDTH>,
17061929      NULL,
1707      NULL
1708   },
1930      NULL,
1931   NULL },
17091932   { 0x01,
1710      &v99x8_device::mode_multi,
1711      &v99x8_device::default_border,
1933      &v99x8_device::mode_multi<UINT16, LONG_WIDTH>,
1934      &v99x8_device::mode_multi<UINT16, SHORT_WIDTH>,
1935      &v99x8_device::default_border<UINT16, LONG_WIDTH>,
1936      &v99x8_device::default_border<UINT16, SHORT_WIDTH>,
17121937      &v99x8_device::sprite_mode1,
1713      &v99x8_device::default_draw_sprite
1714   },
1938      &v99x8_device::default_draw_sprite<UINT16, LONG_WIDTH>,
1939   &v99x8_device::default_draw_sprite<UINT16, SHORT_WIDTH> },
17151940   { 0x00,
1716      &v99x8_device::mode_graphic1,
1717      &v99x8_device::default_border,
1941      &v99x8_device::mode_graphic1<UINT16, LONG_WIDTH>,
1942      &v99x8_device::mode_graphic1<UINT16, SHORT_WIDTH>,
1943      &v99x8_device::default_border<UINT16, LONG_WIDTH>,
1944      &v99x8_device::default_border<UINT16, SHORT_WIDTH>,
17181945      &v99x8_device::sprite_mode1,
1719      &v99x8_device::default_draw_sprite
1720   },
1946      &v99x8_device::default_draw_sprite<UINT16, LONG_WIDTH>,
1947   &v99x8_device::default_draw_sprite<UINT16, SHORT_WIDTH> },
17211948   { 0x04,
1722      &v99x8_device::mode_graphic23,
1723      &v99x8_device::default_border,
1949      &v99x8_device::mode_graphic23<UINT16, LONG_WIDTH>,
1950      &v99x8_device::mode_graphic23<UINT16, SHORT_WIDTH>,
1951      &v99x8_device::default_border<UINT16, LONG_WIDTH>,
1952      &v99x8_device::default_border<UINT16, SHORT_WIDTH>,
17241953      &v99x8_device::sprite_mode1,
1725      &v99x8_device::default_draw_sprite
1726   },
1954      &v99x8_device::default_draw_sprite<UINT16, LONG_WIDTH>,
1955   &v99x8_device::default_draw_sprite<UINT16, SHORT_WIDTH> },
17271956   { 0x08,
1728      &v99x8_device::mode_graphic23,
1729      &v99x8_device::default_border,
1957      &v99x8_device::mode_graphic23<UINT16, LONG_WIDTH>,
1958      &v99x8_device::mode_graphic23<UINT16, SHORT_WIDTH>,
1959      &v99x8_device::default_border<UINT16, LONG_WIDTH>,
1960      &v99x8_device::default_border<UINT16, SHORT_WIDTH>,
17301961      &v99x8_device::sprite_mode2,
1731      &v99x8_device::default_draw_sprite
1732   },
1962      &v99x8_device::default_draw_sprite<UINT16, LONG_WIDTH>,
1963   &v99x8_device::default_draw_sprite<UINT16, SHORT_WIDTH> },
17331964   { 0x0c,
1734      &v99x8_device::mode_graphic4,
1735      &v99x8_device::default_border,
1965      &v99x8_device::mode_graphic4<UINT16, LONG_WIDTH>,
1966      &v99x8_device::mode_graphic4<UINT16, SHORT_WIDTH>,
1967      &v99x8_device::default_border<UINT16, LONG_WIDTH>,
1968      &v99x8_device::default_border<UINT16, SHORT_WIDTH>,
17361969      &v99x8_device::sprite_mode2,
1737      &v99x8_device::default_draw_sprite
1738   },
1970      &v99x8_device::default_draw_sprite<UINT16, LONG_WIDTH>,
1971   &v99x8_device::default_draw_sprite<UINT16, SHORT_WIDTH> },
17391972   { 0x10,
1740      &v99x8_device::mode_graphic5,
1741      &v99x8_device::graphic5_border,
1973      &v99x8_device::mode_graphic5<UINT16, LONG_WIDTH>,
1974      &v99x8_device::mode_graphic5<UINT16, SHORT_WIDTH>,
1975      &v99x8_device::graphic5_border<UINT16, LONG_WIDTH>,
1976      &v99x8_device::graphic5_border<UINT16, SHORT_WIDTH>,
17421977      &v99x8_device::sprite_mode2,
1743      &v99x8_device::graphic5_draw_sprite
1744   },
1978      &v99x8_device::graphic5_draw_sprite<UINT16, LONG_WIDTH>,
1979   &v99x8_device::graphic5_draw_sprite<UINT16, SHORT_WIDTH> },
17451980   { 0x14,
1746      &v99x8_device::mode_graphic6,
1747      &v99x8_device::default_border,
1981      &v99x8_device::mode_graphic6<UINT16, LONG_WIDTH>,
1982      &v99x8_device::mode_graphic6<UINT16, SHORT_WIDTH>,
1983      &v99x8_device::default_border<UINT16, LONG_WIDTH>,
1984      &v99x8_device::default_border<UINT16, SHORT_WIDTH>,
17481985      &v99x8_device::sprite_mode2,
1749      &v99x8_device::default_draw_sprite
1750   },
1986      &v99x8_device::default_draw_sprite<UINT16, LONG_WIDTH>,
1987   &v99x8_device::default_draw_sprite<UINT16, SHORT_WIDTH> },
17511988   { 0x1c,
1752      &v99x8_device::mode_graphic7,
1753      &v99x8_device::graphic7_border,
1989      &v99x8_device::mode_graphic7<UINT16, LONG_WIDTH>,
1990      &v99x8_device::mode_graphic7<UINT16, SHORT_WIDTH>,
1991      &v99x8_device::graphic7_border<UINT16, LONG_WIDTH>,
1992      &v99x8_device::graphic7_border<UINT16, SHORT_WIDTH>,
17541993      &v99x8_device::sprite_mode2,
1755      &v99x8_device::graphic7_draw_sprite
1756   },
1994      &v99x8_device::graphic7_draw_sprite<UINT16, LONG_WIDTH>,
1995   &v99x8_device::graphic7_draw_sprite<UINT16, SHORT_WIDTH> },
17571996   { 0x0a,
1758      &v99x8_device::mode_text2,
1759      &v99x8_device::default_border,
1997      &v99x8_device::mode_text2<UINT16, LONG_WIDTH>,
1998      &v99x8_device::mode_text2<UINT16, SHORT_WIDTH>,
1999      &v99x8_device::default_border<UINT16, LONG_WIDTH>,
2000      &v99x8_device::default_border<UINT16, SHORT_WIDTH>,
17602001      NULL,
1761      NULL
1762   },
2002      NULL,
2003   NULL },
17632004   { 0xff,
1764      &v99x8_device::mode_unknown,
1765      &v99x8_device::default_border,
2005      &v99x8_device::mode_unknown<UINT16, LONG_WIDTH>,
2006      &v99x8_device::mode_unknown<UINT16, SHORT_WIDTH>,
2007      &v99x8_device::default_border<UINT16, LONG_WIDTH>,
2008      &v99x8_device::default_border<UINT16, SHORT_WIDTH>,
17662009      NULL,
1767      NULL
1768   }
2010      NULL,
2011   NULL },
17692012};
17702013
17712014void v99x8_device::set_mode()
r248389r248390
17832026void v99x8_device::refresh_16(int line)
17842027{
17852028   const pen_t *pens = m_palette->pens();
1786   bool double_lines = false;
2029   int i, double_lines;
17872030   UINT8 col[256];
17882031   UINT16 *ln, *ln2 = NULL;
17892032
1790   if (m_cont_reg[9] & 0x08)
2033   double_lines = 0;
2034
2035   if (m_size == RENDER_HIGH)
17912036   {
1792      ln = &m_bitmap.pix16(line*2+((m_stat_reg[2]>>1)&1));
2037      if (m_cont_reg[9] & 0x08)
2038      {
2039         m_size_now = RENDER_HIGH;
2040         ln = &m_bitmap.pix16(line*2+((m_stat_reg[2]>>1)&1));
2041      }
2042      else
2043      {
2044         ln = &m_bitmap.pix16(line*2);
2045         ln2 = &m_bitmap.pix16(line*2+1);
2046         double_lines = 1;
2047      }
17932048   }
17942049   else
1795   {
1796      ln = &m_bitmap.pix16(line*2);
1797      ln2 = &m_bitmap.pix16(line*2+1);
1798      double_lines = true;
1799   }
2050      ln = &m_bitmap.pix16(line);
18002051
18012052   if ( !(m_cont_reg[1] & 0x40) || (m_stat_reg[2] & 0x40) )
18022053   {
1803      (this->*s_modes[m_mode].border_16) (pens, ln);
2054      if (m_size == RENDER_HIGH)
2055         (this->*s_modes[m_mode].border_16) (pens, ln);
2056      else
2057         (this->*s_modes[m_mode].border_16s) (pens, ln);
18042058   }
18052059   else
18062060   {
1807      int i = (line - m_offset_y) & 255;
1808      (this->*s_modes[m_mode].visible_16) (pens, ln, i);
1809      if (s_modes[m_mode].sprites)
2061      i = (line - m_offset_y) & 255;
2062      if (m_size == RENDER_HIGH)
18102063      {
1811         (this->*s_modes[m_mode].sprites) (i, col);
1812         (this->*s_modes[m_mode].draw_sprite_16) (pens, ln, col);
2064         (this->*s_modes[m_mode].visible_16) (pens, ln, i);
2065         if (s_modes[m_mode].sprites)
2066         {
2067            (this->*s_modes[m_mode].sprites) (i, col);
2068            (this->*s_modes[m_mode].draw_sprite_16) (pens, ln, col);
2069         }
18132070      }
2071      else
2072      {
2073         (this->*s_modes[m_mode].visible_16s) (pens, ln, i);
2074         if (s_modes[m_mode].sprites)
2075         {
2076            (this->*s_modes[m_mode].sprites) (i, col);
2077            (this->*s_modes[m_mode].draw_sprite_16s) (pens, ln, col);
2078         }
2079      }
18142080   }
18152081
18162082   if (double_lines)
r248389r248390
19752241            m_blink_count = (m_cont_reg[13] & 0x0f) * 10;
19762242      }
19772243   }
2244
2245   // check screen rendering size
2246   if (m_size_auto && (m_size_now >= 0) && (m_size != m_size_now) )
2247      m_size = m_size_now;
2248
2249   if (m_size != m_size_old)
2250   {
2251      if (m_size == RENDER_HIGH)
2252         m_screen->set_visible_area (0, 512 + 32 - 1, 0, 424 + 56 - 1);
2253      else
2254         m_screen->set_visible_area (0, 256 + 16 - 1, 0, 212 + 28 - 1);
2255
2256      m_size_old = m_size;
2257   }
2258
2259   m_size_now = -1;
19782260}
19792261
19802262/***************************************************************************
trunk/src/emu/video/v9938.h
r248389r248390
2929#define MCFG_V99X8_INTERRUPT_CALLBACK(_irq) \
3030   downcast<v99x8_device *>(device)->set_interrupt_callback(DEVCB_##_irq);
3131
32// init functions
3233
34#define MODEL_V9938 (0)
35#define MODEL_V9958 (1)
36
37// resolutions
38#define RENDER_HIGH (0)
39#define RENDER_LOW  (1)
40#define RENDER_AUTO (2)
41
42
3343//**************************************************************************
3444//  GLOBAL VARIABLES
3545//**************************************************************************
r248389r248390
4050
4151
4252
53
4354//**************************************************************************
4455//  TYPE DEFINITIONS
4556//**************************************************************************
r248389r248390
5970      m_int_callback.set_callback(irq);
6071   }
6172   int interrupt ();
73   void set_resolution (int);
6274   int get_transpen();
6375   bitmap_ind16 &get_bitmap() { return m_bitmap; }
6476   void update_mouse_state(int mx_delta, int my_delta, int button_state);
r248389r248390
101113   void check_int();
102114   void register_write(int reg, int data);
103115
104   void default_border(const pen_t *pens, UINT16 *ln);
105   void graphic7_border(const pen_t *pens, UINT16 *ln);
106   void graphic5_border(const pen_t *pens, UINT16 *ln);
107   void mode_text1(const pen_t *pens, UINT16 *ln, int line);
108   void mode_text2(const pen_t *pens, UINT16 *ln, int line);
109   void mode_multi(const pen_t *pens, UINT16 *ln, int line);
110   void mode_graphic1(const pen_t *pens, UINT16 *ln, int line);
111   void mode_graphic23(const pen_t *pens, UINT16 *ln, int line);
112   void mode_graphic4(const pen_t *pens, UINT16 *ln, int line);
113   void mode_graphic5(const pen_t *pens, UINT16 *ln, int line);
114   void mode_graphic6(const pen_t *pens, UINT16 *ln, int line);
115   void mode_graphic7(const pen_t *pens, UINT16 *ln, int line);
116   template<typename _PixelType, int _Width> void default_border(const pen_t *pens, _PixelType *ln);
117   template<typename _PixelType, int _Width> void graphic7_border(const pen_t *pens, _PixelType *ln);
118   template<typename _PixelType, int _Width> void graphic5_border(const pen_t *pens, _PixelType *ln);
119   template<typename _PixelType, int _Width> void mode_text1(const pen_t *pens, _PixelType *ln, int line);
120   template<typename _PixelType, int _Width> void mode_text2(const pen_t *pens, _PixelType *ln, int line);
121   template<typename _PixelType, int _Width> void mode_multi(const pen_t *pens, _PixelType *ln, int line);
122   template<typename _PixelType, int _Width> void mode_graphic1(const pen_t *pens, _PixelType *ln, int line);
123   template<typename _PixelType, int _Width> void mode_graphic23(const pen_t *pens, _PixelType *ln, int line);
124   template<typename _PixelType, int _Width> void mode_graphic4(const pen_t *pens, _PixelType *ln, int line);
125   template<typename _PixelType, int _Width> void mode_graphic5(const pen_t *pens, _PixelType *ln, int line);
126   template<typename _PixelType, int _Width> void mode_graphic6(const pen_t *pens, _PixelType *ln, int line);
127   template<typename _PixelType, int _Width> void mode_graphic7(const pen_t *pens, _PixelType *ln, int line);
116128//  template<typename _PixelType, int _Width> void mode_yae(const pen_t *pens, _PixelType *ln, int line);
117129//  template<typename _PixelType, int _Width> void mode_yjk(const pen_t *pens, _PixelType *ln, int line);
118   void mode_unknown(const pen_t *pens, UINT16 *ln, int line);
119   void default_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col);
120   void graphic5_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col);
121   void graphic7_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col);
130   template<typename _PixelType, int _Width> void mode_unknown(const pen_t *pens, _PixelType *ln, int line);
131   template<typename _PixelType, int _Width> void default_draw_sprite(const pen_t *pens, _PixelType *ln, UINT8 *col);
132   template<typename _PixelType, int _Width> void graphic5_draw_sprite(const pen_t *pens, _PixelType *ln, UINT8 *col);
133   template<typename _PixelType, int _Width> void graphic7_draw_sprite(const pen_t *pens, _PixelType *ln, UINT8 *col);
122134
123135   void sprite_mode1(int line, UINT8 *col);
124136   void sprite_mode2(int line, UINT8 *col);
r248389r248390
185197   int m_scanline;
186198   // blinking
187199   int m_blink, m_blink_count;
200   // size
201   int m_size, m_size_old, m_size_auto, m_size_now;
188202   // mouse
189203   UINT8 m_mx_delta, m_my_delta;
190204   // mouse & lightpen
r248389r248390
214228   {
215229      UINT8 m;
216230      void (v99x8_device::*visible_16)(const pen_t *, UINT16*, int);
231      void (v99x8_device::*visible_16s)(const pen_t *, UINT16*, int);
217232      void (v99x8_device::*border_16)(const pen_t *, UINT16*);
233      void (v99x8_device::*border_16s)(const pen_t *, UINT16*);
218234      void (v99x8_device::*sprites)(int, UINT8*);
219235      void (v99x8_device::*draw_sprite_16)(const pen_t *, UINT16*, UINT8*);
236      void (v99x8_device::*draw_sprite_16s)(const pen_t *, UINT16*, UINT8*);
220237   } ;
221238   static const v99x8_mode s_modes[];
222239   required_device<palette_device> m_palette;
trunk/src/emu/video/voodoo.c
r248389r248390
174174
175175#define MODIFY_PIXEL(VV)
176176
177// Need to turn off cycle eating when debugging MIPS drc
178// otherwise timer interrupts won't match nodrc debug mode.
179#define EAT_CYCLES          (1)
180177
181178
179
182180/*************************************
183181 *
184182 *  Statics
r248389r248390
39533951         /* bit 31 is not used */
39543952
39553953         /* eat some cycles since people like polling here */
3956         if (EAT_CYCLES) v->cpu->execute().eat_cycles(1000);
3954         v->cpu->execute().eat_cycles(1000);
39573955         break;
39583956
39593957      /* bit 2 of the initEnable register maps this to dacRead */
r248389r248390
39663964      case vRetrace:
39673965
39683966         /* eat some cycles since people like polling here */
3969         if (EAT_CYCLES) v->cpu->execute().eat_cycles(10);
3967         v->cpu->execute().eat_cycles(10);
39703968         result = v->screen->vpos();
39713969         break;
39723970
r248389r248390
39813979         result = v->fbi.cmdfifo[0].rdptr;
39823980
39833981         /* eat some cycles since people like polling here */
3984         if (EAT_CYCLES) v->cpu->execute().eat_cycles(1000);
3982         v->cpu->execute().eat_cycles(1000);
39853983         break;
39863984
39873985      case cmdFifoAMin:
trunk/src/mame/arcade.lst
r248389r248390
31393139cawingbl        // bootleg
31403140cawingb2        // bootleg
31413141nemo            // 30/11/1990 (c) 1990 (World)
3142nemor1          // 09/11/1990 (c) 1990 (World)
3142nemor1      // 09/11/1990 (c) 1990 (World)
31433143nemoj           // 20/11/1990 (c) 1990 (Japan)
31443144sf2             // 22/05/1991 (c) 1991 (World)
31453145sf2eb           // 14/02/1991 (c) 1991 (World)
r248389r248390
32063206sf2v004         // hack
32073207sf2acc          // hack
32083208sf2acca         // hack
3209sf2ceblp        // hack
3209sf2ceblp            // hack
32103210sf2accp2        // hack
32113211sf2amf          // bootleg
32123212sf2amf2         // bootleg
r248389r248390
32343234varthr1         // 12/06/1992 (c) 1992 (World)
32353235varthu          // 12/06/1992 (c) 1992 (USA)
32363236varthj          // 14/07/1992 (c) 1992 (Japan)
3237varthjr         // 14/07/1992 (c) 1992 (Japan)
32383237qad             // 01/07/1992 (c) 1992 (USA)
32393238qadjr           // 21/09/1994 (c) 1994 (Japan)
32403239wof             // 31/10/1992 (c) 1992 (World) (CPS1 + QSound)
r248389r248390
32793278rockmanj        // 22/09/1995 (c) 1995 (Japan)
32803279fcrash          // bootleg of Final Fight
32813280ffightbl        // bootleg
3282ffightbla      // bootleg
32833281ganbare         // 11/04/2000 (c) 2000 (Japan)
32843282
32853283
r248389r248390
46894687passshtb        // bootleg
46904688shinoblb        // (c) 1987 (but bootleg)
46914689shinobld        // (c) 1987 (but bootleg)
4692shinoblda      //
46934690tetrisbl        // (c) 1988 (but bootleg)
46944691beautyb         // (c) 1991 AMT
46954692iqpipe          // (c) 1991 AMT
r248389r248390
48224819// Sega System 24 games
48234820// disk based
48244821hotrodj         // 1988.03 Hot Rod (Japan)
4825hotrodja        // 1988.03 Hot Rod (Japan)
48264822hotrod          // 1988.?? Hot Rod (World)
48274823hotroda
48284824            // 1988.07 Hot Rod (US)
r248389r248390
57645760            // 2006.09 Sega Network Taisen Mahjong MJ 3 Evolution (Rev A)
57655761            // 2006.10 Quest of D Oukoku no Syugosya Ver.3.00
57665762            // 2006.11 Quest of D Oukoku no Syugosya Ver.3.01
5767mj3evo      // 2007.06 Sega Network Taisen Mahjong MJ 3 Evolution (Rev B)
57685763            // 2007.11 Quest of D The Battle Kingdom Ver.4.00
57695764            // 2008.01 Quest of D The Battle Kingdom Ver.4.00b
57705765            // 2008.02 Quest of D The Battle Kingdom Ver.4.00c
r248389r248390
60226017midres          // (c) 1989 Data East Corporation (World)
60236018midresu         // (c) 1989 Data East USA (US)
60246019midresj         // (c) 1989 Data East Corporation (Japan)
6025midresb         // bootleg
6026midresbj      // bootleg
6020midresb         // (c) 1989 Data East Corporation (Japan)
60276021bouldash        // (c) 1990 Data East Corporation (World)
60286022bouldashj       // (c) 1990 Data East Corporation (Japan)
60296023// end of similar hardware
r248389r248390
64836477wecleman        // GX602 (c) 1986
64846478wecleman2       // GX602?(c) 1988
64856479hotchase        // GX763 (c) 1988
6486hotchasea
64876480chqflag         // GX717 (c) 1988
64886481chqflagj        // GX717 (c) 1988 (Japan)
64896482ultraman        // GX910 (c) 1991 Banpresto/Bandai
r248389r248390
96719664maya            // (c) 1994 Promat
96729665mayaa           // (c) 1994 Promat
96739666mayab           // (c) 1994 Promat
9674mayac         // (c) 1994 Promat
96759667inca            // (c) 199? ????
96769668blktouch        // (c) Yang Gi Co Ltd.
96779669mcnpshnt        // "33" Mahjong Campus Hunting 1990 Dynax
r248389r248390
97269718ddenlovj        // "112" (c) 1995 Dynax (Japan)
97279719ddenlovrk       // "113" (c) 1995 Dynax (Korea)
97289720ddenlovr        // "113" (c) 1996 Dynax (Hong Kong)
9729mjschuka        // "115" (c) 1995 Dynax
97309721mjchuuka        // "121" (c) 1998 Dynax
97319722ddenlovrb       // bootleg
97329723mjflove         // "500" 1996 Dynax
r248389r248390
1065710648koftball        // (c) 1995 BMC
1065810649bmcpokr         // (c) 1999 BMC
1065910650popobear        // (c) 2000 BMC
10660mjmaglmp        // (c) 2000 BMC
1066110651
1066210652// Merit
1066310653mgames          // (c) 1981 Merit
trunk/src/mame/audio/nl_kidniki.c
r248389r248390
1616#ifndef __PLIB_PREPROCESSOR__
1717
1818#define MC14584B_GATE(_name)                                                \
19      NET_REGISTER_DEV(MC14584B_GATE, _name)
19      NET_REGISTER_DEV_X(MC14584B_GATE, _name)
2020
2121#define MC14584B_DIP(_name)                                                   \
22      NET_REGISTER_DEV(MC14584B_DIP, _name)
22      NET_REGISTER_DEV_X(MC14584B_DIP, _name)
2323
2424#define LM324_DIP(_name)                                                   \
25      NET_REGISTER_DEV(LM324_DIP, _name)
25      NET_REGISTER_DEV_X(LM324_DIP, _name)
2626
2727#define LM358_DIP(_name)                                                   \
28      NET_REGISTER_DEV(LM358_DIP, _name)
28      NET_REGISTER_DEV_X(LM358_DIP, _name)
2929
3030NETLIST_EXTERNAL(kidniki_lib)
3131
trunk/src/mame/audio/poolshrk.c
r248389r248390
157157 *
158158 *************************************/
159159
160WRITE8_MEMBER(poolshrk_state::scratch_sound_w)
160WRITE8_MEMBER(poolshrk_state::poolshrk_scratch_sound_w)
161161{
162162   m_discrete->write(space, POOLSHRK_SCRATCH_SND, offset & 1);
163163}
164164
165WRITE8_MEMBER(poolshrk_state::score_sound_w)
165WRITE8_MEMBER(poolshrk_state::poolshrk_score_sound_w)
166166{
167167   m_discrete->write(space, POOLSHRK_SCORE_EN, 1); /* this will trigger the sound code for 1 sample */
168168}
169169
170WRITE8_MEMBER(poolshrk_state::click_sound_w)
170WRITE8_MEMBER(poolshrk_state::poolshrk_click_sound_w)
171171{
172172   m_discrete->write(space, POOLSHRK_CLICK_EN, 1); /* this will trigger the sound code for 1 sample */
173173}
174174
175WRITE8_MEMBER(poolshrk_state::bump_sound_w)
175WRITE8_MEMBER(poolshrk_state::poolshrk_bump_sound_w)
176176{
177177   m_discrete->write(space, POOLSHRK_BUMP_EN, offset & 1);
178178}
trunk/src/mame/audio/scramble.c
r248389r248390
162162}
163163
164164
165// Harem (same as scorpion)
165// Harem
166166
167READ8_MEMBER(scramble_state::harem_digitalker_intr_r)
167WRITE8_MEMBER( scramble_state::harem_portA_w )
168168{
169   return m_digitalker->digitalker_0_intr_r();
169   // Speech?
170170}
171
172WRITE8_MEMBER(scramble_state::harem_digitalker_control_w)
171WRITE8_MEMBER( scramble_state::harem_portB_w )
173172{
174   m_digitalker->digitalker_0_cs_w (data & 1 ? ASSERT_LINE : CLEAR_LINE);
175   m_digitalker->digitalker_0_cms_w(data & 2 ? ASSERT_LINE : CLEAR_LINE);
176   m_digitalker->digitalker_0_wr_w (data & 4 ? ASSERT_LINE : CLEAR_LINE);
173   // Speech?
177174}
178175
179176
trunk/src/mame/drivers/1942.c
r248389r248390
168168}
169169
170170
171
172
173171static ADDRESS_MAP_START( c1942_map, AS_PROGRAM, 8, _1942_state )
174172   AM_RANGE(0x0000, 0x7fff) AM_ROM
175173   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
r248389r248390
205203   m_palette->set_indirect_color(offset, rgb_t(r<<5,g<<5,b<<6));
206204}
207205
208WRITE8_MEMBER(_1942_state::c1942p_soundlatch_w)
209{
210   soundlatch_byte_w(space, 0, data);
211   m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
212}
213
214206static ADDRESS_MAP_START( c1942p_map, AS_PROGRAM, 8, _1942_state )
215207   AM_RANGE(0x0000, 0x7fff) AM_ROM
216208   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
r248389r248390
229221   AM_RANGE(0xf000, 0xf3ff) AM_RAM AM_WRITE(c1942p_palette_w)  AM_SHARE("protopal")
230222
231223   AM_RANGE(0xf400, 0xf400) AM_WRITE(c1942_bankswitch_w)
232   AM_RANGE(0xf500, 0xf500) AM_WRITE(c1942p_soundlatch_w)
224   AM_RANGE(0xf500, 0xf500) AM_WRITE(soundlatch_byte_w)
233225   AM_RANGE(0xf600, 0xf600) AM_WRITE(c1942p_f600_w)
234226
235227   AM_RANGE(0xf700, 0xf700) AM_READ_PORT("DSWA")
r248389r248390
239231   AM_RANGE(0xf704, 0xf704) AM_READ_PORT("P2")
240232ADDRESS_MAP_END
241233
242
243static ADDRESS_MAP_START(c1942p_sound_map, AS_PROGRAM, 8, _1942_state )
244   AM_RANGE(0x0000, 0x3fff) AM_ROM
245   AM_RANGE(0x4000, 0x47ff) AM_RAM
246
247   AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r)
248ADDRESS_MAP_END
249
250static ADDRESS_MAP_START( c1942p_sound_io, AS_IO, 8, _1942_state )
251   ADDRESS_MAP_GLOBAL_MASK(0xff)
252   AM_RANGE(0x0000, 0x0000) AM_WRITENOP
253   AM_RANGE(0x0014, 0x0015) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
254   AM_RANGE(0x0018, 0x0019) AM_DEVWRITE("ay2", ay8910_device, address_data_w)
255ADDRESS_MAP_END
256
257
258
259234static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, _1942_state )
260235   AM_RANGE(0x0000, 0x3fff) AM_ROM
261236   AM_RANGE(0x4000, 0x47ff) AM_RAM
r248389r248390
625600   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", _1942_state, c1942_scanline, "screen", 0, 1)
626601
627602   MCFG_CPU_ADD("audiocpu", Z80, SOUND_CPU_CLOCK)  /* 3 MHz ??? */
628   MCFG_CPU_PROGRAM_MAP(c1942p_sound_map)
629   MCFG_CPU_IO_MAP(c1942p_sound_io)
603   MCFG_CPU_PROGRAM_MAP(sound_map)
630604   MCFG_CPU_PERIODIC_INT_DRIVER(_1942_state, irq0_line_hold, 4*60)
631605
632606
r248389r248390
917891   ROM_LOAD( "3.bin",    0x14000, 0x4000, CRC(108fda63) SHA1(6ffdf57a04bcfae9fdb2343f30cff50926188cbf) ) // sldh
918892
919893   ROM_REGION( 0x10000, "audiocpu", 0 )
920   ROM_LOAD( "04.bin",   0x0000, 0x4000,  CRC(b4efd1af) SHA1(015b687b1714f892c3b2528bceb2df8ca48b6b8e) )
894   ROM_LOAD( "snd.bin",   0x0000, 0x4000, BAD_DUMP CRC(43d6df9f) SHA1(c34579c73faa7e9552a6721ef8050b33ca158588) ) // sldh - looks bad, window was smashed, likely dead.
895   ROM_LOAD( "sr-01.c11", 0x0000, 0x4000, CRC(bd87f06b) SHA1(821f85cf157f81117eeaba0c3cf0337eac357e58) ) // works but we can't be 100% sure it was the same.
921896
922897   ROM_REGION( 0x2000, "gfx1", ROMREGION_INVERT )
923898   ROM_LOAD( "8.bin",    0x0000, 0x2000, CRC(6ebca191) SHA1(0dbddadde54a0ab66994c4a8726be05c6ca88a0e) ) /* characters */ // sldh
r248389r248390
951926GAME( 198?, 1942h,    1942, 1942, 1942, _1942_state, 1942, ROT270, "hack (Two Bit Score?)", "42", GAME_SUPPORTS_SAVE )
952927GAME( 1984, 1942b,    1942, 1942, 1942, _1942_state, 1942, ROT270, "Capcom", "1942 (First Version)", GAME_SUPPORTS_SAVE )
953928GAME( 1985, 1942w,    1942, 1942, 1942, _1942_state, 1942, ROT270, "Capcom (Williams Electronics license)", "1942 (Williams Electronics license)", GAME_SUPPORTS_SAVE ) /* Based on 1942 (Revision B) */
954GAME( 1984, 1942p,    1942, 1942p,1942p,_1942_state, 1942, ROT270, "bootleg", "1942 (Tecfri PCB, bootleg?)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
929GAME( 1984, 1942p,    1942, 1942p,1942p,_1942_state, 1942, ROT270, "Capcom", "1942 (prototype)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/bmcpokr.c
r248389r248390
11// license:BSD-3-Clause
22// copyright-holders:Luca Elia
3/***************************************************************************
3/************************************************************************************************************
44
5BMC games using a 68k + VDB40817/SYA70521
5Dongfang Shenlong ("Eastern Dragon")
6BMC 1999
67
78driver by Luca Elia
8
99Similar to bmcbowl, koftball, popobear
1010
11CPU:    68000
12Video:  BMC VDB40817 + BMC SYA70521
13Sound:  M6295 + UM3567
14Other:  BMC B816140 (CPLD)
11PCB Layout
12----------
1513
16***************************************************************************/
14BMC-A81212
15|---------------------------------------|
16|          CH-A-401  CH-M-301  CH-M-701 |
17|M11B416256A                   UM3567   |
18|42MHz     CH-M-201  CH-M-101     M6295 |
19|      VDB40817                        1|
20|              HM86171-80        VOL   0|
21|      SYA70521                        W|
22|                        LM324   7805  A|
23|DSW1                                  Y|
24|      68000                   TDA2003  |
25|DSW2       CH-M-505  CH-M-605          |
26|            6264     6264             2|
27|DSW3  CPLD   74HC132 74LS05           2|
28|                 555                  W|
29|DSW4                                  A|
30|        BATT  SW       JAMMA          Y|
31|---------------------------------------|
32Notes:
33      RAM - M11B416256, 6264(x2)
34      VDB40817/SYA70521 - Unknown QFP100
35      CPLD - unknown PLCC44 chip labelled 'BMC B816140'
36      BATT - 5.5 volt 0.047F super cap
37      68000 @10.50MHz (42/4)
38      M6295 @1.05MHz (42/40)
39      UM3567 @3.50MHz (42/12)
40      HSync - 15.440kHz
41      VSync - 58.935Hz
1742
43************************************************************************************************************/
44
1845#include "emu.h"
1946#include "cpu/m68000/m68000.h"
20#include "video/ramdac.h"
2147#include "sound/2413intf.h"
2248#include "sound/okim6295.h"
49#include "video/ramdac.h"
2350#include "machine/nvram.h"
2451#include "machine/ticket.h"
2552
r248389r248390
4269      m_palette(*this, "palette")
4370      { }
4471
45   // Devices
4672   required_device<cpu_device> m_maincpu;
4773   required_device<ticket_dispenser_device> m_hopper;
4874   required_shared_ptr<UINT16> m_videoram_1;
r248389r248390
5682   required_device<gfxdecode_device> m_gfxdecode;
5783   required_device<palette_device> m_palette;
5884
59   // Protection
85   tilemap_t *m_tilemap_1;
86   tilemap_t *m_tilemap_2;
87   TILE_GET_INFO_MEMBER(get_t1_tile_info);
88   TILE_GET_INFO_MEMBER(get_t2_tile_info);
89   TILE_GET_INFO_MEMBER(get_t3_tile_info);
90   DECLARE_WRITE16_MEMBER(videoram_1_w);
91   DECLARE_WRITE16_MEMBER(videoram_2_w);
92
6093   UINT16 m_prot_val;
6194   DECLARE_READ16_MEMBER(prot_r);
6295   DECLARE_WRITE16_MEMBER(prot_w);
6396   DECLARE_READ16_MEMBER(unk_r);
6497
65   // I/O
6698   UINT16 m_mux;
6799   DECLARE_WRITE16_MEMBER(mux_w);
68100   DECLARE_READ16_MEMBER(dsw_r);
69101   DECLARE_CUSTOM_INPUT_MEMBER(hopper_r);
70   DECLARE_READ16_MEMBER(mjmaglmp_dsw_r);
71   DECLARE_READ16_MEMBER(mjmaglmp_key_r);
72102
73   // Interrrupts
74103   UINT16 m_irq_enable;
75104   DECLARE_WRITE16_MEMBER(irq_enable_w);
76105   DECLARE_WRITE16_MEMBER(irq_ack_w);
77   TIMER_DEVICE_CALLBACK_MEMBER(interrupt);
78106
79   // Video
80   tilemap_t *m_tilemap_1;
81   tilemap_t *m_tilemap_2;
82   TILE_GET_INFO_MEMBER(get_t1_tile_info);
83   TILE_GET_INFO_MEMBER(get_t2_tile_info);
84   TILE_GET_INFO_MEMBER(get_t3_tile_info);
85   DECLARE_WRITE16_MEMBER(videoram_1_w);
86   DECLARE_WRITE16_MEMBER(videoram_2_w);
87
88107   bitmap_ind16 *m_pixbitmap;
89108   void pixbitmap_redraw();
90109   UINT16 m_pixpal;
r248389r248390
95114   void draw_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer);
96115   UINT32 screen_update_bmcpokr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
97116
117   TIMER_DEVICE_CALLBACK_MEMBER(interrupt);
118
98119   void save_state()
99120   {
100121      save_item(NAME(m_prot_val));
r248389r248390
418439   AM_RANGE(0x3b0000, 0x3b0001) AM_READ_PORT("INPUTS2")
419440ADDRESS_MAP_END
420441
421
422READ16_MEMBER(bmcpokr_state::mjmaglmp_dsw_r)
423{
424   switch ((m_mux >> 4) & 7)
425   {
426      case 7: return ioport("DSW1")->read() << 8;
427      case 6: return ioport("DSW2")->read() << 8;
428      case 5: return ioport("DSW3")->read() << 8;
429      case 3: return ioport("DSW4")->read() << 8;
430   }
431   return 0xff << 8;
432}
433
434READ16_MEMBER(bmcpokr_state::mjmaglmp_key_r)
435{
436   UINT16 key = 0x3f;
437   switch ((m_mux >> 4) & 7)
438   {
439      case 0: key = ioport("KEY1")->read(); break;
440      case 1: key = ioport("KEY2")->read(); break;
441      case 2: key = ioport("KEY3")->read(); break;
442      case 3: key = ioport("KEY4")->read(); break;
443      case 4: key = ioport("KEY5")->read(); break;
444   }
445   return ioport("INPUTS")->read() | (key & 0x3f);
446}
447
448static ADDRESS_MAP_START( mjmaglmp_map, AS_PROGRAM, 16, bmcpokr_state )
449   AM_RANGE(0x000000, 0x03ffff) AM_ROM
450   AM_RANGE(0x210000, 0x21ffff) AM_RAM AM_SHARE("nvram")
451
452   AM_RANGE(0x280000, 0x287fff) AM_RAM_WRITE(videoram_1_w) AM_SHARE("videoram_1")
453   AM_RANGE(0x288000, 0x28ffff) AM_RAM_WRITE(videoram_2_w) AM_SHARE("videoram_2")
454   AM_RANGE(0x290000, 0x297fff) AM_RAM
455
456   AM_RANGE(0x2a0000, 0x2dffff) AM_RAM_WRITE(pixram_w) AM_SHARE("pixram")
457
458   AM_RANGE(0x2ff800, 0x2ff9ff) AM_RAM AM_SHARE("scrollram_1")
459   AM_RANGE(0x2ffa00, 0x2ffbff) AM_RAM AM_SHARE("scrollram_2")
460   AM_RANGE(0x2ffc00, 0x2ffdff) AM_RAM AM_SHARE("scrollram_3")
461   AM_RANGE(0x2ffe00, 0x2fffff) AM_RAM
462
463   AM_RANGE(0x320000, 0x320003) AM_RAM AM_SHARE("layerctrl")
464
465   AM_RANGE(0x388000, 0x388001) AM_WRITE(mux_w)
466
467   AM_RANGE(0x390000, 0x390001) AM_READ(mjmaglmp_dsw_r)
468
469   AM_RANGE(0x398000, 0x398001) AM_READ(mjmaglmp_key_r)
470
471   AM_RANGE(0x3c8800, 0x3c8803) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
472   AM_RANGE(0x3c9000, 0x3c9001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
473
474   AM_RANGE(0x3c9800, 0x3c9801) AM_DEVWRITE8("ramdac",ramdac_device, index_w, 0x00ff )
475   AM_RANGE(0x3c9802, 0x3c9803) AM_DEVWRITE8("ramdac",ramdac_device, pal_w,   0x00ff )
476   AM_RANGE(0x3c9804, 0x3c9805) AM_DEVWRITE8("ramdac",ramdac_device, mask_w,  0x00ff )
477
478   AM_RANGE(0x3ca000, 0x3ca001) AM_RAM // 3ca001.b, rw
479   AM_RANGE(0x3ca002, 0x3ca003) AM_RAM // 3ca003.b, w(9d)
480   AM_RANGE(0x3ca006, 0x3ca007) AM_WRITE(irq_ack_w)
481   AM_RANGE(0x3ca008, 0x3ca009) AM_WRITE(irq_enable_w)
482   AM_RANGE(0x3ca00e, 0x3ca00f) AM_RAM AM_SHARE("priority")    // 3ca00f.b, w (priority?)
483   AM_RANGE(0x3ca016, 0x3ca017) AM_WRITE(pixpal_w)
484   AM_RANGE(0x3ca018, 0x3ca019) AM_RAM // 3ca019.b, w
485   AM_RANGE(0x3ca01a, 0x3ca01b) AM_READ(unk_r) AM_WRITENOP
486   AM_RANGE(0x3ca01c, 0x3ca01d) AM_RAM // 3ca01d.b, w(0)
487ADDRESS_MAP_END
488
489442/***************************************************************************
490443                                Input Ports
491444***************************************************************************/
r248389r248390
609562   PORT_DIPSETTING(    0x00, DEF_STR( Joystick ) )
610563INPUT_PORTS_END
611564
612static INPUT_PORTS_START( mjmaglmp )
613   PORT_START("INPUTS")
614   // Joystick controls:
615   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1         ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // START
616   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // UP
617   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // DOWN
618   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // LEFT
619   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // RIGHT
620   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1        ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // 1P E1 (select)
621
622   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_COIN2          ) // NOTE
623   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT  ) // KEY DOWN
624   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) // PAY
625    PORT_BIT( 0x0200, IP_ACTIVE_HIGH,IPT_SPECIAL        ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bmcpokr_state,hopper_r, NULL)  // HOPPER
626   PORT_SERVICE_NO_TOGGLE( 0x0400, IP_ACTIVE_LOW       ) // ACCOUNT
627   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE1       ) PORT_NAME("Reset") // RESET
628   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN        ) // (unused)
629   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2        ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // 1P E2 (bet)
630   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3        ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // 1P E3 (select)
631   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN1          ) // COIN
632
633   PORT_START("KEY1")
634   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A        ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
635   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E        ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
636   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I        ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
637   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M        ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
638   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN      ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
639   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1           ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
640
641   PORT_START("KEY2")
642   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B        ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
643   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F        ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
644   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J        ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
645   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N        ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
646   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH    ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
647   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET      ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
648
649   PORT_START("KEY3")
650   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C        ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
651   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G        ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
652   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K        ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
653   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI      ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
654   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON      ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
655   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN          ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
656
657   PORT_START("KEY4")
658   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D        ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
659   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H        ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
660   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L        ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
661   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON      ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
662   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN          ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
663   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN          ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
664
665   PORT_START("KEY5")
666   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN          ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
667   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE    ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
668   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
669   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN          ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
670   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG      ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
671   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL    ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
672
673   PORT_START("DSW1")
674   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("DIP1:1")
675   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
676   PORT_DIPSETTING(    0x01, DEF_STR( No ) )
677   PORT_DIPNAME( 0x02, 0x00, "Doube-Up Game" )             PORT_DIPLOCATION("DIP1:2")
678   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
679   PORT_DIPSETTING(    0x02, DEF_STR( No ) )
680   PORT_DIPNAME( 0x04, 0x04, "Coin Sw. Function" )         PORT_DIPLOCATION("DIP1:3")
681   PORT_DIPSETTING(    0x00, "Coin" )
682   PORT_DIPSETTING(    0x04, "Note" )
683   PORT_DIPNAME( 0x08, 0x08, "Pay Sw. Function" )          PORT_DIPLOCATION("DIP1:4")
684   PORT_DIPSETTING(    0x00, "Pay-Out" )
685   PORT_DIPSETTING(    0x08, "Key-Down" )
686   PORT_DIPNAME( 0x10, 0x10, "Game Hint" )                 PORT_DIPLOCATION("DIP1:5")
687   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
688   PORT_DIPSETTING(    0x10, DEF_STR( No ) )
689   PORT_DIPNAME( 0x20, 0x20, "Direct Double" )             PORT_DIPLOCATION("DIP1:6")
690   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
691   PORT_DIPSETTING(    0x20, DEF_STR( No ) )
692   PORT_DIPNAME( 0x40, 0x40, "Coin Acceptor" )             PORT_DIPLOCATION("DIP1:7")
693   PORT_DIPSETTING(    0x00, "Mechanical" )
694   PORT_DIPSETTING(    0x40, "Electronic" )
695   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "DIP1:8" )
696
697   PORT_START("DSW2")
698   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Controls ) )         PORT_DIPLOCATION("DIP2:1")
699   PORT_DIPSETTING(    0x01, "Keyboard" )
700   PORT_DIPSETTING(    0x00, DEF_STR( Joystick ) )
701   PORT_DIPNAME( 0x02, 0x02, "Key-In Limit" )              PORT_DIPLOCATION("DIP2:2")
702   PORT_DIPSETTING(    0x00, "1000" )
703   PORT_DIPSETTING(    0x02, "5000" )
704   PORT_DIPNAME( 0x04, 0x04, "Double Lose Pool" )          PORT_DIPLOCATION("DIP2:3")
705   PORT_DIPSETTING(    0x00, "50" )
706   PORT_DIPSETTING(    0x04, "100" )
707   PORT_DIPNAME( 0x18, 0x18, "Double Over / Round Bonus" ) PORT_DIPLOCATION("DIP2:4,5")
708   PORT_DIPSETTING(    0x10, "100 / 10" )
709   PORT_DIPSETTING(    0x18, "200 / 10" )
710   PORT_DIPSETTING(    0x08, "300 / 15" )
711   PORT_DIPSETTING(    0x00, "500 / 25" )
712   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "DIP2:6" )
713   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "DIP2:7" )
714   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "DIP2:8" )
715
716   PORT_START("DSW3")
717   PORT_DIPNAME( 0x03, 0x03, "Pay-Out Rate" )              PORT_DIPLOCATION("DIP3:1,2")
718   PORT_DIPSETTING(    0x02, "75" )
719   PORT_DIPSETTING(    0x01, "82" )
720   PORT_DIPSETTING(    0x03, "85" )
721   PORT_DIPSETTING(    0x00, "88" )
722   PORT_DIPNAME( 0x0c, 0x0c, "Double-Up Rate" )            PORT_DIPLOCATION("DIP3:3,4")
723   PORT_DIPSETTING(    0x08, "95" )
724   PORT_DIPSETTING(    0x04, "96" )
725   PORT_DIPSETTING(    0x00, "97" )
726   PORT_DIPSETTING(    0x0c, "98" )
727   PORT_DIPNAME( 0x30, 0x30, "Game Enhance Type" )         PORT_DIPLOCATION("DIP3:5,6")
728   PORT_DIPSETTING(    0x10, "Small" )
729   PORT_DIPSETTING(    0x00, "Big" )
730   PORT_DIPSETTING(    0x30, "Normal" )
731   PORT_DIPSETTING(    0x20, "Bonus" )
732   PORT_DIPNAME( 0xc0, 0xc0, "Credit Limit" )              PORT_DIPLOCATION("DIP3:7,8")
733   PORT_DIPSETTING(    0x00, "300" )
734   PORT_DIPSETTING(    0x80, "500" )
735   PORT_DIPSETTING(    0x40, "1000" )
736   PORT_DIPSETTING(    0xc0, "2000" )
737
738   PORT_START("DSW4")
739   PORT_DIPNAME( 0x01, 0x01, "Max Bet" )                   PORT_DIPLOCATION("DIP4:1")
740   PORT_DIPSETTING(    0x01, "10" )
741   PORT_DIPSETTING(    0x00, "20" )
742   PORT_DIPNAME( 0x06, 0x06, "Min Bet" )                   PORT_DIPLOCATION("DIP4:2,3")
743   PORT_DIPSETTING(    0x00, "1" )
744   PORT_DIPSETTING(    0x06, "3" )
745   PORT_DIPSETTING(    0x04, "6" )
746   PORT_DIPSETTING(    0x02, "9" )
747   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coinage ) )          PORT_DIPLOCATION("DIP4:4,5")
748   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
749   PORT_DIPSETTING(    0x18, DEF_STR( 1C_1C ) )
750   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
751   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
752   PORT_DIPNAME( 0x60, 0x60, "Credits Per Key-In" )        PORT_DIPLOCATION("DIP4:6,7")
753   PORT_DIPSETTING(    0x40, "5" )
754   PORT_DIPSETTING(    0x60, "10" )
755   PORT_DIPSETTING(    0x20, "50" )
756   PORT_DIPSETTING(    0x00, "100" )
757   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "DIP4:8" )
758INPUT_PORTS_END
759
760565/***************************************************************************
761566                                Graphics Layout
762567***************************************************************************/
r248389r248390
831636   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
832637MACHINE_CONFIG_END
833638
834static MACHINE_CONFIG_DERIVED( mjmaglmp, bmcpokr )
835   MCFG_CPU_MODIFY("maincpu")
836   MCFG_CPU_PROGRAM_MAP(mjmaglmp_map)
837MACHINE_CONFIG_END
838
839639/***************************************************************************
840640                                ROMs Loading
841641***************************************************************************/
842642
843/***************************************************************************
844
845Dongfang Shenlong ("Eastern Dragon")
846BMC 1999
847
848PCB Layout
849----------
850
851BMC-A81212
852|---------------------------------------|
853|          CH-A-401  CH-M-301  CH-M-701 |
854|M11B416256A                   UM3567   |
855|42MHz     CH-M-201  CH-M-101     M6295 |
856|      VDB40817                        1|
857|              HM86171-80        VOL   0|
858|      SYA70521                        W|
859|                        LM324   7805  A|
860|DSW1                                  Y|
861|      68000                   TDA2003  |
862|DSW2       CH-M-505  CH-M-605          |
863|            6264     6264             2|
864|DSW3  CPLD   74HC132 74LS05           2|
865|                 555                  W|
866|DSW4                                  A|
867|        BATT  SW       JAMMA          Y|
868|---------------------------------------|
869Notes:
870      RAM - M11B416256, 6264(x2)
871      VDB40817/SYA70521 - Unknown QFP100
872      CPLD - unknown PLCC44 chip labelled 'BMC B816140'
873      BATT - 5.5 volt 0.047F super cap
874      68000 @10.50MHz (42/4)
875      M6295 @1.05MHz (42/40)
876      UM3567 @3.50MHz (42/12)
877      HSync - 15.440kHz
878      VSync - 58.935Hz
879
880***************************************************************************/
881
882643ROM_START( bmcpokr )
883644   ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 Code */
884645   ROM_LOAD16_BYTE( "ch-m-605.u13", 0x000000, 0x20000, CRC(c5c3fcd1) SHA1(b77fef734c290d52ae877a24bb3ee42b24eb5cb8) )
r248389r248390
894655   ROM_LOAD( "ch-m-701.u10", 0x00000, 0x40000,  CRC(e01be644) SHA1(b68682786d5b40cb5672cfd7f717adcfb8fac7d3) )
895656ROM_END
896657
897/***************************************************************************
898
899Mahjong Magic Lamp (BMC, 2000)
900
901PCB Layout
902----------
903
904BMC-A70809
905  |--------------------------------------|
906|-|               6116          555      |
907|            0.1UF    JA-A-602  JA-A-502 |
908|                                  68000 |
909|   TD62003                   42MHz      |
910|            PAL                         |
911|            PAL                 51C4160 |
912|                         SYA70521       |
913|-|    U3567                             |
914  |                                      |
915  |             HM86171   VDB40817       |
916|-| VOL                             DSW4 |
917|  7805  6295                       DSW3 |
918|  AMP          JA-A-301 JA-A-401   DSW2 |
919|-|    JA-A-901 JA-A-201 JA-A-101   DSW1 |
920  |--------------------------------------|
921Notes:
922      68000   - clock 10.5000MHz [42/4]
923      M6295   - clock 1.0500MHz [42/40]. Pin 7 HIGH
924      U3567   - = YM2413, clock 3.5000MHz [42/12]
925      HM86171 - HMC RAMDAC. Clock input 10.5000MHz [42/4]
926      VDB/SYA - custom QFP100 GFX chips badged with BMC logo
927      51C4160 - SOJ40 video RAM, possibly 4M DRAM (256k x 16-bit)
928      555     - 555 Timer
929      DSW1-4  - 8-position DIP switches
930      AMP     - NEC uPC1241H
931      VSync   - 58.9342Hz
932      HSync   - 15.4408kHz
933
934***************************************************************************/
935
936ROM_START( mjmaglmp )
937   ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 Code */
938   ROM_LOAD16_BYTE( "ja-a-602.u10", 0x000000, 0x20000, CRC(b69e235c) SHA1(04e5d0d667de29680e4a35d0d98b587447e54ce3) )
939   ROM_LOAD16_BYTE( "ja-a-502.u11", 0x000001, 0x20000, CRC(bb609da3) SHA1(ffadc20912e0a9ebe0d1a1f7f94dfaccb48be5c1) )
940
941   ROM_REGION( 0x200000, "gfx1", 0 )
942   ROM_LOAD16_BYTE( "ja-a-101.u41", 0x000000, 0x80000, CRC(7878b9a1) SHA1(7efacb063b47e518c4d3856e90d7532f478e54dd) )
943   ROM_LOAD16_BYTE( "ja-a-201.u42", 0x000001, 0x80000, CRC(b74f3b2b) SHA1(09724909a14aebc135029d97fafcd215a84f05e3) )
944   ROM_LOAD16_BYTE( "ja-a-301.u43", 0x100000, 0x80000, CRC(2bbaf65e) SHA1(d792054671671a2e479b89ad29bc7b3f935804f9) )
945   ROM_LOAD16_BYTE( "ja-a-401.u44", 0x100001, 0x80000, CRC(9292acb1) SHA1(01ce7997305dd5fdc5dc2b801046303a4d8a89c0) )
946
947   ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
948   ROM_LOAD( "ja-a-901.u6", 0x00000, 0x40000, CRC(25f36d00) SHA1(c182348340ca67ad69d1a67c58b47d6371a725c9) )
949ROM_END
950
951GAME( 1999, bmcpokr,  0, bmcpokr,  bmcpokr,  driver_device, 0, ROT0, "BMC", "Dongfang Shenlong",             GAME_SUPPORTS_SAVE )
952GAME( 2000, mjmaglmp, 0, mjmaglmp, mjmaglmp, driver_device, 0, ROT0, "BMC", "Mahjong Magic Lamp (v. JAA02)", GAME_SUPPORTS_SAVE )
658GAME( 1999, bmcpokr,    0, bmcpokr,    bmcpokr, driver_device,    0, ROT0,  "BMC", "Dongfang Shenlong", GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/chihiro.c
r248389r248390
5252|*| 2005 | Sega Club Golf 2006: Next Tours (Rev A)            | Sega                     | GDROM  | GDX-0018A  |              |
5353| | 2006 | Sega Network Taisen Mahjong MJ 3 Evolution         | Sega                     | GDROM  | GDX-0021   |              |
5454| | 2006 | Sega Network Taisen Mahjong MJ 3 Evolution (Rev A) | Sega                     | GDROM  | GDX-0021A  |              |
55|*| 2007 | Sega Network Taisen Mahjong MJ 3 Evolution (Rev B) | Sega                     | GDROM  | GDX-0021B  |              |
5655| | 2009 | Firmware Update For Compact Flash Box              | Sega                     | GDROM  | GDX-0024   |              |
5756|*| 2009 | Firmware Update For Compact Flash Box (Rev A)      | Sega                     | GDROM  | GDX-0024A  | 317-0567-EXP |
5857|*| 2004 | Quest Of D (Ver.1.01C)                             | Sega                     | CDROM  | CDV-10005C |              |
r248389r248390
29322931   ROM_LOAD("gdx-0018.data", 0x00, 0x50, CRC(1a210abd) SHA1(43a54d028315d2dfa9f8ea6fb59265e0b980b02f) )
29332932ROM_END
29342933
2935ROM_START( mj3evo )
2936   CHIHIRO_BIOS
2937
2938   DISK_REGION( "gdrom" )
2939   DISK_IMAGE_READONLY( "gdx-0021b", 0, SHA1(c97d1dc95cdf1b4bd5d7cf6b4db0757f3d6bd723) )
2940
2941   // PIC label is unknown
2942   ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF)
2943   ROM_LOAD( "317-xxxx-jpn.pic", 0x000000, 0x004000, CRC(650fcc94) SHA1(c88488900460fb3deecb3cf376fc043b10c020ef) )
2944ROM_END
2945
29462934/*
29472935Title             BOX GDROM CF-BOX FIRM
29482936Media ID          EB08
r248389r248390
30213009/* 0018A */ GAME( 2005, scg06nt,  chihiro,  chihirogd,    chihiro, driver_device, 0, ROT0, "Sega",                     "Sega Club Golf 2006 Next Tours (Rev A) (GDX-0018A)", GAME_NO_SOUND|GAME_NOT_WORKING )
30223010// 0019
30233011// 0020
3024// 0021     GAME( 2006, mj3evoo,  mj3evo,    chihirogd,   chihiro, driver_device, 0, ROT0, "Sega",                     "Sega Network Taisen Mahjong MJ 3 Evolution (GDX-0021)", GAME_NO_SOUND|GAME_NOT_WORKING )
3025// 0021A    GAME( 2006, mj3evoa,  mj3evo,    chihirogd,   chihiro, driver_device, 0, ROT0, "Sega",                     "Sega Network Taisen Mahjong MJ 3 Evolution (Rev A) (GDX-0021A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3026/* 0021B */ GAME( 2007, mj3evo,   chihiro,   chihirogd,   chihiro, driver_device, 0, ROT0, "Sega",                     "Sega Network Taisen Mahjong MJ 3 Evolution (Rev B) (GDX-0021B)", GAME_NO_SOUND|GAME_NOT_WORKING )
3012// 0021     GAME( 2005, mj3evo,   mj3ev,    chihirogd,    chihiro, driver_device, 0, ROT0, "Sega",                     "Sega Network Taisen Mahjong MJ 3 Evolution (GDX-0021)", GAME_NO_SOUND|GAME_NOT_WORKING )
3013// 0021A    GAME( 2005, mj3ev,    chihiro,  chihirogd,    chihiro, driver_device, 0, ROT0, "Sega",                     "Sega Network Taisen Mahjong MJ 3 Evolution (Rev A) (GDX-0021A)", GAME_NO_SOUND|GAME_NOT_WORKING )
30273014// 0022
30283015// 0023
30293016// 0024     GAME( 2009, ccfboxo,  ccfboxa,  chihirogd,    chihiro, driver_device, 0, ROT0, "Sega",                     "Chihiro Firmware Update For Compact Flash Box (GDX-0024)", GAME_NO_SOUND|GAME_NOT_WORKING )
trunk/src/mame/drivers/cps1.c
r248389r248390
96019601   ROM_LOAD( "ioc1.ic1",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
96029602ROM_END
96039603
9604/* B-Board 91634B-2, Japan Resale Ver. */
9605ROM_START( varthjr )
9606   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
9607   ROM_LOAD16_WORD_SWAP( "vaj_23b.8f", 0x00000, 0x80000, CRC(ad3d3522) SHA1(db627233f9d8a03c2d4bb31614951a0cdc81600d) )
9608   ROM_LOAD16_WORD_SWAP( "vaj_22b.7f", 0x80000, 0x80000, CRC(034e3e55) SHA1(eeb85a827cf18dafbdf0a2828aa39128352857f3) )
9609
9610   ROM_REGION( 0x200000, "gfx", 0 )
9611   ROMX_LOAD( "va_01.3a", 0x000000, 0x80000, CRC(b1fb726e) SHA1(5ac0876b6c49d0a99710dda68653664f4d8c1167) , ROM_GROUPWORD | ROM_SKIP(6) )  // == va-5m.7a
9612   ROMX_LOAD( "va_02.4a", 0x000002, 0x80000, CRC(4c6588cd) SHA1(d14e8cf051ac934ccc989d8c571c6cc9eed34af5) , ROM_GROUPWORD | ROM_SKIP(6) )  // == va-7m.9a
9613   ROMX_LOAD( "va_03.5a", 0x000004, 0x80000, CRC(0b1ace37) SHA1(6f9493c22f667f683db2789972fd16bb94724679) , ROM_GROUPWORD | ROM_SKIP(6) )  // == va-1m.3a
9614   ROMX_LOAD( "va_04.6a", 0x000006, 0x80000, CRC(44dfe706) SHA1(a013a434df3161a91aafbb35dc4e20dfb3f177f4) , ROM_GROUPWORD | ROM_SKIP(6) )  // == va-3m.5a
9615
9616   ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
9617   ROM_LOAD( "va_09.12a", 0x00000, 0x08000, CRC(7a99446e) SHA1(ca027f41e3e58be5abc33ad7380746658cb5380a) )
9618   ROM_CONTINUE(          0x10000, 0x08000 )
9619
9620   ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
9621   ROM_LOAD( "va_18.11c", 0x00000, 0x20000, CRC(de30510e) SHA1(8e878696192606b76a3a0e53553e638d9621cff7) )
9622   ROM_LOAD( "va_19.12c", 0x20000, 0x20000, CRC(0610a4ac) SHA1(3da02ea6a7a56c85de898806d2a1cf6bc526c1b3) )
9623
9624   ROM_REGION( 0x0200, "aboardplds", 0 )
9625   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
9626   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
9627   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
9628   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
9629   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
9630
9631   ROM_REGION( 0x0200, "bboardplds", 0 )
9632   ROM_LOAD( "va63b.1a",     0x0000, 0x0117, BAD_DUMP CRC(38540e86) SHA1(86e0aba363108f80a8eff84b99d11528ad6db099) ) /* Handcrafted but works on actual US PCB.  Redump needed */
9633   ROM_LOAD( "iob1.12d",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
9634   ROM_LOAD( "bprg1.11d",    0x0000, 0x0117, CRC(31793da7) SHA1(400fa7ac517421c978c1ee7773c30b9ed0c5d3f3) )
9635
9636   ROM_REGION( 0x0200, "cboardplds", 0 )
9637   ROM_LOAD( "ioc1.ic1",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
9638ROM_END
9639
96409604/* B-Board 89625B-1 */
96419605ROM_START( qad )
96429606   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
r248389r248390
1185511819GAME( 1992, varthr1,     varth,    cps1_12MHz, varth,    cps_state,   cps1,     ROT270, "Capcom", "Varth: Operation Thunderstorm (World 920612)", GAME_SUPPORTS_SAVE )  // "ETC"
1185611820GAME( 1992, varthu,      varth,    cps1_12MHz, varth,    cps_state,   cps1,     ROT270, "Capcom (Romstar license)", "Varth: Operation Thunderstorm (USA 920612)", GAME_SUPPORTS_SAVE )
1185711821GAME( 1992, varthj,      varth,    cps1_12MHz, varth,    cps_state,   cps1,     ROT270, "Capcom", "Varth: Operation Thunderstorm (Japan 920714)", GAME_SUPPORTS_SAVE )
11858GAME( 1992, varthjr,     varth,    cps1_12MHz, varth,    cps_state,   cps1,     ROT270, "Capcom", "Varth: Operation Thunderstorm (Japan Resale Ver. 920714)", GAME_SUPPORTS_SAVE )
1185911822GAME( 1992, qad,         0,        cps1_12MHz, qad,      cps_state,   cps1,     ROT0,   "Capcom", "Quiz & Dragons: Capcom Quiz Game (USA 920701)", GAME_SUPPORTS_SAVE ) // 12MHz verified
1186011823GAME( 1994, qadjr,       qad,      cps1_12MHz, qadjr,    cps_state,   cps1,     ROT0,   "Capcom", "Quiz & Dragons: Capcom Quiz Game (Japan Resale Ver. 940921)", GAME_SUPPORTS_SAVE )
1186111824GAME( 1992, wof,         0,        qsound,     wof,      cps_state,   wof,      ROT0,   "Capcom", "Warriors of Fate (World 921031)", GAME_SUPPORTS_SAVE )   // "ETC"
trunk/src/mame/drivers/csplayh5.c
r248389r248390
443443
444444   if((scanline % 2) == 0)
445445   {
446      m_v9958->set_resolution(RENDER_HIGH);
446447      m_v9958->interrupt();
447448   }
448449}
trunk/src/mame/drivers/ddenlovr.c
r248389r248390
262694 Hf Hana Ginga           D8102048L1          Z80   YM2149 YM2413 M6295 NL-002 1108F0405  1427F0071 4L02?
272794 Super Hana Paradise     N8010178L1+N73RSUB  Z80          YM2413 M6295 NL-002 1108F0406  1427F0071 4L02F2637
282895 Mj Dai Chuuka Ken       D11107218L1         Z80   AY8910 YM2413 M6295 70C160F009
2995 Mj Super Dai Chuuka Ken D11510198L1         Z80   AY8910 YM2413 M6295
302995 Hf Hana Gokou           N83061581L1         Z80   AY8910 YM2413 M6295 NL-002 1108?      1427?     4L02?
313095 Hf Hana Gokou Bangaihen N10805078L1         Z80   AY8910 YM2413 M6295 NL-002 1108?      1427?     4L02?
323195 Nettoh Quiz Champion                        68000 AY8910 YM2413 M6295
r248389r248390
341340   DECLARE_READ8_MEMBER(hanakanz_rand_r);
342341   DECLARE_WRITE8_MEMBER(mjreach1_protection_w);
343342   DECLARE_READ8_MEMBER(mjreach1_protection_r);
344   DECLARE_WRITE8_MEMBER(mjschuka_protection_w);
345   DECLARE_READ8_MEMBER(mjschuka_protection_r);
346343   DECLARE_READ8_MEMBER(mjchuuka_keyb_r);
347344   DECLARE_WRITE8_MEMBER(mjchuuka_blitter_w);
348345   DECLARE_READ8_MEMBER(mjchuuka_gfxrom_0_r);
r248389r248390
30413038
30423039
30433040/***************************************************************************
3044     Mahjong Super Dai Chuuka Ken
3045***************************************************************************/
3046
3047// 255F: 13 34 7A 96 A8
3048// 2564: 13 34 7A 96 13
3049
3050WRITE8_MEMBER(ddenlovr_state::mjschuka_protection_w)
3051{
3052   m_prot_val = data;
3053}
3054
3055READ8_MEMBER(ddenlovr_state::mjschuka_protection_r)
3056{
3057   switch (m_prot_val)
3058   {
3059      case 0xa8:  return 0x13;
3060   }
3061   return m_prot_val;
3062}
3063
3064static ADDRESS_MAP_START( mjschuka_portmap, AS_IO, 8, ddenlovr_state )
3065   ADDRESS_MAP_GLOBAL_MASK(0xff)
3066   AM_RANGE(0x00, 0x0f) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
3067   AM_RANGE(0x1c, 0x1c) AM_READNOP AM_WRITE(sryudens_rambank_w)    // ? ack on RTC int
3068   AM_RANGE(0x1e, 0x1e) AM_WRITE(mjflove_rombank_w)
3069
3070   AM_RANGE(0x20, 0x23) AM_WRITE(ddenlovr_palette_base_w)
3071   AM_RANGE(0x24, 0x27) AM_WRITE(ddenlovr_palette_mask_w)
3072   AM_RANGE(0x28, 0x2b) AM_WRITE(ddenlovr_transparency_pen_w)
3073   AM_RANGE(0x2c, 0x2f) AM_WRITE(ddenlovr_transparency_mask_w)
3074   AM_RANGE(0x34, 0x34) AM_WRITE(ddenlovr_bgcolor_w)
3075   AM_RANGE(0x35, 0x35) AM_WRITE(ddenlovr_priority_w)
3076   AM_RANGE(0x36, 0x36) AM_WRITE(ddenlovr_layer_enable_w)
3077   AM_RANGE(0x38, 0x38) AM_READNOP         // ? ack or watchdog
3078
3079   AM_RANGE(0x40, 0x41) AM_WRITE(mjmyster_blitter_w)
3080   AM_RANGE(0x43, 0x43) AM_READ(rongrong_gfxrom_r)
3081   AM_RANGE(0x50, 0x50) AM_WRITE(mjflove_okibank_w)
3082
3083   AM_RANGE(0x54, 0x54) AM_READWRITE(mjschuka_protection_r, mjschuka_protection_w)
3084   // 58 writes ? (0/1)
3085   AM_RANGE(0x5c, 0x5c) AM_READ(hanakanz_rand_r)
3086
3087   AM_RANGE(0x60, 0x60) AM_WRITE(sryudens_coincounter_w)
3088   AM_RANGE(0x61, 0x61) AM_WRITE(hanakanz_keyb_w)
3089   AM_RANGE(0x62, 0x62) AM_READ_PORT("SYSTEM")
3090   AM_RANGE(0x63, 0x64) AM_READ(sryudens_keyb_r)
3091
3092   AM_RANGE(0x68, 0x68) AM_READ_PORT("DSW1")
3093   AM_RANGE(0x69, 0x69) AM_READ_PORT("DSW2")
3094   AM_RANGE(0x6a, 0x6a) AM_READ_PORT("DSW3")
3095   AM_RANGE(0x6b, 0x6b) AM_READ_PORT("DSW4")
3096   AM_RANGE(0x6c, 0x6c) AM_READ_PORT("DSW5")     // DSW 1-4 high bits
3097   AM_RANGE(0x70, 0x71) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
3098   AM_RANGE(0x74, 0x74) AM_DEVREADWRITE("oki", okim6295_device, read, write)
3099   AM_RANGE(0x78, 0x79) AM_DEVWRITE("ym2413", ym2413_device, write)
3100ADDRESS_MAP_END
3101
3102
3103/***************************************************************************
31043041                        Mahjong The Mysterious World
31053042***************************************************************************/
31063043
r248389r248390
67546691INPUT_PORTS_END
67556692
67566693
6757static INPUT_PORTS_START( mjschuka )
6758
6759   PORT_START("SYSTEM")
6760   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 )   // medal out
6761   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
6762   PORT_SERVICE(0x04, IP_ACTIVE_LOW)
6763   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )   // analyzer
6764   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE2 )   // data clear
6765   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )  // note
6766   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1)
6767   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
6768
6769   PORT_START("KEY0")
6770   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(2)   // A
6771   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(2)   // E
6772   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(2)   // I
6773   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(2)   // M
6774   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2) // Kan
6775   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) // Start 2
6776
6777   PORT_START("KEY1")
6778   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(2)   // B
6779   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(2)   // F
6780   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(2)   // J
6781   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(2)   // N
6782   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2)   // Reach
6783   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_PLAYER(2) // BET
6784
6785   PORT_START("KEY2")
6786   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(2)   // C
6787   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(2)   // G
6788   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(2)   // K
6789   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(2) // Chi
6790   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2) // Ron
6791   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )    // nothing
6792
6793   PORT_START("KEY3")
6794   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(2)   // D
6795   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(2)   // H
6796   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(2)   // L
6797   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(2) // Pon
6798   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )    // nothing
6799   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )    // nothing
6800
6801   PORT_START("KEY4")
6802   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) PORT_PLAYER(2) // "l"
6803   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_PLAYER(2)   // "t"
6804   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) PORT_PLAYER(2)   // "w"
6805   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2)   // Flip Flop
6806   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG   ) PORT_PLAYER(2)   // "b"
6807   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_PLAYER(2)   // "s"
6808
6809   PORT_START("KEY5")
6810   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )  // A
6811   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E )  // E
6812   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I )  // I
6813   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M )  // M
6814   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )    // Kan
6815   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) // Start 1
6816
6817   PORT_START("KEY6")
6818   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )  // B
6819   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )  // F
6820   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J )  // J
6821   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N )  // N
6822   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )  // Reach
6823   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET )    // BET
6824
6825   PORT_START("KEY7")
6826   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C )  // C
6827   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G )  // G
6828   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )  // K
6829   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )    // Chi
6830   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON )    // Ron
6831   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )    // nothing
6832
6833   PORT_START("KEY8")
6834   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D )  // D
6835   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H )  // H
6836   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L )  // L
6837   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON )    // Pon
6838   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )    // nothing
6839   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )    // nothing
6840
6841   PORT_START("KEY9")
6842   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE )    // "l"
6843   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE )  // "t"
6844   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP )  // "w"
6845   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )  // Flip Flop
6846   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG )    // "b"
6847   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL )  // "s"
6848
6849   PORT_START("DSW1")
6850   PORT_DIPNAME( 0x0f, 0x07, "Pay Out Rate (%)" )
6851   PORT_DIPSETTING(    0x00, "50" )
6852   PORT_DIPSETTING(    0x01, "53" )
6853   PORT_DIPSETTING(    0x02, "56" )
6854   PORT_DIPSETTING(    0x03, "59" )
6855   PORT_DIPSETTING(    0x04, "62" )
6856   PORT_DIPSETTING(    0x05, "65" )
6857   PORT_DIPSETTING(    0x06, "68" )
6858   PORT_DIPSETTING(    0x07, "71" )
6859   PORT_DIPSETTING(    0x08, "75" )
6860   PORT_DIPSETTING(    0x09, "78" )
6861   PORT_DIPSETTING(    0x0a, "81" )
6862   PORT_DIPSETTING(    0x0b, "84" )
6863   PORT_DIPSETTING(    0x0c, "87" )
6864   PORT_DIPSETTING(    0x0d, "90" )
6865   PORT_DIPSETTING(    0x0e, "93" )
6866   PORT_DIPSETTING(    0x0f, "96" )
6867   PORT_DIPNAME( 0x30, 0x30, "Odds Rate" )
6868   PORT_DIPSETTING(    0x20, "1 2 3 4 6 8 10 15" )
6869   PORT_DIPSETTING(    0x30, "1 2 4 8 12 16 24 32" )
6870   PORT_DIPSETTING(    0x00, "1 2 3 5 8 15 30 50" )
6871   PORT_DIPSETTING(    0x10, "1 2 3 5 10 25 50 100" )
6872   PORT_DIPNAME( 0xc0, 0xc0, "Max Bet" )
6873   PORT_DIPSETTING(    0xc0, "1" )
6874   PORT_DIPSETTING(    0x80, "5" )
6875   PORT_DIPSETTING(    0x40, "10" )
6876   PORT_DIPSETTING(    0x00, "20" )
6877
6878   PORT_START("DSW2")
6879   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
6880   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
6881   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
6882   PORT_DIPSETTING(    0x01, DEF_STR( 1C_5C ) )
6883   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )
6884   PORT_DIPNAME( 0x0c, 0x0c, "Min Rate To Play" )
6885   PORT_DIPSETTING(    0x0c, "1" )
6886   PORT_DIPSETTING(    0x08, "2" )
6887   PORT_DIPSETTING(    0x04, "3" )
6888   PORT_DIPSETTING(    0x00, "5" )
6889   PORT_DIPNAME( 0x30, 0x30, "Payout" )
6890   PORT_DIPSETTING(    0x30, "300" )
6891   PORT_DIPSETTING(    0x20, "500" )
6892   PORT_DIPSETTING(    0x10, "700" )
6893   PORT_DIPSETTING(    0x00, "1000" )
6894   PORT_DIPNAME( 0x40, 0x40, "W-BET" )
6895   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
6896   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6897   PORT_DIPNAME( 0x80, 0x80, "Last Chance" )
6898   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
6899   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6900
6901   PORT_START("DSW3")
6902   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
6903   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
6904   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6905   PORT_DIPNAME( 0x02, 0x00, "In Game Music" )
6906   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
6907   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6908   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
6909   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
6910   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6911   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
6912   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
6913   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6914   PORT_DIPNAME( 0x10, 0x00, "Girls" )
6915   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
6916   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6917   PORT_DIPNAME( 0x20, 0x00, "Girls Speech" )
6918   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
6919   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6920   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
6921   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
6922   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6923   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
6924   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
6925   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6926
6927   PORT_START("DSW4")
6928   PORT_DIPNAME( 0x07, 0x07, "YAKUMAN Bonus" )
6929   PORT_DIPSETTING(    0x07, "Cut" )
6930   PORT_DIPSETTING(    0x06, "1 T" )
6931   PORT_DIPSETTING(    0x05, "300" )
6932   PORT_DIPSETTING(    0x04, "500" )
6933   PORT_DIPSETTING(    0x03, "700" )
6934   PORT_DIPSETTING(    0x02, "1000" )
6935   PORT_DIPSETTING(    0x01, "1000?" )
6936   PORT_DIPSETTING(    0x00, "1000?" )
6937   PORT_DIPNAME( 0x08, 0x08, "YAKUMAN Times?" )
6938   PORT_DIPSETTING(    0x00, "1" )
6939   PORT_DIPSETTING(    0x08, "2" )
6940   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
6941   PORT_DIPSETTING(    0x00, "140" )
6942   PORT_DIPSETTING(    0x10, "160" )
6943   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
6944   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
6945   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6946   PORT_DIPNAME( 0x40, 0x40, "DonDen Key" )
6947   PORT_DIPSETTING(    0x40, "Start" )
6948   PORT_DIPSETTING(    0x00, "Flip Flop" )
6949   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
6950   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
6951   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6952
6953   PORT_START("DSW5")
6954   PORT_DIPNAME( 0x01, 0x01, "Credits Per Note" )
6955   PORT_DIPSETTING(    0x01, "5" )
6956   PORT_DIPSETTING(    0x00, "10" )
6957   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
6958   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
6959   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6960   PORT_DIPNAME( 0x0c, 0x0c, "Computer Strength?" )
6961   PORT_DIPSETTING(    0x0c, "Weak" )
6962   PORT_DIPSETTING(    0x08, DEF_STR( Normal ))
6963   PORT_DIPSETTING(    0x04, "Strong" )
6964   PORT_DIPSETTING(    0x00, "Very Strong" )
6965   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
6966   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
6967   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6968   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
6969   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
6970   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6971   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
6972   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
6973   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6974   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
6975   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
6976   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6977
6978   PORT_START("BET")
6979   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
6980   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
6981   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6982
6983   PORT_START("HOPPER")
6984   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
6985   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
6986   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6987
6988INPUT_PORTS_END
6989
6990
69916694static INPUT_PORTS_START( funkyfig )
69926695   PORT_START("IN0")   /* Keys (port 83 with port 80 = 20) */
69936696   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
r248389r248390
102089911
102099912
102109913/***************************************************************************
10211     Mahjong Super Dai Chuuka Ken
10212***************************************************************************/
10213
10214static MACHINE_CONFIG_START( mjschuka, ddenlovr_state )
10215
10216   /* basic machine hardware */
10217   MCFG_CPU_ADD("maincpu",Z80,XTAL_16MHz/2)
10218   MCFG_CPU_PROGRAM_MAP(mjmyster_map)
10219   MCFG_CPU_IO_MAP(mjschuka_portmap)
10220   MCFG_CPU_VBLANK_INT_DRIVER("screen", ddenlovr_state, hginga_irq)
10221
10222   MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,hanakanz)
10223   MCFG_MACHINE_RESET_OVERRIDE(ddenlovr_state,ddenlovr)
10224
10225   /* video hardware */
10226   MCFG_SCREEN_ADD("screen", RASTER)
10227   MCFG_SCREEN_REFRESH_RATE(60)
10228   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
10229   MCFG_SCREEN_SIZE(336, 256+22)
10230   MCFG_SCREEN_VISIBLE_AREA(0, 336-1, 5, 256-11-1)
10231   MCFG_SCREEN_UPDATE_DRIVER(ddenlovr_state, screen_update_ddenlovr)
10232   MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
10233   MCFG_SCREEN_PALETTE("palette")
10234
10235   MCFG_PALETTE_ADD("palette", 0x200)
10236
10237   MCFG_VIDEO_START_OVERRIDE(ddenlovr_state,mjflove)  // blitter commands in the roms are shuffled around
10238
10239   /* sound hardware */
10240   MCFG_SPEAKER_STANDARD_MONO("mono")
10241
10242   MCFG_SOUND_ADD("ym2413", YM2413, XTAL_28_63636MHz / 8)
10243   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
10244
10245   MCFG_SOUND_ADD("aysnd", AY8910, XTAL_28_63636MHz / 8)
10246   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
10247
10248   MCFG_OKIM6295_ADD("oki", XTAL_28_63636MHz / 28, OKIM6295_PIN7_HIGH)
10249   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
10250
10251   /* devices */
10252   MCFG_DEVICE_ADD("rtc", MSM6242, XTAL_32_768kHz)
10253   MCFG_MSM6242_OUT_INT_HANDLER(WRITELINE(ddenlovr_state, hginga_rtc_irq))
10254MACHINE_CONFIG_END
10255
10256
10257/***************************************************************************
102589914                        Mahjong The Mysterious World
102599915***************************************************************************/
102609916
r248389r248390
1184011496
1184111497/***************************************************************************
1184211498
11843Mahjong Super Dai Chuuka Ken (Dynax, 1995)
11844
11845PCB Layout
11846----------
11847
11848Dynax Inc. Nagoya Japan D11510198L1
11849sticker: D11509208L1
11850|----------------------------------------|
11851| MB3714A   TA7535(x2) M6295 1151 3V_BATT|
11852|   VOL  YMZ284-D   YM2413   1152        |
11853| DSW5                 16MHz      PAL    |
11854|                      CPU  62256        |
11855| ULN2003                   1153 62421RTC|
11856|       PLCC44/68                        |
11857|                                        |
11858|            28.63636MHz         M514262 |
11859|                                M514262 |
11860|                   QFP208       M514262 |
11861|            CXK5863             M514262 |
11862|                            PAL         |
11863|DSW1 DSW2                       1154    |
11864|DSW3 DSW4                       1155    |
11865|----------------------------------------|
11866Notes:
11867      PLCC44 and QFP208 unknown (surface scratched), location has alternative pads for PLCC68
11868      CPU    - surface scratched. clock input 16MHz, looks like TMPZ8400
11869      M6295  - clock 1.0227MHz (28.63636/28). Pin 7 HIGH
11870      YMZ284 - clock 3.579545MHz (28.63636/8)
11871      YM2413 - clock 3.579545MHz (28.63636/8)
11872      DSW1-4 - 10-position DIP switches
11873      DSW5   - 4-position DIP switch
11874      TA7535 - = LM358
11875      VSync  - 60.8529Hz
11876      HSync  - 15.2790kHz
11877      EPROM 1152 is M27C1001, others are MX27C4000
11878
11879***************************************************************************/
11880
11881ROM_START( mjschuka )
11882   ROM_REGION( 0x90000+16*0x1000, "maincpu", 0 )   /* Z80 Code */
11883   ROM_LOAD( "1153.5c", 0x00000, 0x80000, CRC(67cf10db) SHA1(a813f44578eb2d67b4346ffd9c15e44e7fa91ca7) )
11884   ROM_RELOAD(          0x10000, 0x80000 )
11885
11886   ROM_REGION( 0x100000, "blitter", 0 )    /* blitter data */
11887   ROM_LOAD( "1154.11b", 0x00000, 0x80000, CRC(b8d04189) SHA1(1acac851c21e1055843e1398087d7afd8b9201b8) )
11888   ROM_LOAD( "1155.12b", 0x80000, 0x80000, CRC(4208edcf) SHA1(444472107dac548956d2749cd892214efb6ff2f6) )
11889
11890   ROM_REGION( 0x200000, "oki", 0 ) /* Samples */
11891   ROM_LOAD( "1151.1c", 0x000000, 0x80000, CRC(c92065a9) SHA1(65c38c3a31d3f4b8240a16fdcdf376acdf5c17d2) )
11892   ROM_RELOAD(          0x100000, 0x20000 )
11893   ROM_LOAD( "1152.2c", 0x080000, 0x20000, CRC(f9244532) SHA1(b502d8d3569c4b4d655af3baf05a3c79831a84ff) )
11894   ROM_RELOAD(          0x180000, 0x20000 )
11895   ROM_RELOAD(          0x0a0000, 0x20000 )
11896   ROM_RELOAD(          0x1a0000, 0x20000 )
11897   ROM_RELOAD(          0x0c0000, 0x20000 )
11898   ROM_RELOAD(          0x1c0000, 0x20000 )
11899ROM_END
11900
11901
11902/***************************************************************************
11903
1190411499The First Funky Fighter
1190511500Nakanihon, 1994
1190611501
r248389r248390
1302112616GAME( 1994, hparadis,  0,        hparadis,  hparadis, driver_device, 0,        ROT0, "Dynax",                                       "Super Hana Paradise (Japan)",                                     GAME_NO_COCKTAIL  )
1302212617GAME( 1995, hgokou,    0,        hgokou,    hgokou,   driver_device, 0,        ROT0, "Dynax (Alba license)",                        "Hanafuda Hana Gokou (Japan)",                                     GAME_NO_COCKTAIL  )
1302312618GAME( 1995, hgokbang,  hgokou,   hgokbang,  hgokou,   driver_device, 0,        ROT0, "Dynax",                                       "Hanafuda Hana Gokou Bangaihen (Japan)",                           GAME_NO_COCKTAIL  )
13024GAME( 1995, mjdchuka,  0,        mjchuuka,  mjchuuka, driver_device, 0,        ROT0, "Dynax",                                       "Mahjong The Dai Chuuka Ken (China, D111)",                        GAME_NO_COCKTAIL  )
13025GAME( 1995, mjschuka,  0,        mjschuka,  mjschuka, driver_device, 0,        ROT0, "Dynax",                                       "Mahjong Super Dai Chuuka Ken (Japan, D115)",                      GAME_NO_COCKTAIL  )
12619GAME( 1995, mjdchuka,  0,        mjchuuka,  mjchuuka, driver_device, 0,        ROT0, "Dynax",                                       "Mahjong The Dai Chuuka Ken (China, v. D111)",                     GAME_NO_COCKTAIL  )
1302612620GAME( 1995, nettoqc,   0,        nettoqc,   nettoqc,  driver_device, 0,        ROT0, "Nakanihon",                                   "Nettoh Quiz Champion (Japan)",                                    GAME_NO_COCKTAIL  | GAME_IMPERFECT_COLORS )
1302712621GAME( 1995, ultrchmp,  nettoqc,  ultrchmp,  ultrchmp, driver_device, 0,        ROT0, "Nakanihon",                                   "Se Gye Hweng Dan Ultra Champion (Korea)",                         GAME_NO_COCKTAIL  | GAME_IMPERFECT_COLORS )
1302812622GAME( 1995, ultrchmph, nettoqc,  ultrchmp,  ultrchmp, driver_device, 0,        ROT0, "Nakanihon",                                   "Cheng Ba Shi Jie - Chao Shi Kong Guan Jun (Taiwan)",              GAME_NO_COCKTAIL  | GAME_IMPERFECT_COLORS )
r248389r248390
1304212636GAME( 1997, hkagerou,  0,        hkagerou,  hkagerou, driver_device, 0,        ROT0, "Nakanihon / Dynax",                           "Hana Kagerou [BET] (Japan)",                                      GAME_NO_COCKTAIL  )
1304312637GAME( 1998, mjchuuka,  0,        mjchuuka,  mjchuuka, driver_device, 0,        ROT0, "Dynax",                                       "Mahjong Chuukanejyo (China)",                                     GAME_NO_COCKTAIL  )
1304412638GAME( 1998, mjreach1,  0,        mjreach1,  mjreach1, driver_device, 0,        ROT0, "Nihon System",                                "Mahjong Reach Ippatsu (Japan)",                                   GAME_NO_COCKTAIL  )
13045GAME( 1999, jongtei,   0,        jongtei,   jongtei,  driver_device, 0,        ROT0, "Dynax",                                       "Mahjong Jong-Tei (Japan, NM532-01)",                              GAME_NO_COCKTAIL  )
12639GAME( 1999, jongtei,   0,        jongtei,   jongtei,  driver_device, 0,        ROT0, "Dynax",                                       "Mahjong Jong-Tei (Japan, ver. NM532-01)",                         GAME_NO_COCKTAIL  )
1304612640GAME( 2002, daimyojn,  0,        daimyojn,  daimyojn, driver_device, 0,        ROT0, "Dynax / Techno-Top / Techno-Planning",        "Mahjong Daimyojin (Japan, T017-PB-00)",                           GAME_NO_COCKTAIL  )
13047GAME( 2004, momotaro,  0,        daimyojn,  daimyojn, ddenlovr_state,momotaro, ROT0, "Techno-Top",                                  "Mahjong Momotarou (Japan)",                                       GAME_NO_COCKTAIL  | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
12641GAME( 2004, momotaro,  0,        daimyojn,  daimyojn, ddenlovr_state,   momotaro, ROT0, "Techno-Top",                               "Mahjong Momotarou (Japan)",                                       GAME_NO_COCKTAIL  | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
trunk/src/mame/drivers/dec0.c
r248389r248390
29412941ROM_END
29422942
29432943
2944ROM_START( midresbj )
2945   ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 code */
2946   ROM_LOAD16_BYTE( "14",         0x00000, 0x10000, CRC(6b3bc886) SHA1(998ef6ae89565148bcb8909f21acbec378ed5f4f) )
2947   ROM_LOAD16_BYTE( "11",         0x00001, 0x10000, CRC(9b6faab3) SHA1(b60e41972f52df910bfa09accd5fde7d858b55bf) )
2948   ROM_LOAD16_BYTE( "13",         0x20000, 0x10000, CRC(d1bb2cd6) SHA1(6d4afd8dd8c4c3e90de199358da27108286637e2) )
2949   ROM_LOAD16_BYTE( "10",         0x20001, 0x10000, CRC(42ccdd0d) SHA1(ef17cc984a8d57e9c52877f4e9b78e9976f99033) )
2950   ROM_LOAD16_BYTE( "12",         0x40000, 0x10000, CRC(258b10b2) SHA1(f0849801ab2c72bc6e929b230d0c6d41823f18ae) )
2951   ROM_LOAD16_BYTE( "9",          0x40001, 0x10000, CRC(dd6985d5) SHA1(bd58a1da2c5152464d7660f5b931d6257cb87c4e) )
2952
2953   ROM_REGION( 0x10000, "audiocpu", 0 )    /* 6502 sound */
2954   ROM_LOAD( "15",         0x0000, 0x10000, CRC(99d47166) SHA1(a9a1adfe47be8dd3e4d6f8c783447e09be1747b2) )
2955
2956   ROM_REGION( 0x10000, "cpu2", ROMREGION_ERASE00 )    /* 68705 MCU */
2957   //ROM_LOAD( "68705r3.bin",              0x00000, 0x1000, CRC(ad5b1c13) SHA1(3616dc5969323a54e3e171d169f76250ae4e711a) ) // unpopulated socket
2958
2959   ROM_REGION( 0x20000, "gfx1", 0 ) /* chars */
2960   ROM_LOAD( "23",             0x08000, 0x08000, CRC(d75aba06) SHA1(cb3b969db3dd8e0c5c3729482f7461cde3a961f3) )
2961   ROM_CONTINUE(                   0x00000, 0x08000 )  /* the two halves are swapped */
2962   ROM_LOAD( "24",             0x18000, 0x08000, CRC(8f5bbb79) SHA1(cb10f68787606111ba5e9967bf0b0cd21269a902) )
2963   ROM_CONTINUE(                   0x10000, 0x08000 )
2964
2965   ROM_REGION( 0x80000, "gfx2", 0 ) /* tiles */
2966   ROM_LOAD( "19",             0x00000, 0x20000, CRC(fd9ba1bd) SHA1(a105a4335eeed19662c89ab0f90485f1029cf03f) )
2967   ROM_LOAD( "18",             0x20000, 0x20000, CRC(a936c03c) SHA1(293e69874ce9b2dfb1d605c9f988fa736b12bbcf) )
2968   ROM_LOAD( "20",             0x40000, 0x20000, CRC(4d8e3cf1) SHA1(db804a608f6ba9ce4cedfec2581bcbb00de3f2ba) )
2969   ROM_LOAD( "17",             0x60000, 0x20000, CRC(b7241ab9) SHA1(3e83f9285ff4c476f1287bf73b514eace482dccc) )
2970
2971   ROM_REGION( 0x40000, "gfx3", 0 ) /* tiles */
2972   ROM_LOAD( "22",             0x10000, 0x10000, CRC(35a54bb4) SHA1(1869eb77a060e9df42b761b02e7fa5ecb7c414d1) )
2973   ROM_CONTINUE(0x00000,0x10000)
2974   ROM_LOAD( "21",             0x30000, 0x10000, CRC(4b9227b3) SHA1(7059f2d07fffa0468a45a42b87bf561da5e9c5a4) )
2975   ROM_CONTINUE(0x20000,0x10000)
2976
2977   ROM_REGION( 0x80000, "gfx4", 0 ) /* sprites */
2978   ROM_LOAD( "4",             0x00000, 0x10000, CRC(3f499acb) SHA1(1a22cfeed0497ddc2d571114d9f246b3ae18ede9) )
2979   ROM_LOAD( "8",             0x10000, 0x10000, CRC(5e7a6800) SHA1(8dd5c9005b6804a30627644053f14e4477fe0074) )
2980   ROM_LOAD( "2",             0x20000, 0x10000, CRC(897ba6e4) SHA1(70fd9cba3922751cb317770d6effdc2fb94c1324) )
2981   ROM_LOAD( "6",             0x30000, 0x10000, CRC(9fefb810) SHA1(863a81540261e78de5c612dea807ba29b12054d4) )
2982   ROM_LOAD( "3",             0x40000, 0x10000, CRC(ebafe720) SHA1(b9f76d2f1b59f1d028e6156b831c5c8ada033641) )
2983   ROM_LOAD( "7",             0x50000, 0x10000, CRC(bb8cf641) SHA1(a22e47a15d38d4f33e5a2c90f3a90a16a4231d2c) ) // slight changes, check (equivalent to 3.bin in above)
2984   ROM_LOAD( "1",             0x60000, 0x10000, CRC(fd0bd8d3) SHA1(d6b19869ddc2a8ed4f38ba9d613b71853f2d13c0) )
2985   ROM_LOAD( "5",             0x70000, 0x10000, CRC(fc46d5ed) SHA1(20ddf3f67f0dfb222ad8d3fd464b892ec9c9e4f5) )
2986
2987   ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */
2988   ROM_LOAD( "16",            0x00000, 0x10000, CRC(ccf24b52) SHA1(39b2663c548b30684197284cb8e7a6ca803330c9))
2989ROM_END
2990
29912944ROM_START( bouldash )
29922945   ROM_REGION( 0x60000, "maincpu", 0 ) /* 68000 code */
29932946   ROM_LOAD16_BYTE( "fw-15-2.17l",   0x00000, 0x10000, CRC(ca19a967) SHA1(b9dc2b1323f19b6239e550ed020943bf13de8db0) )
r248389r248390
31293082GAME( 1988, drgninjab,  baddudes, baddudes, drgninja, dec0_state, baddudes, ROT0,   "bootleg", "Dragonninja (bootleg)", GAME_SUPPORTS_SAVE )
31303083
31313084// this is a common bootleg board
3132GAME( 1989, midresb,    midres,   midresb,  midresb, dec0_state,  midresb,  ROT0,   "bootleg", "Midnight Resistance (bootleg with 68705)", GAME_SUPPORTS_SAVE ) // need to hook up 68705? (probably unused)
3133GAME( 1989, midresbj,   midres,   midresb,  midresb, dec0_state,  midresb,  ROT0,   "bootleg", "Midnight Resistance (Joystick bootleg)", GAME_SUPPORTS_SAVE )
3085GAME( 1989, midresb,    midres,   midresb,  midresb, dec0_state,  midresb,  ROT0,   "bootleg", "Midnight Resistance (bootleg with 68705)", GAME_SUPPORTS_SAVE ) // need to hook up 68705?
31343086GAME( 1989, ffantasybl, hippodrm, ffantasybl, ffantasybl, dec0_state, ffantasybl,   ROT0,   "bootleg", "Fighting Fantasy (bootleg with 68705)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // 68705 not dumped, might be the same as midresb
31353087/* A Bad Dudes bootleg with 68705 like the midres and ffantasy ones exists, but is not dumped */
31363088
trunk/src/mame/drivers/destroyr.c
r248389r248390
2929
3030   destroyr_state(const machine_config &mconfig, device_type type, const char *tag)
3131      : driver_device(mconfig, type, tag),
32      m_alpha_num_ram(*this, "alpha_nuram"),
33      m_major_obj_ram(*this, "major_obj_ram"),
34      m_minor_obj_ram(*this, "minor_obj_ram"),
3235      m_maincpu(*this, "maincpu"),
3336      m_gfxdecode(*this, "gfxdecode"),
3437      m_screen(*this, "screen"),
35      m_palette(*this, "palette"),
36      m_alpha_num_ram(*this, "alpha_nuram"),
37      m_major_obj_ram(*this, "major_obj_ram"),
38      m_minor_obj_ram(*this, "minor_obj_ram") { }
38      m_palette(*this, "palette") { }
3939
40   /* devices */
41   required_device<cpu_device> m_maincpu;
42   required_device<gfxdecode_device> m_gfxdecode;
43   required_device<screen_device> m_screen;
44   required_device<palette_device> m_palette;
45
4640   /* memory pointers */
4741   required_shared_ptr<UINT8> m_alpha_num_ram;
4842   required_shared_ptr<UINT8> m_major_obj_ram;
r248389r248390
5852   int            m_attract;
5953   int            m_motor_speed;
6054   int            m_noise;
61   emu_timer      *m_dial_timer;
62   emu_timer      *m_frame_timer;
6355
64   DECLARE_WRITE8_MEMBER(misc_w);
65   DECLARE_WRITE8_MEMBER(cursor_load_w);
66   DECLARE_WRITE8_MEMBER(interrupt_ack_w);
67   DECLARE_WRITE8_MEMBER(output_w);
68   DECLARE_READ8_MEMBER(input_r);
69   DECLARE_READ8_MEMBER(scanline_r);
56   /* devices */
57   required_device<cpu_device> m_maincpu;
58   required_device<gfxdecode_device> m_gfxdecode;
59   required_device<screen_device> m_screen;
60   required_device<palette_device> m_palette;
7061
62   DECLARE_WRITE8_MEMBER(destroyr_misc_w);
63   DECLARE_WRITE8_MEMBER(destroyr_cursor_load_w);
64   DECLARE_WRITE8_MEMBER(destroyr_interrupt_ack_w);
65   DECLARE_WRITE8_MEMBER(destroyr_output_w);
66   DECLARE_READ8_MEMBER(destroyr_input_r);
67   DECLARE_READ8_MEMBER(destroyr_scanline_r);
7168   virtual void machine_start();
7269   virtual void machine_reset();
7370   DECLARE_PALETTE_INIT(destroyr);
71   UINT32 screen_update_destroyr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
72   TIMER_CALLBACK_MEMBER(destroyr_dial_callback);
73   TIMER_CALLBACK_MEMBER(destroyr_frame_callback);
7474
75   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
76
77   TIMER_CALLBACK_MEMBER(dial_callback);
78   TIMER_CALLBACK_MEMBER(frame_callback);
79
8075protected:
8176   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
8277};
8378
8479
85UINT32 destroyr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
80UINT32 destroyr_state::screen_update_destroyr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
8681{
8782   int i, j;
8883
r248389r248390
154149   switch (id)
155150   {
156151   case TIMER_DESTROYR_DIAL:
157      dial_callback(ptr, param);
152      destroyr_dial_callback(ptr, param);
158153      break;
159154   case TIMER_DESTROYR_FRAME:
160      frame_callback(ptr, param);
155      destroyr_frame_callback(ptr, param);
161156      break;
162157   default:
163158      assert_always(FALSE, "Unknown id in destroyr_state::device_timer");
r248389r248390
165160}
166161
167162
168TIMER_CALLBACK_MEMBER(destroyr_state::dial_callback)
163TIMER_CALLBACK_MEMBER(destroyr_state::destroyr_dial_callback)
169164{
170165   int dial = param;
171166
r248389r248390
185180}
186181
187182
188TIMER_CALLBACK_MEMBER(destroyr_state::frame_callback)
183TIMER_CALLBACK_MEMBER(destroyr_state::destroyr_frame_callback)
189184{
190185   m_potsense[0] = 0;
191186   m_potsense[1] = 0;
192187
193188   /* PCB supports two dials, but cab has only got one */
194   m_dial_timer->adjust(m_screen->time_until_pos(ioport("PADDLE")->read()));
195   m_frame_timer->adjust(m_screen->time_until_pos(0));
189   timer_set(m_screen->time_until_pos(ioport("PADDLE")->read()), TIMER_DESTROYR_DIAL);
190   timer_set(m_screen->time_until_pos(0), TIMER_DESTROYR_FRAME);
196191}
197192
198193
r248389r248390
212207}
213208
214209
215WRITE8_MEMBER(destroyr_state::misc_w)
210WRITE8_MEMBER(destroyr_state::destroyr_misc_w)
216211{
217212   /* bits 0 to 2 connect to the sound circuits */
218213   m_attract = data & 0x01;
r248389r248390
227222}
228223
229224
230WRITE8_MEMBER(destroyr_state::cursor_load_w)
225WRITE8_MEMBER(destroyr_state::destroyr_cursor_load_w)
231226{
232227   m_cursor = data;
233228   watchdog_reset_w(space, offset, data);
234229}
235230
236231
237WRITE8_MEMBER(destroyr_state::interrupt_ack_w)
232WRITE8_MEMBER(destroyr_state::destroyr_interrupt_ack_w)
238233{
239234   m_maincpu->set_input_line(0, CLEAR_LINE);
240235}
241236
242237
243WRITE8_MEMBER(destroyr_state::output_w)
238WRITE8_MEMBER(destroyr_state::destroyr_output_w)
244239{
245   if (offset & 8) misc_w(space, 8, data);
240   if (offset & 8) destroyr_misc_w(space, 8, data);
246241
247242   else switch (offset & 7)
248243   {
r248389r248390
274269}
275270
276271
277READ8_MEMBER(destroyr_state::input_r)
272READ8_MEMBER(destroyr_state::destroyr_input_r)
278273{
279274   if (offset & 1)
280275   {
r248389r248390
295290}
296291
297292
298READ8_MEMBER(destroyr_state::scanline_r)
293READ8_MEMBER(destroyr_state::destroyr_scanline_r)
299294{
300295   return m_screen->vpos();
301296}
r248389r248390
304299static ADDRESS_MAP_START( destroyr_map, AS_PROGRAM, 8, destroyr_state )
305300   ADDRESS_MAP_GLOBAL_MASK(0x7fff)
306301   AM_RANGE(0x0000, 0x00ff) AM_MIRROR(0xf00) AM_RAM
307   AM_RANGE(0x1000, 0x1fff) AM_READWRITE(input_r, output_w)
302   AM_RANGE(0x1000, 0x1fff) AM_READWRITE(destroyr_input_r, destroyr_output_w)
308303   AM_RANGE(0x2000, 0x2fff) AM_READ_PORT("IN2")
309304   AM_RANGE(0x3000, 0x30ff) AM_MIRROR(0xf00) AM_WRITEONLY AM_SHARE("alpha_nuram")
310305   AM_RANGE(0x4000, 0x401f) AM_MIRROR(0xfe0) AM_WRITEONLY AM_SHARE("major_obj_ram")
311   AM_RANGE(0x5000, 0x5000) AM_MIRROR(0xff8) AM_WRITE(cursor_load_w)
312   AM_RANGE(0x5001, 0x5001) AM_MIRROR(0xff8) AM_WRITE(interrupt_ack_w)
306   AM_RANGE(0x5000, 0x5000) AM_MIRROR(0xff8) AM_WRITE(destroyr_cursor_load_w)
307   AM_RANGE(0x5001, 0x5001) AM_MIRROR(0xff8) AM_WRITE(destroyr_interrupt_ack_w)
313308   AM_RANGE(0x5002, 0x5007) AM_MIRROR(0xff8) AM_WRITEONLY AM_SHARE("minor_obj_ram")
314   AM_RANGE(0x6000, 0x6fff) AM_READ(scanline_r)
309   AM_RANGE(0x6000, 0x6fff) AM_READ(destroyr_scanline_r)
315310   AM_RANGE(0x7000, 0x7fff) AM_ROM
316311ADDRESS_MAP_END
317312
r248389r248390
474469
475470void destroyr_state::machine_start()
476471{
477   m_dial_timer = timer_alloc(TIMER_DESTROYR_DIAL);
478   m_frame_timer = timer_alloc(TIMER_DESTROYR_FRAME);
479   
480472   save_item(NAME(m_cursor));
481473   save_item(NAME(m_wavemod));
482474   save_item(NAME(m_attract));
r248389r248390
499491   MCFG_SCREEN_REFRESH_RATE(60)
500492   MCFG_SCREEN_SIZE(256, 262)
501493   MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 239)
502   MCFG_SCREEN_UPDATE_DRIVER(destroyr_state, screen_update)
494   MCFG_SCREEN_UPDATE_DRIVER(destroyr_state, screen_update_destroyr)
503495   MCFG_SCREEN_PALETTE("palette")
504496
505497   MCFG_GFXDECODE_ADD("gfxdecode", "palette", destroyr)
r248389r248390
560552ROM_END
561553
562554
563GAMEL( 1977, destroyr,  0,        destroyr, destroyr, driver_device, 0, ORIENTATION_FLIP_X, "Atari", "Destroyer (version O2)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE, layout_destroyr )
564GAMEL( 1977, destroyr1, destroyr, destroyr, destroyr, driver_device, 0, ORIENTATION_FLIP_X, "Atari", "Destroyer (version O1)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE, layout_destroyr )
555GAMEL( 1977, destroyr,  0,        destroyr, destroyr, driver_device, 0, ORIENTATION_FLIP_X, "Atari", "Destroyer (version O2)", GAME_NO_SOUND, layout_destroyr )
556GAMEL( 1977, destroyr1, destroyr, destroyr, destroyr, driver_device, 0, ORIENTATION_FLIP_X, "Atari", "Destroyer (version O1)", GAME_NO_SOUND, layout_destroyr )
trunk/src/mame/drivers/dynax.c
r248389r248390
53525352   ROM_LOAD( "promat02.bin",  0x200, 0x200, CRC(e38eb360) SHA1(739960dd57ec3305edd57aa63816a81ddfbebf3e) )
53535353ROM_END
53545354
5355ROM_START( mayac )
5356   ROM_REGION( 0x90000, "maincpu", 0 ) // Z80 Code
5357   ROM_LOAD( "e16", 0x00000, 0x10000, CRC(badafb62) SHA1(eabe390f5b3ca6acd4b194b65b81fda7ddca35b8) )
5358   ROM_LOAD( "e15", 0x28000, 0x10000, CRC(7ea5b49a) SHA1(aaae848669d9f88c0660f46cc801e4eb0f5e3b89) )
5359
5360   ROM_REGION( 0xc0000, "gfx1", 0 )
5361   ROM_LOAD( "g18", 0x00000, 0x40000, CRC(b621955c) SHA1(8bb3cf16585f33e81921efe7958cf8ca08e8df7f) )
5362   ROM_LOAD( "g16", 0x40000, 0x40000, CRC(26b1c824) SHA1(e1a1a51ef94a3933d5fe4b3d47ad2c1dfb9a1c19) )
5363   ROM_LOAD( "g15", 0x80000, 0x40000, CRC(f7c6f77e) SHA1(27ba271ec67504dc0c6f9b20362206bbd4b0d90a) )
5364
5365   ROM_REGION( 0x400, "proms", 0 ) // Color PROMs
5366   ROM_LOAD( "82s147-2.b5",  0x000, 0x200, CRC(5091de2b) SHA1(ae13676cd2fbde1b87c85480283b24440e069ba4) ) // FIXED BITS (0xxxxxxx)
5367   ROM_LOAD( "82s147-1.b6",  0x200, 0x200, CRC(6d4940cd) SHA1(33875fd846977f8839fdb0f2a259959994552f35) )
5368ROM_END
5369
5370
53715355ROM_START( inca )
53725356   ROM_REGION( 0x90000, "maincpu", 0 ) // Z80 Code
53735357   ROM_LOAD( "am27c512.1", 0x00000, 0x10000, CRC(b0d513f7) SHA1(65ef4702302bbfc7c7a77f7353120ee3f5c94b31) )
r248389r248390
54565440
54575441   }
54585442}
5459   
54605443
5461DRIVER_INIT_MEMBER(dynax_state, maya_common)
5444DRIVER_INIT_MEMBER(dynax_state,maya)
54625445{
54635446   /* Address lines scrambling on 1 z80 rom */
5447   int i;
5448   UINT8   *gfx = (UINT8 *)memregion("gfx1")->base();
54645449   UINT8   *rom = memregion("maincpu")->base() + 0x28000, *end = rom + 0x10000;
54655450   for ( ; rom < end; rom += 8)
54665451   {
r248389r248390
54715456      rom[0] = temp[0];   rom[1] = temp[4];   rom[2] = temp[1];   rom[3] = temp[5];
54725457      rom[4] = temp[2];   rom[5] = temp[6];   rom[6] = temp[3];   rom[7] = temp[7];
54735458   }
5474}
54755459
5476
5477DRIVER_INIT_MEMBER(dynax_state,maya)
5478{
5479   DRIVER_INIT_CALL(maya_common);
5480
5481   UINT8   *gfx = (UINT8 *)memregion("gfx1")->base();
5482   int i;
5483
54845460   /* Address lines scrambling on the blitter data roms */
54855461   {
54865462      dynamic_buffer rom(0xc0000);
54875463      memcpy(&rom[0], gfx, 0xc0000);
54885464      for (i = 0; i < 0xc0000; i++)
5489         gfx[i] = rom[BITSWAP24(i, 23, 22, 21, 20, 19, 18, 14, 15, 16, 17, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)];
5465         gfx[i] = rom[BITSWAP24(i,23,22,21,20,19,18,14,15, 16,17,13,12,11,10,9,8, 7,6,5,4,3,2,1,0)];
54905466   }
54915467}
54925468
54935469
5494DRIVER_INIT_MEMBER(dynax_state,mayac)
5495{
5496   DRIVER_INIT_CALL(maya_common);
5497
5498   UINT8   *gfx = (UINT8 *)memregion("gfx1")->base();
5499   int i;
5500
5501   /* Address lines scrambling on the blitter data roms */
5502   {
5503      dynamic_buffer rom(0xc0000);
5504      memcpy(&rom[0], gfx, 0xc0000);
5505      for (i = 0; i < 0xc0000; i++)
5506         gfx[i] = rom[BITSWAP24(i, 23, 22, 21, 20, 19, 18, 17, 14, 16, 15, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)];
5507   }
5508}
5509
5510
55115470/***************************************************************************
55125471
55135472Mahjong Dial Q2
r248389r248390
73807339GAME( 1989, hnoridur, hjingi,   hnoridur, hnoridur, driver_device, 0,        ROT180, "Dynax",                    "Hana Oriduru (Japan)",                                          GAME_SUPPORTS_SAVE )
73817340GAME( 1989, drgpunch, 0,        sprtmtch, drgpunch, driver_device, 0,        ROT0,   "Dynax",                    "Dragon Punch (Japan)",                                          GAME_SUPPORTS_SAVE )
73827341GAME( 1989, sprtmtch, drgpunch, sprtmtch, sprtmtch, driver_device, 0,        ROT0,   "Dynax (Fabtek license)",   "Sports Match",                                                  GAME_SUPPORTS_SAVE )
7383/* these 3 are Korean hacks / bootlegs of Dragon Punch / Sports Match */
7342/* these 5 are Korean hacks / bootlegs of Dragon Punch / Sports Match */
73847343GAME( 1994, maya,     0,        sprtmtch, drgpunch, dynax_state,   maya,     ROT0,   "Promat",                   "Maya (set 1)",                                                  GAME_SUPPORTS_SAVE ) // this set has backgrounds blacked out in attract
73857344GAME( 1994, mayaa,    maya,     sprtmtch, drgpunch, dynax_state,   maya,     ROT0,   "Promat",                   "Maya (set 2)",                                                  GAME_SUPPORTS_SAVE ) // this set has backgrounds blacked out in attract
73867345GAME( 1994, mayab,    maya,     sprtmtch, drgpunch, dynax_state,   maya,     ROT0,   "Promat",                   "Maya (set 3)",                                                  GAME_SUPPORTS_SAVE )
7387GAME( 1994, mayac,    maya,     sprtmtch, drgpunch, dynax_state,   mayac,    ROT0,   "Promat",                   "Maya (set 4, clean)",                                           GAME_SUPPORTS_SAVE )
73887346GAME( 199?, inca,     0,        sprtmtch, drgpunch, dynax_state,   maya,     ROT0,   "<unknown>",                "Inca",                                                          GAME_SUPPORTS_SAVE )
73897347GAME( 199?, blktouch, 0,        sprtmtch, drgpunch, dynax_state,   blktouch, ROT0,   "Yang Gi Co Ltd.",          "Black Touch (Korea)",                                           GAME_SUPPORTS_SAVE )
73907348
trunk/src/mame/drivers/fcrash.c
r248389r248390
17821782   ROMX_LOAD( "12.bin",     0x080001, 0x20000, CRC(25055642) SHA1(578cf6a436489cc1f2d1acdb0cba6c1cbee2e21f) , ROM_SKIP(3) )
17831783   ROMX_LOAD( "14.bin",     0x080002, 0x20000, CRC(b77d0328) SHA1(42eb1ebfda301f2b09f3add5932e8331f4790706) , ROM_SKIP(3) )
17841784   ROMX_LOAD( "16.bin",     0x080003, 0x20000, CRC(ea111a79) SHA1(1b86aa984d2d6c527e96b61274a82263f34d0d89) , ROM_SKIP(3) )
1785   ROMX_LOAD( "19.bin",     0x100000, 0x20000, CRC(b3aa1f48) SHA1(411f3855739992f5967e915f2a5255afcedeac2e) , ROM_SKIP(3) ) // only these 4 differ from ffightbla (new title logo)
1786   ROMX_LOAD( "21.bin",     0x100001, 0x20000, CRC(04d175c9) SHA1(33e6e3fefae4e3977c8c954fbd7feff36e92d723) , ROM_SKIP(3) ) // ^
1787   ROMX_LOAD( "23.bin",     0x100002, 0x20000, CRC(e592ba4f) SHA1(62559481e0da3954a90da0ab0fb51f87f1b3dd9d) , ROM_SKIP(3) ) // ^
1788   ROMX_LOAD( "25.bin",     0x100003, 0x20000, CRC(b89a740f) SHA1(516d73c772e0a904dfb0bd84874919d78bbbd200) , ROM_SKIP(3) ) // ^
1785   ROMX_LOAD( "19.bin",     0x100000, 0x20000, CRC(b3aa1f48) SHA1(411f3855739992f5967e915f2a5255afcedeac2e) , ROM_SKIP(3) )
1786   ROMX_LOAD( "21.bin",     0x100001, 0x20000, CRC(04d175c9) SHA1(33e6e3fefae4e3977c8c954fbd7feff36e92d723) , ROM_SKIP(3) )
1787   ROMX_LOAD( "23.bin",     0x100002, 0x20000, CRC(e592ba4f) SHA1(62559481e0da3954a90da0ab0fb51f87f1b3dd9d) , ROM_SKIP(3) )
1788   ROMX_LOAD( "25.bin",     0x100003, 0x20000, CRC(b89a740f) SHA1(516d73c772e0a904dfb0bd84874919d78bbbd200) , ROM_SKIP(3) )
17891789   ROMX_LOAD( "11.bin",     0x180000, 0x20000, CRC(d4457a60) SHA1(9e956efafa81a81aca92837df03968f5670ffc15) , ROM_SKIP(3) )
17901790   ROMX_LOAD( "13.bin",     0x180001, 0x20000, CRC(3b26a37d) SHA1(58d8d0cdef81c938fb1a5595f2d02b228865893b) , ROM_SKIP(3) )
17911791   ROMX_LOAD( "15.bin",     0x180002, 0x20000, CRC(6d837e09) SHA1(b4a133ab96c35b689ee692bfcc04981791099b6f) , ROM_SKIP(3) )
r248389r248390
18141814   ROM_COPY( "gfx", 0x000000, 0x000000, 0x8000 )   /* stars */
18151815ROM_END
18161816
1817// this is identical to the Final Crash bootleg but without the modified gfx.
1818// it's less common than Final Crash, but is either the original bootleg, or the bootleggers wanted to restore the
1819// original title.
1820ROM_START( ffightbla )
1821   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
1822   ROM_LOAD16_BYTE( "9.bin",  0x00000, 0x20000, CRC(c6854c91) SHA1(29f01cc65be5eaa3f86e99eebdd284104623abb0) )
1823   ROM_LOAD16_BYTE( "5.bin",  0x00001, 0x20000, CRC(77f7c2b3) SHA1(feea48d9555824a2e5bf5e99ce159edc015f0792) )
1824   ROM_LOAD16_BYTE( "8.bin",  0x40000, 0x20000, CRC(1895b3df) SHA1(415a26050c50ed79a7ee5ddd1b8d61593b1ce876) )
1825   ROM_LOAD16_BYTE( "4.bin",  0x40001, 0x20000, CRC(bbd411ee) SHA1(85d50ca72ec46d627f9c88ff0809aa30e164821a) )
1826   ROM_LOAD16_BYTE( "7.bin",  0x80000, 0x20000, CRC(5b23ebf2) SHA1(8c28c21a72a28ad249170026891c6bb865943f84) )
1827   ROM_LOAD16_BYTE( "3.bin",  0x80001, 0x20000, CRC(aba2aebe) SHA1(294109b5929ed63859a55bef16643e3ade7da16f) )
1828   ROM_LOAD16_BYTE( "6.bin",  0xc0000, 0x20000, CRC(d4bf37f6) SHA1(f47e1cc9aa3b3019ee57f59715e3a611acf9fe3e) )
1829   ROM_LOAD16_BYTE( "2.bin",  0xc0001, 0x20000, CRC(07ac8f43) SHA1(7a41b003c76adaabd3f94929cc163461b70e0ed9) )
1830   //ROM_FILL(0x2610, 1, 7)  // temporary patch to fix transitions
18311817
1832   ROM_REGION( 0x30000, "audiocpu", 0 ) /* Audio CPU + Sample Data */
1833   ROM_LOAD( "1.bin",   0x00000, 0x20000, CRC(5b276c14) SHA1(73e53c077d4e3c1b919eee28b29e34176ee204f8) )
1834   ROM_RELOAD(          0x10000, 0x20000 )
18351818
1836   ROM_REGION( 0x200000, "gfx", 0 )
1837   ROMX_LOAD( "18.bin",     0x000000, 0x20000, CRC(f1eee6d9) SHA1(bee95efbff49c582cff1cc6d9bb5ef4ea5c4a074) , ROM_SKIP(3) )
1838   ROMX_LOAD( "20.bin",     0x000001, 0x20000, CRC(675f4537) SHA1(acc68822da3aafbb62f76cbffa5f3389fcc91447) , ROM_SKIP(3) )
1839   ROMX_LOAD( "22.bin",     0x000002, 0x20000, CRC(db8a32ac) SHA1(b95f73dff291acee239e22e5fd7efe15d0de23be) , ROM_SKIP(3) )
1840   ROMX_LOAD( "24.bin",     0x000003, 0x20000, CRC(f4113e57) SHA1(ff1f443c13494a169b9be24abc361d27a6d01c09) , ROM_SKIP(3) )
1841   ROMX_LOAD( "10.bin",     0x080000, 0x20000, CRC(d478853e) SHA1(91fcf8eb022ccea66d291bec84ace557181cf861) , ROM_SKIP(3) )
1842   ROMX_LOAD( "12.bin",     0x080001, 0x20000, CRC(25055642) SHA1(578cf6a436489cc1f2d1acdb0cba6c1cbee2e21f) , ROM_SKIP(3) )
1843   ROMX_LOAD( "14.bin",     0x080002, 0x20000, CRC(b77d0328) SHA1(42eb1ebfda301f2b09f3add5932e8331f4790706) , ROM_SKIP(3) )
1844   ROMX_LOAD( "16.bin",     0x080003, 0x20000, CRC(ea111a79) SHA1(1b86aa984d2d6c527e96b61274a82263f34d0d89) , ROM_SKIP(3) )
1845   ROMX_LOAD( "ff-19.bin",  0x100000, 0x20000, CRC(7bc03747) SHA1(6964e5c562d6af5b4327ff828f3d0522c34911bc) , ROM_SKIP(3) ) // only these 4 differ from fcrash
1846   ROMX_LOAD( "ff-21.bin",  0x100001, 0x20000, CRC(0c248e2b) SHA1(28731fe25a8eb39c1e0822cf9074a7a32c6b2978) , ROM_SKIP(3) ) // ^
1847   ROMX_LOAD( "ff-23.bin",  0x100002, 0x20000, CRC(53949d0e) SHA1(1b11134005a47c323917b9892fe44819c36c6ee2) , ROM_SKIP(3) ) // ^
1848   ROMX_LOAD( "ff-25.bin",  0x100003, 0x20000, CRC(8d34a67d) SHA1(69e9f52efb73952313848a6d54dbdc17a2275c59) , ROM_SKIP(3) ) // ^
1849   ROMX_LOAD( "11.bin",     0x180000, 0x20000, CRC(d4457a60) SHA1(9e956efafa81a81aca92837df03968f5670ffc15) , ROM_SKIP(3) )
1850   ROMX_LOAD( "13.bin",     0x180001, 0x20000, CRC(3b26a37d) SHA1(58d8d0cdef81c938fb1a5595f2d02b228865893b) , ROM_SKIP(3) )
1851   ROMX_LOAD( "15.bin",     0x180002, 0x20000, CRC(6d837e09) SHA1(b4a133ab96c35b689ee692bfcc04981791099b6f) , ROM_SKIP(3) )
1852   ROMX_LOAD( "17.bin",     0x180003, 0x20000, CRC(c59a4d6c) SHA1(59e49c7d24dd333007de4bb621050011a5392bcc) , ROM_SKIP(3) )
18531819
1854   ROM_REGION( 0x8000, "gfx2", 0 )
1855   ROM_COPY( "gfx", 0x000000, 0x000000, 0x8000 )   /* stars */
1856ROM_END
18571820
1858
1859
18601821// ************************************************************************* KODB
18611822
18621823/*
r248389r248390
29422903
29432904GAME( 1990, fcrash,    ffight,   fcrash,    fcrash,   cps_state, cps1,     ROT0,   "bootleg (Playmark)", "Final Crash (bootleg of Final Fight)", GAME_SUPPORTS_SAVE )
29442905GAME( 1990, ffightbl,  ffight,   fcrash,    fcrash,   cps_state, cps1,     ROT0,   "bootleg", "Final Fight (bootleg)", GAME_SUPPORTS_SAVE )
2945GAME( 1990, ffightbla, ffight,   fcrash,    fcrash,   cps_state, cps1,     ROT0,   "bootleg", "Final Fight (bootleg on Final Crash PCB)", GAME_SUPPORTS_SAVE ) // same as Final Crash without the modified gfx
29462906
29472907GAME( 1991, kodb,      kod,      kodb,      kodb,     cps_state, kodb,     ROT0,   "bootleg (Playmark)", "The King of Dragons (bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // 910731  "ETC"
29482908GAME( 1991, knightsb,  knights,  knightsb,  knights,  cps_state, dinopic,  ROT0,   "bootleg", "Knights of the Round (bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )    // 911127 - based on World version
trunk/src/mame/drivers/fuukifg3.c
r248389r248390
3838- PCM channels of music in asurabus is sometimes off-tune, check Chen-Mao's stage for example
3939  note: srom.u7 (z80 prg) is a good dump
4040
41- YMF278B and YMF262 are hooked up in an awkward way (real chip has YMF262 integrated)
42
4143Asura Blade
4244Fuuki Co. Ltd., 1998
4345
r248389r248390
160162#include "cpu/z80/z80.h"
161163#include "cpu/m68000/m68000.h"
162164#include "sound/ymf278b.h"
165#include "sound/262intf.h"
163166#include "includes/fuukifg3.h"
164167
165168
r248389r248390
255258WRITE8_MEMBER(fuuki32_state::snd_ymf278b_w)
256259{
257260   machine().device<ymf278b_device>("ymf1")->write(space, offset, data);
261
262   // also write to ymf262
263   if (offset < 4)
264      machine().device<ymf262_device>("ymf2")->write(space, offset, data);
258265}
259266
260267static ADDRESS_MAP_START( fuuki32_sound_map, AS_PROGRAM, 8, fuuki32_state )
r248389r248390
577584   MCFG_YMF278B_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
578585   MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
579586   MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
587
588   MCFG_SOUND_ADD("ymf2", YMF262, YMF278B_STD_CLOCK / (19/8.0))
589   MCFG_SOUND_ROUTE(0, "lspeaker", 0.40)
590   MCFG_SOUND_ROUTE(1, "rspeaker", 0.40)
580591   MCFG_SOUND_ROUTE(2, "lspeaker", 0.40)
581592   MCFG_SOUND_ROUTE(3, "rspeaker", 0.40)
582   MCFG_SOUND_ROUTE(4, "lspeaker", 0.40)
583   MCFG_SOUND_ROUTE(5, "rspeaker", 0.40)
584593
585594MACHINE_CONFIG_END
586595
trunk/src/mame/drivers/kurukuru.c
r248389r248390
266266
267267TIMER_DEVICE_CALLBACK_MEMBER(kurukuru_state::kurukuru_vdp_scanline)
268268{
269   m_v9938->set_resolution(0);
269270   m_v9938->interrupt();
270271}
271272
trunk/src/mame/drivers/mazerbla.c
r248389r248390
2121 - 32 dipswitches in 4 banks of 8
2222 - four 'test button' style switches
2323 - one 4Mhz xtal @A1
24 - this same board is shared with cliff hanger (cliffhgr.c)
24 - this same board is shared with cliff hanger (clifhgr.c)
2525
2626CFB-1000 - video/subcpu board (Color Frame Board)
2727 - this board has a sub-cpu on it and four roms (six sockets for roms, two empty)
r248389r248390
4848   - PROMS: 82s123: @B8 @B9; 82s129: @G8 @G9 (all dumped)
4949
5050CRF-1001 - RF Filter board for video/audio output
51 - this same board is shared with cliff hanger (cliffhgr.c)
51 - this same board is shared with cliff hanger (clifhgr.c)
5252
5353Versions:
5454======
r248389r248390
6161
6262Issues:
6363======
64Sprites leave trails in both games
64Sprites leave trails in both ganes
6565Sprites should be transparent (color 0x0f)
6666Screen flickers heavily in Great Guns (double buffer issue?).
6767
r248389r248390
233233   TIMER_CALLBACK_MEMBER(deferred_ls670_1_w);
234234   TIMER_CALLBACK_MEMBER(delayed_sound_w);
235235   IRQ_CALLBACK_MEMBER(irq_callback);
236   void rom_bank_select();
236237};
237238
238239
r248389r248390
350351WRITE8_MEMBER(mazerbla_state::cfb_rom_bank_sel_w)
351352{
352353   m_gfx_rom_bank = data;
353   
354   membank("bank1")->set_entry(m_gfx_rom_bank);
354   rom_bank_select();
355355}
356356
357void mazerbla_state::rom_bank_select()
358{
359   membank("bank1")->set_base(memregion("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000);
360}
361
362
357363#if 0
358364WRITE8_MEMBER(mazerbla_state::vcu_video_reg_w)
359365{
r248389r248390
13801386
13811387void mazerbla_state::machine_start()
13821388{
1383   membank("bank1")->configure_entries(0, 256, memregion("sub2")->base() + 0x10000, 0x2000);
1384   
13851389   save_item(NAME(m_vcu_video_reg));
13861390   save_item(NAME(m_vcu_gfx_addr));
13871391   save_item(NAME(m_vcu_gfx_param_addr));
r248389r248390
14091413
14101414   save_item(NAME(m_vsb_ls273));
14111415   save_item(NAME(m_soundlatch));
1416
1417   machine().save().register_postload(save_prepost_delegate(FUNC(mazerbla_state::rom_bank_select), this));
14121418}
14131419
14141420void mazerbla_state::machine_reset()
trunk/src/mame/drivers/mcr3.c
r248389r248390
20332033/* MCR scrolling games */
20342034GAMEL(1983, spyhunt,  0,        mcrsc_csd, spyhunt,  mcr3_state,  spyhunt,  ROT90, "Bally Midway", "Spy Hunter", GAME_SUPPORTS_SAVE, layout_spyhunt )
20352035GAMEL(1983, spyhuntp, spyhunt,  mcrsc_csd, spyhunt,  mcr3_state,  spyhunt,  ROT90, "Bally Midway (Playtronic license)", "Spy Hunter (Playtronic license)", GAME_SUPPORTS_SAVE, layout_spyhunt )
2036GAME (1983, spyhuntpr,spyhunt,  spyhuntpr, spyhuntpr,mcr3_state,  spyhuntpr,ROT90, "Bally Midway (Recreativos Franco S.A. license)", "Spy Hunter (Spain, Recreativos Franco S.A. PCB)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // PCB made by Recreativos Franco S.A. in Spain, has Bally Midway logo, board is dated '85' so seems to be a low-cost rebuild? it is unclear if it made it to market.
20362037GAME( 1984, crater,   0,        mcrscroll, crater,   mcr3_state, crater,   ORIENTATION_FLIP_X, "Bally Midway", "Crater Raider", GAME_SUPPORTS_SAVE )
20372038GAMEL(1985, turbotag, 0,        mcrsc_csd, turbotag, mcr3_state, turbotag, ROT90, "Bally Midway", "Turbo Tag (prototype)", GAME_SUPPORTS_SAVE, layout_turbotag )
2038 
2039// very different hardware, probably bootleg despite the license text printed on the PCB, similar to '1942p' in 1942.c.  Probably should be put in separate driver.
2040// PCB made by Tecfri for Recreativos Franco S.A. in Spain, has Bally Midway logo, and licensing text on the PCB.  Board is dated '85' so seems to be a low-cost rebuild? it is unclear if it made it to market.
2041GAME (1983, spyhuntpr,spyhunt,  spyhuntpr, spyhuntpr,mcr3_state,  spyhuntpr,ROT90, "Bally Midway (Recreativos Franco S.A. license)", "Spy Hunter (Spain, Tecfri / Recreativos Franco S.A. PCB)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/megatech.c
r248389r248390
14511451/* 52 */ GAME( 1991, mt_sonic, megatech, megatech, megatech, mtech_state, mt_crt, ROT0, "Sega",                  "Sonic The Hedgehog (Mega-Tech, set 1)", GAME_NOT_WORKING )
14521452/*    */ GAME( 1991, mt_sonia, mt_sonic, megatech, megatech, mtech_state, mt_crt, ROT0, "Sega",                  "Sonic The Hedgehog (Mega-Tech, set 2)", GAME_NOT_WORKING )
14531453/* 53 */ GAME( 1990, mt_fshrk, megatech, megatech, megatech, mtech_state, mt_crt, ROT0, "Toaplan / Sega",        "Fire Shark (Mega-Tech)", GAME_NOT_WORKING )
1454/* 54 */ GAME( 1991, mt_spman, megatech, megatech, megatech, mtech_state, mt_crt, ROT0, "Sega / Marvel",         "Spider-Man vs The Kingpin (Mega-Tech)", GAME_NOT_WORKING )
1454/* 54 */ GAME( 1991, mt_spman, megatech, megatech, megatech, mtech_state, mt_crt, ROT0, "Marvel / Sega",         "Spider-Man vs The Kingpin (Mega-Tech)", GAME_NOT_WORKING )
14551455/* 55 */ GAME( 1991, mt_calga, megatech, megatech, megatech, mtech_state, mt_crt, ROT0, "Sega",                  "California Games (Mega-Tech)", GAME_NOT_WORKING )
14561456/* 56 */ // unknown
14571457/* 57 */ GAME( 1991, mt_gaxe2, megatech, megatech, megatech, mtech_state, mt_crt, ROT0, "Sega",                  "Golden Axe II (Mega-Tech)", GAME_NOT_WORKING )
trunk/src/mame/drivers/meritm.c
r248389r248390
301301
302302   if((scanline % 2) == 0)
303303   {
304      m_v9938_0->set_resolution(RENDER_HIGH);
304305      m_v9938_0->interrupt();
306
307      m_v9938_1->set_resolution(RENDER_HIGH);
305308      m_v9938_1->interrupt();
306309   }
307310}
trunk/src/mame/drivers/namcona1.c
r248389r248390
319319   }
320320   if( dest>=0xf00000 && dest<0xf02000 )
321321   {
322      paletteram_w(space, (dest-0xf00000)/2, data, 0xffff );
322      namcona1_paletteram_w(space, (dest-0xf00000)/2, data, 0xffff );
323323   }
324324   else if( dest>=0xf40000 && dest<0xf80000 )
325325   {
326      gfxram_w(space, (dest-0xf40000)/2, data, 0xffff );
326      namcona1_gfxram_w(space, (dest-0xf40000)/2, data, 0xffff );
327327   }
328328   else if( dest>=0xff0000 && dest<0xffc000 )
329329   {
330      videoram_w(space, (dest-0xff0000)/2, data, 0xffff );
330      namcona1_videoram_w(space, (dest-0xff0000)/2, data, 0xffff );
331331   }
332332   else if( dest>=0xfff000 && dest<0x1000000 )
333333   {
r248389r248390
412412   }
413413} /* blit_setup */
414414
415void namcona1_state::blit()
415void namcona1_state::namcona1_blit()
416416{
417417   int src0 = m_vreg[0x0];
418418   int src1 = m_vreg[0x1];
r248389r248390
487487         src_offset = 0;
488488      }
489489   }
490} /* blit */
490} /* namcona1_blit */
491491
492WRITE16_MEMBER(namcona1_state::vreg_w)
492WRITE16_MEMBER(namcona1_state::namcona1_vreg_w)
493493{
494494   COMBINE_DATA( &m_vreg[offset] );
495495
496496   switch( offset )
497497   {
498498   case 0x18/2:
499      blit();
499      namcona1_blit();
500500      /* see also 0x1e */
501501      break;
502502
r248389r248390
505505      /* interrupt enable mask; 0 enables INT level */
506506      break;
507507   }
508} /* vreg_w */
508} /* namcona1_vreg_w */
509509
510510/***************************************************************/
511511
r248389r248390
546546   AM_RANGE(0xc00000, 0xdfffff) AM_ROM AM_REGION("maincpu", 0)  // code
547547   AM_RANGE(0xe00000, 0xe00fff) AM_DEVREADWRITE8("eeprom", eeprom_parallel_28xx_device, read, write, 0x00ff)
548548   AM_RANGE(0xe40000, 0xe4000f) AM_READWRITE(custom_key_r, custom_key_w)
549   AM_RANGE(0xefff00, 0xefffff) AM_RAM_WRITE(vreg_w) AM_SHARE("vreg")
550   AM_RANGE(0xf00000, 0xf01fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
551   AM_RANGE(0xf40000, 0xf7ffff) AM_READWRITE(gfxram_r, gfxram_w) AM_SHARE("cgram")
552   AM_RANGE(0xff0000, 0xffbfff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
549   AM_RANGE(0xefff00, 0xefffff) AM_RAM_WRITE(namcona1_vreg_w) AM_SHARE("vreg")
550   AM_RANGE(0xf00000, 0xf01fff) AM_RAM_WRITE(namcona1_paletteram_w) AM_SHARE("paletteram")
551   AM_RANGE(0xf40000, 0xf7ffff) AM_READWRITE(namcona1_gfxram_r, namcona1_gfxram_w) AM_SHARE("cgram")
552   AM_RANGE(0xff0000, 0xffbfff) AM_RAM_WRITE(namcona1_videoram_w) AM_SHARE("videoram")
553553   AM_RANGE(0xffd000, 0xffdfff) AM_RAM /* unknown */
554554   AM_RANGE(0xffe000, 0xffefff) AM_RAM AM_SHARE("scroll")      /* scroll registers */
555555   AM_RANGE(0xfff000, 0xffffff) AM_RAM AM_SHARE("spriteram")           /* spriteram */
r248389r248390
694694   m_maskrom = (UINT16 *)memregion("maskrom")->base();
695695   m_mEnableInterrupts = 0;
696696   m_c140->set_base(m_workram);
697   
698   save_item(NAME(m_mEnableInterrupts));
699   save_item(NAME(m_count));
700   save_item(NAME(m_mcu_mailbox));
701   save_item(NAME(m_mcu_port4));
702   save_item(NAME(m_mcu_port5));
703   save_item(NAME(m_mcu_port6));
704   save_item(NAME(m_mcu_port8));
705697}
706698
707699// the MCU boots the 68000
r248389r248390
901893//                 IRQ 1 =>
902894//                 IRQ 2 =>
903895
904TIMER_DEVICE_CALLBACK_MEMBER(namcona1_state::interrupt)
896TIMER_DEVICE_CALLBACK_MEMBER(namcona1_state::namcona1_interrupt)
905897{
906898   int scanline = param;
907899   int enabled = m_mEnableInterrupts ? ~m_vreg[0x1a/2] : 0;
r248389r248390
941933   MCFG_CPU_PROGRAM_MAP(namcona1_mcu_map)
942934   MCFG_CPU_IO_MAP( namcona1_mcu_io_map)
943935
944   MCFG_TIMER_DRIVER_ADD_SCANLINE("scan_main", namcona1_state, interrupt, "screen", 0, 1)
936   MCFG_TIMER_DRIVER_ADD_SCANLINE("scan_main", namcona1_state, namcona1_interrupt, "screen", 0, 1)
945937
946938   MCFG_EEPROM_2816_ADD("eeprom")
947939
r248389r248390
951943   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
952944   MCFG_SCREEN_SIZE(38*8, 32*8)
953945   MCFG_SCREEN_VISIBLE_AREA(8, 38*8-1-8, 4*8, 32*8-1)
954   MCFG_SCREEN_UPDATE_DRIVER(namcona1_state, screen_update)
946   MCFG_SCREEN_UPDATE_DRIVER(namcona1_state, screen_update_namcona1)
955947   MCFG_SCREEN_PALETTE("palette")
956948
957949   MCFG_PALETTE_ADD("palette", 0x2000)
r248389r248390
1000992DRIVER_INIT_MEMBER(namcona1_state,numanath)  { m_gametype = NAMCO_NUMANATH; }
1001993DRIVER_INIT_MEMBER(namcona1_state,quiztou)   { m_gametype = NAMCO_QUIZTOU; }
1002994DRIVER_INIT_MEMBER(namcona1_state,swcourt)   { m_gametype = NAMCO_SWCOURT; }
1003DRIVER_INIT_MEMBER(namcona1_state,tinklpit)  { m_gametype = NAMCO_TINKLPIT; save_item(NAME(m_keyval)); }
995DRIVER_INIT_MEMBER(namcona1_state,tinklpit)  { m_gametype = NAMCO_TINKLPIT; }
1004996DRIVER_INIT_MEMBER(namcona1_state,xday2)     { m_gametype = NAMCO_XDAY2; }
1005997
1006998ROM_START( bkrtmaq )
r248389r248390
13091301ROM_END
13101302
13111303// NA-1 (C69 MCU)
1312GAME( 1992, bkrtmaq,    0,        namcona1w, namcona1_quiz, namcona1_state,bkrtmaq,  ROT0, "Namco", "Bakuretsu Quiz Ma-Q Dai Bouken (Japan)", GAME_SUPPORTS_SAVE )
1313GAME( 1992, cgangpzl,   0,        namcona1w, namcona1_joy, namcona1_state, cgangpzl, ROT0, "Namco", "Cosmo Gang the Puzzle (US)", GAME_SUPPORTS_SAVE )
1314GAME( 1992, cgangpzlj,  cgangpzl, namcona1w, namcona1_joy, namcona1_state, cgangpzl, ROT0, "Namco", "Cosmo Gang the Puzzle (Japan)", GAME_SUPPORTS_SAVE )
1315GAME( 1992, exvania,    0,        namcona1,  namcona1_joy, namcona1_state, exbania,  ROT0, "Namco", "Exvania (World)", GAME_SUPPORTS_SAVE )
1316GAME( 1992, exvaniaj,   exvania,  namcona1,  namcona1_joy, namcona1_state, exbania,  ROT0, "Namco", "Exvania (Japan)", GAME_SUPPORTS_SAVE )
1317GAME( 1992, fghtatck,   0,        namcona1,  namcona1_joy, namcona1_state, fa,       ROT90,"Namco", "Fighter & Attacker (US)", GAME_SUPPORTS_SAVE )
1318GAME( 1992, fa,         fghtatck, namcona1,  namcona1_joy, namcona1_state, fa,       ROT90,"Namco", "F/A (Japan)", GAME_SUPPORTS_SAVE )
1319GAME( 1992, swcourt,    0,        namcona1w, namcona1_joy, namcona1_state, swcourt,  ROT0, "Namco", "Super World Court (World)", GAME_SUPPORTS_SAVE )
1320GAME( 1992, swcourtj,   swcourt,  namcona1w, namcona1_joy, namcona1_state, swcourt,  ROT0, "Namco", "Super World Court (Japan)", GAME_SUPPORTS_SAVE )
1321GAME( 1993, emeraldaj,  emeralda, namcona1w, namcona1_joy, namcona1_state, emeraldj, ROT0, "Namco", "Emeraldia (Japan Version B)", GAME_SUPPORTS_SAVE ) /* Parent is below on NA-2 Hardware */
1322GAME( 1993, emeraldaja, emeralda, namcona1w, namcona1_joy, namcona1_state, emeraldj, ROT0, "Namco", "Emeraldia (Japan)", GAME_SUPPORTS_SAVE ) /* Parent is below on NA-2 Hardware */
1323GAME( 1993, tinklpit,   0,        namcona1w, namcona1_joy, namcona1_state, tinklpit, ROT0, "Namco", "Tinkle Pit (Japan)", GAME_SUPPORTS_SAVE )
1304GAME( 1992, bkrtmaq,    0,        namcona1w, namcona1_quiz, namcona1_state,bkrtmaq,  ROT0, "Namco", "Bakuretsu Quiz Ma-Q Dai Bouken (Japan)", 0 )
1305GAME( 1992, cgangpzl,   0,        namcona1w, namcona1_joy, namcona1_state, cgangpzl, ROT0, "Namco", "Cosmo Gang the Puzzle (US)", 0 )
1306GAME( 1992, cgangpzlj,  cgangpzl, namcona1w, namcona1_joy, namcona1_state, cgangpzl, ROT0, "Namco", "Cosmo Gang the Puzzle (Japan)", 0 )
1307GAME( 1992, exvania,    0,        namcona1,  namcona1_joy, namcona1_state, exbania,  ROT0, "Namco", "Exvania (World)", 0 )
1308GAME( 1992, exvaniaj,   exvania,  namcona1,  namcona1_joy, namcona1_state, exbania,  ROT0, "Namco", "Exvania (Japan)", 0 )
1309GAME( 1992, fghtatck,   0,        namcona1,  namcona1_joy, namcona1_state, fa,       ROT90,"Namco", "Fighter & Attacker (US)", 0 )
1310GAME( 1992, fa,         fghtatck, namcona1,  namcona1_joy, namcona1_state, fa,       ROT90,"Namco", "F/A (Japan)", 0 )
1311GAME( 1992, swcourt,    0,        namcona1w, namcona1_joy, namcona1_state, swcourt,  ROT0, "Namco", "Super World Court (World)", 0 )
1312GAME( 1992, swcourtj,   swcourt,  namcona1w, namcona1_joy, namcona1_state, swcourt,  ROT0, "Namco", "Super World Court (Japan)", 0 )
1313GAME( 1993, emeraldaj,  emeralda, namcona1w, namcona1_joy, namcona1_state, emeraldj, ROT0, "Namco", "Emeraldia (Japan Version B)", 0 ) /* Parent is below on NA-2 Hardware */
1314GAME( 1993, emeraldaja, emeralda, namcona1w, namcona1_joy, namcona1_state, emeraldj, ROT0, "Namco", "Emeraldia (Japan)", 0 ) /* Parent is below on NA-2 Hardware */
1315GAME( 1993, tinklpit,   0,        namcona1w, namcona1_joy, namcona1_state, tinklpit, ROT0, "Namco", "Tinkle Pit (Japan)", 0 )
13241316
13251317// NA-2 (C70 MCU)
1326GAME( 1992, knckhead,   0,        namcona2,  namcona1_joy, namcona1_state, knckhead, ROT0, "Namco", "Knuckle Heads (World)", GAME_SUPPORTS_SAVE )
1327GAME( 1992, knckheadj,  knckhead, namcona2,  namcona1_joy, namcona1_state, knckhead, ROT0, "Namco", "Knuckle Heads (Japan)", GAME_SUPPORTS_SAVE )
1328GAME( 1992, knckheadjp, knckhead, namcona2,  namcona1_joy, namcona1_state, knckhead, ROT0, "Namco", "Knuckle Heads (Japan, Prototype?)", GAME_SUPPORTS_SAVE )
1329GAME( 1993, emeralda,   0,        namcona2,  namcona1_joy, namcona1_state, emeralda, ROT0, "Namco", "Emeraldia (World)", GAME_SUPPORTS_SAVE )
1330GAME( 1993, numanath,   0,        namcona2,  namcona1_joy, namcona1_state, numanath, ROT0, "Namco", "Numan Athletics (World)", GAME_SUPPORTS_SAVE )
1331GAME( 1993, numanathj,  numanath, namcona2,  namcona1_joy, namcona1_state, numanath, ROT0, "Namco", "Numan Athletics (Japan)", GAME_SUPPORTS_SAVE )
1332GAME( 1993, quiztou,    0,        namcona2,  namcona1_quiz, namcona1_state,quiztou,  ROT0, "Namco", "Nettou! Gekitou! Quiztou!! (Japan)", GAME_SUPPORTS_SAVE )
1333GAME( 1995, xday2,      0,        namcona2,  namcona1_joy, namcona1_state, xday2,    ROT0, "Namco", "X-Day 2 (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
1318GAME( 1992, knckhead,   0,        namcona2,  namcona1_joy, namcona1_state, knckhead, ROT0, "Namco", "Knuckle Heads (World)", 0 )
1319GAME( 1992, knckheadj,  knckhead, namcona2,  namcona1_joy, namcona1_state, knckhead, ROT0, "Namco", "Knuckle Heads (Japan)", 0 )
1320GAME( 1992, knckheadjp, knckhead, namcona2,  namcona1_joy, namcona1_state, knckhead, ROT0, "Namco", "Knuckle Heads (Japan, Prototype?)", 0 )
1321GAME( 1993, emeralda,   0,        namcona2,  namcona1_joy, namcona1_state, emeralda, ROT0, "Namco", "Emeraldia (World)", 0 )
1322GAME( 1993, numanath,   0,        namcona2,  namcona1_joy, namcona1_state, numanath, ROT0, "Namco", "Numan Athletics (World)", 0 )
1323GAME( 1993, numanathj,  numanath, namcona2,  namcona1_joy, namcona1_state, numanath, ROT0, "Namco", "Numan Athletics (Japan)", 0 )
1324GAME( 1993, quiztou,    0,        namcona2,  namcona1_quiz, namcona1_state,quiztou,  ROT0, "Namco", "Nettou! Gekitou! Quiztou!! (Japan)", 0 )
1325GAME( 1995, xday2,      0,        namcona2,  namcona1_joy, namcona1_state, xday2,    ROT0, "Namco", "X-Day 2 (Japan)", GAME_IMPERFECT_GRAPHICS )
trunk/src/mame/drivers/naomi.c
r248389r248390
91519151/* 0004 */ GAME( 1999, shangril, naomi, naomim2, naomi_mp,naomi_state,naomi_mp,ROT0,  "Marvelous Ent.",  "Dengen Tenshi Taisen Janshi Shangri-la (JPN, USA, EXP, KOR, AUS)", GAME_FLAGS )
91529152/* 0005 */ GAME( 1999, spawn,    naomi, naomim2, naomi,   naomi_state, naomi,  ROT0,  "Todd Mc Farlane / Capcom","Spawn In the Demon's Hand (JPN, USA, EUR, ASI, AUS) (Rev B)", GAME_FLAGS )
91539153/* 0006 */ GAME( 1999, puyoda,   naomi, naomim2, naomi,   naomi_state, naomi,  ROT0,  "Compile",         "Puyo Puyo Da!", GAME_FLAGS )
9154/* 0007-02 */ GAME( 2000,mvsc2,  naomi, naomim1, naomi,   naomi_state, mvsc2,  ROT0,  "Capcom / Marvel", "Marvel Vs. Capcom 2 New Age of Heroes (JPN, USA, EUR, ASI, AUS) (Rev A)", GAME_FLAGS )
9154/* 0007-02 */ GAME( 2000,mvsc2,  naomi, naomim1, naomi,   naomi_state, mvsc2,  ROT0,  "Marvel / Capcom", "Marvel Vs. Capcom 2 New Age of Heroes (JPN, USA, EUR, ASI, AUS) (Rev A)", GAME_FLAGS )
91559155/* 0008 */ GAME( 2000, pstone2,  naomi, naomim2, naomi,   naomi_state, naomi,  ROT0,  "Capcom",          "Power Stone 2 (JPN, USA, EUR, ASI, AUS)", GAME_FLAGS )
91569156/* 0011 */ GAME( 2000, capsnk,   naomi, naomim2, naomi,   naomi_state, naomi,  ROT0,  "Capcom / SNK",    "Capcom Vs. SNK Millennium Fight 2000 (JPN, USA, EXP, KOR, AUS) (Rev C)", GAME_FLAGS )
91579157/* 0011 */ GAME( 2000, capsnka,  capsnk,naomim2, naomi,   naomi_state, naomi,  ROT0,  "Capcom / SNK",    "Capcom Vs. SNK Millennium Fight 2000 (JPN, USA, EXP, KOR, AUS) (Rev A)", GAME_FLAGS )
trunk/src/mame/drivers/naughtyb.c
r248389r248390
416416   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
417417   MCFG_SCREEN_SIZE(36*8, 28*8)
418418   MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
419   MCFG_SCREEN_UPDATE_DRIVER(naughtyb_state, screen_update)
419   MCFG_SCREEN_UPDATE_DRIVER(naughtyb_state, screen_update_naughtyb)
420420   MCFG_SCREEN_PALETTE("palette")
421421
422422   MCFG_GFXDECODE_ADD("gfxdecode", "palette", naughtyb)
r248389r248390
453453   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
454454   MCFG_SCREEN_SIZE(36*8, 28*8)
455455   MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
456   MCFG_SCREEN_UPDATE_DRIVER(naughtyb_state, screen_update)
456   MCFG_SCREEN_UPDATE_DRIVER(naughtyb_state, screen_update_naughtyb)
457457   MCFG_SCREEN_PALETTE("palette")
458458
459459   MCFG_GFXDECODE_ADD("gfxdecode", "palette", naughtyb)
r248389r248390
832832   m_maincpu->space(AS_PROGRAM).install_read_handler(0x9090, 0x9090, read8_delegate(FUNC(naughtyb_state::popflame_protection_r),this));
833833
834834   m_maincpu->space(AS_PROGRAM).install_write_handler(0xb000, 0xb0ff, write8_delegate(FUNC(naughtyb_state::popflame_protection_w),this));
835   
836   save_item(NAME(m_popflame_prot_seed));
837   save_item(NAME(m_r_index));
838   save_item(NAME(m_prot_count));
839835}
840836
841837
r248389r248390
864860{
865861   /* install questions' handlers  */
866862   m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xc000, 0xc002, read8_delegate(FUNC(naughtyb_state::trvmstr_questions_r),this), write8_delegate(FUNC(naughtyb_state::trvmstr_questions_w),this));
867   
868   save_item(NAME(m_question_offset));
869863}
870864
871865
872GAME( 1982, naughtyb, 0,        naughtyb, naughtyb, driver_device, 0,        ROT90, "Jaleco", "Naughty Boy", GAME_SUPPORTS_SAVE )
873GAME( 1982, naughtyba,naughtyb, naughtyb, naughtyb, driver_device, 0,        ROT90, "bootleg", "Naughty Boy (bootleg)", GAME_SUPPORTS_SAVE )
874GAME( 1982, naughtybc,naughtyb, naughtyb, naughtyb, driver_device, 0,        ROT90, "Jaleco (Cinematronics license)", "Naughty Boy (Cinematronics)", GAME_SUPPORTS_SAVE )
875GAME( 1982, popflame, 0,        popflame, naughtyb, naughtyb_state, popflame, ROT90, "Jaleco", "Pop Flamer (protected)", GAME_SUPPORTS_SAVE )
876GAME( 1982, popflamea,popflame, popflame, naughtyb, driver_device, 0,        ROT90, "Jaleco", "Pop Flamer (not protected)", GAME_SUPPORTS_SAVE )
877GAME( 1982, popflameb,popflame, popflame, naughtyb, driver_device, 0,        ROT90, "Jaleco", "Pop Flamer (hack?)", GAME_SUPPORTS_SAVE )
878GAME( 1982, popflamen,popflame, naughtyb, naughtyb, driver_device, 0,        ROT90, "Jaleco", "Pop Flamer (bootleg on Naughty Boy PCB)", GAME_SUPPORTS_SAVE )
879GAME( 1985, trvmstr,  0,        naughtyb, trvmstr, naughtyb_state,  trvmstr,  ROT90, "Enerdyne Technologies Inc.", "Trivia Master (set 1)", GAME_SUPPORTS_SAVE )
880GAME( 1985, trvmstra, trvmstr,  naughtyb, trvmstr, naughtyb_state,  trvmstr,  ROT90, "Enerdyne Technologies Inc.", "Trivia Master (set 2)", GAME_SUPPORTS_SAVE )
881GAME( 1985, trvmstrb, trvmstr,  naughtyb, trvmstr, naughtyb_state,  trvmstr,  ROT90, "Enerdyne Technologies Inc.", "Trivia Master (set 3)", GAME_SUPPORTS_SAVE )
882GAME( 1985, trvmstrc, trvmstr,  naughtyb, trvmstr, naughtyb_state,  trvmstr,  ROT90, "Enerdyne Technologies Inc.", "Trivia Master (set 4)", GAME_SUPPORTS_SAVE )
883GAME( 1985, trvgns,   trvmstr,  naughtyb, trvmstr, naughtyb_state,  trvmstr,  ROT90, "bootleg", "Trivia Genius", GAME_SUPPORTS_SAVE )
866GAME( 1982, naughtyb, 0,        naughtyb, naughtyb, driver_device, 0,        ROT90, "Jaleco", "Naughty Boy", 0 )
867GAME( 1982, naughtyba,naughtyb, naughtyb, naughtyb, driver_device, 0,        ROT90, "bootleg", "Naughty Boy (bootleg)", 0 )
868GAME( 1982, naughtybc,naughtyb, naughtyb, naughtyb, driver_device, 0,        ROT90, "Jaleco (Cinematronics license)", "Naughty Boy (Cinematronics)", 0 )
869GAME( 1982, popflame, 0,        popflame, naughtyb, naughtyb_state, popflame, ROT90, "Jaleco", "Pop Flamer (protected)", 0 )
870GAME( 1982, popflamea,popflame, popflame, naughtyb, driver_device, 0,        ROT90, "Jaleco", "Pop Flamer (not protected)", 0 )
871GAME( 1982, popflameb,popflame, popflame, naughtyb, driver_device, 0,        ROT90, "Jaleco", "Pop Flamer (hack?)", 0 )
872GAME( 1982, popflamen,popflame, naughtyb, naughtyb, driver_device, 0,        ROT90, "Jaleco", "Pop Flamer (bootleg on Naughty Boy PCB)", 0 )
873GAME( 1985, trvmstr,  0,        naughtyb, trvmstr, naughtyb_state,  trvmstr,  ROT90, "Enerdyne Technologies Inc.", "Trivia Master (set 1)", 0 )
874GAME( 1985, trvmstra, trvmstr,  naughtyb, trvmstr, naughtyb_state,  trvmstr,  ROT90, "Enerdyne Technologies Inc.", "Trivia Master (set 2)", 0 )
875GAME( 1985, trvmstrb, trvmstr,  naughtyb, trvmstr, naughtyb_state,  trvmstr,  ROT90, "Enerdyne Technologies Inc.", "Trivia Master (set 3)", 0 )
876GAME( 1985, trvmstrc, trvmstr,  naughtyb, trvmstr, naughtyb_state,  trvmstr,  ROT90, "Enerdyne Technologies Inc.", "Trivia Master (set 4)", 0 )
877GAME( 1985, trvgns,   trvmstr,  naughtyb, trvmstr, naughtyb_state,  trvmstr,  ROT90, "bootleg", "Trivia Genius", 0 )
trunk/src/mame/drivers/nl_breakout.c
r248389r248390
133133   CHIP("F1", 9316)
134134   NET_C(Y1.Q, F1.2)
135135
136   CONNECTION("F1", 14, d, 13)
136   CONNECTION("F1", 14, "H1", 13)
137137   CONNECTION("F1", 13, "H1", 12)
138138   CONNECTION("F1", 15, "E1", 5)
139139   CONNECTION(P, "F1", 1)
trunk/src/mame/drivers/nl_pong.c
r248389r248390
1616#define TTL_7400A_NAND(_name, _A, _B) TTL_7400_NAND(_name, _A, _B)
1717#else
1818#define TTL_7400A_NAND(_name, _A, _B)                                          \
19      NET_REGISTER_DEV(TTL_7400A_NAND, _name)                              \
19      NET_REGISTER_DEV_X(TTL_7400A_NAND, _name)                              \
2020      NET_CONNECT(_name, A, _A)                                              \
2121      NET_CONNECT(_name, B, _B)
2222#endif
trunk/src/mame/drivers/paranoia.c
r248389r248390
5151   paranoia_state(const machine_config &mconfig, device_type type, const char *tag)
5252      : pce_common_state(mconfig, type, tag) { }
5353
54   DECLARE_WRITE8_MEMBER(i8085_d000_w);
55   DECLARE_READ8_MEMBER(z80_io_01_r);
56   DECLARE_READ8_MEMBER(z80_io_02_r);
57   DECLARE_WRITE8_MEMBER(z80_io_17_w);
58   DECLARE_WRITE8_MEMBER(z80_io_37_w);
59   DECLARE_WRITE8_MEMBER(i8155_a_w);
60   DECLARE_WRITE8_MEMBER(i8155_b_w);
61   DECLARE_WRITE8_MEMBER(i8155_c_w);
62   DECLARE_WRITE_LINE_MEMBER(i8155_timer_out);
54   DECLARE_WRITE8_MEMBER(paranoia_8085_d000_w);
55   DECLARE_READ8_MEMBER(paranoia_z80_io_01_r);
56   DECLARE_READ8_MEMBER(paranoia_z80_io_02_r);
57   DECLARE_WRITE8_MEMBER(paranoia_z80_io_17_w);
58   DECLARE_WRITE8_MEMBER(paranoia_z80_io_37_w);
59   DECLARE_WRITE8_MEMBER(paranoia_i8155_a_w);
60   DECLARE_WRITE8_MEMBER(paranoia_i8155_b_w);
61   DECLARE_WRITE8_MEMBER(paranoia_i8155_c_w);
62   DECLARE_WRITE_LINE_MEMBER(paranoia_i8155_timer_out);
6363};
6464
6565
r248389r248390
9090   AM_RANGE( 0x00, 0x03) AM_DEVREADWRITE( "huc6270", huc6270_device, read, write )
9191ADDRESS_MAP_END
9292
93WRITE8_MEMBER(paranoia_state::i8085_d000_w)
93WRITE8_MEMBER(paranoia_state::paranoia_8085_d000_w)
9494{
9595   //logerror( "D000 (8085) write %02x\n", data );
9696}
r248389r248390
9999   AM_RANGE( 0x0000, 0x7fff) AM_ROM
100100   AM_RANGE( 0x8000, 0x80ff) AM_DEVREADWRITE("i8155", i8155_device, memory_r, memory_w)
101101   AM_RANGE( 0x8100, 0x8107) AM_DEVREADWRITE("i8155", i8155_device, io_r, io_w)
102   AM_RANGE( 0xd000, 0xd000) AM_WRITE(i8085_d000_w )
102   AM_RANGE( 0xd000, 0xd000) AM_WRITE(paranoia_8085_d000_w )
103103   AM_RANGE( 0xe000, 0xe1ff) AM_RAM
104104ADDRESS_MAP_END
105105
r248389r248390
112112   AM_RANGE( 0x7000, 0x73ff) AM_RAM
113113ADDRESS_MAP_END
114114
115READ8_MEMBER(paranoia_state::z80_io_01_r)
115READ8_MEMBER(paranoia_state::paranoia_z80_io_01_r)
116116{
117117   return 0;
118118}
119119
120READ8_MEMBER(paranoia_state::z80_io_02_r)
120READ8_MEMBER(paranoia_state::paranoia_z80_io_02_r)
121121{
122122   return 0;
123123}
124124
125WRITE8_MEMBER(paranoia_state::z80_io_17_w)
125WRITE8_MEMBER(paranoia_state::paranoia_z80_io_17_w)
126126{
127127}
128128
129WRITE8_MEMBER(paranoia_state::z80_io_37_w)
129WRITE8_MEMBER(paranoia_state::paranoia_z80_io_37_w)
130130{
131131}
132132
133133static ADDRESS_MAP_START(paranoia_z80_io_map, AS_IO, 8, paranoia_state )
134134   ADDRESS_MAP_GLOBAL_MASK(0xff)
135   AM_RANGE( 0x01, 0x01 ) AM_READ(z80_io_01_r )
136   AM_RANGE( 0x02, 0x02 ) AM_READ(z80_io_02_r )
137   AM_RANGE( 0x17, 0x17 ) AM_WRITE(z80_io_17_w )
138   AM_RANGE( 0x37, 0x37 ) AM_WRITE(z80_io_37_w )
135   AM_RANGE( 0x01, 0x01 ) AM_READ(paranoia_z80_io_01_r )
136   AM_RANGE( 0x02, 0x02 ) AM_READ(paranoia_z80_io_02_r )
137   AM_RANGE( 0x17, 0x17 ) AM_WRITE(paranoia_z80_io_17_w )
138   AM_RANGE( 0x37, 0x37 ) AM_WRITE(paranoia_z80_io_37_w )
139139ADDRESS_MAP_END
140140
141WRITE8_MEMBER(paranoia_state::i8155_a_w)
141WRITE8_MEMBER(paranoia_state::paranoia_i8155_a_w)
142142{
143143   //logerror("i8155 Port A: %02X\n", data);
144144}
145145
146WRITE8_MEMBER(paranoia_state::i8155_b_w)
146WRITE8_MEMBER(paranoia_state::paranoia_i8155_b_w)
147147{
148148   //logerror("i8155 Port B: %02X\n", data);
149149}
150150
151WRITE8_MEMBER(paranoia_state::i8155_c_w)
151WRITE8_MEMBER(paranoia_state::paranoia_i8155_c_w)
152152{
153153   //logerror("i8155 Port C: %02X\n", data);
154154}
155155
156WRITE_LINE_MEMBER(paranoia_state::i8155_timer_out)
156WRITE_LINE_MEMBER(paranoia_state::paranoia_i8155_timer_out)
157157{
158158   //m_subcpu->set_input_line(I8085_RST55_LINE, state ? CLEAR_LINE : ASSERT_LINE );
159159   //logerror("Timer out %d\n", state);
r248389r248390
175175   MCFG_CPU_IO_MAP(paranoia_z80_io_map)
176176
177177   MCFG_DEVICE_ADD("i8155", I8155, 1000000 /*?*/)
178   MCFG_I8155_OUT_PORTA_CB(WRITE8(paranoia_state, i8155_a_w))
179   MCFG_I8155_OUT_PORTB_CB(WRITE8(paranoia_state, i8155_b_w))
180   MCFG_I8155_OUT_PORTC_CB(WRITE8(paranoia_state, i8155_c_w))
181   MCFG_I8155_OUT_TIMEROUT_CB(WRITELINE(paranoia_state, i8155_timer_out))
178   MCFG_I8155_OUT_PORTA_CB(WRITE8(paranoia_state, paranoia_i8155_a_w))
179   MCFG_I8155_OUT_PORTB_CB(WRITE8(paranoia_state, paranoia_i8155_b_w))
180   MCFG_I8155_OUT_PORTC_CB(WRITE8(paranoia_state, paranoia_i8155_c_w))
181   MCFG_I8155_OUT_TIMEROUT_CB(WRITELINE(paranoia_state, paranoia_i8155_timer_out))
182182
183183   /* video hardware */
184184   MCFG_SCREEN_ADD("screen", RASTER)
r248389r248390
217217   ROM_LOAD( "4.352", 0x18000, 0x8000, CRC(11297fed) SHA1(17a294e65ba1c4806307602dee4c7c627ad1fcfd) )
218218ROM_END
219219
220GAME( 1990, paranoia, 0, paranoia, paranoia, pce_common_state, pce_common, ROT0, "Naxat Soft", "Paranoia", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
220GAME( 1990, paranoia, 0, paranoia, paranoia, pce_common_state, pce_common, ROT0, "Naxat Soft", "Paranoia", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
trunk/src/mame/drivers/poolshrk.c
r248389r248390
1919   UINT8* pSprite = memregion("gfx1")->base();
2020   UINT8* pOffset = memregion("proms")->base();
2121
22   int i;
23   int j;
24
2225   /* re-arrange sprite data using the PROM */
2326
24   for (int i = 0; i < 16; i++)
27   for (i = 0; i < 16; i++)
2528   {
26      for (int j = 0; j < 16; j++)
29      for (j = 0; j < 16; j++)
2730      {
2831         UINT16 v =
2932            (pSprite[0] << 0xC) |
r248389r248390
4144         pSprite += 4;
4245      }
4346   }
44   
45   save_item(NAME(m_da_latch));
4647}
4748
4849
49WRITE8_MEMBER(poolshrk_state::da_latch_w)
50WRITE8_MEMBER(poolshrk_state::poolshrk_da_latch_w)
5051{
5152   m_da_latch = data & 15;
5253}
5354
5455
55WRITE8_MEMBER(poolshrk_state::led_w)
56WRITE8_MEMBER(poolshrk_state::poolshrk_led_w)
5657{
5758   if (offset & 2)
5859      set_led_status(machine(), 0, offset & 1);
r248389r248390
6162}
6263
6364
64WRITE8_MEMBER(poolshrk_state::watchdog_w)
65WRITE8_MEMBER(poolshrk_state::poolshrk_watchdog_w)
6566{
6667   if ((offset & 3) == 3)
6768   {
r248389r248390
7071}
7172
7273
73READ8_MEMBER(poolshrk_state::input_r)
74READ8_MEMBER(poolshrk_state::poolshrk_input_r)
7475{
7576   static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
7677   UINT8 val = ioport(portnames[offset & 3])->read();
r248389r248390
9091}
9192
9293
93READ8_MEMBER(poolshrk_state::irq_reset_r)
94READ8_MEMBER(poolshrk_state::poolshrk_irq_reset_r)
9495{
9596   m_maincpu->set_input_line(0, CLEAR_LINE);
9697
r248389r248390
104105   AM_RANGE(0x0400, 0x07ff) AM_MIRROR(0x2000) AM_WRITEONLY AM_SHARE("playfield_ram")
105106   AM_RANGE(0x0800, 0x080f) AM_MIRROR(0x23f0) AM_WRITEONLY AM_SHARE("hpos_ram")
106107   AM_RANGE(0x0c00, 0x0c0f) AM_MIRROR(0x23f0) AM_WRITEONLY AM_SHARE("vpos_ram")
107   AM_RANGE(0x1000, 0x13ff) AM_MIRROR(0x2000) AM_READWRITE(input_r, watchdog_w)
108   AM_RANGE(0x1400, 0x17ff) AM_MIRROR(0x2000) AM_WRITE(scratch_sound_w)
109   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x2000) AM_WRITE(score_sound_w)
110   AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x2000) AM_WRITE(click_sound_w)
108   AM_RANGE(0x1000, 0x13ff) AM_MIRROR(0x2000) AM_READWRITE(poolshrk_input_r, poolshrk_watchdog_w)
109   AM_RANGE(0x1400, 0x17ff) AM_MIRROR(0x2000) AM_WRITE(poolshrk_scratch_sound_w)
110   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x2000) AM_WRITE(poolshrk_score_sound_w)
111   AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x2000) AM_WRITE(poolshrk_click_sound_w)
111112   AM_RANGE(0x4000, 0x4000) AM_NOP /* diagnostic ROM location */
112   AM_RANGE(0x6000, 0x63ff) AM_WRITE(da_latch_w)
113   AM_RANGE(0x6400, 0x67ff) AM_WRITE(bump_sound_w)
114   AM_RANGE(0x6800, 0x6bff) AM_READ(irq_reset_r)
115   AM_RANGE(0x6c00, 0x6fff) AM_WRITE(led_w)
113   AM_RANGE(0x6000, 0x63ff) AM_WRITE(poolshrk_da_latch_w)
114   AM_RANGE(0x6400, 0x67ff) AM_WRITE(poolshrk_bump_sound_w)
115   AM_RANGE(0x6800, 0x6bff) AM_READ(poolshrk_irq_reset_r)
116   AM_RANGE(0x6c00, 0x6fff) AM_WRITE(poolshrk_led_w)
116117   AM_RANGE(0x7000, 0x7fff) AM_ROM
117118ADDRESS_MAP_END
118119
r248389r248390
224225   MCFG_SCREEN_REFRESH_RATE(60)
225226   MCFG_SCREEN_SIZE(256, 256)
226227   MCFG_SCREEN_VISIBLE_AREA(1, 255, 24, 255)
227   MCFG_SCREEN_UPDATE_DRIVER(poolshrk_state, screen_update)
228   MCFG_SCREEN_UPDATE_DRIVER(poolshrk_state, screen_update_poolshrk)
228229   MCFG_SCREEN_PALETTE("palette")
229230
230231   MCFG_GFXDECODE_ADD("gfxdecode", "palette", poolshrk)
r248389r248390
257258ROM_END
258259
259260
260GAME( 1977, poolshrk, 0, poolshrk, poolshrk, poolshrk_state, poolshrk, 0, "Atari", "Poolshark", GAME_SUPPORTS_SAVE )
261GAME( 1977, poolshrk, 0, poolshrk, poolshrk, poolshrk_state, poolshrk, 0, "Atari", "Poolshark", 0 )
trunk/src/mame/drivers/sangho.c
r248389r248390
444444
445445   if((scanline % 2) == 0)
446446   {
447      m_v9958->set_resolution(RENDER_HIGH);
447448      m_v9958->interrupt();
448449   }
449450}
trunk/src/mame/drivers/sbowling.c
r248389r248390
5555      m_videoram(*this, "videoram"),
5656      m_gfxdecode(*this, "gfxdecode") { }
5757
58   int m_bgmap;
5859   required_device<cpu_device> m_maincpu;
5960   required_shared_ptr<UINT8> m_videoram;
6061   required_device<gfxdecode_device> m_gfxdecode;
6162
62   int m_bgmap;
63   int m_system;
64   tilemap_t *m_tilemap;
63   int m_sbw_system;
64   tilemap_t *m_sb_tilemap;
6565   bitmap_ind16 *m_tmpbitmap;
6666   UINT32 m_color_prom_address;
6767   UINT8 m_pix_sh;
6868   UINT8 m_pix[2];
6969
70   DECLARE_WRITE8_MEMBER(videoram_w);
70   DECLARE_WRITE8_MEMBER(sbw_videoram_w);
7171   DECLARE_WRITE8_MEMBER(pix_shift_w);
7272   DECLARE_WRITE8_MEMBER(pix_data_w);
7373   DECLARE_READ8_MEMBER(pix_data_r);
7474   DECLARE_WRITE8_MEMBER(system_w);
7575   DECLARE_WRITE8_MEMBER(graph_control_w);
7676   DECLARE_READ8_MEMBER(controls_r);
77
78   TILE_GET_INFO_MEMBER(get_tile_info);
79   TIMER_DEVICE_CALLBACK_MEMBER(interrupt);
80
77   TILE_GET_INFO_MEMBER(get_sb_tile_info);
8178   virtual void video_start();
8279   DECLARE_PALETTE_INIT(sbowling);
83
84   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
85   void postload();
80   UINT32 screen_update_sbowling(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
81   TIMER_DEVICE_CALLBACK_MEMBER(sbw_interrupt);
8682};
8783
88TILE_GET_INFO_MEMBER(sbowling_state::get_tile_info)
84TILE_GET_INFO_MEMBER(sbowling_state::get_sb_tile_info)
8985{
9086   UINT8 *rom = memregion("user1")->base();
9187   int tileno = rom[tile_index + m_bgmap * 1024];
r248389r248390
10096      y = 255-y;
10197      x = 247-x;
10298   }
103   
10499   tmpbitmap->pix16(y, x) = col;
105100}
106101
107WRITE8_MEMBER(sbowling_state::videoram_w)
102WRITE8_MEMBER(sbowling_state::sbw_videoram_w)
108103{
109104   int flip = flip_screen();
110   int x,y,v1,v2;
105   int x,y,i,v1,v2;
111106
112107   m_videoram[offset] = data;
113108
r248389r248390
119114   v1 = m_videoram[offset];
120115   v2 = m_videoram[offset+0x2000];
121116
122   for (int i = 0; i < 8; i++)
117   for (i = 0; i < 8; i++)
123118   {
124119      plot_pixel_sbw(m_tmpbitmap, x++, y, m_color_prom_address | ( ((v1&1)*0x20) | ((v2&1)*0x40) ), flip);
125120      v1 >>= 1;
r248389r248390
127122   }
128123}
129124
130UINT32 sbowling_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
125UINT32 sbowling_state::screen_update_sbowling(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
131126{
132127   bitmap.fill(0x18, cliprect);
133   m_tilemap->draw(screen, bitmap, cliprect, 0, 0);
128   m_sb_tilemap->draw(screen, bitmap, cliprect, 0, 0);
134129   copybitmap_trans(bitmap, *m_tmpbitmap, 0, 0, 0, 0, cliprect, m_color_prom_address);
135130   return 0;
136131}
r248389r248390
138133void sbowling_state::video_start()
139134{
140135   m_tmpbitmap = auto_bitmap_ind16_alloc(machine(),32*8,32*8);
141   m_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sbowling_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
142
143   save_item(NAME(m_bgmap));
144   save_item(NAME(m_system));
145   save_item(NAME(m_color_prom_address));
146   save_item(NAME(m_pix_sh));
147   save_item(NAME(m_pix));
148   machine().save().register_postload(save_prepost_delegate(FUNC(sbowling_state::postload), this));
136   m_sb_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sbowling_state::get_sb_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
149137}
150138
151void sbowling_state::postload()
152{
153   address_space &space = m_maincpu->space(AS_PROGRAM);
154   for (int offs = 0; offs < 0x4000; offs++)
155      videoram_w(space, offs, m_videoram[offs]);
156}
157
158139WRITE8_MEMBER(sbowling_state::pix_shift_w)
159140{
160141   m_pix_sh = data;
r248389r248390
180161
181162
182163
183TIMER_DEVICE_CALLBACK_MEMBER(sbowling_state::interrupt)
164TIMER_DEVICE_CALLBACK_MEMBER(sbowling_state::sbw_interrupt)
184165{
185166   int scanline = param;
186167
r248389r248390
205186
206187   flip_screen_set(data&1);
207188
208   if ((m_system^data)&1)
189   if ((m_sbw_system^data)&1)
209190   {
210191      int offs;
211192      for (offs = 0;offs < 0x4000; offs++)
212         videoram_w(space, offs, m_videoram[offs]);
193         sbw_videoram_w(space, offs, m_videoram[offs]);
213194   }
214   m_system = data;
195   m_sbw_system = data;
215196}
216197
217198WRITE8_MEMBER(sbowling_state::graph_control_w)
r248389r248390
229210   m_color_prom_address = ((data&0x07)<<7) | ((data&0xc0)>>3);
230211
231212   m_bgmap = ((data>>4)^3) & 0x3;
232   m_tilemap->mark_all_dirty();
213   m_sb_tilemap->mark_all_dirty();
233214}
234215
235216READ8_MEMBER(sbowling_state::controls_r)
236217{
237   if (m_system & 2)
218   if (m_sbw_system & 2)
238219      return ioport("TRACKY")->read();
239220   else
240221      return ioport("TRACKX")->read();
r248389r248390
242223
243224static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, sbowling_state )
244225   AM_RANGE(0x0000, 0x2fff) AM_ROM
245   AM_RANGE(0x8000, 0xbfff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
226   AM_RANGE(0x8000, 0xbfff) AM_RAM_WRITE(sbw_videoram_w) AM_SHARE("videoram")
246227   AM_RANGE(0xf800, 0xf801) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
247228   AM_RANGE(0xf801, 0xf801) AM_DEVREAD("aysnd", ay8910_device, data_r)
248229   AM_RANGE(0xfc00, 0xffff) AM_RAM
r248389r248390
362343PALETTE_INIT_MEMBER(sbowling_state, sbowling)
363344{
364345   const UINT8 *color_prom = memregion("proms")->base();
346   int i;
365347
366348   static const int resistances_rg[3] = { 470, 270, 100 };
367349   static const int resistances_b[2]  = { 270, 100 };
r248389r248390
373355      3,  resistances_rg, outputs_g,  0,  100,
374356      2,  resistances_b,  outputs_b,  0,  100);
375357
376   for (int i = 0;i < palette.entries();i++)
358   for (i = 0;i < palette.entries();i++)
377359   {
378360      int bit0,bit1,bit2,r,g,b;
379361
r248389r248390
402384   MCFG_CPU_ADD("maincpu", I8080, XTAL_19_968MHz/10)   /* ? */
403385   MCFG_CPU_PROGRAM_MAP(main_map)
404386   MCFG_CPU_IO_MAP(port_map)
405   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sbowling_state, interrupt, "screen", 0, 1)
387   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sbowling_state, sbw_interrupt, "screen", 0, 1)
406388
407389   /* video hardware */
408390   MCFG_SCREEN_ADD("screen", RASTER)
409391   MCFG_SCREEN_REFRESH_RATE(60)
410392   MCFG_SCREEN_SIZE(32*8, 262)     /* vert size taken from mw8080bw */
411393   MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 4*8, 32*8-1)
412   MCFG_SCREEN_UPDATE_DRIVER(sbowling_state, screen_update)
394   MCFG_SCREEN_UPDATE_DRIVER(sbowling_state, screen_update_sbowling)
413395   MCFG_SCREEN_PALETTE("palette")
414396
415397   MCFG_GFXDECODE_ADD("gfxdecode", "palette", sbowling)
r248389r248390
443425   ROM_LOAD( "kb09.6m",        0x0400, 0x0400, CRC(e29191a6) SHA1(9a2c78a96ef6d118f4dacbea0b7d454b66a452ae))
444426ROM_END
445427
446GAME( 1982, sbowling, 0, sbowling, sbowling, driver_device, 0, ROT90, "Taito Corporation", "Strike Bowling", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
428GAME( 1982, sbowling, 0, sbowling, sbowling, driver_device, 0, ROT90, "Taito Corporation", "Strike Bowling",GAME_IMPERFECT_SOUND)
trunk/src/mame/drivers/scramble.c
r248389r248390
412412
413413static ADDRESS_MAP_START( harem_sound_map, AS_PROGRAM, 8, scramble_state )
414414   AM_RANGE(0x0000, 0x2fff) AM_ROM
415   AM_RANGE(0x6000, 0x6000) AM_READ(harem_digitalker_intr_r)
415   AM_RANGE(0x6000, 0x6000) AM_READNOP
416416   AM_RANGE(0x8000, 0x83ff) AM_RAM
417417   AM_RANGE(0xa000, 0xafff) AM_WRITE(scramble_filter_w)
418418ADDRESS_MAP_END
r248389r248390
420420static ADDRESS_MAP_START( harem_sound_io_map, AS_IO, 8, scramble_state )
421421   ADDRESS_MAP_GLOBAL_MASK(0xff)
422422
423   // ports->speech:
423   // ports->speech?:
424424   AM_RANGE(0x04, 0x04) AM_DEVWRITE("8910.3", ay8910_device, address_w)
425425   AM_RANGE(0x08, 0x08) AM_DEVREADWRITE("8910.3", ay8910_device, data_r, data_w)
426426   // same as scramble:
r248389r248390
16881688
16891689   MCFG_VIDEO_START_OVERRIDE(scramble_state,harem)
16901690
1691   /* extra AY8910 with I/O ports */
1691   /* sound hardware */
16921692   MCFG_SOUND_ADD("8910.3", AY8910, 14318000/8)
16931693   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
1694   MCFG_AY8910_PORT_A_WRITE_CB(DEVWRITE8("digitalker", digitalker_device, digitalker_data_w))
1695   MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(scramble_state, harem_digitalker_control_w))
1696
1697   MCFG_DIGITALKER_ADD("digitalker", 4000000)
1698   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
1694   MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(scramble_state, harem_portA_w))   // Port A write
1695   MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(scramble_state, harem_portB_w))   // Port B write
16991696MACHINE_CONFIG_END
17001697
17011698/***************************************************************************
r248389r248390
22212218   ROM_LOAD( "harem_sound1.ic12", 0x0000, 0x2000, CRC(b54799dd) SHA1(b6aeb010257cba48a52afd33b4f8031c7d99550c) )
22222219   ROM_LOAD( "harem_sound2.ic13", 0x2000, 0x1000, CRC(2d5573a4) SHA1(1fdcd99d89e078509634742b2116a35bb199fe4b) )
22232220
2224   ROM_REGION( 0x2000, "digitalker", 0 ) // DigiTalker ROM (same exact sound PCB as Scorpion (galaxian.c))
2221   ROM_REGION( 0x2000, "unknown", 0 ) // DigiTalker ROM (same exact sound PCB as Scorpion (galdrv.c))
22252222   ROM_LOAD( "harem_h1+h2.ic25",  0x0000, 0x2000, CRC(279f923a) SHA1(166b1b625997766f0de7cc18af52c42268022fcb) )
22262223
22272224   ROM_REGION( 0x4000, "gfx1", 0 )
r248389r248390
22712268
22722269GAME( 1981, turpins,  turtles,  turpins,  turpins,  driver_device,  0,            ROT90, "bootleg",             "Turpin (bootleg on Scramble hardware)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) // haven't hooked up the sound CPU yet
22732270
2274GAME( 1983, harem,    0,        harem,    harem,    scramble_state, harem,        ROT90, "I.G.R.",              "Harem",                          GAME_SUPPORTS_SAVE )
2271GAME( 1983, harem,    0,        harem,    harem,    scramble_state, harem,        ROT90, "I.G.R.",              "Harem",                          GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND ) // colors, missing speech?
trunk/src/mame/drivers/segas24.c
r248389r248390
19781978   ROM_LOAD16_BYTE( "epr-11338.ic1", 0x000001, 0x20000, CRC(7d4a7ff3) SHA1(3d3af04d990d232ba0a8fe155de59bc632a0a461) )
19791979
19801980   ROM_REGION( 0x1d6000, "floppy", 0)
1981   ROM_LOAD( "ds3-5000-01d_3p_turbo.img", 0x000000, 0x1d6000, CRC(842006fd) SHA1(d5432f58c0fb39f2bf62786a0d842bdd469ab2cb) )
1981   ROM_LOAD( "ds3-5000-01d_3p_turbo.img", 0x000000, 0x1d6000, CRC(627e8053) SHA1(d1a95f99078f5a29cccacfb1b30c3c9ead7b605c) )
19821982ROM_END
19831983
19841984ROM_START( hotroda )
r248389r248390
19871987   ROM_LOAD16_BYTE( "epr-11338.ic1", 0x000001, 0x20000, CRC(7d4a7ff3) SHA1(3d3af04d990d232ba0a8fe155de59bc632a0a461) )
19881988
19891989   ROM_REGION( 0x1d6000, "floppy", 0)
1990   ROM_LOAD( "ds3-5000-01d.img", 0x000000, 0x1d6000, CRC(e25c6b63) SHA1(fbf86d2ebccd8053b990939f63f5497907d18321) )
1990   ROM_LOAD( "ds3-5000-01d.img", 0x000000, 0x1d6000, CRC(abf67b02) SHA1(f397435eaad691ff5a38d6d1d27840ed95a62df3) ) // World? 3 Player TURBO
19911991ROM_END
19921992
1993ROM_START( hotrodja )
1994   ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 code */
1995   ROM_LOAD16_BYTE( "epr-11339.ic2", 0x000000, 0x20000, CRC(75130e73) SHA1(e079739f4a3da3807aac570442c5afef1a7d7b0e) )
1996   ROM_LOAD16_BYTE( "epr-11338.ic1", 0x000001, 0x20000, CRC(7d4a7ff3) SHA1(3d3af04d990d232ba0a8fe155de59bc632a0a461) )
1997
1998   ROM_REGION( 0x1d6000, "floppy", 0)
1999   ROM_LOAD( "ds3-5000-01a-rev-b.img", 0x000000, 0x1d6000, CRC(c18f6dca) SHA1(6f2b5a9567a340324a5f3fb57a3b744de0924a23) )
2000ROM_END
2001
20021993ROM_START( hotrodj )
20031994   ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 code */
20041995   ROM_LOAD16_BYTE( "epr-11339.ic2", 0x000000, 0x20000, CRC(75130e73) SHA1(e079739f4a3da3807aac570442c5afef1a7d7b0e) )
20051996   ROM_LOAD16_BYTE( "epr-11338.ic1", 0x000001, 0x20000, CRC(7d4a7ff3) SHA1(3d3af04d990d232ba0a8fe155de59bc632a0a461) )
20061997
20071998   ROM_REGION( 0x1d6000, "floppy", 0)
2008   ROM_LOAD( "ds3-5000-01a-rev-c.img", 0x000000, 0x1d6000, CRC(852f9b5f) SHA1(159e161f55beed0f90cce8a73b0aeb4564d6af90) )
1999   ROM_LOAD( "ds3-5000-01a-rev-b.img", 0x000000, 0x1d6000, CRC(a39a0c2d) SHA1(ea8104c2266c48f480837aa7679c0a6f0c5e5452) ) // Japanese 4 Player
20092000ROM_END
20102001
20112002ROM_START( qgh )
r248389r248390
20802071   ROM_RELOAD ( 0x180001, 0x40000)
20812072
20822073   ROM_REGION( 0x1c2000, "floppy", 0)
2083   ROM_LOAD( "ds3-5000-07d.img", 0x000000, 0x1c2000, CRC(2e70251f) SHA1(1c2616dfa5cc15e8ebf1424012f2dd66f3a001a1) ) /* Region letter needs to be verfied */
2074   ROM_LOAD( "ds3-5000-07d.img", 0x000000, 0x1c2000, CRC(ea7a3302) SHA1(5f92efb2e1135c1f3eeca38ba5789739a22dbd11) ) /* Region letter needs to be verfied */
20842075ROM_END
20852076
20862077ROM_START( bnzabrosj )
r248389r248390
21202111   ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
21212112
21222113   ROM_REGION( 0x1c2000, "floppy", 0)
2123   ROM_LOAD( "ds3-5000-02-.img", 0x000000, 0x1c2000, CRC(179b98e9) SHA1(f6fc52c599c336d5c6f7aa199515268b4b3218a8) )
2114   ROM_LOAD( "ds3-5000-02-.img", 0x000000, 0x1c2000, CRC(cefbda69) SHA1(5b47ae0f1584ce1eb697246273ba761bd9e981c1) )
21242115ROM_END
21252116
21262117ROM_START( sspiritj )
r248389r248390
21662157   ROM_LOAD( "317-0058-05c.key", 0x0000, 0x2000, CRC(ae0eabe5) SHA1(692d7565bf9c5b32cc80bb4bd88c9193aa04cbb0) )
21672158
21682159   ROM_REGION( 0x1c2000, "floppy", 0)
2169   ROM_LOAD( "ds3-5000-05c.img", 0x000000, 0x1c2000, CRC(63a6ef3a) SHA1(f39fe0bf8930de994b1a77e0ba787d249d73c5e5) )
2160   ROM_LOAD( "ds3-5000-05c.img", 0x000000, 0x1c2000, CRC(06c4f834) SHA1(5e178ed0edff7721c93f76da2e03ae188dc5efa4) )
21702161ROM_END
21712162
21722163ROM_START( sgmastj )
r248389r248390
24752466/* Disk Based Games */
24762467/* 01 */GAME( 1988, hotrod,    0,        system24_floppy,        hotrod,   segas24_state, hotrod,   ROT0,   "Sega", "Hot Rod (World, 3 Players, Turbo set 1, Floppy Based)", 0 )
24772468/* 01 */GAME( 1988, hotroda,   hotrod,   system24_floppy,        hotrod,   segas24_state, hotrod,   ROT0,   "Sega", "Hot Rod (World, 3 Players, Turbo set 2, Floppy Based)", 0 )
2478/* 01 */GAME( 1988, hotrodj,   hotrod,   system24_floppy,        hotrodj,  segas24_state, hotrod,   ROT0,   "Sega", "Hot Rod (Japan, 4 Players, Floppy Based, Rev C)", 0 )
2479/* 01 */GAME( 1988, hotrodja,  hotrod,   system24_floppy,        hotrodj,  segas24_state, hotrod,   ROT0,   "Sega", "Hot Rod (Japan, 4 Players, Floppy Based, Rev B)", 0 )
2469/* 01 */GAME( 1988, hotrodj,   hotrod,   system24_floppy,        hotrodj,  segas24_state, hotrod,   ROT0,   "Sega", "Hot Rod (Japan, 4 Players, Floppy Based)", 0 )
24802470/* 02 */GAME( 1988, sspirits,  0,        system24_floppy,        sspirits, segas24_state, sspirits, ROT270, "Sega", "Scramble Spirits (World, Floppy Based)", 0 )
24812471/* 02 */GAME( 1988, sspiritj,  sspirits, system24_floppy,        sspirits, segas24_state, sspiritj, ROT270, "Sega", "Scramble Spirits (Japan, Floppy DS3-5000-02-REV-A Based)", 0 )
24822472/* 02 */GAME( 1988, sspirtfc,  sspirits, system24_floppy_fd1094, sspirits, segas24_state, sspirits, ROT270, "Sega", "Scramble Spirits (World, Floppy Based, FD1094 317-0058-02c)", GAME_NOT_WORKING ) /* MISSING disk image */
trunk/src/mame/drivers/seta2.c
r248389r248390
21232123   MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
21242124
21252125   // sound hardware
2126   MCFG_SPEAKER_STANDARD_MONO("mono")
2126   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
21272127
21282128   MCFG_SOUND_ADD("x1snd", X1_010, XTAL_50MHz/3)   // clock?
2129   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
2129   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
2130   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
21302131MACHINE_CONFIG_END
21312132
21322133
trunk/src/mame/drivers/snk.c
r248389r248390
39793979   MCFG_CPU_MODIFY("audiocpu")
39803980   MCFG_CPU_PROGRAM_MAP(YM3812_Y8950_sound_map)
39813981
3982   /* video hardware */
3983   MCFG_SCREEN_MODIFY("screen")
3984   // this visible area matches the flyer
3985   MCFG_SCREEN_SIZE(51*8, 28*8)
3986   MCFG_SCREEN_VISIBLE_AREA(1*8, 50*8-1, 0*8, 28*8-1)
3987
39823988   /* sound hardware */
39833989   MCFG_SOUND_REPLACE("ym1", YM3812, 4000000)
39843990   MCFG_YM3812_IRQ_HANDLER(WRITELINE(snk_state, ymirq_callback_1))
trunk/src/mame/drivers/spbactn.c
r248389r248390
8484
8585TODO : (also check the notes from the galspnbl.c driver)
8686
87  - coin insertion is not recognized consistently.
87  - coin insertion is not recognized consistenly.
8888  - rewrite video, do single pass sprite render, move sprite code to device, share with gaiden.c etc.
8989  - convert to tilemaps
9090  - all the unknown regs
r248389r248390
580580
581581
582582   /* does this have an extra (horizontal) screen maybe, with the girls being displayed on that instead of the main one.. */
583   ROM_REGION( 0x10000, "extracpu", 0 ) // what? it's another z80 rom... unused for now
583   ROM_REGION( 0x10000, "extracpu", 0 ) // what? it's annother z80 rom... unused for now
584584   ROM_LOAD( "6204_6-6.29c",   0x00000, 0x10000, CRC(e8250c26) SHA1(9b669878790c8e3c5d80f165b5ffa1d6830f4696) )
585585
586586   ROM_REGION( 0x080000, "gfx4", 0 ) /* 8x8 BG Tiles */ // more 8x8 tiles, with the girl graphics? unused for now .. for horizontal orientation??
r248389r248390
592592   ROM_LOAD( "tcm1.19g.bin", 0x00000, 0x53, CRC(2c54354a) SHA1(11d8b6cdaf052b5a9fbcf6b6fbf99c5f89575cfa) )
593593ROM_END
594594
595GAME( 1991, spbactn, 0,        spbactn, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (US)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
596GAME( 1991, spbactnj, spbactn, spbactn, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
597GAME( 1989, spbactnp, spbactn, spbactnp, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (prototype)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // early proto, (c) date is 2 years earlier!
595GAME( 1991, spbactn, 0,        spbactn, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (US)", GAME_IMPERFECT_GRAPHICS )
596GAME( 1991, spbactnj, spbactn, spbactn, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (Japan)", GAME_IMPERFECT_GRAPHICS )
597GAME( 1989, spbactnp, spbactn, spbactnp, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (prototype)", GAME_NOT_WORKING ) // early proto, (c) date is 2 years earlier!
trunk/src/mame/drivers/ssingles.c
r248389r248390
11// license:LGPL-2.1+
22// copyright-holders:Tomasz Slanina
33/*
4 'Swinging Singles' US distribution by Ent. Ent. Ltd
5 Original Japan release is 'Utamaro' by 'Yachiyo' (undumped!)
4 'Swinging Singles' by Ent. Ent. Ltd
65 driver by Tomasz Slanina
76
87
r248389r248390
665664   save_item(NAME(m_colorram));
666665}
667666
668GAME( 1983, ssingles, 0, ssingles, ssingles, ssingles_state, ssingles, ROT90, "Yachiyo Denki (Entertainment Enterprises, Ltd. license)", "Swinging Singles (US)", GAME_SUPPORTS_SAVE | GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
667GAME( 1983, ssingles, 0, ssingles, ssingles, ssingles_state, ssingles, ROT90, "Entertainment Enterprises, Ltd.", "Swinging Singles", GAME_SUPPORTS_SAVE | GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
669668GAME( 1983, atamanot, 0, atamanot, ssingles, ssingles_state, ssingles, ROT90, "Yachiyo Denki / Uni Enterprize", "Computer Quiz Atama no Taisou (Japan)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION )
trunk/src/mame/drivers/system1.c
r248389r248390
4747thetogyu    3x16k 1x8k  6x8k  2x16k  no  pio  6073
4848
4949spatter     3x16k 1x8k  6x8k  4x16k  no  pio  6394    6306
50spattera    3x16k 1x8k  6x8k  4x16k  no  pio  6599    6306
5150ssanchan    3x16k 1x8k  6x8k  4x16k  no  pio  6312
5251
5352pitfall2    3x16k 1x8k  6x8k  2x16k  no  pio  6458(a) 6454
r248389r248390
122121
123122*******************************************************************************
124123
125Spatter (315-5099)
126Sega 1984
127
128This game runs on Sega System 1 hardware.
129
130834-5583-12 SPATTER (sticker)
131834-5542 daughter board with 4 eproms (EPR6306, EPR6307, EPR6308, EPR6309)
132834-5540 daughter board with logic ICs
133315-5099 custom Z80 CPU w/security
134
135*******************************************************************************
136
137124Chop Lifter
138125Sega 1985
139126
r248389r248390
28212808
28222809ROM_START( spattera )
28232810   ROM_REGION( 0x10000, "maincpu", 0 )
2824   ROM_LOAD( "epr-6597.116",   0x0000, 0x4000, CRC(fb928b9d) SHA1(0a9bede7a147009b9ebb8a0b73681359da665982) ) /* encrypted */
2811   ROM_LOAD( "epr-6597.116",   0x0000, 0x4000, BAD_DUMP CRC(be80384d) SHA1(9e1f5807492b98c3f36a5b80466dcb2a1f1fead8) ) /* encrypted */ // consistent read, but fails ingame ROM check on PCB
28252812   ROM_LOAD( "epr-6598.109",   0x4000, 0x4000, CRC(5dff037a) SHA1(8e6f6b75a89609ab0498d317c11e6d653343ffbe) ) /* encrypted */
28262813   ROM_LOAD( "epr-6599.96",    0x8000, 0x4000, CRC(7ba9de5b) SHA1(f18542c95e8241433ed995c213924ad1ce03cd5b) )
28272814
r248389r248390
49714958   sega_decode(m_maincpu_region->base(), m_decrypted_opcodes, 0x8000, convtable);
49724959}
49734960
4974DRIVER_INIT_MEMBER(system1_state,spattera)
4975{
4976   static const UINT8 convtable[32][4] =
4977   {
4978      /*       opcode                   data                     address      */
4979      /*  A    B    C    D         A    B    C    D                           */
4980      { 0xa0,0xa8,0x20,0x28 }, { 0x80,0xa0,0x00,0x20 },   /* ...0...0...0...0 */
4981      { 0x20,0x28,0x00,0x08 }, { 0x20,0x28,0x00,0x08 },   /* ...0...0...0...1 */
4982      { 0xa0,0xa8,0x20,0x28 }, { 0x08,0x28,0x00,0x20 },   /* ...0...0...1...0 */
4983      { 0x88,0x08,0xa8,0x28 }, { 0x88,0x08,0xa8,0x28 },   /* ...0...0...1...1 */
4984      { 0xa0,0xa8,0x20,0x28 }, { 0x20,0x28,0x00,0x08 },   /* ...0...1...0...0 */
4985      { 0x28,0xa8,0x20,0xa0 }, { 0x20,0x28,0x00,0x08 },   /* ...0...1...0...1 */
4986      { 0xa0,0xa8,0x20,0x28 }, { 0x08,0x28,0x00,0x20 },   /* ...0...1...1...0 */
4987      { 0x88,0x08,0xa8,0x28 }, { 0x88,0x08,0xa8,0x28 },   /* ...0...1...1...1 */
4988      { 0x28,0xa8,0x20,0xa0 }, { 0xa0,0xa8,0x20,0x28 },   /* ...1...0...0...0 */
4989      { 0x88,0x08,0xa8,0x28 }, { 0x80,0xa0,0x00,0x20 },   /* ...1...0...0...1 */
4990      { 0x28,0xa8,0x20,0xa0 }, { 0x08,0x28,0x00,0x20 },   /* ...1...0...1...0 */
4991      { 0x28,0xa8,0x20,0xa0 }, { 0x80,0xa0,0x00,0x20 },   /* ...1...0...1...1 */
4992      { 0x20,0x28,0x00,0x08 }, { 0x20,0x28,0x00,0x08 },   /* ...1...1...0...0 */
4993      { 0x88,0x08,0xa8,0x28 }, { 0x20,0x28,0x00,0x08 },   /* ...1...1...0...1 */
4994      { 0x08,0x28,0x00,0x20 }, { 0x80,0xa0,0x00,0x20 },   /* ...1...1...1...0 */
4995      { 0x08,0x28,0x00,0x20 }, { 0x88,0x08,0xa8,0x28 }    /* ...1...1...1...1 */
4996   };
4997
4998   DRIVER_INIT_CALL(bank00);
4999   sega_decode(m_maincpu_region->base(), m_decrypted_opcodes, 0x8000, convtable);
5000}
5001
50024961DRIVER_INIT_MEMBER(system1_state,pitfall2)
50034962{
50044963   static const UINT8 convtable[32][4] =
r248389r248390
56565615GAME( 1984, flickys2,   flicky,   sys1pio,   flickys2,  system1_state, bank00,   ROT0,   "Sega", "Flicky (128k Version, System 2, not encrypted)", GAME_SUPPORTS_SAVE )
56575616GAME( 1984, thetogyu,   bullfgt,  sys1piox,  bullfgt,   system1_state, bullfgtj, ROT0,   "Coreland / Sega", "The Togyu (315-5065, Japan)", GAME_SUPPORTS_SAVE )
56585617GAME( 1984, spatter,    0,        sys1piosx, spatter,   system1_state, spatter,  ROT0,   "Sega", "Spatter (set 1)", GAME_SUPPORTS_SAVE )
5659GAME( 1984, spattera,   spatter,  sys1piosx, spatter,   system1_state, spattera, ROT0,   "Sega", "Spatter (315-5099)", GAME_SUPPORTS_SAVE )
5618GAME( 1984, spattera,   spatter,  sys1piosx, spatter,   system1_state, spatter, ROT0,   "Sega", "Spatter (315-5099)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
56605619GAME( 1984, ssanchan,   spatter,  sys1piosx, spatter,   system1_state, spatter,  ROT0,   "Sega", "Sanrin San Chan (Japan)", GAME_SUPPORTS_SAVE )
56615620GAME( 1985, pitfall2,   0,        sys1piox,  pitfall2,  system1_state, pitfall2, ROT0,   "Sega", "Pitfall II (315-5093)", GAME_SUPPORTS_SAVE )
56625621GAME( 1985, pitfall2a,  pitfall2, sys1piox,  pitfall2,  system1_state, pitfall2, ROT0,   "Sega", "Pitfall II (315-5093, Flicky Conversion)", GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/system16.c
r248389r248390
9797#include "sound/2612intf.h"
9898#include "sound/rf5c68.h"
9999#include "video/segaic16.h"
100#include "sound/2203intf.h"
101100
102101#define SHADOW_COLORS_MULTIPLIER 3
103102
r248389r248390
119118   }
120119}
121120
122WRITE16_MEMBER(segas1x_bootleg_state::sound_command_irq_w)
123{
124   if (ACCESSING_BITS_0_7)
125   {
126      soundlatch_byte_w(space, 0, data & 0xff);
127      m_soundcpu->set_input_line(0, HOLD_LINE);
128   }
129}
130121
131
132122static ADDRESS_MAP_START( shinobib_map, AS_PROGRAM, 16, segas1x_bootleg_state )
133123   AM_RANGE(0x000000, 0x03ffff) AM_ROM
134124   AM_RANGE(0x400000, 0x40ffff) AM_RAM // tilemap ram on the original, used as a buffer on the bootlegs
r248389r248390
137127   AM_RANGE(0x412000, 0x412fff) AM_RAM AM_SHARE("bg1_tileram")
138128   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites")
139129   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
140//   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sound_command_irq_w)
141   AM_RANGE(0xC42006, 0xC42007) AM_WRITE(sound_command_irq_w)
142   
143   AM_RANGE(0xC44000, 0xC44001) AM_READNOP
130   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sound_command_nmi_w)
144131   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
145132   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
146133   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2")
r248389r248390
159146
160147/***************************************************************************/
161148
149WRITE16_MEMBER(segas1x_bootleg_state::sound_command_w)
150{
151   if (ACCESSING_BITS_0_7)
152   {
153      soundlatch_byte_w(space, 0, data & 0xff);
154      m_soundcpu->set_input_line(0, HOLD_LINE);
155   }
156}
157
162158WRITE16_MEMBER(segas1x_bootleg_state::sys16_coinctrl_w)
163159{
164160   if (ACCESSING_BITS_0_7)
r248389r248390
191187   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
192188   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
193189   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
194   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_irq_w)
190   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
195191   AM_RANGE(0xc46000, 0xc46001) AM_WRITE(s16a_bootleg_bgscrolly_w)
196192   AM_RANGE(0xc46002, 0xc46003) AM_WRITE(s16a_bootleg_bgscrollx_w)
197193   AM_RANGE(0xc46004, 0xc46005) AM_WRITE(s16a_bootleg_fgscrolly_w)
r248389r248390
269265   AM_RANGE(0xc41006, 0xc41007) AM_READ(passht4b_io3_r)
270266   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
271267   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
272   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_irq_w)
268   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
273269   AM_RANGE(0xc43000, 0xc43001) AM_READ_PORT("P1")     // test mode only
274270   AM_RANGE(0xc43002, 0xc43003) AM_READ_PORT("P2")
275271   AM_RANGE(0xc43004, 0xc43005) AM_READ_PORT("P3")
r248389r248390
317313   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
318314   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
319315   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
320   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_irq_w)
316   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
321317   AM_RANGE(0xC44000, 0xC44001) AM_WRITENOP
322318   AM_RANGE(0xc46000, 0xc46001) AM_WRITE(s16a_bootleg_bgscrolly_w)
323319   AM_RANGE(0xc46002, 0xc46003) AM_WRITE(s16a_bootleg_bgscrollx_w)
r248389r248390
428424
429425/*******************************************************************************/
430426
431static ADDRESS_MAP_START(shinobi_datsu_sound_map, AS_PROGRAM, 8, segas1x_bootleg_state )
432   AM_RANGE(0x0000, 0x7fff) AM_ROM
433
434   AM_RANGE(0xe000, 0xe001) AM_DEVREADWRITE("ym1", ym2203_device, read, write)
435   AM_RANGE(0xe400, 0xe401) AM_DEVREADWRITE("ym2", ym2203_device, read, write)
436   AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_byte_r)
437
438   AM_RANGE(0xf800, 0xffff) AM_RAM
439ADDRESS_MAP_END
440
441static ADDRESS_MAP_START( shinobi_datsu_sound_io, AS_IO, 8, segas1x_bootleg_state )
442   ADDRESS_MAP_GLOBAL_MASK(0xff)
443ADDRESS_MAP_END
444
445
446
447/*******************************************************************************/
448
449427static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, segas1x_bootleg_state )
450428   AM_RANGE(0x0000, 0x7fff) AM_ROM
451429   AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_byte_r)
r248389r248390
526504   AM_RANGE(0x901000, 0x901001) AM_READ_PORT("SERVICE")
527505   AM_RANGE(0x902002, 0x902003) AM_READ_PORT("DSW1")
528506   AM_RANGE(0x902000, 0x902001) AM_READ_PORT("DSW2")
529   AM_RANGE(0xff0006, 0xff0007) AM_WRITE(sound_command_irq_w)
507   AM_RANGE(0xff0006, 0xff0007) AM_WRITE(sound_command_w)
530508   AM_RANGE(0xff0020, 0xff003f) AM_WRITENOP // config regs
531509ADDRESS_MAP_END
532510#endif
r248389r248390
713691   AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
714692   AM_RANGE(0x900000, 0x900001) AM_READ_PORT("DSW1")
715693   AM_RANGE(0x900002, 0x900003) AM_READ_PORT("DSW2")
716   AM_RANGE(0x900006, 0x900007) AM_WRITE(sound_command_irq_w)
694   AM_RANGE(0x900006, 0x900007) AM_WRITE(sound_command_w)
717695   AM_RANGE(0x901000, 0x901001) AM_READ_PORT("SERVICE") AM_WRITE(sys16_coinctrl_w)
718696   AM_RANGE(0x901002, 0x901003) AM_READ_PORT("P1")
719697   AM_RANGE(0x901006, 0x901007) AM_READ_PORT("P2")
r248389r248390
727705   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites")
728706   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
729707   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
730   AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_irq_w)
708   AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_w)
731709   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
732710   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
733711   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
r248389r248390
847825   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE(sys16_textram_w) AM_SHARE("textram")
848826   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_SHARE("sprites")
849827
850   AM_RANGE(0x600006, 0x600007) AM_WRITE(sound_command_irq_w)
828   AM_RANGE(0x600006, 0x600007) AM_WRITE(sound_command_w)
851829   AM_RANGE(0x601000, 0x601001) AM_READ_PORT("SERVICE")
852830   AM_RANGE(0x601002, 0x601003) AM_READ_PORT("P1")
853831   AM_RANGE(0x601004, 0x601005) AM_READ_PORT("P2")
r248389r248390
901879   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
902880   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
903881   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
904   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_irq_w)
882   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
905883   AM_RANGE(0xc80000, 0xc80001) AM_WRITENOP
906884   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
907885ADDRESS_MAP_END
r248389r248390
928906   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2")
929907   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
930908   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
931   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_irq_w)
909   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
932910   AM_RANGE(0xc43034, 0xc43035) AM_WRITENOP
933911   AM_RANGE(0xc80000, 0xc80001) AM_NOP
934912   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
r248389r248390
965943   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
966944   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
967945   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
968   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_irq_w)
946   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
969947
970948   AM_RANGE(0xc40000, 0xc40001) AM_WRITENOP
971949   AM_RANGE(0xc80000, 0xc80001) AM_WRITENOP // vblank irq ack
r248389r248390
985963   AM_RANGE(0x600000, 0x600001) AM_WRITE(sys16_coinctrl_w)
986964   AM_RANGE(0x600000, 0x600001) AM_READ_PORT("DSW2")
987965   AM_RANGE(0x600002, 0x600003) AM_READ_PORT("DSW1")
988   AM_RANGE(0x600006, 0x600007) AM_WRITE(sound_command_irq_w)
966   AM_RANGE(0x600006, 0x600007) AM_WRITE(sound_command_w)
989967   AM_RANGE(0x601000, 0x601001) AM_READ_PORT("SERVICE")
990968   AM_RANGE(0x601002, 0x601003) AM_READ_PORT("P1")
991969   AM_RANGE(0x601004, 0x601005) AM_READ_PORT("P2")
r248389r248390
11051083
11061084***************************************************************************/
11071085
1086WRITE16_MEMBER(segas1x_bootleg_state::sound_command_irq_w)
1087{
1088   if (ACCESSING_BITS_0_7)
1089   {
1090      soundlatch_byte_w(space, 0, data & 0xff);
1091      m_soundcpu->set_input_line(0, HOLD_LINE);
1092   }
1093}
11081094
11091095static ADDRESS_MAP_START( shdancbl_map, AS_PROGRAM, 16, segas1x_bootleg_state )
11101096   AM_RANGE(0x000000, 0x07ffff) AM_ROM
r248389r248390
20302016 *************************************/
20312017
20322018/* System 16A/B Bootlegs */
2033static MACHINE_CONFIG_START( system16_base, segas1x_bootleg_state )
2019static MACHINE_CONFIG_START( system16, segas1x_bootleg_state )
20342020
20352021   /* basic machine hardware */
20362022   MCFG_CPU_ADD("maincpu", M68000, 10000000)
20372023   MCFG_CPU_VBLANK_INT_DRIVER("screen", segas1x_bootleg_state,  sys16_interrupt)
20382024
2025   MCFG_CPU_ADD("soundcpu", Z80, 4000000)
2026   MCFG_CPU_PROGRAM_MAP(sound_map)
2027   MCFG_CPU_IO_MAP(sound_io_map)
2028
20392029   /* video hardware */
20402030   MCFG_SCREEN_ADD("screen", RASTER)
20412031   MCFG_SCREEN_REFRESH_RATE(60)
r248389r248390
20492039   MCFG_PALETTE_ADD("palette", 2048*SHADOW_COLORS_MULTIPLIER)
20502040
20512041   MCFG_VIDEO_START_OVERRIDE(segas1x_bootleg_state,system16)
2052MACHINE_CONFIG_END
20532042
2054static MACHINE_CONFIG_DERIVED( system16, system16_base )
2055
2056   MCFG_CPU_ADD("soundcpu", Z80, 4000000)
2057   MCFG_CPU_PROGRAM_MAP(sound_map)
2058   MCFG_CPU_IO_MAP(sound_io_map)
2059
20602043   /* sound hardware */
20612044   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
20622045
r248389r248390
20652048   MCFG_SOUND_ROUTE(1, "rspeaker", 0.32)
20662049MACHINE_CONFIG_END
20672050
2051
20682052WRITE_LINE_MEMBER(segas1x_bootleg_state::sound_cause_nmi)
20692053{
20702054   /* upd7759 callback */
r248389r248390
21102094   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.80)
21112095MACHINE_CONFIG_END
21122096
2113static MACHINE_CONFIG_DERIVED( shinobi_datsu, system16_base )
21142097
2098static MACHINE_CONFIG_DERIVED( shinobib, system16 )
2099
21152100   /* basic machine hardware */
21162101   MCFG_CPU_MODIFY("maincpu")
21172102   MCFG_CPU_PROGRAM_MAP(shinobib_map)
r248389r248390
21222107   MCFG_VIDEO_START_OVERRIDE(segas1x_bootleg_state, s16a_bootleg_shinobi )
21232108   MCFG_SCREEN_MODIFY("screen")
21242109   MCFG_SCREEN_UPDATE_DRIVER(segas1x_bootleg_state, screen_update_s16a_bootleg)
2125
2126   MCFG_CPU_ADD("soundcpu", Z80, 4000000)
2127   MCFG_CPU_PERIODIC_INT_DRIVER(segas1x_bootleg_state, nmi_line_pulse,  3000) // or from the YM2203?
2128   MCFG_CPU_PROGRAM_MAP(shinobi_datsu_sound_map)
2129   MCFG_CPU_IO_MAP(shinobi_datsu_sound_io)
2130
2131   /* sound hardware */
2132   MCFG_SPEAKER_STANDARD_MONO("mono")
2133
2134   // 2x YM2203C, one at U57, one at U56
2135   MCFG_SOUND_ADD("ym1", YM2203, 4000000)
2136//   MCFG_YM2203_IRQ_HANDLER(WRITELINE(segas1x_bootleg_state, datsu_irq_handler))
2137   MCFG_SOUND_ROUTE(0, "mono", 0.50)
2138   MCFG_SOUND_ROUTE(1, "mono", 0.50)
2139   MCFG_SOUND_ROUTE(2, "mono", 0.50)
2140   MCFG_SOUND_ROUTE(3, "mono", 0.80)
2141
2142   MCFG_SOUND_ADD("ym2", YM2203, 4000000)
2143   MCFG_SOUND_ROUTE(0, "mono", 0.50)
2144//   MCFG_YM2203_IRQ_HANDLER(WRITELINE(segas1x_bootleg_state, datsu_irq_handler))
2145   MCFG_SOUND_ROUTE(1, "mono", 0.50)
2146   MCFG_SOUND_ROUTE(2, "mono", 0.50)
2147   MCFG_SOUND_ROUTE(3, "mono", 0.80)
2148
21492110MACHINE_CONFIG_END
21502111
2151
21522112static MACHINE_CONFIG_DERIVED( passshtb, system16_7759 )
21532113
21542114   /* basic machine hardware */
r248389r248390
24712431   ROM_LOAD( "16.bin", 0x0000, 0x10000, CRC(52c8364e) SHA1(01d30b82f92498d155d2e31d43d58dff0285cce3) )
24722432ROM_END
24732433
2474ROM_START( shinoblda )
2475   ROM_REGION( 0x040000, "maincpu", 0 ) /* 68000 code */
2476   ROM_LOAD16_BYTE( "12.bin", 0x000001, 0x10000, CRC(68c91fd5) SHA1(54dc1d26711c73b30cbb5387dde27ba21cc102f4) ) // sldh
2477   ROM_LOAD16_BYTE( "14.bin", 0x000000, 0x10000, CRC(9e887c80) SHA1(798a3dc499ef14b362bc37ff91b247e367f42ab9) ) // sldh
2478   ROM_LOAD16_BYTE( "13.bin", 0x020001, 0x10000, CRC(c4334bcd) SHA1(ea1dd23ca6fbf632d8e10bbb9ced6515a69bd14a) )
2479   ROM_LOAD16_BYTE( "15.bin", 0x020000, 0x10000, CRC(b70a6ec1) SHA1(79db41c36d6a053bcdc355b46b19ae938a7755a9) )
2480
2481   ROM_REGION( 0x30000, "gfx1", ROMREGION_INVERT ) /* tiles */
2482   ROM_LOAD( "9.bin",  0x00000, 0x10000, CRC(565e11c6) SHA1(e063400b3d0470b932d75da0be9cd4b446189dea) )
2483   ROM_LOAD( "10.bin", 0x10000, 0x10000, CRC(7cc40b6c) SHA1(ffad7eef7ab2ff9a2e49a8d71b5785a61fa3c675) )
2484   ROM_LOAD( "11.bin", 0x20000, 0x10000, CRC(0f6c7b1c) SHA1(defc76592c285b3396e89a3cff7a73f3a948117f) )
2485
2486   ROM_REGION16_BE( 0x080000, "sprites", ROMREGION_ERASEFF ) /* sprites */
2487   ROM_LOAD16_BYTE( "5.bin", 0x00001, 0x10000, CRC(611f413a) SHA1(180f83216e2dfbfd77b0fb3be83c3042954d12df) )
2488   ROM_LOAD16_BYTE( "3.bin", 0x00000, 0x10000, CRC(5eb00fc1) SHA1(97e02eee74f61fabcad2a9e24f1868cafaac1d51) )
2489   ROM_LOAD16_BYTE( "8.bin", 0x20001, 0x10000, CRC(3c0797c0) SHA1(df18c7987281bd9379026c6cf7f96f6ae49fd7f9) )
2490   ROM_LOAD16_BYTE( "2.bin", 0x20000, 0x10000, CRC(25307ef8) SHA1(91ffbe436f80d583524ee113a8b7c0cf5d8ab286) )
2491   ROM_LOAD16_BYTE( "6.bin", 0x40001, 0x10000, CRC(c29ac34e) SHA1(b5e9b8c3233a7d6797f91531a0d9123febcf1660) )
2492   ROM_LOAD16_BYTE( "4.bin", 0x40000, 0x10000, CRC(04a437f8) SHA1(ea5fed64443236e3404fab243761e60e2e48c84c) )
2493   ROM_LOAD16_BYTE( "7.bin", 0x60001, 0x10000, CRC(41f41063) SHA1(5cc461e9738dddf9eea06831fce3702d94674163) )
2494   ROM_LOAD16_BYTE( "1.bin", 0x60000, 0x10000, CRC(b6e1fd72) SHA1(eb86e4bf880bd1a1d9bcab3f2f2e917bcaa06172) )
2495
2496   ROM_REGION( 0x10000, "soundcpu", 0 ) /* sound CPU + data */
2497   ROM_LOAD( "16.bin", 0x0000, 0x10000, CRC(52c8364e) SHA1(01d30b82f92498d155d2e31d43d58dff0285cce3) )
2498ROM_END
2499
25002434/* Passing Shot Bootleg is a decrypted version of Passing Shot Japanese (passshtj). It has been heavily modified */
25012435ROM_START( passshtb )
25022436   ROM_REGION( 0x020000, "maincpu", 0 ) /* 68000 code */
r248389r248390
37683702 *************************************/
37693703
37703704/* System 16A based bootlegs (less complex tilemap system) */
3771GAME( 1987, shinobld,    shinobi,   shinobi_datsu,    shinobi, segas1x_bootleg_state,   shinobl,    ROT0,   "bootleg (Datsu)", "Shinobi (Datsu bootleg, set 1)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND )
3772GAME( 1987, shinoblda,   shinobi,   shinobi_datsu,    shinobi, segas1x_bootleg_state,   shinobl,    ROT0,   "bootleg (Datsu)", "Shinobi (Datsu bootleg, set 2)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND )
3773
3774
3775
3705GAME( 1987, shinobld,    shinobi,   shinobib,    shinobi, segas1x_bootleg_state,   shinobl,    ROT0,   "bootleg (Datsu)", "Shinobi (Datsu bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND )
37763706GAME( 1988, passshtb,    passsht,   passshtb,    passsht, segas1x_bootleg_state,   passsht,    ROT270, "bootleg", "Passing Shot (2 Players) (bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
37773707GAME( 1988, passht4b,    passsht,   passsht4b,   passht4b, segas1x_bootleg_state,  shinobl,    ROT270, "bootleg", "Passing Shot (4 Players) (bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND )
37783708GAME( 1988, wb3bbl,      wb3,       wb3bb,       wb3b, segas1x_bootleg_state,      wb3bbl,     ROT0,   "bootleg", "Wonder Boy III - Monster Lair (bootleg)", GAME_NOT_WORKING )
trunk/src/mame/drivers/taito_x.c
r248389r248390
10541054   ROM_REGION( 0x80000, "ymsnd", 0 )   /* ADPCM samples */
10551055   ROM_LOAD( "b61-01.e18", 0x00000, 0x80000, CRC(3cf99786) SHA1(f6febf9bda87ca04f0a5890d0e8001c26dfa6c81) )
10561056
1057   ROM_REGION( 0x10000, "cchip", 0 )     /* 64k for TC0030CMD (C-Chip protection, uPD78C11 with embedded 4K maskrom, 8k eprom, 8k RAM)  */
1057   ROM_REGION( 0x10000, "cchip", 0 )     /* 64k for TC0030CMD (C-Chip protection, Z80 with embedded 64K rom + 64K RAM)  */
10581058   ROM_LOAD( "b61_11.m11", 0x00000, 0x10000, NO_DUMP )
10591059ROM_END
10601060
trunk/src/mame/drivers/taitoair.c
r248389r248390
184184
185185****************************************************************************/
186186/*!
187 @todo - Framebuffer DMA requires palette switch to be selected dynamically, see at first stage Course Select in Top Landing.
187 @todo - Framebuffer DMA requires palette switch to be selected dynamically, see at first stage Course Select in Top Landing.
188188         My gut feeling is that 3d poly fill operation actually copies to internal buffer then a DMA op actually do the buffer-to-screen copy, including gradiation ROZ too;
189189      - Air Inferno: missing landing monitor camera (blackened);
190190      - Air Inferno: missing 3d HUD graphics;
191191      - Air Inferno: Expert course has wrong 3d geometry;
192      - Air Inferno: Almost surely crashing during replay has missing smoke effect, looks quite odd atm.
192      - Air Inferno: Almost surely crashing during replay has missing smoke effect, looks quit odd atm.
193193      - Top Landing: Night stages might have wrong priority for stars-above-sea;
194194      - Input limiters / analog thresholds for both games;
195      - Special thanks to syq for being a cunt.
195196 */
196197
197198#include "emu.h"
r248389r248390
354355        [3] both games uses 0xb7, most likely a register setting.
355356*/
356357WRITE16_MEMBER(taitoair_state::dma_regs_w)
357{
358{   
358359   printf("%08x %04x\n",offset,data);
359
360   
360361   if(offset == 0 && ACCESSING_BITS_8_15)
361362   {
362363      if(data == 0x1fff)
r248389r248390
480481{
481482   if(m_dsp_muldiv_c_1 == 0)
482483      return 0xffff; /**< @todo true value? */
483
484   
484485   return m_dsp_muldiv_a_1*m_dsp_muldiv_b_1/m_dsp_muldiv_c_1;
485486}
486487
r248389r248390
503504{
504505   if(m_dsp_muldiv_c_2 == 0)
505506      return 0xffff; /**< @todo true value? */
506
507   
507508   return m_dsp_muldiv_a_2*m_dsp_muldiv_b_2/m_dsp_muldiv_c_2;
508509}
509510
trunk/src/mame/drivers/thedealr.c
r248389r248390
371371   PORT_DIPSETTING(    0x08, "2" )
372372   PORT_DIPSETTING(    0x00, "3" )
373373   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" )
374/*
375 Switches 7 & 8 control the payout as follows:
374   PORT_DIPNAME( 0xc0, 0xc0, "SW1:7,8" ) PORT_DIPLOCATION("SW1:7,8")
375   PORT_DIPSETTING(    0xc0, "0" )
376   PORT_DIPSETTING(    0x80, "1" )
377   PORT_DIPSETTING(    0x40, "2" )
378   PORT_DIPSETTING(    0x00, "3" )
376379
377            Off/Off Off/On  On/Off  On/On   Notes
378          ---------------------------------------------------------------------------------------------
379Jackpot MB   5000    5000    5000    2000   Ryl Flush bonus at Max Bet
380   Jackpot   2500    2500    2500    1000   Ryl Flush bonus at 5 coins + 500 (or 200) per coin up to Max Bet
381   Mini JP   1500    1500    1000     500   Str Flush bonus at Max Bet
382 Ryl Flush    500     500     500     200   x Bet
383 Str Flush    150     150     100      50   x Bet
384        4K     60      60      40      25   x Bet
385Full House     10      10      10       8   x Bet
386     Flush      7       6       7       6   x Bet
387  Straight      5       5       5       5   x Bet
388        3K      3       3       3       4   x Bet
389  Two pair      2       2       2       2   x Bet
390    Jacks+      1       1       1       1   x Bet (When enabled - DSW 3-2)
391
392Return Rate 111.9%  110.7%  106.6%  105.8%  Jacks or Better
393Return Rate  94.7%   92.9%   89.4%   87.8%  Two Pair
394
395NOTE: Jackpot & Mini Jackpot values based on 10 Coin Max Bet. Values increase with higher Max Bet values.
396
397Calculated returns based on 1 coin bet and paytable as shown above, Two Pair through Royal Flush without bonuses.
398*/
399   PORT_DIPNAME( 0xc0, 0xc0, "Payout Percentage" ) PORT_DIPLOCATION("SW1:7,8")
400   PORT_DIPSETTING(    0x00, "87.8%" )  PORT_CONDITION("DSW3", 0x02, EQUALS, 0x02)
401   PORT_DIPSETTING(    0x40, "89.4%" )  PORT_CONDITION("DSW3", 0x02, EQUALS, 0x02)
402   PORT_DIPSETTING(    0x80, "92.9%" )  PORT_CONDITION("DSW3", 0x02, EQUALS, 0x02)
403   PORT_DIPSETTING(    0xc0, "94.7%" )  PORT_CONDITION("DSW3", 0x02, EQUALS, 0x02)
404   PORT_DIPSETTING(    0x00, "105.8%" ) PORT_CONDITION("DSW3", 0x02, EQUALS, 0x00)
405   PORT_DIPSETTING(    0x40, "106.6%" ) PORT_CONDITION("DSW3", 0x02, EQUALS, 0x00)
406   PORT_DIPSETTING(    0x80, "110.7%" ) PORT_CONDITION("DSW3", 0x02, EQUALS, 0x00)
407   PORT_DIPSETTING(    0xc0, "111.9%" ) PORT_CONDITION("DSW3", 0x02, EQUALS, 0x00)
408
409380   PORT_START("DSW2")
410381   PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW2:1" )
411   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:2,3")
412   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
413   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
414   PORT_DIPSETTING(    0x02, DEF_STR( 1C_5C ) )
415   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )
382   PORT_DIPNAME( 0x06, 0x06, "SW2:2,3" ) PORT_DIPLOCATION("SW2:2,3")
383   PORT_DIPSETTING(    0x06, "0" )
384   PORT_DIPSETTING(    0x04, "1" )
385   PORT_DIPSETTING(    0x02, "2" )
386   PORT_DIPSETTING(    0x00, "3" )
416387   PORT_DIPNAME( 0x18, 0x18, "SW2:4,5" ) PORT_DIPLOCATION("SW2:4,5")
417388   PORT_DIPSETTING(    0x18, "0" )
418389   PORT_DIPSETTING(    0x10, "1" )
419390   PORT_DIPSETTING(    0x08, "2" )
420391   PORT_DIPSETTING(    0x00, "3" )
421   PORT_DIPNAME( 0xe0, 0xe0, "Max Bet" ) PORT_DIPLOCATION("SW2:6,7,8")
422   PORT_DIPSETTING(    0xc0, "5" )
423   PORT_DIPSETTING(    0xe0, "10" )
424   PORT_DIPSETTING(    0xa0, "20" )
425   PORT_DIPSETTING(    0x80, "20 Duplicate" )
426   PORT_DIPSETTING(    0x40, "30" )
427   PORT_DIPSETTING(    0x00, "30 Duplicate" )
428   PORT_DIPSETTING(    0x60, "60" )
429   PORT_DIPSETTING(    0x20, "60 Duplicate" )
392   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" )
393   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" )
394   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" )
430395
431396   PORT_START("DSW3")
432397   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW3:1" )
433   PORT_DIPNAME( 0x02, 0x02, "Lowest Paid Hand" ) PORT_DIPLOCATION("SW3:2")
434   PORT_DIPSETTING(    0x02, "Two Pair" )
435   PORT_DIPSETTING(    0x00, "Jacks or Better" )
436   PORT_DIPNAME( 0x04, 0x04, "Double Up" ) PORT_DIPLOCATION("SW3:3")
437   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
438   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
398   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW3:2" )
399   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW3:3" )
439400   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW3:4" )
440401   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW3:5" )
441/*
442Fever Mode:
443  Overrides Jacks or Better
444  3 of a Kind winning hand Jacks or higher enters Fever Mode
445  You start with a pair of your 3 of a Kind cards & you draw 3 cards each hand.
446    Jacks through Kings get 5 Fever Mode Draws
447   Aces get 15 Fever Mode Draws
448*/
449   PORT_DIPNAME( 0x20, 0x20, "Fever Mode" ) PORT_DIPLOCATION("SW3:6")
450   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
451   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
452   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW3:7" ) /* Overrides Coinage - 1C / 1C */
453   PORT_DIPNAME( 0x80, 0x80, "Coin In / Coin Out" ) PORT_DIPLOCATION("SW3:8") /* No credit - payout waiting for hopper??? */
454   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
455   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
402   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW3:6" )
403   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW3:7" )
404   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" )
456405
457406   PORT_START("DSW4")
458407   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW4:7" )   // X in service mode
trunk/src/mame/drivers/timeplt.c
r248389r248390
699699GAME( 1982, timepltc, timeplt, timeplt, timeplt, driver_device, 0, ROT90,  "Konami (Centuri license)", "Time Pilot (Centuri)", GAME_SUPPORTS_SAVE )
700700GAME( 1982, timeplta, timeplt, timeplt, timeplt, driver_device, 0, ROT90,  "Konami (Atari license)", "Time Pilot (Atari)", GAME_SUPPORTS_SAVE )
701701GAME( 1982, spaceplt, timeplt, timeplt, timeplt, driver_device, 0, ROT90,  "bootleg", "Space Pilot", GAME_SUPPORTS_SAVE )
702
703702GAME( 1988, psurge,   0,       psurge,  psurge, driver_device,  0, ROT270, "Vision Electronics", "Power Surge", GAME_SUPPORTS_SAVE )
704
705GAME( 1988, chkun,    0,       chkun,   chkun, driver_device,   0, ROT90,  "Peni", "Chance Kun (Japan)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND )
706GAME( 1987, bikkuric, 0,       bikkuric,bikkuric, driver_device,0, ROT90,  "Peni", "Bikkuri Card (Japan)", GAME_SUPPORTS_SAVE )
703// ROM says manufactured by Peni Soft for these two ... no, I'm not going to add THAT -.-"
704GAME( 1988, chkun,    0,       chkun,   chkun, driver_device,   0, ROT90,  "<unknown>", "Chance Kun (Japan)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND )
705GAME( 1987, bikkuric, 0,       bikkuric,bikkuric, driver_device,0, ROT90,  "<unknown>", "Bikkuri Card (Japan)", GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/tmnt.c
r248389r248390
21982198   MCFG_SCREEN_REFRESH_RATE(60)
21992199   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
22002200   MCFG_SCREEN_SIZE(64*8, 32*8)
2201   MCFG_SCREEN_VISIBLE_AREA(12*8, (64-12)*8-1, 2*8, 30*8-1 )
2201   MCFG_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 )
22022202   MCFG_SCREEN_UPDATE_DRIVER(tmnt_state, screen_update_lgtnfght)
22032203   MCFG_SCREEN_PALETTE("palette")
22042204
trunk/src/mame/drivers/tnzs.c
r248389r248390
21952195ROM_END
21962196
21972197/* M6100309A PCB
2198   P0-0038A */
2198   PO-0038A */
21992199ROM_START( kageki )
22002200   ROM_REGION( 0x20000, "maincpu", 0 )
22012201   ROM_LOAD( "b35-16.11c", 0x00000, 0x10000, CRC(a4e6fd58) SHA1(7cfe5b3fa6c88cdab45719f5b58541270825ad30) )    /* US ver */
r248389r248390
25022502Taito ID: K1100356A
25032503          J1100156A
25042504          MAIN PCB
2505Seta ID: P0-041A
2505Seta ID: PO-041A
25062506*/
25072507/* This pcb is similar but not identical to the Chuka Taisen pcb above;
25082508   there is an M-chip i8742 (with Taito silkscreen) and no 3rd z80.
trunk/src/mame/drivers/tonton.c
r248389r248390
215215
216216TIMER_DEVICE_CALLBACK_MEMBER(tonton_state::tonton_interrupt)
217217{
218   m_v9938->set_resolution(0);
218219   m_v9938->interrupt();
219220}
220221
trunk/src/mame/drivers/ttchamp.c
r248389r248390
3131 _|   74LS244  74LS14N 74HC74  16MHz |D70116C-10 | |
3232|__________________________________________________|
3333
34The PCB is Spanish and manufactured by Gamart.
34The PCB is Spanish and manufacured by Gamart.
3535
3636
3737Table tennis Championships by Gamart 1995
r248389r248390
4646ttennis2/3 main program
4747ttennis1 adpcm data
4848ttennis4/5 graphics
49*there is a pic16c84 that I cannot dump because my programmer doesn't support it.
49*there is a pic16c84 that i cannot dump because my programmer doesn't support it.
5050
5151Dumped by tirino73
5252
r248389r248390
5959- A bunch of spurious RAM writes to ROM area (genuine bug? left-overs?)
6060
6161Notes
62I think the PIC is used to interface with battery backed RAM instead of an EEPROM,
62I think the PIC is used to interface with battry backed RAM instead of an EEPROM,
6363we currently simulate this as the PIC is read protected.
6464
6565
r248389r248390
7171#include "sound/okim6295.h"
7272#include "machine/nvram.h"
7373
74
7574class ttchamp_state : public driver_device
7675{
7776public:
r248389r248390
8079      m_maincpu(*this, "maincpu"),
8180      m_palette(*this, "palette")  { }
8281
83   required_device<cpu_device> m_maincpu;
84   required_device<palette_device> m_palette;
85   
82   UINT16* m_peno_mainram;
83
8684   UINT16 m_paloff;
85   DECLARE_WRITE16_MEMBER(paloff_w);
86   DECLARE_WRITE16_MEMBER(pcup_prgbank_w);
87   DECLARE_WRITE16_MEMBER(paldat_w);
88
89   DECLARE_WRITE16_MEMBER(port10_w);
90
91   DECLARE_WRITE16_MEMBER(port20_w);
92   DECLARE_WRITE16_MEMBER(port62_w);
93
94   DECLARE_READ16_MEMBER(port1e_r);
95
96   DECLARE_READ16_MEMBER(ttchamp_pic_r);
97   DECLARE_WRITE16_MEMBER(ttchamp_pic_w);
98
8799   UINT16 m_port10;
88100   UINT8 m_rombank;
101
102   DECLARE_DRIVER_INIT(ttchamp);
103
104   DECLARE_READ16_MEMBER(ttchamp_blit_start_r);
105
106   DECLARE_READ16_MEMBER(ttchamp_mem_r);
107   DECLARE_WRITE16_MEMBER(ttchamp_mem_w);
108
89109   UINT16 m_videoram0[0x10000 / 2];
90110   UINT16 m_videoram2[0x10000 / 2];
91111
112
92113   enum picmode
93114   {
94115      PIC_IDLE = 0,
r248389r248390
97118      PIC_SET_WRITELATCH = 3,
98119      PIC_SET_READLATCH = 4
99120
100   };
121   } picmodex;
101122
102   picmode m_picmodex;
103123
104124   int m_pic_readaddr;
105125   int m_pic_writeaddr;
r248389r248390
113133   int m_spritesinit;
114134   int m_spriteswidth;
115135   int m_spritesaddr;
136
137   virtual void machine_start();
116138   UINT16* m_rom16;
117139   UINT8* m_rom8;
118140
119   DECLARE_WRITE16_MEMBER(paloff_w);
120   DECLARE_WRITE16_MEMBER(pcup_prgbank_w);
121   DECLARE_WRITE16_MEMBER(paldat_w);
122
123   DECLARE_WRITE16_MEMBER(port10_w);
124
125   DECLARE_WRITE16_MEMBER(port20_w);
126   DECLARE_WRITE16_MEMBER(port62_w);
127
128   DECLARE_READ16_MEMBER(port1e_r);
129
130   DECLARE_READ16_MEMBER(pic_r);
131   DECLARE_WRITE16_MEMBER(pic_w);
132
133   DECLARE_READ16_MEMBER(blit_start_r);
134
135   DECLARE_READ16_MEMBER(mem_r);
136   DECLARE_WRITE16_MEMBER(mem_w);
137
138   virtual void machine_start();
139141   virtual void video_start();
140
141   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
142
143   INTERRUPT_GEN_MEMBER(irq);
142   UINT32 screen_update_ttchamp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
143   INTERRUPT_GEN_MEMBER(ttchamp_irq);
144   required_device<cpu_device> m_maincpu;
145   required_device<palette_device> m_palette;
144146};
145147
146ALLOW_SAVE_TYPE(ttchamp_state::picmode);
147
148
149148void ttchamp_state::machine_start()
150149{
151150   m_rom16 = (UINT16*)memregion("maincpu")->base();
152151   m_rom8 = memregion("maincpu")->base();
153152
154   m_picmodex = PIC_IDLE;
153   picmodex = PIC_IDLE;
155154
156155   m_bakram = auto_alloc_array(machine(), UINT8, 0x100);
157156   machine().device<nvram_device>("backram")->set_base(m_bakram, 0x100);
158   
159   save_item(NAME(m_paloff));
160   save_item(NAME(m_port10));
161   save_item(NAME(m_rombank));
162   save_item(NAME(m_videoram0));
163   save_item(NAME(m_videoram2));
164   save_item(NAME(m_picmodex));
165   save_item(NAME(m_pic_readaddr));
166   save_item(NAME(m_pic_writeaddr));
167   save_item(NAME(m_pic_latched));
168   save_item(NAME(m_pic_writelatched));
169   save_item(NAME(m_mainram));
170   save_item(NAME(m_spritesinit));
171   save_item(NAME(m_spriteswidth));
172   save_item(NAME(m_spritesaddr));
173157
174158}
175159
r248389r248390
177161{
178162}
179163
180UINT32 ttchamp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
164UINT32 ttchamp_state::screen_update_ttchamp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
181165{
182166   logerror("update\n");
183167   int y,x,count;
r248389r248390
277261   m_palette->set_pen_color(m_paloff & 0x3ff,pal5bit(data>>0),pal5bit(data>>5),pal5bit(data>>10));
278262}
279263
280READ16_MEMBER(ttchamp_state::pic_r)
264READ16_MEMBER(ttchamp_state::ttchamp_pic_r)
281265{
282266//  printf("%06x: read from PIC (%04x)\n", space.device().safe_pc(),mem_mask);
283   if (m_picmodex == PIC_SET_READLATCH)
267   if (picmodex == PIC_SET_READLATCH)
284268   {
285269//      printf("read data %02x from %02x\n", m_pic_latched, m_pic_readaddr);
286      m_picmodex = PIC_IDLE;
270      picmodex = PIC_IDLE;
287271
288272      return m_pic_latched << 8;
289273
r248389r248390
292276
293277}
294278
295WRITE16_MEMBER(ttchamp_state::pic_w)
279WRITE16_MEMBER(ttchamp_state::ttchamp_pic_w)
296280{
297//  printf("%06x: write to PIC %04x (%04x) (%d)\n", space.device().safe_pc(),data,mem_mask, m_picmodex);
298   if (m_picmodex == PIC_IDLE)
281//  printf("%06x: write to PIC %04x (%04x) (%d)\n", space.device().safe_pc(),data,mem_mask, picmodex);
282   if (picmodex == PIC_IDLE)
299283   {
300284      if (data == 0x11)
301285      {
302         m_picmodex = PIC_SET_READADDRESS;
286         picmodex = PIC_SET_READADDRESS;
303287//          printf("state = SET_READADDRESS\n");
304288      }
305289      else if (data == 0x12)
306290      {
307         m_picmodex = PIC_SET_WRITELATCH;
291         picmodex = PIC_SET_WRITELATCH;
308292//          printf("latch write data.. \n" );
309293      }
310294      else if (data == 0x20)
311295      {
312         m_picmodex = PIC_SET_WRITEADDRESS;
296         picmodex = PIC_SET_WRITEADDRESS;
313297//          printf("state = PIC_SET_WRITEADDRESS\n");
314298      }
315299      else if (data == 0x21) // write latched data
316300      {
317         m_picmodex = PIC_IDLE;
301         picmodex = PIC_IDLE;
318302         m_bakram[m_pic_writeaddr] = m_pic_writelatched;
319303   //      printf("wrote %02x to %02x\n", m_pic_writelatched, m_pic_writeaddr);
320304      }
r248389r248390
325309         m_pic_latched = m_bakram[m_pic_readaddr>>1];
326310
327311//          printf("latch read data %02x from %02x\n",m_pic_latched, m_pic_readaddr );
328         m_picmodex = PIC_SET_READLATCH; // waiting to read...
312         picmodex = PIC_SET_READLATCH; // waiting to read...
329313      }
330314      else
331315      {
332316//          printf("unknown\n");
333317      }
334318   }
335   else if (m_picmodex == PIC_SET_READADDRESS)
319   else if (picmodex == PIC_SET_READADDRESS)
336320   {
337321      m_pic_readaddr = data;
338      m_picmodex = PIC_IDLE;
322      picmodex = PIC_IDLE;
339323   }
340   else if (m_picmodex == PIC_SET_WRITEADDRESS)
324   else if (picmodex == PIC_SET_WRITEADDRESS)
341325   {
342326      m_pic_writeaddr = data;
343      m_picmodex = PIC_IDLE;
327      picmodex = PIC_IDLE;
344328   }
345   else if (m_picmodex == PIC_SET_WRITELATCH)
329   else if (picmodex == PIC_SET_WRITELATCH)
346330   {
347331      m_pic_writelatched = data;
348      m_picmodex = PIC_IDLE;
332      picmodex = PIC_IDLE;
349333   }
350334
351335}
352336
353337
354READ16_MEMBER(ttchamp_state::mem_r)
338READ16_MEMBER(ttchamp_state::ttchamp_mem_r)
355339{
356340   // bits 0xf0 are used too, so this is likely wrong.
357341
r248389r248390
383367   }
384368}
385369
386WRITE16_MEMBER(ttchamp_state::mem_w)
370WRITE16_MEMBER(ttchamp_state::ttchamp_mem_w)
387371{
388372   // this is very strange, we use the offset (address bits) not data bits to set values..
389373   // I get the impression this might actually overlay the entire address range, including RAM and regular VRAM?
r248389r248390
500484
501485
502486static ADDRESS_MAP_START( ttchamp_map, AS_PROGRAM, 16, ttchamp_state )
503   AM_RANGE(0x00000, 0xfffff) AM_READWRITE(mem_r, mem_w)
487   AM_RANGE(0x00000, 0xfffff) AM_READWRITE(ttchamp_mem_r, ttchamp_mem_w)
504488ADDRESS_MAP_END
505489
506490/* Re-use same parameters as before (one-shot) */
r248389r248390
510494   return 0xff;
511495}
512496
513READ16_MEMBER(ttchamp_state::blit_start_r)
497READ16_MEMBER(ttchamp_state::ttchamp_blit_start_r)
514498{
515499   m_spritesinit = 1;
516500   return 0xff;
r248389r248390
549533
550534   AM_RANGE(0x0006, 0x0007) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
551535
552   AM_RANGE(0x0018, 0x0019) AM_READ(blit_start_r) // read before using bus write offset as blit parameters
536   AM_RANGE(0x0018, 0x0019) AM_READ(ttchamp_blit_start_r) // read before using bus write offset as blit parameters
553537   AM_RANGE(0x001e, 0x001f) AM_READ(port1e_r) // read before some blit operations (but not all)
554538
555539   AM_RANGE(0x0008, 0x0009) AM_WRITE(paldat_w)
r248389r248390
559543
560544   AM_RANGE(0x0020, 0x0021) AM_WRITE(port20_w)
561545
562   AM_RANGE(0x0034, 0x0035) AM_READWRITE(pic_r, pic_w)
546   AM_RANGE(0x0034, 0x0035) AM_READWRITE(ttchamp_pic_r, ttchamp_pic_w)
563547
564548   AM_RANGE(0x0062, 0x0063) AM_WRITE(port62_w)
565549
r248389r248390
632616INPUT_PORTS_END
633617
634618
635INTERRUPT_GEN_MEMBER(ttchamp_state::irq)/* right? */
619INTERRUPT_GEN_MEMBER(ttchamp_state::ttchamp_irq)/* right? */
636620{
637621   device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
638622}
r248389r248390
642626   MCFG_CPU_ADD("maincpu", V30, 8000000)
643627   MCFG_CPU_PROGRAM_MAP(ttchamp_map)
644628   MCFG_CPU_IO_MAP(ttchamp_io)
645   MCFG_CPU_VBLANK_INT_DRIVER("screen", ttchamp_state,  irq)
629   MCFG_CPU_VBLANK_INT_DRIVER("screen", ttchamp_state,  ttchamp_irq)
646630
647631   /* video hardware */
648632   MCFG_SCREEN_ADD("screen", RASTER)
r248389r248390
650634   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
651635   MCFG_SCREEN_SIZE(1024,1024)
652636   MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1)
653   MCFG_SCREEN_UPDATE_DRIVER(ttchamp_state, screen_update)
637   MCFG_SCREEN_UPDATE_DRIVER(ttchamp_state, screen_update_ttchamp)
654638   MCFG_SCREEN_PALETTE("palette")
655639
656640   MCFG_PALETTE_ADD("palette", 0x400)
r248389r248390
692676   ROM_LOAD( "27c020.1", 0x000000, 0x040000,  CRC(e2c4fe95) SHA1(da349035cc348db220a1e12b4c2a6021e2168425) )
693677ROM_END
694678
679DRIVER_INIT_MEMBER(ttchamp_state,ttchamp)
680{
681}
695682
696683// only the graphics differ between the two sets, code section is the same
697GAME( 1995, ttchamp, 0,        ttchamp, ttchamp, driver_device, 0, ROT0,  "Gamart",                               "Table Tennis Champions", GAME_SUPPORTS_SAVE ) // this has various advertising boards, including 'Electronic Devices' and 'Deniam'
698GAME( 1995, ttchampa,ttchamp,  ttchamp, ttchamp, driver_device, 0, ROT0,  "Gamart (Palencia Elektronik license)", "Table Tennis Champions (Palencia Elektronik license)", GAME_SUPPORTS_SAVE ) // this only has Palencia Elektronik advertising boards
684GAME( 1995, ttchamp, 0,        ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0,  "Gamart",                               "Table Tennis Champions", 0 ) // this has various advertising boards, including 'Electronic Devices' and 'Deniam'
685GAME( 1995, ttchampa,ttchamp,  ttchamp, ttchamp, ttchamp_state, ttchamp, ROT0,  "Gamart (Palencia Elektronik license)", "Table Tennis Champions (Palencia Elektronik license)", 0 ) // this only has Palencia Elektronik advertising boards
trunk/src/mame/drivers/wecleman.c
r248389r248390
14051405   ROM_LOAD( "763a12", 0x000000, 0x008000, CRC(05f1e553) SHA1(8aaeb7374bd93038c24e6470398936f22cabb0fe) )
14061406ROM_END
14071407
1408/*
1409
1410Hot Chase
1411Konami 1988
1412
1413
1414
1415         E08D E08B    E09D E09B  E10D E10B
1416         E08A E08C    E09A E09C  E10A E10C
1417
1418GX763 350861
1419
1420               E09      E10        E11
1421               E08      07232      07232
1422               07232   3.579MHz         2128
1423                               6809     P01.R10
1424      SW1
1425      SW2                               2128  2128
1426               6264 6264                6264  6264
1427                                        R02.P14 R03.R14
1428                            07770       R04.P16 R05.R16
1429      2018-45  D06.E18 D07.H18   10MHz
1430      2018-45  68000-10         07641   68000-10
1431
1432GX763 350860
1433
1434 051316 PSAC    051316 PSAC  A13.H5 A14.J5
1435                                                2018-45 2018-R6
1436                    2018-45
1437                    2018-45                     07558
1438 051316 PSAC        2018-45                            A12.R13
1439
1440                             A15.H14
1441
1442    A23.B17                            07634
1443                                                     07635
1444               2018-45 2018-45
1445               2018-45 2018-45         07557
1446               2018-45 2018-45                       25.2MHz
1447               2018-45 2018-45
1448
1449
1450Left EPROM board
1451
1452                                   E19A.A8 E19B.A7 E19C.A6 E19D.A5
1453E22E.B12 E22F.B11 E22G.B10 E22H.B9 E19E.B8 E19F.B7 E19G.B6 E19H.B5
1454                                   E22A.D9 E22B.D7 E22C.D6 E22D.D5
1455
1456Right EPROM board
1457
1458E21E E21F E21G E21H E17A E17B E17C E17D E18A E18B E18C E18D
1459E20E E20F E20G E20H E17E E17F E17G E17H E18E E18F E18G E18H
1460                    E20A E20B E20C E20D E21A E21B E21C E21D
1461
1462*/
1463
1464// uses EPROM sub-boards in place of some of the MASK roms, different program too
1465ROM_START( hotchasea )
1466   ROM_REGION( 0x40000, "maincpu", 0 ) /* Main Code */
1467   ROM_LOAD16_BYTE( "763r05.r16", 0x000000, 0x010000, CRC(c880d5e4) SHA1(3c3ab3ad5496cfbc8de76620eedc06601ee7a8c7) )
1468   ROM_LOAD16_BYTE( "763r04.p16", 0x000001, 0x010000, CRC(b732ee2c) SHA1(b3d73cf5039980ac74927eef656326515fd2026b) )
1469   ROM_LOAD16_BYTE( "763r03.r14", 0x020000, 0x010000, CRC(13dd71de) SHA1(4b86b81ef79e0e92a1e458010b0b9574183a9c29) )
1470   ROM_LOAD16_BYTE( "763r02.p14", 0x020001, 0x010000, CRC(6cd1a18e) SHA1(0ddfe6a46e95052534325f228b7f0faba121950e) )
1471
1472   ROM_REGION( 0x20000, "sub", 0 ) /* Sub Code */
1473   ROM_LOAD16_BYTE( "763d07.h18", 0x000000, 0x010000, CRC(ae12fa90) SHA1(7f76f09916fe152411b5af3c504ee7be07497ef4) )
1474   ROM_LOAD16_BYTE( "763d06.e18", 0x000001, 0x010000, CRC(b77e0c07) SHA1(98bf492ac889d31419df706029fdf3d51b85c936) )
1475
1476   ROM_REGION( 0x10000, "audiocpu", 0 )    /* Sound Code */
1477   ROM_LOAD( "763p01.r10", 0x8000, 0x8000, CRC(15dbca7b) SHA1(ac0c965b72a8579a3b60dbadfb942248d2cff2d8) )
1478
1479   ROM_REGION( 0x300000 * 2, "gfx1", 0 )   /* x2, do not dispose, zooming sprites */
1480   ROM_LOAD16_BYTE( "763e17a", 0x000000, 0x010000, CRC(8542d7d7) SHA1(a7c8aa7d8e0cabdc5269eb7adff944aaa0f819b6) )
1481   ROM_LOAD16_BYTE( "763e17e", 0x000001, 0x010000, CRC(4b4d919c) SHA1(0364eb74da8db7238888274d12011de876662d5a) )
1482   ROM_LOAD16_BYTE( "763e17b", 0x020000, 0x010000, CRC(ba9d7e72) SHA1(3af618087dcc66552ffabaf655f97b20e597122c) )
1483   ROM_LOAD16_BYTE( "763e17f", 0x020001, 0x010000, CRC(582400bb) SHA1(9479e45087d908c9b20392dba2a752a7ec1482e2) )
1484   ROM_LOAD16_BYTE( "763e17c", 0x040000, 0x010000, CRC(0ed292f8) SHA1(8c161e73c7f27925377799f67585b888bade6d82) )
1485   ROM_LOAD16_BYTE( "763e17g", 0x040001, 0x010000, CRC(35b27ed7) SHA1(e17e7674ee210ff340482a16dce3439b55c29f72) )
1486   ROM_LOAD16_BYTE( "763e17d", 0x060000, 0x010000, CRC(0166d00d) SHA1(e58f6deabc5743f6610252242f97bd5e973316ae) )
1487   ROM_LOAD16_BYTE( "763e17h", 0x060001, 0x010000, CRC(e5b8e8e6) SHA1(ae1349977559ff24dcd1678d6fd3a3e118612d07) )
1488   ROM_LOAD16_BYTE( "763e20a", 0x080000, 0x010000, CRC(256fe63c) SHA1(414325f2ff9abc411e2401dddd216e1a4de8a01e) )
1489   ROM_LOAD16_BYTE( "763e20e", 0x080001, 0x010000, CRC(ee8ca7e1) SHA1(fee544d6508f4106176f39e3765961e9f80fe620) )
1490   ROM_LOAD16_BYTE( "763e20b", 0x0a0000, 0x010000, CRC(b6714c24) SHA1(88f6437e181f36b7e44f1c70872314d8c0cc30e7) )
1491   ROM_LOAD16_BYTE( "763e20f", 0x0a0001, 0x010000, CRC(9dbc4b21) SHA1(31559903707a4f8ba3b044e8aad928de38403dcf) )
1492   ROM_LOAD16_BYTE( "763e20c", 0x0c0000, 0x010000, CRC(5173ad9b) SHA1(afe82c69f7036c7595f1a56b22176ba202b00b5c) )
1493   ROM_LOAD16_BYTE( "763e20g", 0x0c0001, 0x010000, CRC(b8c77f99) SHA1(e3bea1481c5b1c4733130651f9cf18587d3efc46) )
1494   ROM_LOAD16_BYTE( "763e20d", 0x0e0000, 0x010000, CRC(4ebdba32) SHA1(ac7daa291c82f75b09faf7bc5f6257870cc46061) )
1495   ROM_LOAD16_BYTE( "763e20h", 0x0e0001, 0x010000, CRC(0a428654) SHA1(551026f6f57d38aedd3498cce33af7bb2cf07184) )
1496   ROM_LOAD16_BYTE( "763e18a", 0x100000, 0x010000, CRC(09748099) SHA1(1821e2067b9a50a0638c8d105c617f4030d61877) )
1497   ROM_LOAD16_BYTE( "763e18e", 0x100001, 0x010000, CRC(049d4fcf) SHA1(aed18297677a3bb0b7197f59ea329aef9b678c01) )
1498   ROM_LOAD16_BYTE( "763e18b", 0x120000, 0x010000, CRC(ed0c3369) SHA1(84f336546dee01fec31c9c256ee00a9f8448cea4) )
1499   ROM_LOAD16_BYTE( "763e18f", 0x120001, 0x010000, CRC(b596a9ce) SHA1(dea0fe1c3386b5f0d19df4467f42d077678ae220) )
1500   ROM_LOAD16_BYTE( "763e18c", 0x140000, 0x010000, CRC(5a278291) SHA1(05c529baa68ef5877a28901c6f221e3d3593735f) )
1501   ROM_LOAD16_BYTE( "763e18g", 0x140001, 0x010000, CRC(aa7263cd) SHA1(b2acf66c02faf7777c5cb947aaf8e038f29c0f2e) )
1502   ROM_LOAD16_BYTE( "763e18d", 0x160000, 0x010000, CRC(b0b79a71) SHA1(46d0f17b7a6e4fb94ac9b8335bc598339d7707a5) )
1503   ROM_LOAD16_BYTE( "763e18h", 0x160001, 0x010000, CRC(a18b9127) SHA1(890971d2922a59ff4beea00238e710c8d3e0f19d) )
1504   ROM_LOAD16_BYTE( "763e21a", 0x180000, 0x010000, CRC(60788c29) SHA1(4faaa192d07f6acac0e7d11676146ecd0e71541f) )
1505   ROM_LOAD16_BYTE( "763e21e", 0x180001, 0x010000, CRC(844799ff) SHA1(8dc3ae3bb30ecb4e921a5b2068d3cd9421577844) )
1506   ROM_LOAD16_BYTE( "763e21b", 0x1a0000, 0x010000, CRC(1eefed61) SHA1(9c09dbff073d63384bf1ec9df4db4833afa33826) )
1507   ROM_LOAD16_BYTE( "763e21f", 0x1a0001, 0x010000, CRC(3aacfb10) SHA1(fb3eebf1f0850ed2f8f02cd4b5b564524e391afd) )
1508   ROM_LOAD16_BYTE( "763e21c", 0x1c0000, 0x010000, CRC(97e48b37) SHA1(864c73f48d839c2afeecec99605be6111f450ddd) )
1509   ROM_LOAD16_BYTE( "763e21g", 0x1c0001, 0x010000, CRC(74fefb12) SHA1(7746918c3ea8981c9cb2ead79a252939ba8bde3f) )
1510   ROM_LOAD16_BYTE( "763e21d", 0x1e0000, 0x010000, CRC(dd41569e) SHA1(065ee2de9ad6980788807cb563feccef1c3d1b9d) )
1511   ROM_LOAD16_BYTE( "763e21h", 0x1e0001, 0x010000, CRC(7ea52bf6) SHA1(2be93f88ccdea989b05beca13ebbfb77626ea41f) )
1512   ROM_LOAD16_BYTE( "763e19a", 0x200000, 0x010000, CRC(8c912c46) SHA1(e314edc39c32471c6fa2969e7c5c771c19fda88c) )
1513   ROM_LOAD16_BYTE( "763e19e", 0x200001, 0x010000, CRC(0eb34787) SHA1(9b8145dae210a177585e672fce30339b39c3c0f3) )
1514   ROM_LOAD16_BYTE( "763e19b", 0x220000, 0x010000, CRC(79960729) SHA1(f5c20ed7683aad8a435c292fbd5a1acc2a97ecee) )
1515   ROM_LOAD16_BYTE( "763e19f", 0x220001, 0x010000, CRC(1764ec5f) SHA1(4f7a0a3667087523a1ccdfc2d0e54a520f1216b3) )
1516   ROM_LOAD16_BYTE( "763e19c", 0x240000, 0x010000, CRC(f13377ac) SHA1(89f8d730cb457cc9cf55049b7002514302b2b04f) )
1517   ROM_LOAD16_BYTE( "763e19g", 0x240001, 0x010000, CRC(f2102e89) SHA1(41ff5d8904618a77c7c3c78c52c6f1b9c5a318fd) )
1518   ROM_LOAD16_BYTE( "763e19d", 0x260000, 0x010000, CRC(0b2a19f4) SHA1(3689b2c1f6227224fbcecc0d2470048a99510794) )
1519   ROM_LOAD16_BYTE( "763e19h", 0x260001, 0x010000, CRC(cd6d08a5) SHA1(ce13a8bba84f24e7d1fb25254e2e95f591fe1d67) )
1520   ROM_LOAD16_BYTE( "763e22a", 0x280000, 0x010000, CRC(16eec250) SHA1(f50375f207575e9d280285aca493902afbb7d729) )
1521   ROM_LOAD16_BYTE( "763e22e", 0x280001, 0x010000, CRC(c184b1c0) SHA1(d765e6eb2631b77dff5331840ac2a99cf1250362) )
1522   ROM_LOAD16_BYTE( "763e22b", 0x2a0000, 0x010000, CRC(1afe4b0c) SHA1(ce5a855291b443c1e16dbf54730960600c754fee) )
1523   ROM_LOAD16_BYTE( "763e22f", 0x2a0001, 0x010000, CRC(61f27c98) SHA1(d80af1a3e424c8dbab4fd21d494a0580ab96cd8d) )
1524   ROM_LOAD16_BYTE( "763e22c", 0x2c0000, 0x010000, CRC(c19b4b63) SHA1(93708b8769c44d5b93dcd2928a0d1120cc52c6ee) )
1525   ROM_LOAD16_BYTE( "763e22g", 0x2c0001, 0x010000, CRC(5bcbaf29) SHA1(621aa19606a15abb1539c07a033b32fc374a2d6a) )
1526   ROM_LOAD16_BYTE( "763e22d", 0x2e0000, 0x010000, CRC(fd5b669d) SHA1(fd5d82886708187e53c204c574ee252fc8a793af) )
1527   ROM_LOAD16_BYTE( "763e22h", 0x2e0001, 0x010000, CRC(9a9f45d8) SHA1(24fa9425b00441fff124eae7b40df7e65c920323) )
1528
1529   ROM_REGION( 0x20000, "k051316_1", 0 )    /* bg */
1530   ROM_LOAD( "763a14", 0x000000, 0x020000, CRC(60392aa1) SHA1(8499eb40a246587e24f6fd00af2eaa6d75ee6363) )
1531
1532   ROM_REGION( 0x08000, "k051316_2", 0 )    /* fg */
1533   /* first half empty - PCB silkscreen reads "27256/27512" */
1534   ROM_LOAD( "763a13", 0x000000, 0x008000, CRC(8bed8e0d) SHA1(ccff330abc23fe499e76c16cab5783c3daf155dd) )
1535   ROM_CONTINUE( 0x000000, 0x008000 )
1536
1537   ROM_REGION( 0x20000, "gfx4", 0 )    /* road */
1538   ROM_LOAD( "763a15", 0x000000, 0x020000, CRC(7110aa43) SHA1(639dc002cc1580f0530bb5bb17f574e2258d5954) )
1539
1540   ROM_REGION( 0x40000, "k007232_1", 0 ) /* Samples, 2 banks */
1541   ROM_LOAD( "763e11a", 0x000000, 0x010000, CRC(a60a93c8) SHA1(ce319f2b30c82f66fee0bab65d091ef4bef58a89) )
1542   ROM_LOAD( "763e11b", 0x010000, 0x010000, CRC(7750feb5) SHA1(e0900b8af400a50a22907ffa514847003cef342d) )
1543   ROM_LOAD( "763e11c", 0x020000, 0x010000, CRC(78b89bf8) SHA1(b74427e363a486d4be003df39f4ca8d10b9d5fc9) )
1544   ROM_LOAD( "763e11d", 0x030000, 0x010000, CRC(5f38d054) SHA1(ce0c87a7b7c0806e09cce5d48a651f12f790dd27) )
1545
1546   ROM_REGION( 0x40000, "k007232_2", 0 ) /* Samples, 2 banks */
1547   ROM_LOAD( "763e10a", 0x000000, 0x010000, CRC(2b1cbefc) SHA1(f23fb943c277a05f2aa4d25de692d1fb3bb752ac) )
1548   ROM_LOAD( "763e10b", 0x010000, 0x010000, CRC(8209c950) SHA1(944c2afb4cfc67bd243de499f5ca6a7982980f45) )
1549   ROM_LOAD( "763e10c", 0x020000, 0x010000, CRC(b91d6c07) SHA1(ef90457cb495750c5793cd1716d0dc44d33d0a95) )
1550   ROM_LOAD( "763e10d", 0x030000, 0x010000, CRC(5b465d20) SHA1(66f10b58873e738f5539b960468c7f92d07c28bc) )
1551
1552   ROM_REGION( 0x100000, "k007232_3", 0 )    /* Samples, 4 banks for each ROM */
1553   ROM_LOAD( "763e08a", 0x000000, 0x020000, CRC(02e4e7ef) SHA1(1622e4d85a333acae6e5f9304a037389bfeb71dc) )
1554   ROM_LOAD( "763e08b", 0x020000, 0x020000, CRC(94edde2f) SHA1(b124f83f271dab710d5ecb67a70cac7b4b41931c) )
1555   ROM_LOAD( "763e08c", 0x040000, 0x020000, CRC(b1ab1529) SHA1(962ad45fdccf6431e05eaec65d1b2f7842bddc02) )
1556   ROM_LOAD( "763e08d", 0x060000, 0x020000, CRC(ee8d14db) SHA1(098ba4f27b8cbb0ce017b28e5b69d6a3d2efa1df) )
1557
1558   ROM_LOAD( "763e09a", 0x080000, 0x020000, CRC(1e6628ec) SHA1(9d24da1d32cb39dcbe3d0633045054d398ca8eb8) )
1559   ROM_LOAD( "763e09b", 0x0a0000, 0x020000, CRC(f0c2feb8) SHA1(9454d45a97dc2e823baf68dce85acce8e82a18f2) )
1560   ROM_LOAD( "763e09c", 0x0c0000, 0x020000, CRC(a0ade3e4) SHA1(1c94cede76f9350769a589625fadaee855c38866) )
1561   ROM_LOAD( "763e09d", 0x0e0000, 0x020000, CRC(c74e484d) SHA1(dd7ef64c30443847c638291f6cd2b45a5f0b2310) )
1562
1563   ROM_REGION( 0x08000, "user1", 0 )   /* extra data for road effects? */
1564   ROM_LOAD( "763a12", 0x000000, 0x008000, CRC(05f1e553) SHA1(8aaeb7374bd93038c24e6470398936f22cabb0fe) )
1565
1566   ROM_REGION( 0x200, "user2", 0 )
1567   ROM_LOAD( "763a23.b17", 0x00000, 0x200, CRC(81c30352) SHA1(20700aed065929835ef5c3b564a6f531f0a8fedf) )
1568ROM_END
1569
1570
15711408/*      Important: you must leave extra space when listing sprite ROMs
15721409    in a ROM module definition.  This routine unpacks each sprite nibble
15731410    into a byte, doubling the memory consumption. */
r248389r248390
16371474
16381475GAMEL( 1986, wecleman,  0,        wecleman, wecleman, wecleman_state, wecleman, ROT0, "Konami", "WEC Le Mans 24 (set 1)", 0, layout_wecleman )
16391476GAMEL( 1986, wecleman2, wecleman, wecleman, wecleman, wecleman_state, wecleman, ROT0, "Konami", "WEC Le Mans 24 (set 2)", 0, layout_wecleman ) // 1988 release
1640
1641GAMEL( 1988, hotchase,  0,        hotchase, hotchase, wecleman_state, hotchase, ROT0, "Konami", "Hot Chase (set 1)", 0, layout_wecleman )
1642GAMEL( 1988, hotchasea, hotchase, hotchase, hotchase, wecleman_state, hotchase, ROT0, "Konami", "Hot Chase (set 2)", 0, layout_wecleman )
1477GAMEL( 1988, hotchase,  0,        hotchase, hotchase, wecleman_state, hotchase, ROT0, "Konami", "Hot Chase", 0, layout_wecleman )
trunk/src/mame/drivers/xyonix.c
r248389r248390
1313Dip SW is 1 x 8-position
1414
1515on the PCB is an empty socket. written next to the socket is 68705P3. "oh no" you
16say..... well, its unpopulated, so maybe it was never used? (another PCB was
17found with the 68705 populated)
16say..... well, its unpopulated, so maybe it was never used?
1817
1918
2019TODO:
r248389r248390
260259   ROM_REGION( 0x10000, "maincpu", 0 )
261260   ROM_LOAD( "xyonix3.bin", 0x00000, 0x10000, CRC(1960a74e) SHA1(5fd7bc31ca2f5f1e114d3d0ccf6554ebd712cbd3) )
262261
263   ROM_REGION( 0x10000, "mcu", 0 )
264   ROM_LOAD( "mc68705p3s.e7", 0x00000, 0x780, BAD_DUMP CRC(f60cdd86) SHA1(e18cc598153b3e108942328ee9c5b9f83b034c41) ) // FIXED BITS (xxxxxx0x)
265   
266262   ROM_REGION( 0x10000, "gfx1", 0 )
267263   ROM_LOAD( "xyonix1.bin", 0x00000, 0x08000, CRC(3dfa9596) SHA1(52cdbbe18f83cea7248c29588ea3a18c4bb7984f) )
268264   ROM_LOAD( "xyonix2.bin", 0x08000, 0x08000, CRC(db87343e) SHA1(62bc30cd65b2f8976cd73a0b349a9ccdb3faaad2) )
r248389r248390
274270/* GAME drivers **************************************************************/
275271
276272GAME( 1989, xyonix, 0, xyonix, xyonix, driver_device, 0, ROT0, "Philko", "Xyonix", GAME_SUPPORTS_SAVE )
277   
No newline at end of file
trunk/src/mame/includes/1942.h
r248389r248390
4545   DECLARE_WRITE8_MEMBER(c1942_scroll_w);
4646   DECLARE_WRITE8_MEMBER(c1942_c804_w);
4747   DECLARE_WRITE8_MEMBER(c1942p_f600_w);
48   DECLARE_WRITE8_MEMBER(c1942p_soundlatch_w);
4948   DECLARE_DRIVER_INIT(1942);
5049   TILE_GET_INFO_MEMBER(get_fg_tile_info);
5150   TILE_GET_INFO_MEMBER(get_bg_tile_info);
trunk/src/mame/includes/dynax.h
r248389r248390
226226   DECLARE_DRIVER_INIT(blktouch);
227227   DECLARE_DRIVER_INIT(mjelct3a);
228228   DECLARE_DRIVER_INIT(mjreach);
229   DECLARE_DRIVER_INIT(maya_common);
230   DECLARE_DRIVER_INIT(mayac);
231229   DECLARE_DRIVER_INIT(maya);
232230
233231   UINT32 screen_update_hanamai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
trunk/src/mame/includes/namcona1.h
r248389r248390
8585
8686   DECLARE_READ16_MEMBER(custom_key_r);
8787   DECLARE_WRITE16_MEMBER(custom_key_w);
88   DECLARE_WRITE16_MEMBER(vreg_w);
88   DECLARE_WRITE16_MEMBER(namcona1_vreg_w);
8989   DECLARE_READ16_MEMBER(mcu_mailbox_r);
9090   DECLARE_WRITE16_MEMBER(mcu_mailbox_w_68k);
9191   DECLARE_WRITE16_MEMBER(mcu_mailbox_w_mcu);
r248389r248390
105105   void simulate_mcu();
106106   void write_version_info();
107107   int transfer_dword(UINT32 dest, UINT32 source);
108   void blit();
108   void namcona1_blit();
109109   void UpdatePalette(int offset);
110   DECLARE_WRITE16_MEMBER(videoram_w);
111   DECLARE_WRITE16_MEMBER(paletteram_w);
112   DECLARE_READ16_MEMBER(gfxram_r);
113   DECLARE_WRITE16_MEMBER(gfxram_w);
110   DECLARE_WRITE16_MEMBER(namcona1_videoram_w);
111   DECLARE_WRITE16_MEMBER(namcona1_paletteram_w);
112   DECLARE_READ16_MEMBER(namcona1_gfxram_r);
113   DECLARE_WRITE16_MEMBER(namcona1_gfxram_w);
114114   void pdraw_tile( screen_device &screen, bitmap_ind16 &dest_bmp, const rectangle &clip, UINT32 code, int color,
115115      int sx, int sy, int flipx, int flipy, int priority, int bShadow, int bOpaque, int gfx_region );
116116   void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
117117   void draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int primask );
118118   DECLARE_READ16_MEMBER(snd_r);
119119   DECLARE_WRITE16_MEMBER(snd_w);
120
121120   DECLARE_DRIVER_INIT(bkrtmaq);
122121   DECLARE_DRIVER_INIT(quiztou);
123122   DECLARE_DRIVER_INIT(emeralda);
r248389r248390
130129   DECLARE_DRIVER_INIT(xday2);
131130   DECLARE_DRIVER_INIT(exbania);
132131   DECLARE_DRIVER_INIT(emeraldj);
133   virtual void machine_start();
134   virtual void machine_reset();
135   virtual void video_start();
136
137132   TILE_GET_INFO_MEMBER(tilemap_get_info0);
138133   TILE_GET_INFO_MEMBER(tilemap_get_info1);
139134   TILE_GET_INFO_MEMBER(tilemap_get_info2);
140135   TILE_GET_INFO_MEMBER(tilemap_get_info3);
141136   TILE_GET_INFO_MEMBER(roz_get_info);
137   virtual void machine_start();
138   virtual void machine_reset();
139   virtual void video_start();
140   UINT32 screen_update_namcona1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
141   TIMER_DEVICE_CALLBACK_MEMBER(namcona1_interrupt);
142142
143   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
144
145   TIMER_DEVICE_CALLBACK_MEMBER(interrupt);
146   void postload();
147
148143private:
149144   void tilemap_get_info(tile_data &tileinfo, int tile_index, const UINT16 *tilemap_videoram, bool use_4bpp_gfx);
150145};
trunk/src/mame/includes/naughtyb.h
r248389r248390
77public:
88   naughtyb_state(const machine_config &mconfig, device_type type, const char *tag)
99      : driver_device(mconfig, type, tag),
10      m_videoram(*this, "videoram"),
11      m_videoram2(*this, "videoram2"),
12      m_scrollreg(*this, "scrollreg"),
1013      m_maincpu(*this, "maincpu"),
1114      m_naughtyb_custom(*this, "naughtyb_custom"),
1215      m_popflame_custom(*this, "popflame_custom"),
1316      m_gfxdecode(*this, "gfxdecode"),
1417      m_screen(*this, "screen"),
15      m_palette(*this, "palette"),
16      m_videoram(*this, "videoram"),
17      m_videoram2(*this, "videoram2"),
18      m_scrollreg(*this, "scrollreg") { }
18      m_palette(*this, "palette") { }
1919
20   required_shared_ptr<UINT8> m_videoram;
21   required_shared_ptr<UINT8> m_videoram2;
22   required_shared_ptr<UINT8> m_scrollreg;
2023   required_device<cpu_device> m_maincpu;
2124   optional_device<naughtyb_sound_device> m_naughtyb_custom;
2225   optional_device<popflame_sound_device> m_popflame_custom;
r248389r248390
2427   required_device<screen_device> m_screen;
2528   required_device<palette_device> m_palette;
2629
27   required_shared_ptr<UINT8> m_videoram;
28   required_shared_ptr<UINT8> m_videoram2;
29   required_shared_ptr<UINT8> m_scrollreg;
3030
3131   UINT8 m_popflame_prot_seed;
3232   int m_r_index;
r248389r248390
3636   UINT8 m_palreg;
3737   int m_bankreg;
3838   bitmap_ind16 m_tmpbitmap;
39
4039   DECLARE_READ8_MEMBER(in0_port_r);
4140   DECLARE_READ8_MEMBER(dsw0_port_r);
4241   DECLARE_READ8_MEMBER(popflame_protection_r);
r248389r248390
4544   DECLARE_WRITE8_MEMBER(trvmstr_questions_w);
4645   DECLARE_WRITE8_MEMBER(naughtyb_videoreg_w);
4746   DECLARE_WRITE8_MEMBER(popflame_videoreg_w);
48
4947   DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
50
5148   DECLARE_DRIVER_INIT(trvmstr);
5249   DECLARE_DRIVER_INIT(popflame);
5350   virtual void video_start();
5451   DECLARE_PALETTE_INIT(naughtyb);
52   UINT32 screen_update_naughtyb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5553
56   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5754};
trunk/src/mame/includes/poolshrk.h
r248389r248390
1515public:
1616   poolshrk_state(const machine_config &mconfig, device_type type, const char *tag)
1717      : driver_device(mconfig, type, tag),
18      m_maincpu(*this, "maincpu"),
19      m_gfxdecode(*this, "gfxdecode"),
20      m_palette(*this, "palette"),
21      m_discrete(*this, "discrete"),
2218      m_playfield_ram(*this, "playfield_ram"),
2319      m_hpos_ram(*this, "hpos_ram"),
24      m_vpos_ram(*this, "vpos_ram") { }
20      m_vpos_ram(*this, "vpos_ram"),
21      m_discrete(*this, "discrete"),
22      m_maincpu(*this, "maincpu"),
23      m_gfxdecode(*this, "gfxdecode"),
24      m_palette(*this, "palette") { }
2525
26   required_device<cpu_device> m_maincpu;
27   required_device<gfxdecode_device> m_gfxdecode;
28   required_device<palette_device> m_palette;
29   required_device<discrete_device> m_discrete;
30
26   int m_da_latch;
3127   required_shared_ptr<UINT8> m_playfield_ram;
3228   required_shared_ptr<UINT8> m_hpos_ram;
3329   required_shared_ptr<UINT8> m_vpos_ram;
34
30   required_device<discrete_device> m_discrete;
3531   tilemap_t* m_bg_tilemap;
36   int m_da_latch;
37
38   DECLARE_WRITE8_MEMBER(da_latch_w);
39   DECLARE_WRITE8_MEMBER(led_w);
40   DECLARE_WRITE8_MEMBER(watchdog_w);
41   DECLARE_READ8_MEMBER(input_r);
42   DECLARE_READ8_MEMBER(irq_reset_r);
43   DECLARE_WRITE8_MEMBER(scratch_sound_w);
44   DECLARE_WRITE8_MEMBER(score_sound_w);
45   DECLARE_WRITE8_MEMBER(click_sound_w);
46   DECLARE_WRITE8_MEMBER(bump_sound_w);
47
48   TILE_GET_INFO_MEMBER(get_tile_info);
49
32   DECLARE_WRITE8_MEMBER(poolshrk_da_latch_w);
33   DECLARE_WRITE8_MEMBER(poolshrk_led_w);
34   DECLARE_WRITE8_MEMBER(poolshrk_watchdog_w);
35   DECLARE_READ8_MEMBER(poolshrk_input_r);
36   DECLARE_READ8_MEMBER(poolshrk_irq_reset_r);
5037   DECLARE_DRIVER_INIT(poolshrk);
38   TILE_GET_INFO_MEMBER(get_tile_info);
5139   virtual void video_start();
5240   DECLARE_PALETTE_INIT(poolshrk);
53
54   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
41   UINT32 screen_update_poolshrk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
42   DECLARE_WRITE8_MEMBER(poolshrk_scratch_sound_w);
43   DECLARE_WRITE8_MEMBER(poolshrk_score_sound_w);
44   DECLARE_WRITE8_MEMBER(poolshrk_click_sound_w);
45   DECLARE_WRITE8_MEMBER(poolshrk_bump_sound_w);
46   required_device<cpu_device> m_maincpu;
47   required_device<gfxdecode_device> m_gfxdecode;
48   required_device<palette_device> m_palette;
5549};
5650
5751
trunk/src/mame/includes/scramble.h
r248389r248390
33#include "machine/i8255.h"
44#include "includes/galaxold.h"
55#include "sound/tms5110.h"
6#include "sound/digitalk.h"
76
87class scramble_state : public galaxold_state
98{
r248389r248390
1413      m_ppi8255_0(*this, "ppi8255_0"),
1514      m_ppi8255_1(*this, "ppi8255_1"),
1615      m_tmsprom(*this, "tmsprom"),
17      m_soundram(*this, "soundram"),
18      m_digitalker(*this, "digitalker")
16      m_soundram(*this, "soundram")
1917   {
2018   }
2119
r248389r248390
2422   optional_device<i8255_device>  m_ppi8255_1;
2523   optional_device<tmsprom_device>  m_tmsprom;
2624   optional_shared_ptr<UINT8> m_soundram;
27   optional_device<digitalker_device> m_digitalker;
2825
2926   UINT8 m_cavelon_bank;
3027
r248389r248390
5350   DECLARE_WRITE8_MEMBER(mars_ppi8255_1_w);
5451   DECLARE_WRITE8_MEMBER(ad2083_tms5110_ctrl_w);
5552
56   // harem
53   DECLARE_WRITE8_MEMBER(harem_portA_w);
54   DECLARE_WRITE8_MEMBER(harem_portB_w);
55
5756   DECLARE_WRITE8_MEMBER(harem_decrypt_bit_w);
5857   DECLARE_WRITE8_MEMBER(harem_decrypt_clk_w);
5958   DECLARE_WRITE8_MEMBER(harem_decrypt_rst_w);
60   DECLARE_READ8_MEMBER(harem_digitalker_intr_r);
61   DECLARE_WRITE8_MEMBER(harem_digitalker_control_w);
6259
6360   DECLARE_DRIVER_INIT(cavelon);
6461   DECLARE_DRIVER_INIT(mariner);
trunk/src/mame/includes/spbactn.h
r248389r248390
99public:
1010   spbactn_state(const machine_config &mconfig, device_type type, const char *tag)
1111      : driver_device(mconfig, type, tag),
12      m_bgvideoram(*this, "bgvideoram"),
13      m_fgvideoram(*this, "fgvideoram"),
14      m_spvideoram(*this, "spvideoram"),
15      m_extraram(*this, "extraram"),
16      m_extraram2(*this, "extraram2"),
1217      m_maincpu(*this, "maincpu"),
1318      m_audiocpu(*this, "audiocpu"),
1419      m_gfxdecode(*this, "gfxdecode"),
1520      m_screen(*this, "screen"),
1621      m_palette(*this, "palette"),
1722      m_sprgen(*this, "spritegen"),
18      m_mixer(*this, "mixer"),
19      m_bgvideoram(*this, "bgvideoram"),
20      m_fgvideoram(*this, "fgvideoram"),
21      m_spvideoram(*this, "spvideoram"),
22      m_extraram(*this, "extraram"),
23      m_extraram2(*this, "extraram2")
23      m_mixer(*this, "mixer")
2424      { }
2525
26   required_device<cpu_device> m_maincpu;
27   required_device<cpu_device> m_audiocpu;
28   required_device<gfxdecode_device> m_gfxdecode;
29   required_device<screen_device> m_screen;
30   required_device<palette_device> m_palette;
31   required_device<tecmo_spr_device> m_sprgen;
32   required_device<tecmo_mix_device> m_mixer;
33
3426   required_shared_ptr<UINT16> m_bgvideoram;
3527   required_shared_ptr<UINT16> m_fgvideoram;
3628   required_shared_ptr<UINT16> m_spvideoram;
r248389r248390
8274   {
8375      return 0xffff;
8476   }
77   required_device<cpu_device> m_maincpu;
78   required_device<cpu_device> m_audiocpu;
79   required_device<gfxdecode_device> m_gfxdecode;
80   required_device<screen_device> m_screen;
81   required_device<palette_device> m_palette;
82   required_device<tecmo_spr_device> m_sprgen;
83   required_device<tecmo_mix_device> m_mixer;
84
85
86
8587};
trunk/src/mame/includes/system1.h
r248389r248390
115115   DECLARE_DRIVER_INIT(seganinj);
116116   DECLARE_DRIVER_INIT(gardia);
117117   DECLARE_DRIVER_INIT(spatter);
118   DECLARE_DRIVER_INIT(spattera);
119118   TILE_GET_INFO_MEMBER(tile_get_info);
120119   virtual void machine_start();
121120   virtual void machine_reset();
trunk/src/mame/includes/system16.h
r248389r248390
125125   optional_shared_ptr<UINT16> m_decrypted_opcodes;
126126
127127   DECLARE_WRITE16_MEMBER(sound_command_nmi_w);
128   DECLARE_WRITE16_MEMBER(sound_command_irq_w);
128   DECLARE_WRITE16_MEMBER(sound_command_w);
129129   DECLARE_WRITE16_MEMBER(sys16_coinctrl_w);
130130   DECLARE_READ16_MEMBER(passht4b_service_r);
131131   DECLARE_READ16_MEMBER(passht4b_io1_r);
r248389r248390
159159   DECLARE_WRITE16_MEMBER(sys18_tilebank_w);
160160   DECLARE_READ8_MEMBER(system18_bank_r);
161161   DECLARE_WRITE8_MEMBER(sys18_soundbank_w);
162   DECLARE_WRITE16_MEMBER(sound_command_irq_w);
162163   DECLARE_WRITE8_MEMBER(shdancbl_msm5205_data_w);
163164   DECLARE_READ8_MEMBER(shdancbl_soundbank_r);
164165   DECLARE_WRITE8_MEMBER(shdancbl_bankctrl_w);
trunk/src/mame/machine/scramble.c
r248389r248390
675675
676676   membank("rombank")->set_base            (m_harem_decrypted_data);
677677   membank("rombank_decrypted")->set_base  (m_harem_decrypted_opcodes);
678
679   save_item(NAME(m_harem_decrypt_mode));
680   save_item(NAME(m_harem_decrypt_bit));
681   save_item(NAME(m_harem_decrypt_clk));
682   save_item(NAME(m_harem_decrypt_count));
683678}
trunk/src/mame/mess.lst
r248389r248390
327327fb01    // 1986 FB-01
328328
329329// Roland
330tb303
330331mt32
331332cm32l
332333d110
r248389r248390
10421043avigo_it     // 1997 Avigo (Italian)
10431044
10441045// Texas Instruments Calculators
1046tisr16    // 1974 SR-16
1047tisr16ii
1048ti1270
1049ti1000
1050ti30      // 1976 TI-30
1051tiprog
1052tibusan1
1053wizatron
1054lilprof
1055lilprof78
10451056ti73      // 1990 TI-73
10461057ti74      // 1985 TI-74
10471058ti95      // 1986 TI-95
r248389r248390
22242235elecbowl    // Marx
22252236mbdtower    // Milton Bradley
22262237
2227// hh_tms1k snspell.c
2238// TI snspell
22282239snspell
22292240snspella
22302241snspellb
r248389r248390
22372248snread
22382249lantutor
22392250
2240// hh_tms1k ticalc1x.c
2241tisr16
2242tisr16ii
2243ti1270
2244ti1000
2245ti30
2246tiprog
2247tibusan1
2248wizatron
2249lilprof
2250lilprof78
2251
22522251// hh_ucom4
22532252ufombs      // Bambino
22542253ssfball     // Bambino
r248389r248390
22682267tcaveman    // Tomy
22692268alnchase    // Tomy
22702269
2271// hh_ucom4 derivatives
2272tb303       // Roland
2273
22742270// other
22752271tama        // Bandai
22762272advision    // Entex
r248389r248390
24442440vector4
24452441unistar
24462442dual68
2447sdk80
24482443sdk85
24492444rpc86
24502445isbc86
r248389r248390
25892584eacc
25902585argo
25912586applix
2592fccpu1
2593258768ksbc
25942588lcmate2
25952589cm1800
trunk/src/mame/video/cps1.c
r248389r248390
151151Varth: Operation Thunderstorm (World 920714)                       89624B-3   VA24B            IOB1  88622-C-5    CPS-B-04  DL-0411-10005  None
152152Varth: Operation Thunderstorm (USA 920612)                         91635B-2   VA63B    BPRG1   IOB1  88622-C-5    CPS-B-04  DL-0411-10005  None
153153Varth: Operation Thunderstorm* (Japan 920714)                      88622B-3   VA22B            LWIO  92641C-1     CPS-B-21  DL-0921-10014          IOC1
154Varth: Operation Thunderstorm* (Japan Resale Ver. 920714)          91634B-2   VA63B    BPRG1   IOB1  92641C-1     CPS-B-21  DL-0921-10014          IOC1
155154
156155Quiz & Dragons: Capcom Quiz Game* (USA 920701)               1992  89625B-1   QD22B            IOB1  92641C-1     CPS-B-21  DL-0921-10014          IOC1
157156Quiz & Dragons: Capcom Quiz Game (Japan Resale Ver. 940921)  1994  91634B-2   QAD63B   BPRG1   IOB1  92631C-6     CPS-B-21  DL-0921-10014  C632    IOC1
r248389r248390
15371536   {"varthr1",     CPS_B_04,     mapper_VA63B },   /* CPSB test has been patched out (60=0008) register is also written to, possibly leftover from development */  // wrong, this set uses VA24B, dumped but equations still not added
15381537   {"varthu",      CPS_B_04,     mapper_VA63B },   /* CPSB test has been patched out (60=0008) register is also written to, possibly leftover from development */
15391538   {"varthj",      CPS_B_21_BT5, mapper_VA22B },   /* CPSB test has been patched out (72=0001) register is also written to, possibly leftover from development */
1540   {"varthjr",     CPS_B_21_BT5, mapper_VA63B },   /* CPSB test has been patched out (72=0001) register is also written to, possibly leftover from development */
15411539   {"cworld2j",    CPS_B_21_BT6, mapper_Q522B,  0x36, 0, 0x34 },   /* (ports 36, 34 probably leftover input code from another game) */
15421540   {"cworld2ja",   CPS_B_21_DEF, mapper_Q522B }, // patched set, no battery, could be desuicided // wrong, this set uses Q529B, still not dumped
15431541   {"cworld2jb",   CPS_B_21_BT6, mapper_Q522B,  0x36, 0, 0x34 }, // wrong, this set uses Q563B, still not dumped
trunk/src/mame/video/namcona1.c
r248389r248390
3636
3737TILE_GET_INFO_MEMBER(namcona1_state::tilemap_get_info0)
3838{
39   tilemap_get_info(tileinfo,tile_index,0*0x1000+m_videoram,m_vreg[0xbc/2]&1);
39   UINT16 *videoram = m_videoram;
40   tilemap_get_info(tileinfo,tile_index,0*0x1000+videoram,m_vreg[0xbc/2]&1);
4041}
4142
4243TILE_GET_INFO_MEMBER(namcona1_state::tilemap_get_info1)
4344{
44   tilemap_get_info(tileinfo,tile_index,1*0x1000+m_videoram,m_vreg[0xbc/2]&2);
45   UINT16 *videoram = m_videoram;
46   tilemap_get_info(tileinfo,tile_index,1*0x1000+videoram,m_vreg[0xbc/2]&2);
4547}
4648
4749TILE_GET_INFO_MEMBER(namcona1_state::tilemap_get_info2)
4850{
49   tilemap_get_info(tileinfo,tile_index,2*0x1000+m_videoram,m_vreg[0xbc/2]&4);
51   UINT16 *videoram = m_videoram;
52   tilemap_get_info(tileinfo,tile_index,2*0x1000+videoram,m_vreg[0xbc/2]&4);
5053}
5154
5255TILE_GET_INFO_MEMBER(namcona1_state::tilemap_get_info3)
5356{
54   tilemap_get_info(tileinfo,tile_index,3*0x1000+m_videoram,m_vreg[0xbc/2]&8);
57   UINT16 *videoram = m_videoram;
58   tilemap_get_info(tileinfo,tile_index,3*0x1000+videoram,m_vreg[0xbc/2]&8);
5559}
5660
5761TILE_GET_INFO_MEMBER(namcona1_state::roz_get_info)
r248389r248390
7882
7983/*************************************************************************/
8084
81WRITE16_MEMBER(namcona1_state::videoram_w)
85WRITE16_MEMBER(namcona1_state::namcona1_videoram_w)
8286{
83   COMBINE_DATA( &m_videoram[offset] );
87   UINT16 *videoram = m_videoram;
88   COMBINE_DATA( &videoram[offset] );
8489   if( offset<0x8000/2 )
8590   {
8691      m_bg_tilemap[offset/0x1000]->mark_tile_dirty(offset&0xfff);
r248389r248390
8994   {
9095      m_bg_tilemap[4]->mark_all_dirty();
9196   }
92} /* videoram_w */
97} /* namcona1_videoram_w */
9398
9499/*************************************************************************/
95100
r248389r248390
108113   m_palette->set_pen_color(offset+0x1000, r, g, b);
109114
110115   m_palette->set_pen_color(offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
111}
116} /* namcona1_paletteram_w */
112117
113WRITE16_MEMBER(namcona1_state::paletteram_w)
118WRITE16_MEMBER(namcona1_state::namcona1_paletteram_w)
114119{
115120   COMBINE_DATA( &m_paletteram[offset] );
116121   if( m_vreg[0x8e/2] )
r248389r248390
124129}
125130
126131
127READ16_MEMBER(namcona1_state::gfxram_r)
132READ16_MEMBER(namcona1_state::namcona1_gfxram_r)
128133{
129134   UINT16 type = m_vreg[0x0c/2];
130135   if( type == 0x03 )
r248389r248390
140145      return m_cgram[offset];
141146   }
142147   return 0x0000;
143} /* gfxram_r */
148} /* namcona1_gfxram_r */
144149
145WRITE16_MEMBER(namcona1_state::gfxram_w)
150WRITE16_MEMBER(namcona1_state::namcona1_gfxram_w)
146151{
147152   UINT16 type = m_vreg[0x0c/2];
148153   UINT16 old_word;
r248389r248390
169174         m_gfxdecode->gfx(1)->mark_dirty(offset/0x20);
170175      }
171176   }
172} /* gfxram_w */
177} /* namcona1_gfxram_w */
173178
174179void namcona1_state::video_start()
175180{
r248389r248390
185190   m_shaperam.resize(0x8000);
186191
187192   m_gfxdecode->gfx(2)->set_source(&m_shaperam[0]);
188   
189   save_item(NAME(m_shaperam));
190   save_item(NAME(m_palette_is_dirty));
191   
192   machine().save().register_postload(save_prepost_delegate(FUNC(namcona1_state::postload), this));
193} /* video_start */
193} /* namcona1_vh_start */
194194
195void namcona1_state::postload()
196{
197   for (int i = 0; i < 3; i++)
198      m_gfxdecode->gfx(i)->mark_all_dirty();
199}
200
201
202195/*************************************************************************/
203196
204197void namcona1_state::pdraw_tile(
r248389r248390
517510   }
518511} /* draw_background */
519512
520UINT32 namcona1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
513UINT32 namcona1_state::screen_update_namcona1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
521514{
522515   int which;
523516   int priority;
trunk/src/mame/video/naughtyb.c
r248389r248390
6464   const UINT8 *color_prom = memregion("proms")->base();
6565   static const int resistances[2] = { 270, 130 };
6666   double weights[2];
67   int i;
6768
6869   /* compute the color output resistor weights */
6970   compute_resistor_weights(0, 255, -1.0,
r248389r248390
7172         2, resistances, weights, 0, 0,
7273         0, 0, 0, 0, 0);
7374
74   for (int i = 0;i < palette.entries(); i++)
75   for (i = 0;i < palette.entries(); i++)
7576   {
7677      int bit0, bit1;
7778      int r, g, b;
r248389r248390
107108
108109   /* Naughty Boy has a virtual screen twice as large as the visible screen */
109110   m_tmpbitmap.allocate(68*8,28*8,m_screen->format());
110   
111   save_item(NAME(m_cocktail));
112   save_item(NAME(m_palreg));
113   save_item(NAME(m_bankreg));
114111}
115112
116113
r248389r248390
186183
187184
188185***************************************************************************/
189UINT32 naughtyb_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
186UINT32 naughtyb_state::screen_update_naughtyb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
190187{
191188   const rectangle scrollvisiblearea(2*8, 34*8-1, 0*8, 28*8-1);
192189   const rectangle leftvisiblearea(0*8, 2*8-1, 0*8, 28*8-1);
193190   const rectangle rightvisiblearea(34*8, 36*8-1, 0*8, 28*8-1);
194191
192   UINT8 *videoram = m_videoram;
193   bitmap_ind16 &tmpbitmap = m_tmpbitmap;
194   int offs;
195
195196   // for every character in the Video RAM
196197
197   for (int offs = 0x800 - 1; offs >= 0; offs--)
198   for (offs = 0x800 - 1; offs >= 0; offs--)
198199   {
199200      int sx,sy;
200201
r248389r248390
225226         }
226227      }
227228
228      m_gfxdecode->gfx(0)->opaque(m_tmpbitmap,m_tmpbitmap.cliprect(),
229      m_gfxdecode->gfx(0)->opaque(tmpbitmap,tmpbitmap.cliprect(),
229230            m_videoram2[offs] + 256 * m_bankreg,
230231            (m_videoram2[offs] >> 5) + 8 * m_palreg,
231232            m_cocktail,m_cocktail,
232233            8*sx,8*sy);
233234
234      m_gfxdecode->gfx(1)->transpen(m_tmpbitmap,m_tmpbitmap.cliprect(),
235            m_videoram[offs] + 256*m_bankreg,
236            (m_videoram[offs] >> 5) + 8 * m_palreg,
235      m_gfxdecode->gfx(1)->transpen(tmpbitmap,tmpbitmap.cliprect(),
236            videoram[offs] + 256*m_bankreg,
237            (videoram[offs] >> 5) + 8 * m_palreg,
237238            m_cocktail,m_cocktail,
238239            8*sx,8*sy,0);
239240   }
r248389r248390
242243   {
243244      int scrollx;
244245
245      copybitmap(bitmap,m_tmpbitmap,0,0,-66*8,0,leftvisiblearea);
246      copybitmap(bitmap,m_tmpbitmap,0,0,-30*8,0,rightvisiblearea);
246      copybitmap(bitmap,tmpbitmap,0,0,-66*8,0,leftvisiblearea);
247      copybitmap(bitmap,tmpbitmap,0,0,-30*8,0,rightvisiblearea);
247248
248249      scrollx = ( m_cocktail ) ? *m_scrollreg - 239 : -*m_scrollreg + 16;
249      copyscrollbitmap(bitmap,m_tmpbitmap,1,&scrollx,0,0,scrollvisiblearea);
250      copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,0,0,scrollvisiblearea);
250251   }
251252   return 0;
252253}
trunk/src/mame/video/poolshrk.c
r248389r248390
2727}
2828
2929
30UINT32 poolshrk_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
30UINT32 poolshrk_state::screen_update_poolshrk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
3131{
32   int i;
33
3234   m_bg_tilemap->mark_all_dirty();
3335
3436   bitmap.fill(0, cliprect);
3537
3638   /* draw sprites */
3739
38   for (int i = 0; i < 16; i++)
40   for (i = 0; i < 16; i++)
3941   {
4042      int hpos = m_hpos_ram[i];
4143      int vpos = m_vpos_ram[i];
trunk/src/mess/drivers/advision.c
r248389r248390
7878   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
7979   MCFG_SCREEN_UPDATE_DRIVER(advision_state, screen_update)
8080   MCFG_SCREEN_SIZE(320, 200)
81   MCFG_SCREEN_VISIBLE_AREA(84, 235, 60, 142)
81   MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1)
8282   MCFG_SCREEN_PALETTE("palette")
8383   MCFG_PALETTE_ADD("palette", 8)
8484   MCFG_PALETTE_INIT_OWNER(advision_state, advision)
trunk/src/mess/drivers/force68k.c
r248389r248390
1// license:BSD-3-Clause
2// copyright-holders:Joakim Larsson Edström
3/***************************************************************************
4
5    Force SYS68K CPU-1/CPU-6 VME SBC drivers, initially based on the 68ksbc.c
6
7    13/06/2015
8
9 The info found on the links below is for a later revisions of the board I have
10 but I hope it is somewhat compatible so I can get it up and running at least.
11 My CPU-1 board has proms from 1983 and no rev markings so probably the original.
12
13 http://bitsavers.trailing-edge.com/pdf/forceComputers/1988_Force_VMEbus_Products.pdf
14 http://www.artisantg.com/info/P_wUovN.pdf
15
16 Some info from those documents:
17
18Address Map
19----------------------------------------------------------
20Address Range     Description
21----------------------------------------------------------
22000 000 - 000 007 Initialisation vectors from system EPROM
23000 008 - 01F FFF Dynamic RAM on CPU-1 B
24000 008 - 07F FFF Dynamic RAM on CPU-1 D
25080 008 - 09F FFF SYSTEM EPROM Area
26OAO 000 - OBF FFF USER EPROMArea
270C0 041 - 0C0 043 ACIA (P3) Host
280C0 080 - 0C0 082 ACIA (P4) Terminal
290C0 101 - 0C0 103 ACIA (P5) Remote device (eg serial printer)
300C0 401 - 0C0 42F RTC
31OEO 001 - 0E0 035 PI/T (eg centronics printer)
32OEO 200 - 0E0 2FF FPU
33OEO 300 - 0E0 300 Reset Off
34OEO 380 - 0E0 380 Reset On
35100 000 - FEF FFF VMEbus addresses (A24)
36FFO 000 - FFF FFF VMEbus Short I/O (A16)
37----------------------------------------------------------
38
39Interrupt sources
40----------------------------------------------------------
41Description                  Device  Lvl  IRQ    VME board
42                             /Board      Vector  Address
43----------------------------------------------------------
44On board Sources
45 ABORT                        Switch  7    31
46 Real Time Clock (RTC)        58167A  6    30
47 Parallel/Timer (PI/T)        68230   5    29
48 Terminal ACIA                6850    4    28
49 Remote ACIA                  6850    3    27
50 Host ACIA                    6850    2    26
51 ACFAIL, SYSFAIL              VME     5    29
52Off board Sources (other VME boards)
53 6 Port Serial I/O board      SIO     4    64-75  0xb00000
54 8 Port Serial I/O board      ISIO    4    76-83  0x960000
55 Disk Controller              WFC     3    119    0xb01000
56 SCSI Controller              ISCSI   4    119    0xa00000
57 Slot 1 Controller Board      ASCU    7    31     0xb02000
58----------------------------------------------------------
59
6010. The VMEbus
61---------------
62The implemented VMEbus Interface includes 24 address, 16 data,
636 address modifier and the asynchronous control signals.
64A single level bus arbiter is provided to build multi master
65systems. In addition to the bus arbiter, a separate slave bus
66arbitration allows selection of the arbitration level (0-3).
67
68The address modifier range .,Short 110 Access« can be selected
69via a jumper for variable system generation. The 7 interrupt
70request levels of the VMEbus are fully supported from the
71SYS68K1CPU-1 B/D. For multi-processing, each IRQ signal can be
72enabled/disabled via a jumper field.
73
74Additionally, the SYS68K1CPU-1 B/D supports the ACFAIL, SYSRESET,
75SYSFAIL and SYSCLK signal (16 MHz).
76
77
78    TODO:
79    - Finish 2 x ACIA6850, host and remote interface left, terminal works
80    - Finish 1 x 68230 Motorola, Parallel Interface / Timer
81      - Connect Port B to a Centronics printer interface
82    - Add 1 x Abort Switch
83    - Add configurable serial connector between ACIA:s and
84      - Real terminal emulator, ie rs232 "socket"
85      - Debug console
86    - Add VME bus driver
87
88****************************************************************************/
89
90#include "emu.h"
91#include "bus/rs232/rs232.h"
92#include "cpu/m68000/m68000.h"
93#include "machine/mm58167.h"
94#include "machine/68230pit.h"
95#include "machine/6850acia.h"
96#include "machine/clock.h"
97
98#define BAUDGEN_CLOCK XTAL_1_8432MHz
99/*
100 The baudrate on the Force68k CPU-1 to CPU-6 is generated by a
101 Motorola 14411 bitrate generator, the CPU-6 documents matches the circuits
102 that I could find on the CPU-1 board. Here how I calculated the clock for
103 the factory settings. No need to add selectors until terminal.c supports
104 configurable baudrates. Fortunality CPU-1 was shipped with 9600N8!
105
106 From the documents:
107
108  3 RS232C interfaces, strap selectable baud rate from 110-9600 or 600-19200 baud
109
110  Default Jumper Settings of B7:
111  --------------------------------
112  GND           10 - 11 RSA input on 14411
113  F1 on 14411    1 - 20 Baud selector of the terminal port
114  F1 on 14411    3 - 18 Baud selector of the host port
115  F1 on 14411    5 - 16 Baud selector of the remote port
116
117 The RSB input on the 14411 is kept high always so RSA=0, RSB=1 and a 1.8432MHz crystal
118 generates 153600 on the F1 output pin which by default strapping is connected to all
119 three 6850 acias on the board. These can be strapped separatelly to speedup downloads.
120 
121 The selectable outputs from 14411, F1-F16:
122 X16 RSA=0,RSB=1: 153600, 115200, 76800, 57600, 38400, 28800, 19200, 9600, 4800, 3200, 2153.3, 1758.8, 1200, 921600, 1843000
123 X64 RSA=1,RSB=1: 614400, 460800, 307200, 230400, 153600, 115200, 76800, 57600, 38400, 28800, 19200, 9600, 4800, 921600, 1843000
124
125 However, the datasheet says baudrate is strapable for 110-9600 but the output is 153600
126 so the system rom MUST setup the acia to divide by 16 to generate the correct baudrate.
127
128*/
129#define ACIA_CLOCK (BAUDGEN_CLOCK / 12)
130
131class force68k_state : public driver_device
132{
133public:
134   force68k_state(const machine_config &mconfig, device_type type, const char *tag) :
135      driver_device(mconfig, type, tag),
136        //      m_rtc(*this, "rtc")
137        m_maincpu(*this, "maincpu"),
138        m_rtc(*this, "rtc"),
139        m_pit(*this, "pit"),
140        m_aciahost(*this, "aciahost"),
141         m_aciaterm(*this, "aciaterm"),
142          m_aciaremt(*this, "aciaremt")
143   {
144   }
145
146   DECLARE_READ16_MEMBER(bootvect_r);
147   virtual void machine_start();
148   DECLARE_WRITE_LINE_MEMBER(write_aciahost_clock);
149   DECLARE_WRITE_LINE_MEMBER(write_aciaterm_clock);
150   DECLARE_WRITE_LINE_MEMBER(write_aciaremt_clock);
151
152private:
153   required_device<cpu_device> m_maincpu;
154   required_device<mm58167_device> m_rtc;
155   required_device<pit68230_device> m_pit;
156   required_device<acia6850_device> m_aciahost;
157   required_device<acia6850_device> m_aciaterm;
158   required_device<acia6850_device> m_aciaremt;
159
160   // Pointer to System ROMs needed by bootvect_r
161   UINT16  *m_sysrom;
162};
163
164static ADDRESS_MAP_START(force68k_mem, AS_PROGRAM, 16, force68k_state)
165        ADDRESS_MAP_UNMAP_HIGH
166        AM_RANGE(0x000000, 0x000007) AM_ROM AM_READ(bootvect_r) /* Vectors mapped from System EPROM */
167        AM_RANGE(0x000008, 0x01ffff) AM_RAM /* DRAM */
168        AM_RANGE(0x080000, 0x09ffff) AM_ROM /* System EPROM Area */
169//   AM_RANGE(0x0a0000, 0x0bffff) AM_ROM /* User EPROM Area   */
170   AM_RANGE(0x0c0040, 0x0c0041) AM_DEVREADWRITE8("aciahost", acia6850_device, status_r, control_w, 0x00ff)
171   AM_RANGE(0x0c0042, 0x0c0043) AM_DEVREADWRITE8("aciahost", acia6850_device, data_r, data_w, 0x00ff)
172   AM_RANGE(0x0c0080, 0x0c0081) AM_DEVREADWRITE8("aciaterm", acia6850_device, status_r, control_w, 0xff00)
173   AM_RANGE(0x0c0082, 0x0c0083) AM_DEVREADWRITE8("aciaterm", acia6850_device, data_r, data_w, 0xff00)
174   AM_RANGE(0x0c0100, 0x0c0101) AM_DEVREADWRITE8("aciaremt", acia6850_device, status_r, control_w, 0x00ff)
175   AM_RANGE(0x0c0102, 0x0c0103) AM_DEVREADWRITE8("aciaremt", acia6850_device, data_r, data_w, 0x00ff)
176        AM_RANGE(0x0c0400, 0x0c042f) AM_DEVREADWRITE8("rtc", mm58167_device, read, write, 0x00ff)
177        AM_RANGE(0x0e0000, 0x0e0035) AM_DEVREADWRITE8("pit", pit68230_device, data_r, data_w, 0x00ff)
178//      AM_RANGE(0x0e0200, 0x0e0380) AM_READWRITE(fpu_r, fpu_w) /* optional FPCP 68881 FPU interface */
179//      AM_RANGE(0x100000, 0xfeffff) /* VMEbus Rev B addresses (24 bits) */
180//      AM_RANGE(0xff0000, 0xffffff) /* VMEbus Rev B addresses (16 bits) */
181ADDRESS_MAP_END
182
183/* Input ports */
184static INPUT_PORTS_START( force68k )
185INPUT_PORTS_END
186
187void force68k_state::machine_start()
188{
189   m_sysrom = (UINT16*)(memregion("maincpu")->base() + 0x080000);
190}
191
192READ16_MEMBER(force68k_state::bootvect_r)
193{
194        return m_sysrom[offset];
195}
196
197WRITE_LINE_MEMBER(force68k_state::write_aciahost_clock)
198{
199        m_aciahost->write_txc(state);
200   m_aciahost->write_rxc(state);
201}
202
203WRITE_LINE_MEMBER(force68k_state::write_aciaterm_clock)
204{
205        m_aciaterm->write_txc(state);
206   m_aciaterm->write_rxc(state);
207}
208
209WRITE_LINE_MEMBER(force68k_state::write_aciaremt_clock)
210{
211        m_aciaremt->write_txc(state);
212   m_aciaremt->write_rxc(state);
213}
214
215static MACHINE_CONFIG_START( fccpu1, force68k_state )
216   /* basic machine hardware */
217   MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz / 2)
218   MCFG_CPU_PROGRAM_MAP(force68k_mem)
219
220        /* P3/Host Port config */
221   MCFG_DEVICE_ADD("aciahost", ACIA6850, 0)
222        MCFG_DEVICE_ADD("aciahost_clock", CLOCK, ACIA_CLOCK)
223   MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciahost_clock))
224
225        /* P4/Terminal Port config */
226   MCFG_DEVICE_ADD("aciaterm", ACIA6850, 0)
227
228   MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE("rs232trm", rs232_port_device, write_txd))
229   MCFG_ACIA6850_RTS_HANDLER(DEVWRITELINE("rs232trm", rs232_port_device, write_rts))
230
231   MCFG_RS232_PORT_ADD("rs232trm", default_rs232_devices, "terminal")
232   MCFG_RS232_RXD_HANDLER(DEVWRITELINE("aciaterm", acia6850_device, write_rxd))
233   MCFG_RS232_CTS_HANDLER(DEVWRITELINE("aciaterm", acia6850_device, write_cts))
234
235        MCFG_DEVICE_ADD("aciaterm_clock", CLOCK, ACIA_CLOCK)
236   MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciaterm_clock))
237
238        /* P5/Remote Port config */
239   MCFG_DEVICE_ADD("aciaremt", ACIA6850, 0)
240
241#define PRINTER 0
242#if PRINTER
243   MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE("rs232rmt", rs232_port_device, write_txd))
244   MCFG_ACIA6850_RTS_HANDLER(DEVWRITELINE("rs232rmt", rs232_port_device, write_rts))
245
246   MCFG_RS232_PORT_ADD("rs232rmt", default_rs232_devices, "printer")
247   MCFG_RS232_RXD_HANDLER(DEVWRITELINE("aciaremt", acia6850_device, write_rxd))
248   MCFG_RS232_CTS_HANDLER(DEVWRITELINE("aciaremt", acia6850_device, write_cts))
249#endif
250
251        MCFG_DEVICE_ADD("aciaremt_clock", CLOCK, ACIA_CLOCK)
252   MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciaterm_clock))
253
254   /* RTC Real Time Clock device */
255   MCFG_DEVICE_ADD("rtc", MM58167, XTAL_32_768kHz)
256
257   /* PIT Parallel Interface and Timer device, assuming strapped for on board clock */
258   MCFG_DEVICE_ADD("pit", PIT68230, XTAL_16MHz / 2)
259
260MACHINE_CONFIG_END
261
262#if 0
263
264static MACHINE_CONFIG_START( fccpu6, force68k_state )
265   MCFG_CPU_ADD("maincpu", M68000, XTAL_8MHz)  /* Jumper B10 Mode B */
266   MCFG_CPU_PROGRAM_MAP(force68k_mem)
267MACHINE_CONFIG_END
268
269static MACHINE_CONFIG_START( fccpu6a, force68k_state )
270   MCFG_CPU_ADD("maincpu", M68000, XTAL_12_5MHz) /* Jumper B10 Mode A */
271   MCFG_CPU_PROGRAM_MAP(force68k_mem)
272MACHINE_CONFIG_END
273
274static MACHINE_CONFIG_START( fccpu6v, force68k_state )
275   MCFG_CPU_ADD("maincpu", M68010, XTAL_8MHz)  /* Jumper B10 Mode B */
276   MCFG_CPU_PROGRAM_MAP(force68k_mem)
277MACHINE_CONFIG_END
278
279static MACHINE_CONFIG_START( fccpu6va, force68k_state )
280   MCFG_CPU_ADD("maincpu", M68010, XTAL_12_5MHz) /* Jumper B10 Mode A */
281   MCFG_CPU_PROGRAM_MAP(force68k_mem)
282MACHINE_CONFIG_END
283
284static MACHINE_CONFIG_START( fccpu6vb, force68k_state )
285   MCFG_CPU_ADD("maincpu", M68010, XTAL_12_5MHz) /* Jumper B10 Mode A */
286   MCFG_CPU_PROGRAM_MAP(force68k_mem)
287MACHINE_CONFIG_END
288#endif
289
290/* ROM definitions */
291ROM_START( fccpu1 )
292   ROM_REGION(0x1000000, "maincpu", 0)
293
294        ROM_LOAD16_BYTE( "fccpu1V1.0L.j8.bin", 0x080001, 0x2000, CRC(3ac6f08f) SHA1(502f6547b508d8732bd68bbbb2402d8c30fefc3b) )
295        ROM_LOAD16_BYTE( "fccpu1V1.0L.j9.bin", 0x080000, 0x2000, CRC(035315fb) SHA1(90dc44d9c25d28428233e6846da6edce2d69e440) )
296/* COMMAND SUMMARY DESCRIPTION (From CPU-1B datasheet, ROMs were dumped
297   from a CPU-1 board so some features might be missing or different)
298---------------------------------------------------------------------------
299   BF <address1> <address2> <data> <CR>        Block Fill memory - from addr1 through addr2 with data
300   BM <address1> <address2> <address 3> <CR>   Block Move  - move from addr1 through addr2to addr3
301   BR [<address> [; <count>] ... ] <CR>        Set/display Breakpoint
302   BS <address1> <address2> <data> <CR>        Block Search - search addr1 through addr2 for data
303   BT <address1> <address2> <CR>               Block Test of memory
304   DC <expression> <CR>                        Data Conversion
305   DF <CR>                                     Display Formatted registers
306   DU [n] <address1> <address2>[<string>] <CR> Dump memory to object file
307   GO [<address] <CR>                          Execute program
308   GD [<address] <CR>                          Go Direct
309   GT <address> <CR>                           Exec prog: temporary breakpoint
310   HE<CR>                                      Help; display monitor commands
311   LO [n] [;<options] <CR>                     Load Object file
312   MD <address> [<count» <CR>                  Memory Display
313   MM <address> [<data» [;<options» <CR>       Memory Modify
314   MS <address> <data1 > <data2> < ... <CR>    Memory Set - starting at addr with data 1. data 2 ...
315   NOBR [<address> ... ] <CR>                  Remove Breakpoint
316   NOPA <CR>                                   Printer Detach (Centronics on PIT/P2)
317   OF <CR>                                     Offset
318   PA <CR>                                     Printer Attach (Centronics on PIT/P2)
319   PF[n] <CR>                                  Set/display Port Format
320   RM <CR>                                     Register Modify
321   TM [<exit character» <CR>                   Transparent Mode
322   TR [<count] <CR>                            Trace
323   TT <address> <CR>                           Trace: temporary breakpoint
324   VE [n] [<string] <CR>                       Verify memory/object file
325----------------------------------------------------------------------------
326  .AO - .A7 [<expression] <CR>                 Display/set address register
327  .00 - .07 [<expression] <CR>                 Display/set data register
328  .RO - .R6 [<expression] <CR>                 Display/set offset register
329  .PC [<expression] <CR>                       Display/set program counter
330  .SR [<expression] <CR>                       Display/set status register
331  .SS [<expression] <CR>                       Display/set supervisor stack
332  .US [<expression] <CR>                       Display/set user stack
333----------------------------------------------------------------------------
334   MD <address> [<count>]; D1 <CR>             Disassemble memory location
335   MM <address>; DI <CR>                       Disassemble/Assemble memory location
336----------------------------------------------------------------------------
337*/
338ROM_END
339
340#if 0
341ROM_START( fccpu6 )
342   ROM_REGION(0x1000000, "maincpu", 0)
343ROM_END
344
345ROM_START( fccpu6a )
346   ROM_REGION(0x1000000, "maincpu", 0)
347ROM_END
348
349ROM_START( fccpu6v )
350   ROM_REGION(0x1000000, "maincpu", 0)
351ROM_END
352
353ROM_START( fccpu6va )
354   ROM_REGION(0x1000000, "maincpu", 0)
355ROM_END
356
357ROM_START( fccpu6vb )
358   ROM_REGION(0x1000000, "maincpu", 0)
359ROM_END
360#endif
361
362/* Driver */
363/*    YEAR  NAME          PARENT  COMPAT   MACHINE         INPUT     CLASS          INIT COMPANY                  FULLNAME          FLAGS */
364COMP( 1983, fccpu1,            0,      0,      fccpu1,      force68k, driver_device,  0,  "Force Computers Gmbh",  "SYS68K/CPU-1",   GAME_NO_SOUND_HW | GAME_TYPE_COMPUTER )
365//COMP( 1989, fccpu6,   0,      0,       fccpu6,      force68k, driver_device,  0,  "Force Computers Gmbh",  "SYS68K/CPU-6",   GAME_IS_SKELETON )
366//COMP( 1989, fccpu6a,  0,      0,       fccpu6a,     force68k, driver_device,  0,  "Force Computers Gmbh",  "SYS68K/CPU-6a",  GAME_IS_SKELETON )
367//COMP( 1989, fccpu6v,  0,      0,       fccpu6v,     force68k, driver_device,  0,  "Force Computers Gmbh",  "SYS68K/CPU-6v",  GAME_IS_SKELETON )
368//COMP( 1989, fccpu6va, 0,      0,       fccpu6va,    force68k, driver_device,  0,  "Force Computers Gmbh",  "SYS68K/CPU-6va", GAME_IS_SKELETON )
369//COMP( 1989, fccpu6vb, 0,      0,       fccpu6vb,    force68k, driver_device,  0,  "Force Computers Gmbh",  "SYS68K/CPU-6vb", GAME_IS_SKELETON )
trunk/src/mess/drivers/hh_hmcs40.c
r248389r248390
15801580{
15811581   // 2-player switch directly enables plate 14
15821582   m_plate = (m_plate & 0x3fff) | (newval ? 0 : 0x4000);
1583   prepare_display();
15841583}
15851584
15861585
trunk/src/mess/drivers/hh_tms1k.c
r248389r248390
4040  MP3403   TMS1100   1978, Marx Electronic Bowling -> elecbowl.c
4141 @MP3404   TMS1100   1978, Parker Brothers Merlin
4242 @MP3405   TMS1100   1979, Coleco Amaze-A-Tron
43 *MP3415   TMS1100   1978, Coleco Electronic Quarterback
4443 @MP3438A  TMS1100   1979, Kenner Star Wars Electronic Battle Command
4544  MP3450A  TMS1100   1979, MicroVision cartridge: Blockbuster
4645  MP3454   TMS1100   1979, MicroVision cartridge: Star Trek Phaser Strike
trunk/src/mess/drivers/hh_ucom4.c
r248389r248390
4747 *060     uPD650C  1979, Mattel Computer Gin
4848 *085     uPD650C  1980, Roland TR-808
4949 *127     uPD650C  198?, Sony OA-S1100 Typecorder (subcpu, have dump)
50 *128     uPD650C  1981, Roland TR-606
50 *128     uPD650C  1982, Roland TR-606
5151  133     uPD650C  1982, Roland TB-303 -> tb303.c
5252
5353  (* denotes not yet emulated by MESS, @ denotes it's in this driver)
5454
5555***************************************************************************/
5656
57#include "includes/hh_ucom4.h"
57#include "emu.h"
58#include "cpu/ucom4/ucom4.h"
59#include "sound/speaker.h"
5860
5961// internal artwork
6062#include "efball.lh"
r248389r248390
6365#include "hh_ucom4_test.lh" // common test-layout - use external artwork
6466
6567
68class hh_ucom4_state : public driver_device
69{
70public:
71   hh_ucom4_state(const machine_config &mconfig, device_type type, const char *tag)
72      : driver_device(mconfig, type, tag),
73      m_maincpu(*this, "maincpu"),
74      m_inp_matrix(*this, "IN"),
75      m_speaker(*this, "speaker"),
76      m_display_wait(33),
77      m_display_maxy(1),
78      m_display_maxx(0)
79   { }
80
81   // devices
82   required_device<cpu_device> m_maincpu;
83   optional_ioport_array<5> m_inp_matrix; // max 5
84   optional_device<speaker_sound_device> m_speaker;
85
86   // misc common
87   UINT8 m_port[9];                    // MCU port A-I write data (optional)
88   UINT16 m_inp_mux;                   // multiplexed inputs mask
89
90   UINT8 read_inputs(int columns);
91
92   // display common
93   int m_display_wait;                 // led/lamp off-delay in microseconds (default 33ms)
94   int m_display_maxy;                 // display matrix number of rows
95   int m_display_maxx;                 // display matrix number of columns (max 31 for now)
96
97   UINT32 m_grid;                      // VFD current row data
98   UINT32 m_plate;                     // VFD current column data
99
100   UINT32 m_display_state[0x20];       // display matrix rows data (last bit is used for always-on)
101   UINT16 m_display_segmask[0x20];     // if not 0, display matrix row is a digit, mask indicates connected segments
102   UINT32 m_display_cache[0x20];       // (internal use)
103   UINT8 m_display_decay[0x20][0x20];  // (internal use)
104
105   TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
106   void display_update();
107   void set_display_size(int maxx, int maxy);
108   void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety);
109
110protected:
111   virtual void machine_start();
112   virtual void machine_reset();
113};
114
115
66116// machine start/reset
67117
68118void hh_ucom4_state::machine_start()
trunk/src/mess/drivers/monty.c
r248389r248390
1919    by adding chips and wires to the inside of the game.
2020
2121    TODO:
22    - Need instructions
22    - Input from the keyboard
2323    - Proper SED1503F emulation (it's simulated in-driver for now)
24    - After each keypress it hits a HALT instruction. I guess the controller's
25      sync pin is involved somehow.
26    - When it wants tiles, put 64 into FD1B (monty), 7D1B (mmonty) and press
27      Enter.
2824
2925****************************************************************************/
3026
3127#include "emu.h"
3228#include "cpu/z80/z80.h"
3329#include "video/sed1520.h"
34#include "sound/speaker.h"
3530
3631
3732class monty_state : public driver_device
r248389r248390
4035   monty_state(const machine_config &mconfig, device_type type, const char *tag)
4136      : driver_device(mconfig, type, tag)
4237      , m_maincpu(*this, "maincpu")
43      , m_speaker(*this, "speaker")
4438      , m_sed0(*this, "sed1520_0")
4539      , m_writeUpper(false)
4640   {
r248389r248390
4842         m_pixels[i] = 0xff000000;
4943   }
5044
51   DECLARE_WRITE8_MEMBER(sound_w);
52   DECLARE_WRITE8_MEMBER(ioDisplayWrite_w);
53   DECLARE_WRITE8_MEMBER(ioCommandWrite0_w);
54   DECLARE_WRITE8_MEMBER(ioCommandWrite1_w);
45   DECLARE_READ8_MEMBER(ioInputRead);
5546
47   DECLARE_WRITE8_MEMBER(ioDisplayWrite);
48   DECLARE_WRITE8_MEMBER(ioCommandWrite0);
49   DECLARE_WRITE8_MEMBER(ioCommandWrite1);
50
5651   // screen updates
5752   UINT32 lcd_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect);
5853
5954private:
6055   required_device<cpu_device> m_maincpu;
61   required_device<speaker_sound_device> m_speaker;
6256   required_device<sed1520_device> m_sed0;     // TODO: This isn't actually a SED1520, it's a SED1503F
6357   //required_device<sed1520_device> m_sed1;   // TODO: Also, there are 2 SED1503Fs on the board - one is flipped upside down
6458
6559   // Test
6660   UINT8 m_writeUpper;
6761   UINT32 m_pixels[42*32];
68   bool m_sound_sw;
69   bool m_dirty;
7062};
7163
7264
73static ADDRESS_MAP_START( monty_mem, AS_PROGRAM, 8, monty_state )
74   AM_RANGE(0x0000, 0xbfff) AM_ROM
65static ADDRESS_MAP_START(monty_mem, AS_PROGRAM, 8, monty_state)
66   AM_RANGE(0x0000, 0x3fff) AM_ROM
7567   //AM_RANGE(0x4000, 0x4000) // The main rom checks to see if another program is here on startup
7668   AM_RANGE(0xf800, 0xffff) AM_RAM
7769ADDRESS_MAP_END
7870
79static ADDRESS_MAP_START( mmonty_mem, AS_PROGRAM, 8, monty_state )
80   AM_RANGE(0x0000, 0x3fff) AM_ROM
81   //AM_RANGE(0xc000, 0xc000) // The main rom checks to see if another program is here on startup
82   AM_RANGE(0x8000, 0xffff) AM_ROM
83   AM_RANGE(0x7800, 0x7fff) AM_RAM
84ADDRESS_MAP_END
8571
86
87static ADDRESS_MAP_START( monty_io, AS_IO, 8, monty_state )
72static ADDRESS_MAP_START(monty_io, AS_IO, 8, monty_state)
8873   ADDRESS_MAP_GLOBAL_MASK(0xff)
89   AM_RANGE(0x00, 0x00) AM_WRITE(ioCommandWrite0_w)
90   AM_RANGE(0x01, 0x01) AM_WRITE(sound_w)
91   AM_RANGE(0x02, 0x02) AM_WRITE(ioCommandWrite1_w)
92   AM_RANGE(0x80, 0xff) AM_WRITE(ioDisplayWrite_w)
74   AM_RANGE(0x00, 0x00) AM_WRITE(ioCommandWrite0)
75   AM_RANGE(0x02, 0x02) AM_WRITE(ioCommandWrite1)
76   AM_RANGE(0x80, 0xff) AM_WRITE(ioDisplayWrite)
9377
9478   // 7 reads from a bit shifted IO port
95   AM_RANGE(0x01, 0x01) AM_READ_PORT("X1")
96   AM_RANGE(0x02, 0x02) AM_READ_PORT("X2")
97   AM_RANGE(0x04, 0x04) AM_READ_PORT("X3")
98   AM_RANGE(0x08, 0x08) AM_READ_PORT("X4")
99   AM_RANGE(0x10, 0x10) AM_READ_PORT("X5")
100   AM_RANGE(0x20, 0x20) AM_READ_PORT("X6")
101   AM_RANGE(0x40, 0x40) AM_READ_PORT("X7")
79   AM_RANGE(0x01, 0x01) AM_READ(ioInputRead)
80   AM_RANGE(0x02, 0x02) AM_READ(ioInputRead)
81   AM_RANGE(0x04, 0x04) AM_READ(ioInputRead)
82   AM_RANGE(0x08, 0x08) AM_READ(ioInputRead)
83   AM_RANGE(0x10, 0x10) AM_READ(ioInputRead)
84   AM_RANGE(0x20, 0x20) AM_READ(ioInputRead)
85   AM_RANGE(0x40, 0x40) AM_READ(ioInputRead)
10286ADDRESS_MAP_END
10387
10488
10589// Input ports
10690static INPUT_PORTS_START( monty )
107   PORT_START("X1")
108   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
109   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Left") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8)
110   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
111   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("-") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-')
112   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z')
113   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
114
115   PORT_START("X2")
116   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
117   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('X')
118   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_CHAR('W')
119   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("V") PORT_CODE(KEYCODE_V) PORT_CHAR('V')
120   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("U") PORT_CODE(KEYCODE_U) PORT_CHAR('U')
121   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
122
123   PORT_START("X3")
124   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("T") PORT_CODE(KEYCODE_T) PORT_CHAR('T')
125   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('S')
126   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("R") PORT_CODE(KEYCODE_R) PORT_CHAR('R')
127   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
128   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("P") PORT_CODE(KEYCODE_P) PORT_CHAR('P')
129   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
130
131   PORT_START("X4")
132   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("O") PORT_CODE(KEYCODE_O) PORT_CHAR('O')
133   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("N") PORT_CODE(KEYCODE_N) PORT_CHAR('N')
134   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("M") PORT_CODE(KEYCODE_M) PORT_CHAR('M')
135   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('L')
136   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_CHAR('K')
137   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
138
139   PORT_START("X5")
140   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("J") PORT_CODE(KEYCODE_J) PORT_CHAR('J')
141   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("I") PORT_CODE(KEYCODE_I) PORT_CHAR('I')
142   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("H") PORT_CODE(KEYCODE_H) PORT_CHAR('H')
143   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CHAR('G')
144   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F')
145   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
146
147   PORT_START("X6")
148   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E')
149   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D')
150   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C')
151   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B')
152   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A')
153   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
154
155   PORT_START("X7")
156   PORT_BIT( 0xFF, IP_ACTIVE_LOW, IPT_UNUSED )
15791INPUT_PORTS_END
15892
15993
160WRITE8_MEMBER( monty_state::sound_w )
94READ8_MEMBER( monty_state::ioInputRead )
16195{
162   m_sound_sw ^= 1;
163   m_speaker->level_w(m_sound_sw);
96   //UINT8 foo; // = machine().rand() & 0xff;
97   //if (m_maincpu->pc() == 0x135f)
98   //    foo = 0x14;
99   //if (m_maincpu->pc() == 0x1371)
100   //    foo = 0x1f;
101
102   UINT8 foo = (machine().rand() & 0xff) | 0x14;
103
104   //printf("(%04x) %02x %02x\n", m_maincpu->pc(), foo, (foo & 0x14));
105   return foo;
164106}
165107
166108
167WRITE8_MEMBER( monty_state::ioCommandWrite0_w )
109WRITE8_MEMBER( monty_state::ioCommandWrite0 )
168110{
169111   //printf("(%04x) Command Port 0 write : %02x\n", m_maincpu->pc(), data);
170112   m_writeUpper = false;
171113}
172114
173115
174WRITE8_MEMBER( monty_state::ioCommandWrite1_w )
116WRITE8_MEMBER( monty_state::ioCommandWrite1 )
175117{
176118   //if (data == 0xfe)
177119   //    printf("---\n");
r248389r248390
181123}
182124
183125
184WRITE8_MEMBER( monty_state::ioDisplayWrite_w )
126WRITE8_MEMBER( monty_state::ioDisplayWrite )
185127{
186   m_dirty = true;
187128   // Offset directly corresponds to sed1503, DD RAM address (offset 0x7f may be special?)
188129   //printf("(%04x) %02x %02x\n", m_maincpu->pc(), offset, data);
189130
190   UINT8 x = offset & 0x3f;
191   UINT8 y = (BIT(offset, 6) + (m_writeUpper ? 2 : 0)) << 3;
131   const UINT8 localUpper = (offset & 0x40) >> 6;
132   const UINT8 seg = offset & 0x3f;
133   const UINT8 com = data;
192134
193135   // Skip the controller and write straight to the LCD    (pc=134f)
194136   for (int i = 0; i < 8; i++)
195137   {
138      // Pixel location
139      const int upperSedOffset = m_writeUpper ? 8*2 : 0;
140
141      const size_t x = seg;
142      const size_t y = i + (localUpper*8) + upperSedOffset;
143
196144      // Pixel color
145      const bool on = (com >> i) & 0x01;
197146      if (x < 42)
198         m_pixels[(y*42) + x] = BIT(data, i) ? 0xffffffff : 0xff000000;
199
200      y++;
147         m_pixels[(y*42) + x] = on ? 0xffffffff : 0xff000000;
201148   }
202149}
203150
204151
205152UINT32 monty_state::lcd_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect)
206153{
207   if (!m_dirty)
208      return 1;
209
210   UINT8 x,y,z;
211   m_dirty = false;
212   for (y = 0; y < 32; y++)
154   for (int y = 0; y < 32; y++)
213155   {
214      for (z = 0; z < 8; z++)
156      for (int x = 0; x < 42; x++)
215157      {
216         for (x = 0; x < 5; x++)
217         {
218            bitmap.pix32(y, x+z*6) = m_pixels[y*42 + z*5 + x];
219         }
220         bitmap.pix32(y, 5+z*6) = 0; // space between letters
158         bitmap.pix32(y, x) = m_pixels[(y*42) + x];
221159      }
222      bitmap.pix32(y, 48) = m_pixels[y*42 + 40];
223      bitmap.pix32(y, 49) = m_pixels[y*42 + 41];
224160   }
225161
226   return 0;
162   return 0x00;
227163}
228164
229165
r248389r248390
245181   MCFG_SCREEN_ADD("screen", LCD)
246182   MCFG_SCREEN_REFRESH_RATE(50)
247183   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // Not accurate
248   MCFG_SCREEN_SIZE(50, 32)    // Two SED1503s (42x16 pixels) control the top and bottom halves
249   MCFG_SCREEN_VISIBLE_AREA(0, 50-1, 0, 32-1)
184   MCFG_SCREEN_SIZE(42, 32)    // Two SED1503s (42x16 pixels) control the top and bottom halves
185   MCFG_SCREEN_VISIBLE_AREA(0, 42-1, 0, 32-1)
250186   MCFG_SCREEN_UPDATE_DRIVER(monty_state, lcd_update)
251187
252   /* sound hardware */
253   MCFG_SPEAKER_STANDARD_MONO("mono")
254   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
255   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
256
257188   // LCD controller interfaces
258189   MCFG_SED1520_ADD("sed1520_0", monty_screen_update)
259190MACHINE_CONFIG_END
260191
261static MACHINE_CONFIG_DERIVED( mmonty, monty )
262   MCFG_CPU_MODIFY( "maincpu" )
263   MCFG_CPU_PROGRAM_MAP(mmonty_mem)
264MACHINE_CONFIG_END
265192
266
267193// ROM definitions
268194ROM_START( monty )
269195   ROM_REGION(0xc000, "maincpu", 0)
270196   ROM_LOAD( "monty_main.bin",    0x0000, 0x4000, CRC(720b4f55) SHA1(0106eb88d3fbbf25a745b9b6ee785ba13689d095) )   // 27128
271197   ROM_LOAD( "monty_module1.bin", 0x4000, 0x4000, CRC(2725d8c3) SHA1(8273b9779c0915f9c7c43ea4fb460f43ce036358) )   // 27128
272198   ROM_LOAD( "monty_module2.bin", 0x8000, 0x4000, CRC(db672e47) SHA1(bb14fe86df06cfa4b19625ba417d1a5bc8eae155) )   // 27128
273   ROM_FILL(0x1193,1,0) // patch out HALT so we can type in our names
274199ROM_END
275200
276201ROM_START( mmonty )
r248389r248390
278203   ROM_LOAD( "master_monty_main.bin", 0x0000, 0x8000, CRC(bb5ef4d4) SHA1(ba2c759e429f8740df419f9abb60832eddfba8ab) )   // 27C256
279204   ROM_LOAD( "monty_module1.bin",     0x8000, 0x4000, CRC(2725d8c3) SHA1(8273b9779c0915f9c7c43ea4fb460f43ce036358) )   // 27128
280205   ROM_LOAD( "monty_module2.bin",     0xc000, 0x4000, CRC(db672e47) SHA1(bb14fe86df06cfa4b19625ba417d1a5bc8eae155) )   // 27128
281   ROM_FILL(0x1487,1,0) // patch out HALT so we can type in our names
282206ROM_END
283207
284208
285209// Drivers
286210//    YEAR  NAME     PARENT  COMPAT   MACHINE    INPUT   STATE           INIT  COMPANY   FULLNAME                 FLAGS
287COMP( 1980, monty,   0,      0,       monty,     monty,  driver_device,  0,    "Ritam",  "Monty Plays Scrabble",  GAME_NOT_WORKING )
288COMP( 1982, mmonty,  0,      0,       mmonty,    monty,  driver_device,  0,    "Ritam",  "Master Monty",          GAME_NOT_WORKING )
211COMP( 1980, monty,   0,      0,       monty,     monty,  driver_device,  0,    "Ritam",  "Monty Plays Scrabble",  GAME_IS_SKELETON )
212COMP( 1980, mmonty,  0,      0,       monty,     monty,  driver_device,  0,    "Ritam",  "Master Monty",          GAME_IS_SKELETON )
trunk/src/mess/drivers/msx.c
r248389r248390
2323**
2424** Todo/known issues:
2525** - piopx7/piopx7uk/piopxv60: Laserdisc integration doesn't exist
26** - piopx7: Is this a pal or an ntsc machine?
2726** - spc800: Haven't been able to test operation of the han rom yet
2827** - svi728: Expansion slot not emulated
2928** - svi738: v9938 not emulated
r248389r248390
8079** - cpg120: Remove ports
8180** - cpg120: Add V9958
8281**
83** TODO:
84** - Add T6950 support. T6950 is selectable between pal and ntsc by a pin.
85**
86** Possibly missing machines:
87** - Sanyo MPC-1 (T6950)
88** - Toshibo HX-51i (T7937)
89** - Sony HB-101 (TMS9118)
9082************************************************************************
9183
9284This following list is probably incomplete. Corrections are welcome.
r248389r248390
635627   PORT_DIPNAME( 0x40, 0, "Swap game port 1 and 2")
636628   PORT_DIPSETTING( 0, DEF_STR( No ) )
637629   PORT_DIPSETTING( 0x40, DEF_STR( Yes ) )
630   PORT_DIPNAME ( 0x03, 0, "Render resolution")
631   PORT_DIPSETTING( 0, DEF_STR( High ))
632   PORT_DIPSETTING( 1, DEF_STR( Low ))
633   PORT_DIPSETTING( 2, "Auto" )
638634
639635   PORT_START("MOUSE0")
640636   PORT_BIT( 0xff00, 0x00, IPT_TRACKBALL_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1)
r248389r248390
13991395MACHINE_CONFIG_END
14001396
14011397
1402static MACHINE_CONFIG_DERIVED( msx_tms9118, msx )
1403   /* Video hardware */
1404   MCFG_DEVICE_ADD( "tms9928a", TMS9118, XTAL_10_738635MHz / 2 )
1405   MCFG_TMS9928A_VRAM_SIZE(0x4000)
1406   MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(msx_state,msx_irq_source0))
1407   MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" )
1408   MCFG_SCREEN_UPDATE_DEVICE("tms9928a", tms9928a_device, screen_update)
1409MACHINE_CONFIG_END
1410
1411
1412static MACHINE_CONFIG_DERIVED( msx_tms9128, msx )
1413   /* Video hardware */
1414   MCFG_DEVICE_ADD( "tms9928a", TMS9128, XTAL_10_738635MHz / 2 )
1415   MCFG_TMS9928A_VRAM_SIZE(0x4000)
1416   MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(msx_state,msx_irq_source0))
1417   MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" )
1418   MCFG_SCREEN_UPDATE_DEVICE("tms9928a", tms9928a_device, screen_update)
1419MACHINE_CONFIG_END
1420
1421
1422static MACHINE_CONFIG_DERIVED( msx_tms9918, msx )
1423   /* Video hardware */
1424   MCFG_DEVICE_ADD( "tms9928a", TMS9918, XTAL_10_738635MHz / 2 )
1425   MCFG_TMS9928A_VRAM_SIZE(0x4000)
1426   MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(msx_state,msx_irq_source0))
1427   MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" )
1428   MCFG_SCREEN_UPDATE_DEVICE("tms9928a", tms9928a_device, screen_update)
1429MACHINE_CONFIG_END
1430
1431
1432static MACHINE_CONFIG_DERIVED( msx_tms9918a, msx )
1433   /* Video hardware */
1434   MCFG_DEVICE_ADD( "tms9928a", TMS9918A, XTAL_10_738635MHz / 2 )
1435   MCFG_TMS9928A_VRAM_SIZE(0x4000)
1436   MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(msx_state,msx_irq_source0))
1437   MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" )
1438   MCFG_SCREEN_UPDATE_DEVICE("tms9928a", tms9928a_device, screen_update)
1439MACHINE_CONFIG_END
1440
1441
1442static MACHINE_CONFIG_DERIVED( msx_tms9928, msx )
1443   /* Video hardware */
1444   MCFG_DEVICE_ADD( "tms9928a", TMS9928A, XTAL_10_738635MHz / 2 )
1445   MCFG_TMS9928A_VRAM_SIZE(0x4000)
1446   MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(msx_state,msx_irq_source0))
1447   MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" )
1448   MCFG_SCREEN_UPDATE_DEVICE("tms9928a", tms9928a_device, screen_update)
1449MACHINE_CONFIG_END
1450
1451
14521398static MACHINE_CONFIG_DERIVED( msx_pal, msx )
14531399   /* Video hardware */
14541400   MCFG_DEVICE_ADD( "tms9928a", TMS9929A, XTAL_10_738635MHz / 2 )
r248389r248390
14591405MACHINE_CONFIG_END
14601406
14611407
1462static MACHINE_CONFIG_DERIVED( msx_tms9129, msx )
1463   /* Video hardware */
1464   MCFG_DEVICE_ADD( "tms9928a", TMS9129, XTAL_10_738635MHz / 2 )
1465   MCFG_TMS9928A_VRAM_SIZE(0x4000)
1466   MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(msx_state,msx_irq_source0))
1467   MCFG_TMS9928A_SCREEN_ADD_PAL( "screen" )
1468   MCFG_SCREEN_UPDATE_DEVICE("tms9928a", tms9928a_device, screen_update)
1469MACHINE_CONFIG_END
1470
1471
1472static MACHINE_CONFIG_DERIVED( msx_tms9929, msx )
1473   /* Video hardware */
1474   MCFG_DEVICE_ADD( "tms9928a", TMS9929A, XTAL_10_738635MHz / 2 )
1475   MCFG_TMS9928A_VRAM_SIZE(0x4000)
1476   MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(msx_state,msx_irq_source0))
1477   MCFG_TMS9928A_SCREEN_ADD_PAL( "screen" )
1478   MCFG_SCREEN_UPDATE_DEVICE("tms9928a", tms9928a_device, screen_update)
1479MACHINE_CONFIG_END
1480
1481
14821408#define MSX2_XBORDER_PIXELS     16
14831409#define MSX2_YBORDER_PIXELS     28
14841410#define MSX2_TOTAL_XRES_PIXELS      256 * 2 + (MSX2_XBORDER_PIXELS * 2)
r248389r248390
16661592   // AY8910/YM2149?
16671593   // FDC: None, 0 drives
16681594   // 2 Cartridge slots
1669   // T7937 (in ax170mk2)
16701595
16711596   MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
16721597   MCFG_MSX_LAYOUT_ROM("arab", 1, 0, 1, 2, "maincpu", 0x8000)
r248389r248390
17251650   ROM_LOAD ("v20bios.rom", 0x0000, 0x8000, CRC(e9ccd789) SHA1(8963fc041975f31dc2ab1019cfdd4967999de53e))
17261651ROM_END
17271652
1728static MACHINE_CONFIG_DERIVED( canonv20, msx_tms9929 )
1653static MACHINE_CONFIG_DERIVED( canonv20, msx_pal )
17291654   // YM2149
17301655   // FDC: None, 0 drives
17311656   // 2 Cartridge slots
r248389r248390
17731698   ROM_LOAD( "mx10bios.rom", 0x0000, 0x8000, CRC(ee229390) SHA1(302afb5d8be26c758309ca3df611ae69cced2821))
17741699ROM_END
17751700
1776static MACHINE_CONFIG_DERIVED( mx10, msx_tms9118 )
1701static MACHINE_CONFIG_DERIVED( mx10, msx_ntsc )
17771702   // FDC: None, 0 drives
17781703   // 2? Cartridge slots
1779   // Z80: uPD780C-1
17801704
17811705   MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
17821706   MCFG_MSX_LAYOUT_RAM("ram", 0, 0, 3, 1) // 16KB RAM
r248389r248390
17961720static MACHINE_CONFIG_DERIVED( mx15, msx_ntsc )
17971721   // FDC: None, 0 drives
17981722   // 3 Cartridge slots
1799   // T6950
18001723
18011724   MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
18021725   MCFG_MSX_LAYOUT_RAM("ram", 0, 0, 3, 1) // 16KB RAM
r248389r248390
18331756   ROM_LOAD("pv7bios.rom", 0x0000, 0x8000, CRC(ee229390) SHA1(302afb5d8be26c758309ca3df611ae69cced2821))
18341757ROM_END
18351758
1836static MACHINE_CONFIG_DERIVED( pv7, msx_tms9118 )
1759static MACHINE_CONFIG_DERIVED( pv7, msx_ntsc )
18371760   // AY8910?
18381761   // FDC: None, 0 drives
18391762   // 1 Cartridge slot + expansion slot, or 2 cartridge slots?
18401763   // By adding a Casio KB-7 2 additional cartridge slots become available and 8KB extra RAM?
18411764   // No cassette port
18421765   // No printer port
1843   // Z80: uPD780C-1
18441766
18451767   MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
18461768   MCFG_MSX_LAYOUT_RAM("ram", 0, 0, 3, 1)   /* 8KB RAM */
r248389r248390
18581780   ROM_LOAD("pv16.rom", 0x0000, 0x8000, CRC(ee229390) SHA1(302afb5d8be26c758309ca3df611ae69cced2821))
18591781ROM_END
18601782
1861static MACHINE_CONFIG_DERIVED( pv16, msx_tms9118 )
1783static MACHINE_CONFIG_DERIVED( pv16, msx_ntsc )
18621784   // AY8910
18631785   // FDC: None, 0 drives
18641786   // 1 Cartridge slot
r248389r248390
19461868   ROM_LOAD ("200han.rom",  0x8000, 0x4000, CRC(97478efb) SHA1(4421fa2504cbce18f7c84b5ea97f04e017007f07))
19471869ROM_END
19481870
1949static MACHINE_CONFIG_DERIVED( dpc200, msx_tms9918 )
1871static MACHINE_CONFIG_DERIVED( dpc200, msx_ntsc )
19501872   // AY8910/YM2149?
19511873   // FDC: None, 0 drives
19521874   // 2 Cartridge slots
r248389r248390
19871909   ROM_LOAD ("50abios.rom", 0x0000, 0x8000, CRC(c3a868ef) SHA1(a08a940aa87313509e00bc5ac7494d53d8e03492))
19881910ROM_END
19891911
1990static MACHINE_CONFIG_DERIVED( cpc50a, msx_tms9918 )
1912static MACHINE_CONFIG_DERIVED( cpc50a, msx_ntsc )
19911913   // AY8910/YM2149?
19921914   // FDC: None, 0 drives
19931915   // 1? Cartridge slot
r248389r248390
20101932   ROM_LOAD ("50bbios.rom", 0x0000, 0x8000, CRC(c3a868ef) SHA1(a08a940aa87313509e00bc5ac7494d53d8e03492))
20111933ROM_END
20121934
2013static MACHINE_CONFIG_DERIVED( cpc50b, msx_tms9118 )
1935static MACHINE_CONFIG_DERIVED( cpc50b, msx_ntsc )
20141936   // AY8910/YM2149?
20151937   // FDC: None, 0 drives
20161938   // 1? Cartridge slot
r248389r248390
20321954   ROM_LOAD ("51bios.rom", 0x0000, 0x8000, CRC(c3a868ef) SHA1(a08a940aa87313509e00bc5ac7494d53d8e03492))
20331955ROM_END
20341956
2035static MACHINE_CONFIG_DERIVED( cpc51, msx_tms9118 )
1957static MACHINE_CONFIG_DERIVED( cpc51, msx_ntsc )
20361958   // AY8910/YM2149?
20371959   // FDC: None, 0 drives
20381960   // 1 Cartridge slot
r248389r248390
20942016   ROM_LOAD ("spc800bios.rom", 0x0000, 0x8000, CRC(8205795e) SHA1(829c00c3114f25b3dae5157c0a238b52a3ac37db))
20952017ROM_END
20962018
2097static MACHINE_CONFIG_DERIVED( fspc800, msx_tms9929 )
2019static MACHINE_CONFIG_DERIVED( fspc800, msx_pal )
20982020   // AY8910?
20992021   // FDC: None, 0 drives
21002022   // 2 Cartridge slots
2101   // Z80: GSS Z8400APS
21022023
21032024   MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
21042025   MCFG_MSX_LAYOUT_RAM("ram", 1, 0, 0, 4)  /* 64KB RAM */
r248389r248390
21802101   ROM_LOAD ("fc200bios.rom.u5b", 0x4000, 0x4000, CRC(1a99b1a1) SHA1(e18f72271b64693a2a2bc226e1b9ebd0448e07c0))
21812102ROM_END
21822103
2183static MACHINE_CONFIG_DERIVED( gsfc200, msx_tms9129 )
2104static MACHINE_CONFIG_DERIVED( gsfc200, msx_pal )
21842105   // AY8910/YM2149?
21852106   // FDC: None, 0 drives
21862107   // 2 Cartridge slots
r248389r248390
22442165   ROM_LOAD ("expbios.rom", 0x0000, 0x8000, CRC(07610d77) SHA1(ef3e010eb57e4476700a3bbff9d2119ab3acdf62))
22452166ROM_END
22462167
2247static MACHINE_CONFIG_DERIVED( expert10, msx_tms9128 )
2168static MACHINE_CONFIG_DERIVED( expert10, msx_ntsc )
22482169   // AY8910/YM2149?
22492170   // FDC: None, 0 drives
22502171   // 2 Cartridge slots
r248389r248390
22632184   ROM_LOAD ("expbios11.rom", 0x0000, 0x8000, CRC(efb4b972) SHA1(d6720845928ee848cfa88a86accb067397685f02))
22642185ROM_END
22652186
2266static MACHINE_CONFIG_DERIVED( expert11, msx_tms9128 )
2187static MACHINE_CONFIG_DERIVED( expert11, msx_ntsc )
22672188   // AY8910/YM2149?
22682189   // FDC: None, 0 drives
22692190   // 2 Cartridge slots
r248389r248390
23062227   // AY8910/YM2149?
23072228   // FDC: mb8877a, 1 3.5" DSDD drive
23082229   // 2 Cartridge slots
2309   // MSX Engine T7937A (also VDP)
2230   // MSX Engine T7937A
23102231
23112232   MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
23122233   MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0)
r248389r248390
23982319   // AY8910/YM2149?
23992320   // FDC: None, 0 drives
24002321   // 2 Cartridge slots
2401   // T6950
24022322
24032323   MCFG_MSX_LAYOUT_ROM("rom", 0, 0, 0, 2, "maincpu", 0x0000)
24042324   MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0)
r248389r248390
25372457   ROM_LOAD ("1200bios.rom", 0x0000, 0x8000, CRC(5ad03407) SHA1(c7a2c5baee6a9f0e1c6ee7d76944c0ab1886796c))
25382458ROM_END
25392459
2540static MACHINE_CONFIG_DERIVED( cf1200, msx_tms9918a )
2460static MACHINE_CONFIG_DERIVED( cf1200, msx_ntsc )
25412461   // AY8910
25422462   // FDC: None, 0 drives
25432463   // 2 Cartridge slots
r248389r248390
26662586   ROM_LOAD ("4000kfn.rom", 0, 0x20000, CRC(956dc96d) SHA1(9ed3ab6d893632b9246e91b412cd5db519e7586b))
26672587ROM_END
26682588
2669static MACHINE_CONFIG_DERIVED( fs4000, msx_tms9128 )
2589static MACHINE_CONFIG_DERIVED( fs4000, msx_ntsc )
26702590   // AY8910/YM2149?
26712591   // FDC: None, 0 drives
26722592   // 2 Cartridge slots
r248389r248390
26932613   ROM_LOAD ("4000kfn.rom", 0, 0x20000, CRC(956dc96d) SHA1(9ed3ab6d893632b9246e91b412cd5db519e7586b))
26942614ROM_END
26952615
2696static MACHINE_CONFIG_DERIVED( fs4000a, msx_tms9128 )
2616static MACHINE_CONFIG_DERIVED( fs4000a, msx_ntsc )
26972617   // AY8910/YM2149?
26982618   // FDC: None, 0 drives
26992619   // 2 Cartridge slots
r248389r248390
27552675   ROM_LOAD ("cf2700g.rom", 0x0000, 0x8000, CRC(4aa194f4) SHA1(69bf27b610e11437dad1f7a1c37a63179a293d12))
27562676ROM_END
27572677
2758static MACHINE_CONFIG_DERIVED( cf2700g, msx_tms9929 )
2678static MACHINE_CONFIG_DERIVED( cf2700g, msx_pal )
27592679   // AY8910
27602680   // FDC: None, 0 drives
27612681   // 2 Cartridge slots
r248389r248390
28142734   ROM_LOAD ("8000bios.rom", 0x0000, 0x8000, CRC(efd970b0) SHA1(42252cf87deeb58181a7bfec7c874190a1351779))
28152735ROM_END
28162736
2817static MACHINE_CONFIG_DERIVED( vg8000, msx_tms9129 )
2737static MACHINE_CONFIG_DERIVED( vg8000, msx_pal )
28182738   // AY8910
28192739   // FDC: None, 0 drives
28202740   // 2 Cartridge slots
r248389r248390
28352755   ROM_LOAD ("8010bios.rom", 0x0000, 0x8000, CRC(efd970b0) SHA1(42252cf87deeb58181a7bfec7c874190a1351779))
28362756ROM_END
28372757
2838static MACHINE_CONFIG_DERIVED( vg8010, msx_tms9129 )
2758static MACHINE_CONFIG_DERIVED( vg8010, msx_pal )
28392759   // AY8910
28402760   // FDC: None, 0 drives
28412761   // 2 Cartridge slots
r248389r248390
28562776   ROM_LOAD ("8010fbios.rom", 0x0000, 0x8000, CRC(df57c9ca) SHA1(898630ad1497dc9a329580c682ee55c4bcb9c30c))
28572777ROM_END
28582778
2859static MACHINE_CONFIG_DERIVED( vg8010f, msx_tms9129 )
2779static MACHINE_CONFIG_DERIVED( vg8010f, msx_pal )
28602780   // AY8910/YM2149?
28612781   // FDC: None, 0 drives
28622782   // 2 Cartridge slots
r248389r248390
28772797   ROM_LOAD ("8020-00bios.rom", 0x0000, 0x8000, CRC(8205795e) SHA1(829c00c3114f25b3dae5157c0a238b52a3ac37db))
28782798ROM_END
28792799
2880static MACHINE_CONFIG_DERIVED( vg802000, msx_tms9929 )
2800static MACHINE_CONFIG_DERIVED( vg802000, msx_pal )
28812801   // YM2149
28822802   // FDC: None, 0 drives
28832803   // 2 Cartridge slots
r248389r248390
28972817   ROM_LOAD ("8020-20bios.rom", 0x0000, 0x8000, CRC(a317e6b4) SHA1(e998f0c441f4f1800ef44e42cd1659150206cf79))
28982818ROM_END
28992819
2900static MACHINE_CONFIG_DERIVED( vg802020, msx_tms9129 )
2820static MACHINE_CONFIG_DERIVED( vg802020, msx_pal )
29012821   // YM2149 (in S-3527 MSX Engine)
29022822   // FDC: None, 0 drives
29032823   // 2 Cartridge slots
r248389r248390
29452865   // AY8910/YM2149?
29462866   // FDC: None, 0 drives
29472867   // 2 Cartridge slots
2948   // TMS9928 is this were an ntsc machine
29492868
29502869   MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
29512870   MCFG_MSX_LAYOUT_RAM("ram", 0, 0, 2, 2)   /* 32KB RAM */
r248389r248390
29662885   ROM_LOAD ("videoart.rom",    0xc000, 0x8000, CRC(0ba148dc) SHA1(b7b4e4cd40a856bb071976e6cf0f5e546fc86a78))
29672886ROM_END
29682887
2969static MACHINE_CONFIG_DERIVED( piopx7uk, msx_tms9129 )
2888static MACHINE_CONFIG_DERIVED( piopx7uk, msx_pal )
29702889   // AY8910/YM2149?
29712890   // FDC: None, 0 drives
29722891   // 2 Cartridge slots
r248389r248390
29892908   ROM_FILL( 0xa000, 0x2000, 0x6E )
29902909ROM_END
29912910
2992static MACHINE_CONFIG_DERIVED( piopxv60, msx_tms9128 )
2911static MACHINE_CONFIG_DERIVED( piopxv60, msx_ntsc )
29932912   // AY8910/YM2149?
29942913   // FDC: None, 0 drives
29952914   // 2 Cartridge slots
r248389r248390
30762995   // AY8910/YM2149?
30772996   // FDC: None, 0 drives
30782997   // 2? Cartridge slots
3079   // T6950
3080   // T7775 MSX Engine
30812998
30822999   MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
30833000   MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0)
r248389r248390
31143031   ROM_LOAD ("28lbios.rom", 0x0000, 0x8000, CRC(d2110d66) SHA1(d3af963e2529662eae63f04a2530454685a1989f))
31153032ROM_END
31163033
3117static MACHINE_CONFIG_DERIVED( phc28l, msx_tms9929 )
3034static MACHINE_CONFIG_DERIVED( phc28l, msx_pal )
31183035   // YM2149
31193036   // FDC: None, 0 drives
31203037   // 2 Cartridge slots
r248389r248390
31343051   ROM_LOAD ("28sbios.rom", 0x0000, 0x8000, CRC(e5cf6b3c) SHA1(b1cce60ef61c058f5e42ef7ac635018d1a431168))
31353052ROM_END
31363053
3137static MACHINE_CONFIG_DERIVED( phc28s, msx_tms9929 )
3054static MACHINE_CONFIG_DERIVED( phc28s, msx_pal )
31383055   // AY8910/YM2149?
31393056   // FDC: None, 0 drives
31403057   // 2 Cartridge slots?
r248389r248390
31743091   ROM_LOAD ("hotbit11.rom", 0x0000, 0x8000, CRC(b6942694) SHA1(663f8c512d04d213fa616b0db5eefe3774012a4b))
31753092ROM_END
31763093
3177static MACHINE_CONFIG_DERIVED( hotbit11, msx_tms9128 )
3094static MACHINE_CONFIG_DERIVED( hotbit11, msx_ntsc )
31783095   // AY8910/YM2149?
31793096   // FDC: None, 0 drives
31803097   // 2 Cartridge slots
r248389r248390
31943111   ROM_LOAD ("hotbit12.rom", 0x0000, 0x8000, CRC(f59a4a0c) SHA1(9425815446d468058705bae545ffa13646744a87))
31953112ROM_END
31963113
3197static MACHINE_CONFIG_DERIVED( hotbit12, msx_tms9128 )
3114static MACHINE_CONFIG_DERIVED( hotbit12, msx_ntsc )
31983115   // AY8910/YM2149?
31993116   // FDC: None, 0 drives
32003117   // 2 Cartridge slots
r248389r248390
32813198   // AY8910/YM2149?
32823199   // FDC: None, 0 drives
32833200   // 2 Cartridge slots
3284   // T6950
32853201
32863202   MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
32873203   MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0)
r248389r248390
33023218   // AY8910/YM2149?
33033219   // FDC: None, 0 drives
33043220   // 2 Cartridge slots
3305   // T6950
33063221
33073222   MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
33083223   MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0)
r248389r248390
34753390   ROM_LOAD ("75pnote.ic44", 0x8000, 0x4000, CRC(492b12f8) SHA1(b262aedc71b445303f84efe5e865cbb71fd7d952))
34763391ROM_END
34773392
3478static MACHINE_CONFIG_DERIVED( hb75p, msx_tms9929 )
3393static MACHINE_CONFIG_DERIVED( hb75p, msx_pal )
34793394   // AY8910
34803395   // FDC: None, 0 drives
34813396   // 2 Cartridge slots?
r248389r248390
35193434   ROM_LOAD ("hb701fddisk.rom", 0x8000, 0x4000, CRC(71961d9d) SHA1(2144036d6573d666143e890e5413956bfe8f66c5))
35203435ROM_END
35213436
3522static MACHINE_CONFIG_DERIVED( hb701fd, msx_tms9928 )
3437static MACHINE_CONFIG_DERIVED( hb701fd, msx_ntsc )
35233438   // YM2149 (in S-1985)
35243439   // FDC: WD2793?, 1 3.5" SSDD drive
35253440   // 2 Cartridge slots
r248389r248390
35463461//  ROM_LOAD ("707disk.rom", 0x8000, 0x4000, CRC(f9978853) SHA1(6aa856cc56eb98863c9da7a566571605682b5c6b))
35473462ROM_END
35483463
3549static MACHINE_CONFIG_DERIVED( svi728, msx_tms9129 )
3464static MACHINE_CONFIG_DERIVED( svi728, msx_pal )
35503465   // AY8910
35513466   // FDC: None, 0 drives
35523467   // 1 Cartridge slots, 1 Expansion slot (eg for SVI-707)
r248389r248390
37553670   ROM_LOAD ("dpc200bios.rom", 0x0000, 0x8000, CRC(8205795e) SHA1(829c00c3114f25b3dae5157c0a238b52a3ac37db))
37563671ROM_END
37573672
3758static MACHINE_CONFIG_DERIVED( tadpc200, msx_tms9129 )
3673static MACHINE_CONFIG_DERIVED( tadpc200, msx_pal )
37593674   // AY8910
37603675   // FDC: None, 0 drives
37613676   // 2 Cartridge slots
r248389r248390
39373852   ROM_LOAD ("hx20word.rom", 0x8000, 0x8000, CRC(39b3e1c0) SHA1(9f7cfa932bd7dfd0d9ecaadc51655fb557c2e125))
39383853ROM_END
39393854
3940static MACHINE_CONFIG_DERIVED( hx20, msx_tms9129 )
3855static MACHINE_CONFIG_DERIVED( hx20, msx_pal )
39413856   // AY8910/YM2149?
39423857   // FDC: None, 0 drives
39433858   // 2 Cartridge slots
3944   // T6950
3859   // T6950 VDP instead of TMS9928A
39453860
39463861   MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
39473862   MCFG_MSX_LAYOUT_RAM("ram1", 0, 0, 2, 2)   /* 32KB RAM */
r248389r248390
39613876   ROM_LOAD ("hx20iword.rom", 0x8000, 0x8000, CRC(39b3e1c0) SHA1(9f7cfa932bd7dfd0d9ecaadc51655fb557c2e125))
39623877ROM_END
39633878
3964static MACHINE_CONFIG_DERIVED( hx20i, msx_tms9129 )
3879static MACHINE_CONFIG_DERIVED( hx20i, msx_pal )
39653880   // AY8910/YM2149?
39663881   // FDC: None, 0 drives
39673882   // 2 Cartridge slots
r248389r248390
39883903   ROM_LOAD ("hx21kfn.rom", 0x0000, 0x20000, CRC(d23d4d2d) SHA1(db03211b7db46899df41db2b1dfbec972109a967))
39893904ROM_END
39903905
3991static MACHINE_CONFIG_DERIVED( hx21, msx_tms9928 )
3906static MACHINE_CONFIG_DERIVED( hx21, msx_ntsc )
39923907   // AY8910/YM2149?
39933908   // FDC: None, 0 drives
39943909   // 2 Cartridge slots
r248389r248390
40593974   ROM_LOAD ("hx22iword.rom", 0x8000, 0x8000, CRC(f9e29c66) SHA1(3289336b2c12161fd926a7e5ce865770ae7038af))
40603975ROM_END
40613976
4062static MACHINE_CONFIG_DERIVED( hx22i, msx_tms9929 )
3977static MACHINE_CONFIG_DERIVED( hx22i, msx_pal )
40633978   // AY8910/YM2149?
40643979   // FDC: None, 0 drives
40653980   // 2 Cartridge slots
40663981   // RS232C builtin?
4067   // Z80: LH0080A
40683982
40693983   MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
40703984   MCFG_MSX_LAYOUT_RAM("ram1", 0, 0, 2, 2)   /* 32KB RAM */
r248389r248390
41874101   ROM_LOAD ("cx5mbios.rom", 0x0000, 0x8000, CRC(e2242b53) SHA1(706dd67036baeec7127e4ccd8c8db8f6ce7d0e4c))
41884102ROM_END
41894103
4190static MACHINE_CONFIG_DERIVED( cx5m, msx_tms9929 )
4104static MACHINE_CONFIG_DERIVED( cx5m, msx_pal )
41914105   // YM2149
41924106   // FDC: None, 0 drives
41934107   // 2 Cartridge slots
trunk/src/mess/drivers/sdk80.c
r248389r248390
1// license:BSD-3-Clause
2// copyright-holders:Nigel Barnes,Ryan Holtz
3/***************************************************************************
4
5        Intel SDK-80
6
7This is an evaluation kit for the 8080 cpu.
8
9There is no speaker or storage facility in the standard kit.
10
11Download the User Manual to get the operating procedures.
12
13Monitor Commands:
14D  Display memory contents
15G  Go to address (execute program at address)
16I  Insert hex code
17M  Move blocks of memory
18S  Substitute memory locations
19X  Examine registers
20
21Please note this rom set boots into BASIC, not monitor.
22
23****************************************************************************/
24
25#include "emu.h"
26#include "cpu/i8085/i8085.h"
27#include "machine/i8251.h"
28#include "machine/clock.h"
29#include "bus/rs232/rs232.h"
30//#include "machine/ay31015.h"
31
32#define I8251A_TAG      "usart"
33#define I8251A_BAUD_TAG   "usart_baud"
34#define RS232_TAG      "rs232"
35
36class sdk80_state : public driver_device
37{
38public:
39   sdk80_state(const machine_config &mconfig, device_type type, const char *tag)
40      : driver_device(mconfig, type, tag)
41      , m_maincpu(*this, "maincpu")
42      , m_usart(*this, I8251A_TAG)
43      , m_rs232(*this, RS232_TAG)
44      , m_usart_baud_rate(*this, I8251A_BAUD_TAG)
45      , m_usart_divide_counter(0)
46      , m_usart_clock_state(0)
47   { }
48
49   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
50
51   DECLARE_WRITE_LINE_MEMBER( usart_clock_tick );
52
53private:
54   required_device<cpu_device> m_maincpu;
55   required_device<i8251_device> m_usart;
56   required_device<rs232_port_device> m_rs232;
57   required_ioport m_usart_baud_rate;
58
59   UINT8 m_usart_divide_counter;
60   UINT8 m_usart_clock_state;
61};
62
63static ADDRESS_MAP_START(sdk80_mem, AS_PROGRAM, 8, sdk80_state)
64   ADDRESS_MAP_UNMAP_HIGH
65   AM_RANGE(0x0000, 0x0fff) AM_ROM
66   AM_RANGE(0x3c00, 0x3fff) AM_RAM
67ADDRESS_MAP_END
68
69static ADDRESS_MAP_START(sdk80_io, AS_IO, 8, sdk80_state)
70   ADDRESS_MAP_UNMAP_HIGH
71   ADDRESS_MAP_GLOBAL_MASK(0xff)
72   AM_RANGE(0xec, 0xec) AM_DEVREADWRITE(I8251A_TAG, i8251_device, data_r, data_w)
73   AM_RANGE(0xed, 0xed) AM_DEVREADWRITE(I8251A_TAG, i8251_device, status_r, control_w)
74ADDRESS_MAP_END
75
76static INPUT_PORTS_START( sdk80 )
77   PORT_START(I8251A_BAUD_TAG)
78   PORT_DIPNAME( 0x3f, 0x01, "i8251 Baud Rate" )
79   PORT_DIPSETTING(    0x01, "4800")
80   PORT_DIPSETTING(    0x02, "2400")
81   PORT_DIPSETTING(    0x04, "1200")
82   PORT_DIPSETTING(    0x08, "600")
83   PORT_DIPSETTING(    0x10, "300")
84   PORT_DIPSETTING(    0x20, "150")
85   PORT_DIPSETTING(    0x40, "75")
86INPUT_PORTS_END
87
88#if 0
89/* Graphics Output */
90const gfx_layout sdk80_charlayout =
91{
92   7, 8,               /* character cell is 7 pixels wide by 8 pixels high */
93   64,                 /* 64 characters in 2513 character generator ROM */
94   1,                  /* 1 bitplane */
95   { 0 },
96   /* 5 visible pixels per row, starting at bit 3, with MSB being 0: */
97   { 3, 4, 5, 6, 7 },
98   /* pixel rows stored from top to bottom: */
99   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
100   8 * 8               /* 8 8-bit pixel rows per character */
101};
102
103static GFXDECODE_START( sdk80 )
104   GFXDECODE_ENTRY( "gfx1", 0x0000, sdk80_charlayout, 0, 1 )
105GFXDECODE_END
106#endif
107
108UINT32 sdk80_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
109{
110   return 0;
111}
112
113WRITE_LINE_MEMBER( sdk80_state::usart_clock_tick )
114{
115   UINT8 old_counter = m_usart_divide_counter;
116   m_usart_divide_counter++;
117
118   UINT8 transition = (old_counter ^ m_usart_divide_counter) & m_usart_baud_rate->read();
119   if (transition)
120   {
121      m_usart->write_txc(m_usart_clock_state);
122      m_usart->write_rxc(m_usart_clock_state);
123      m_usart_clock_state ^= 1;
124   }
125}
126
127static MACHINE_CONFIG_START( sdk80, sdk80_state )
128   /* basic machine hardware */
129   MCFG_CPU_ADD("maincpu", I8080A, XTAL_18_432MHz/9)
130   MCFG_CPU_PROGRAM_MAP(sdk80_mem)
131   MCFG_CPU_IO_MAP(sdk80_io)
132
133   MCFG_DEVICE_ADD(I8251A_TAG, I8251, 0)
134   MCFG_I8251_TXD_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_txd))
135   MCFG_I8251_DTR_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_dtr))
136   MCFG_I8251_RTS_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_rts))
137
138   MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, "null_modem")
139   MCFG_RS232_RXD_HANDLER(DEVWRITELINE(I8251A_TAG, i8251_device, write_rxd))
140   MCFG_RS232_DSR_HANDLER(DEVWRITELINE(I8251A_TAG, i8251_device, write_dsr))
141
142   MCFG_DEVICE_ADD("usart_clock", CLOCK, XTAL_18_432MHz/60)
143   MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(sdk80_state, usart_clock_tick))
144
145   /* video hardware */
146   // 96364 crt controller
147
148//   MCFG_SCREEN_ADD("screen", RASTER)
149//   MCFG_SCREEN_REFRESH_RATE(60)
150   /* Video is blanked for 70 out of 262 scanlines per refresh cycle.
151      Each scanline is composed of 65 character times, 40 of which
152      are visible, and each character time is 7 dot times; a dot time
153      is 2 cycles of the fundamental 14.31818 MHz oscillator.  The
154      total blanking time is about 4450 microseconds. */
155//   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC((int) (70 * 65 * 7 * 2 / 14.31818)))
156   /* It would be nice if we could implement some sort of display
157      overscan here. */
158//   MCFG_SCREEN_SIZE(40 * 7, 24 * 8)
159//   MCFG_SCREEN_VISIBLE_AREA(0, 40 * 7 - 1, 0, 24 * 8 - 1)
160//   MCFG_SCREEN_UPDATE_DRIVER(sdk80_state, screen_update)
161//   MCFG_SCREEN_PALETTE("palette")
162
163//   MCFG_GFXDECODE_ADD("gfxdecode", "palette", sdk80)
164
165//   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
166
167   // Video board UART
168//   MCFG_DEVICE_ADD( "hd6402", AY31015, 0 )
169//   MCFG_AY31015_TX_CLOCK(( XTAL_16MHz / 16 ) / 256)
170//   MCFG_AY31015_RX_CLOCK(( XTAL_16MHz / 16 ) / 256)
171//   MCFG_AY51013_READ_SI_CB(READ8(sdk80_state, nascom1_hd6402_si))
172//   MCFG_AY51013_WRITE_SO_CB(WRITE8(sdk80_state, nascom1_hd6402_so))
173
174   /* Devices */
175//   MCFG_DEVICE_ADD("i8279", I8279, 3100000) // based on divider
176//   MCFG_I8279_OUT_IRQ_CB(INPUTLINE("maincpu", I8085_RST55_LINE))   // irq
177//   MCFG_I8279_OUT_SL_CB(WRITE8(sdk80_state, scanlines_w))          // scan SL lines
178//   MCFG_I8279_OUT_DISP_CB(WRITE8(sdk80_state, digit_w))            // display A&B
179//   MCFG_I8279_IN_RL_CB(READ8(sdk80_state, kbd_r))                  // kbd RL lines
180//   MCFG_I8279_IN_SHIFT_CB(VCC)                                     // Shift key
181//   MCFG_I8279_IN_CTRL_CB(VCC)
182
183   //MCFG_DEVICE_ADD("terminal", GENERIC_TERMINAL, 0)
184   //MCFG_GENERIC_TERMINAL_KEYBOARD_CB(WRITE8(sdk80_state, kbd_put))
185MACHINE_CONFIG_END
186
187/* ROM definition */
188ROM_START( sdk80 )
189   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
190   ROM_LOAD( "basic_blc_1.a14", 0x0000, 0x0400, CRC(b5e75aee) SHA1(6bd1eb9586d72544e8afb4ae43ecedcefa14da33))
191   ROM_LOAD( "basic_blc_2.a15", 0x0400, 0x0400, CRC(0a9ad1ed) SHA1(92c47eadcf8b18eeedcccaa3deb9f1518aaceeae))
192   ROM_LOAD( "basic_blc_3.a16", 0x0800, 0x0400, CRC(bc898e4b) SHA1(adc000534db0f736a75fbceed360dc220e02c30d))
193   ROM_LOAD( "basic_blc_4.a17", 0x0c00, 0x0400, CRC(568e8b6d) SHA1(22960193d3b0ae1b5d876d8c3b3f3b40db01358c))
194
195   /* 512-byte Signetics 2513 character generator ROM at location D2-D3 */
196   ROM_REGION(0x0200, "gfx1",0)
197   ROM_LOAD("s2513.d2", 0x0000, 0x0200, CRC(a7e567fc) SHA1(b18aae0a2d4f92f5a7e22640719bbc4652f3f4ee))
198
199   /* 256x4 PROM located on the video board, schematic location P7, to be moved into separate device later */
200   ROM_REGION( 0x0120, "proms", 0 )
201   ROM_LOAD( "6300__d7.p7",    0x0020, 0x0100, CRC(3eb3a8e4) SHA1(19097b5f60d1030f8b82d9f1d3a241f93e5c75d6) )
202ROM_END
203
204/*    YEAR  NAME    PARENT  COMPAT  MACHINE    INPUT   CLASS           INIT   COMPANY   FULLNAME  FLAGS */
205COMP( 1975, sdk80,  0,       0,     sdk80,     sdk80,  driver_device,  0,     "Intel",  "SDK-80", GAME_NO_SOUND_HW | GAME_NOT_WORKING )
trunk/src/mess/drivers/smc777.c
r248389r248390
5656   m_fdc(*this, "fdc"),
5757   m_floppy0(*this, "fdc:0"),
5858   m_floppy1(*this, "fdc:1"),
59   m_sn(*this, "sn1"),
5960   m_beeper(*this, "beeper"),
6061   m_gfxdecode(*this, "gfxdecode"),
6162   m_palette(*this, "palette")
6263   { }
6364
64   DECLARE_WRITE8_MEMBER(mc6845_w);
65   DECLARE_READ8_MEMBER(vram_r);
66   DECLARE_READ8_MEMBER(attr_r);
67   DECLARE_READ8_MEMBER(pcg_r);
68   DECLARE_WRITE8_MEMBER(vram_w);
69   DECLARE_WRITE8_MEMBER(attr_w);
70   DECLARE_WRITE8_MEMBER(pcg_w);
71   DECLARE_READ8_MEMBER(fbuf_r);
72   DECLARE_WRITE8_MEMBER(fbuf_w);
73   DECLARE_READ8_MEMBER(key_r);
74   DECLARE_WRITE8_MEMBER(key_w);
75   DECLARE_WRITE8_MEMBER(border_col_w);
76   DECLARE_READ8_MEMBER(system_input_r);
77   DECLARE_WRITE8_MEMBER(system_output_w);
78   DECLARE_WRITE8_MEMBER(color_mode_w);
79   DECLARE_WRITE8_MEMBER(ramdac_w);
80   DECLARE_READ8_MEMBER(display_reg_r);
81   DECLARE_WRITE8_MEMBER(display_reg_w);
82   DECLARE_READ8_MEMBER(smc777_mem_r);
83   DECLARE_WRITE8_MEMBER(smc777_mem_w);
84   DECLARE_READ8_MEMBER(irq_mask_r);
85   DECLARE_WRITE8_MEMBER(irq_mask_w);
86   DECLARE_PALETTE_INIT(smc777);
87   UINT32 screen_update_smc777(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
88   INTERRUPT_GEN_MEMBER(vblank_irq);
89   TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback);
90
91   DECLARE_READ8_MEMBER(fdc_r);
92   DECLARE_WRITE8_MEMBER(fdc_w);
93   DECLARE_READ8_MEMBER(fdc_request_r);
94   DECLARE_WRITE8_MEMBER(floppy_select_w);
95   DECLARE_WRITE_LINE_MEMBER(fdc_intrq_w);
96   DECLARE_WRITE_LINE_MEMBER(fdc_drq_w);
97
98protected:
99   virtual void machine_start();
100   virtual void machine_reset();
101   virtual void video_start();
102
103private:
10465   required_device<cpu_device> m_maincpu;
10566   required_device<mc6845_device> m_crtc;
10667   required_device<mb8876_t> m_fdc;
10768   required_device<floppy_connector> m_floppy0;
10869   required_device<floppy_connector> m_floppy1;
70   optional_device<sn76489a_device> m_sn;
10971   required_device<beep_device> m_beeper;
110   required_device<gfxdecode_device> m_gfxdecode;
111   required_device<palette_device> m_palette;
11272
11373   UINT8 *m_ipl_rom;
11474   UINT8 *m_work_ram;
r248389r248390
12989   UINT8 m_raminh,m_raminh_pending_change; //bankswitch
13090   UINT8 m_raminh_prefetch;
13191   UINT8 m_irq_mask;
92   UINT8 m_keyb_direct;
13293   UINT8 m_pal_mode;
13394   UINT8 m_keyb_cmd;
13495   UINT8 m_crtc_vreg[0x20];
13596   UINT8 m_crtc_addr;
97   DECLARE_WRITE8_MEMBER(smc777_6845_w);
98   DECLARE_READ8_MEMBER(smc777_vram_r);
99   DECLARE_READ8_MEMBER(smc777_attr_r);
100   DECLARE_READ8_MEMBER(smc777_pcg_r);
101   DECLARE_WRITE8_MEMBER(smc777_vram_w);
102   DECLARE_WRITE8_MEMBER(smc777_attr_w);
103   DECLARE_WRITE8_MEMBER(smc777_pcg_w);
104   DECLARE_READ8_MEMBER(smc777_fbuf_r);
105   DECLARE_WRITE8_MEMBER(smc777_fbuf_w);
106   DECLARE_READ8_MEMBER(key_r);
107   DECLARE_WRITE8_MEMBER(key_w);
108   DECLARE_WRITE8_MEMBER(border_col_w);
109   DECLARE_READ8_MEMBER(system_input_r);
110   DECLARE_WRITE8_MEMBER(system_output_w);
111   DECLARE_READ8_MEMBER(smc777_joystick_r);
112   DECLARE_WRITE8_MEMBER(smc777_color_mode_w);
113   DECLARE_WRITE8_MEMBER(smc777_ramdac_w);
114   DECLARE_READ8_MEMBER(display_reg_r);
115   DECLARE_WRITE8_MEMBER(display_reg_w);
116   DECLARE_READ8_MEMBER(smc777_mem_r);
117   DECLARE_WRITE8_MEMBER(smc777_mem_w);
118   DECLARE_READ8_MEMBER(smc777_irq_mask_r);
119   DECLARE_WRITE8_MEMBER(smc777_irq_mask_w);
120   DECLARE_READ8_MEMBER(smc777_io_r);
121   DECLARE_WRITE8_MEMBER(smc777_io_w);
122   virtual void machine_start();
123   virtual void machine_reset();
124   virtual void video_start();
125   DECLARE_PALETTE_INIT(smc777);
126   UINT32 screen_update_smc777(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
127   INTERRUPT_GEN_MEMBER(smc777_vblank_irq);
128   TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback);
129
130   DECLARE_READ8_MEMBER(fdc_r);
131   DECLARE_WRITE8_MEMBER(fdc_w);
132   DECLARE_READ8_MEMBER(fdc_request_r);
133   DECLARE_WRITE8_MEMBER(floppy_select_w);
134   DECLARE_WRITE_LINE_MEMBER(fdc_intrq_w);
135   DECLARE_WRITE_LINE_MEMBER(fdc_drq_w);
136
137   required_device<gfxdecode_device> m_gfxdecode;
138   required_device<palette_device> m_palette;
136139};
137140
138141
r248389r248390
287290   return 0;
288291}
289292
290WRITE8_MEMBER(smc777_state::mc6845_w)
293WRITE8_MEMBER(smc777_state::smc777_6845_w)
291294{
292295   if(offset == 0)
293296   {
r248389r248390
301304   }
302305}
303306
304READ8_MEMBER(smc777_state::vram_r)
307READ8_MEMBER(smc777_state::smc777_vram_r)
305308{
306309   UINT16 vram_index;
307310
r248389r248390
311314   return m_vram[vram_index];
312315}
313316
314READ8_MEMBER(smc777_state::attr_r)
317READ8_MEMBER(smc777_state::smc777_attr_r)
315318{
316319   UINT16 vram_index;
317320
r248389r248390
321324   return m_attr[vram_index];
322325}
323326
324READ8_MEMBER(smc777_state::pcg_r)
327READ8_MEMBER(smc777_state::smc777_pcg_r)
325328{
326329   UINT16 vram_index;
327330
r248389r248390
331334   return m_pcg[vram_index];
332335}
333336
334WRITE8_MEMBER(smc777_state::vram_w)
337WRITE8_MEMBER(smc777_state::smc777_vram_w)
335338{
336339   UINT16 vram_index;
337340
r248389r248390
341344   m_vram[vram_index] = data;
342345}
343346
344WRITE8_MEMBER(smc777_state::attr_w)
347WRITE8_MEMBER(smc777_state::smc777_attr_w)
345348{
346349   UINT16 vram_index;
347350
r248389r248390
351354   m_attr[vram_index] = data;
352355}
353356
354WRITE8_MEMBER(smc777_state::pcg_w)
357WRITE8_MEMBER(smc777_state::smc777_pcg_w)
355358{
356359   UINT16 vram_index;
357360
r248389r248390
363366   m_gfxdecode->gfx(0)->mark_dirty(vram_index >> 3);
364367}
365368
366READ8_MEMBER(smc777_state::fbuf_r)
369READ8_MEMBER(smc777_state::smc777_fbuf_r)
367370{
368371   UINT16 vram_index;
369372
r248389r248390
373376   return m_gvram[vram_index];
374377}
375378
376WRITE8_MEMBER(smc777_state::fbuf_w)
379WRITE8_MEMBER(smc777_state::smc777_fbuf_w)
377380{
378381   UINT16 vram_index;
379382
r248389r248390
519522   }
520523}
521524
522WRITE8_MEMBER(smc777_state::color_mode_w)
525/* presumably SMC-777 specific */
526READ8_MEMBER(smc777_state::smc777_joystick_r)
523527{
528   return ioport("JOY_1P")->read();
529}
530
531WRITE8_MEMBER(smc777_state::smc777_color_mode_w)
532{
524533   switch(data & 0x0f)
525534   {
526535      case 0x06: m_pal_mode = (data & 0x10) ^ 0x10; break;
r248389r248390
528537   }
529538}
530539
531WRITE8_MEMBER(smc777_state::ramdac_w)
540WRITE8_MEMBER(smc777_state::smc777_ramdac_w)
532541{
533542   UINT8 pal_index;
534543   pal_index = (offset & 0xf00) >> 8;
r248389r248390
587596   m_work_ram[offset] = data;
588597}
589598
590READ8_MEMBER(smc777_state::irq_mask_r)
599READ8_MEMBER(smc777_state::smc777_irq_mask_r)
591600{
592601   return m_irq_mask;
593602}
594603
595WRITE8_MEMBER(smc777_state::irq_mask_w)
604WRITE8_MEMBER(smc777_state::smc777_irq_mask_w)
596605{
597606   if(data & 0xfe)
598607      printf("Irq mask = %02x\n",data & 0xfe);
r248389r248390
600609   m_irq_mask = data & 1;
601610}
602611
603static ADDRESS_MAP_START( smc777_mem, AS_PROGRAM, 8, smc777_state )
612static ADDRESS_MAP_START(smc777_mem, AS_PROGRAM, 8, smc777_state )
604613   ADDRESS_MAP_UNMAP_HIGH
605   AM_RANGE(0x0000, 0xffff) AM_READWRITE(smc777_mem_r, smc777_mem_w)
614   AM_RANGE(0x0000, 0xffff) AM_READWRITE(smc777_mem_r,smc777_mem_w)
606615ADDRESS_MAP_END
607616
608static ADDRESS_MAP_START( smc777_io, AS_IO, 8, smc777_state )
617READ8_MEMBER(smc777_state::smc777_io_r)
618{
619   UINT8 low_offs;
620
621   low_offs = offset & 0xff;
622
623   if(low_offs <= 0x07)                          { return smc777_vram_r(space,offset & 0xff07); }
624   else if(low_offs >= 0x08 && low_offs <= 0x0f) { return smc777_attr_r(space,offset & 0xff07); }
625   else if(low_offs >= 0x10 && low_offs <= 0x17) { return smc777_pcg_r(space,offset & 0xff07); }
626   else if(low_offs >= 0x18 && low_offs <= 0x19) { logerror("6845 read %02x",low_offs & 1); }
627   else if(low_offs >= 0x1a && low_offs <= 0x1b) { return key_r(space,low_offs & 1); }
628   else if(low_offs == 0x1c)                     { return system_input_r(space,0); }
629   else if(low_offs == 0x1d)                     { logerror("System and control data R PC=%04x\n",space.device().safe_pc()); return 0xff; }
630   else if(low_offs == 0x20)                     { return display_reg_r(space,0); }
631   else if(low_offs == 0x21)                     { return smc777_irq_mask_r(space,0); }
632   else if(low_offs == 0x25)                     { logerror("RTC read PC=%04x\n",space.device().safe_pc()); return 0xff; }
633   else if(low_offs == 0x26)                     { logerror("RS-232c RX %04x\n",space.device().safe_pc()); return 0xff; }
634   else if(low_offs >= 0x28 && low_offs <= 0x2c) { logerror("FDC 2 read %02x\n",low_offs & 7); return 0xff; }
635   else if(low_offs >= 0x2d && low_offs <= 0x2f) { logerror("RS-232c no. 2 read %02x\n",low_offs & 3); return 0xff; }
636   else if(low_offs >= 0x30 && low_offs <= 0x33) { return fdc_r(space, low_offs & 3); }
637   else if(low_offs >= 0x34 && low_offs <= 0x34) { return fdc_request_r(space, 0); }
638   else if(low_offs >= 0x35 && low_offs <= 0x37) { logerror("RS-232c no. 3 read %02x\n",low_offs & 3); return 0xff; }
639   else if(low_offs >= 0x38 && low_offs <= 0x3b) { logerror("Cache disk unit read %02x\n",low_offs & 7); return 0xff; }
640   else if(low_offs >= 0x3c && low_offs <= 0x3d) { logerror("RGB superimposer read %02x\n",low_offs & 1); return 0xff; }
641   else if(low_offs >= 0x40 && low_offs <= 0x47) { logerror("IEEE-488 interface unit read %02x\n",low_offs & 7); return 0xff; }
642   else if(low_offs >= 0x48 && low_offs <= 0x4f) { logerror("HDD (Winchester) read %02x\n",low_offs & 1); return 0xff; } //might be 0x48 - 0x50
643   else if(low_offs == 0x51)                     { return smc777_joystick_r(space,0); }
644   else if(low_offs >= 0x54 && low_offs <= 0x59) { logerror("VTR Controller read %02x\n",low_offs & 7); return 0xff; }
645   else if(low_offs == 0x5a || low_offs == 0x5b) { logerror("RAM Banking %02x\n",low_offs & 1); }
646   else if(low_offs == 0x70)                     { logerror("Auto-start ROM read\n"); }
647   else if(low_offs == 0x74)                     { logerror("IEEE-488 ROM read\n"); }
648   else if(low_offs == 0x75)                     { logerror("VTR Controller ROM read\n"); }
649   else if(low_offs == 0x7e || low_offs == 0x7f) { logerror("Kanji ROM read %02x\n",low_offs & 1); }
650   else if(low_offs >= 0x80)                     { return smc777_fbuf_r(space,offset & 0xff7f); }
651
652   logerror("Undefined read at %04x offset = %02x\n",space.device().safe_pc(),low_offs);
653   return 0xff;
654}
655
656WRITE8_MEMBER(smc777_state::smc777_io_w)
657{
658   UINT8 low_offs;
659
660   low_offs = offset & 0xff;
661
662   if(low_offs <= 0x07)                          { smc777_vram_w(space,offset & 0xff07,data); }
663   else if(low_offs >= 0x08 && low_offs <= 0x0f) { smc777_attr_w(space,offset & 0xff07,data); }
664   else if(low_offs >= 0x10 && low_offs <= 0x17) { smc777_pcg_w(space,offset & 0xff07,data); }
665   else if(low_offs >= 0x18 && low_offs <= 0x19) { smc777_6845_w(space,low_offs & 1,data); }
666   else if(low_offs == 0x1a || low_offs == 0x1b) { key_w(space,low_offs & 1,data); }
667   else if(low_offs == 0x1c)                     { system_output_w(space,0,data); }
668   else if(low_offs == 0x1d)                     { logerror("Printer status / strobe write %02x\n",data); }
669   else if(low_offs == 0x1e || low_offs == 0x1f) { logerror("RS-232C irq control [%02x] %02x\n",low_offs & 1,data); }
670   else if(low_offs == 0x20)                     { display_reg_w(space,0,data); }
671   else if(low_offs == 0x21)                     { smc777_irq_mask_w(space,0,data); }
672   else if(low_offs == 0x22)                     { logerror("Printer output data %02x\n",data); }
673   else if(low_offs == 0x23)                     { border_col_w(space,0,data); }
674   else if(low_offs == 0x24)                     { logerror("RTC write / specify address %02x\n",data); }
675   else if(low_offs == 0x26)                     { logerror("RS-232c TX %02x\n",data); }
676   else if(low_offs >= 0x28 && low_offs <= 0x2c) { logerror("FDC 2 write %02x %02x\n",low_offs & 7,data); }
677   else if(low_offs >= 0x2d && low_offs <= 0x2f) { logerror("RS-232c no. 2 write %02x %02x\n",low_offs & 3,data); }
678   else if(low_offs >= 0x30 && low_offs <= 0x33) { fdc_w(space, low_offs & 3, data); }
679   else if(low_offs >= 0x34 && low_offs <= 0x34) { floppy_select_w(space, 0, data); }
680   else if(low_offs >= 0x35 && low_offs <= 0x37) { logerror("RS-232c no. 3 write %02x %02x\n",low_offs & 3,data); }
681   else if(low_offs >= 0x38 && low_offs <= 0x3b) { logerror("Cache disk unit write %02x %02x\n",low_offs & 7,data); }
682   else if(low_offs >= 0x3c && low_offs <= 0x3d) { logerror("RGB superimposer write %02x %02x\n",low_offs & 1,data); }
683   else if(low_offs >= 0x40 && low_offs <= 0x47) { logerror("IEEE-488 interface unit write %02x %02x\n",low_offs & 7,data); }
684   else if(low_offs >= 0x48 && low_offs <= 0x4f) { logerror("HDD (Winchester) write %02x %02x\n",low_offs & 1,data); } //might be 0x48 - 0x50
685   else if(low_offs == 0x51)                     { smc777_color_mode_w(space,0,data); }
686   else if(low_offs == 0x52)                     { smc777_ramdac_w(space,offset & 0xff00,data); }
687   else if(low_offs == 0x53)                     { m_sn->write(space,0,data); }
688   else if(low_offs >= 0x54 && low_offs <= 0x59) { logerror("VTR Controller write [%02x] %02x\n",low_offs & 7,data); }
689   else if(low_offs == 0x5a || low_offs == 0x5b) { logerror("RAM Banking write [%02x] %02x\n",low_offs & 1,data); }
690   else if(low_offs == 0x70)                     { logerror("Auto-start ROM write %02x\n",data); }
691   else if(low_offs == 0x74)                     { logerror("IEEE-488 ROM write %02x\n",data); }
692   else if(low_offs == 0x75)                     { logerror("VTR Controller ROM write %02x\n",data); }
693   else if(low_offs == 0x7e || low_offs == 0x7f) { logerror("Kanji ROM write [%02x] %02x\n",low_offs & 1,data); }
694   else if(low_offs >= 0x80)                     { smc777_fbuf_w(space,offset & 0xff7f,data); }
695   else                                          { logerror("Undefined write at %04x offset = %02x data = %02x\n",space.device().safe_pc(),low_offs,data); }
696}
697
698static ADDRESS_MAP_START( smc777_io , AS_IO, 8, smc777_state )
609699   ADDRESS_MAP_UNMAP_HIGH
610   AM_RANGE(0x00, 0x07) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(vram_r, vram_w)
611   AM_RANGE(0x08, 0x0f) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(attr_r, attr_w)
612   AM_RANGE(0x10, 0x17) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(pcg_r, pcg_w)
613   AM_RANGE(0x18, 0x19) AM_MIRROR(0xff00) AM_WRITE(mc6845_w)
614   AM_RANGE(0x1a, 0x1b) AM_MIRROR(0xff00) AM_READWRITE(key_r, key_w)
615   AM_RANGE(0x1c, 0x1c) AM_MIRROR(0xff00) AM_READWRITE(system_input_r, system_output_w)
616//   AM_RANGE(0x1d, 0x1d) system and control read, printer strobe write
617//   AM_RANGE(0x1e, 0x1f) rs232 irq control
618   AM_RANGE(0x20, 0x20) AM_MIRROR(0xff00) AM_READWRITE(display_reg_r, display_reg_w)
619   AM_RANGE(0x21, 0x21) AM_MIRROR(0xff00) AM_READWRITE(irq_mask_r, irq_mask_w)
620//   AM_RANGE(0x22, 0x22) printer output data
621   AM_RANGE(0x23, 0x23) AM_MIRROR(0xff00) AM_WRITE(border_col_w)
622//   AM_RANGE(0x24, 0x24) rtc write address
623//   AM_RANGE(0x25, 0x25) rtc read
624//   AM_RANGE(0x26, 0x26) rs232 #1
625//   AM_RANGE(0x28, 0x2c) fdc #2
626//   AM_RANGE(0x2d, 0x2f) rs232 #2
627   AM_RANGE(0x30, 0x33) AM_MIRROR(0xff00) AM_READWRITE(fdc_r, fdc_w)
628   AM_RANGE(0x34, 0x34) AM_MIRROR(0xff00) AM_READWRITE(fdc_request_r, floppy_select_w)
629//   AM_RANGE(0x35, 0x37) rs232 #3
630//   AM_RANGE(0x38, 0x3b) cache disk unit
631//   AM_RANGE(0x3c, 0x3d) rgb superimposer
632//   AM_RANGE(0x40, 0x47) ieee-488
633//   AM_RANGE(0x48, 0x4f) hdd (winchester)
634   AM_RANGE(0x51, 0x51) AM_MIRROR(0xff00) AM_READ_PORT("JOY_1P") AM_WRITE(color_mode_w)
635   AM_RANGE(0x52, 0x52) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_WRITE(ramdac_w)
636   AM_RANGE(0x53, 0x53) AM_MIRROR(0xff00) AM_DEVWRITE("sn1", sn76489a_device, write)
637//   AM_RANGE(0x54, 0x59) vrt controller
638//   AM_RANGE(0x5a, 0x5b) ram banking
639//   AM_RANGE(0x70, 0x70) auto-start rom
640//   AM_RANGE(0x74, 0x74) ieee-488 rom
641//   AM_RANGE(0x75, 0x75) vrt controller rom
642//   AM_RANGE(0x7e, 0x7f) kanji rom
643   AM_RANGE(0x80, 0xff) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(fbuf_r, fbuf_w)
700   AM_RANGE(0x0000, 0xffff) AM_READWRITE(smc777_io_r,smc777_io_w)
644701ADDRESS_MAP_END
645702
646703/* Input ports */
r248389r248390
9481005}
9491006
9501007
951INTERRUPT_GEN_MEMBER(smc777_state::vblank_irq)
1008INTERRUPT_GEN_MEMBER(smc777_state::smc777_vblank_irq)
9521009{
9531010   if(m_irq_mask)
9541011      device.execute().set_input_line(0,HOLD_LINE);
r248389r248390
9651022   MCFG_CPU_ADD("maincpu",Z80, MASTER_CLOCK)
9661023   MCFG_CPU_PROGRAM_MAP(smc777_mem)
9671024   MCFG_CPU_IO_MAP(smc777_io)
968   MCFG_CPU_VBLANK_INT_DRIVER("screen", smc777_state, vblank_irq)
1025   MCFG_CPU_VBLANK_INT_DRIVER("screen", smc777_state, smc777_vblank_irq)
9691026
9701027   /* video hardware */
9711028   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mess/drivers/tb303.c
r248389r248390
22// copyright-holders:hap
33/***************************************************************************
44
5  ** subclass of hh_ucom4_state (includes/hh_ucom4.h, drivers/hh_ucom4.c) **
6
75  Roland TB-303 Bass Line, 1982, designed by Tadao Kikumoto
86  * NEC uCOM-43 MCU, labeled D650C 133
97  * 3*uPD444C 1024x4 Static CMOS SRAM
108  * board is packed with discrete components
119
12  TODO:
13  - still too much to list here
10  x
1411
1512***************************************************************************/
1613
17#include "includes/hh_ucom4.h"
14#include "emu.h"
15#include "cpu/ucom4/ucom4.h"
1816
1917#include "tb303.lh"
2018
2119
22class tb303_state : public hh_ucom4_state
20class tb303_state : public driver_device
2321{
2422public:
2523   tb303_state(const machine_config &mconfig, device_type type, const char *tag)
26      : hh_ucom4_state(mconfig, type, tag),
24      : driver_device(mconfig, type, tag),
25      m_maincpu(*this, "maincpu"),
2726      m_t3_off_timer(*this, "t3_off")
2827   { }
2928
29   required_device<cpu_device> m_maincpu;
3030   required_device<timer_device> m_t3_off_timer;
31   
32   UINT8 m_ram[0xc00];
33   UINT16 m_ram_address;
34   bool m_ram_ce;
35   bool m_ram_we;
3631
37   DECLARE_WRITE8_MEMBER(ram_w);
38   DECLARE_READ8_MEMBER(ram_r);
39   DECLARE_WRITE8_MEMBER(strobe_w);
40   void refresh_ram();
41
42   DECLARE_WRITE8_MEMBER(switch_w);
43   DECLARE_READ8_MEMBER(input_r);
44   void update_leds();
45
4632   TIMER_DEVICE_CALLBACK_MEMBER(t3_clock);
4733   TIMER_DEVICE_CALLBACK_MEMBER(t3_off);
4834
r248389r248390
5036};
5137
5238
53/***************************************************************************
54
55  Timer/Interrupt
56
57***************************************************************************/
58
5939// T2 to MCU CLK: LC circuit, stable sine wave, 2.2us interval
6040#define TB303_T2_CLOCK_HZ   454545 /* in hz */
6141
r248389r248390
7656
7757
7858
79/***************************************************************************
8059
81  I/O
82
83***************************************************************************/
84
85// external ram
86
87void tb303_state::refresh_ram()
88{
89   // MCU E2,E3 goes through a 4556 IC(pin 14,13) to one of uPD444 _CE:
90   // _Q0: N/C, _Q1: IC-5, _Q2: IC-3, _Q3: IC-4
91   m_ram_ce = true;
92   UINT8 hi = 0;
93   switch (m_port[NEC_UCOM4_PORTE] >> 2 & 3)
94   {
95      case 0: m_ram_ce = false; break;
96      case 1: hi = 0; break;
97      case 2: hi = 1; break;
98      case 3: hi = 2; break;
99   }
100   
101   if (m_ram_ce)
102   {
103      // _WE must be high(read mode) for address transitions
104      if (!m_ram_we)
105         m_ram_address = hi << 10 | (m_port[NEC_UCOM4_PORTE] << 8 & 0x300) | m_port[NEC_UCOM4_PORTF] << 4 | m_port[NEC_UCOM4_PORTD];
106      else
107         m_ram[m_ram_address] = m_port[NEC_UCOM4_PORTC];
108   }
109}
110
111WRITE8_MEMBER(tb303_state::ram_w)
112{
113   // MCU C: RAM data
114   // MCU D,F,E: RAM address
115   m_port[offset] = data;
116   refresh_ram();
117   
118   // MCU D,F01: pitch data
119   //..
120}
121
122READ8_MEMBER(tb303_state::ram_r)
123{
124   // MCU C: RAM data
125   if (m_ram_ce && !m_ram_we)
126      return m_ram[m_ram_address];
127   else
128      return 0;
129}
130
131WRITE8_MEMBER(tb303_state::strobe_w)
132{
133   // MCU I0: RAM _WE
134   m_ram_we = (data & 1) ? false : true;
135   refresh_ram();
136   
137   // MCU I1: pitch data latch strobe
138   // MCU I2: gate signal
139
140   m_port[offset] = data;
141}
142
143
144// switch board
145
146void tb303_state::update_leds()
147{
148   // 4*4 LED matrix from port G/H:
149   /*
150      0.0 D204    1.0 D211    2.0 D217    3.0 D205
151      0.1 D206    1.1 D213    2.1 D218    3.1 D207
152      0.2 D208    1.2 D215    2.2 D220    3.2 D210
153      0.3 D209    1.3 D216    2.3 D221    3.3 D212
154   */
155   display_matrix(4, 4, m_port[NEC_UCOM4_PORTG], m_port[NEC_UCOM4_PORTH]);
156   
157   // todo: battery led
158   // todo: 4 more leds(see top-left part)
159}
160
161WRITE8_MEMBER(tb303_state::switch_w)
162{
163   // MCU G: leds state
164   // MCU H: input/led mux
165   if (offset == NEC_UCOM4_PORTH)
166      m_inp_mux = data = data ^ 0xf;
167   
168   m_port[offset] = data;
169   update_leds();
170}
171
172READ8_MEMBER(tb303_state::input_r)
173{
174   // MCU A,B: multiplexed inputs
175   // if input mux(port H) is 0, port A status buffer & gate is selected (via Q5 NAND)
176   if (offset == NEC_UCOM4_PORTA && m_inp_mux == 0)
177   {
178      // todo..
179      return m_inp_matrix[4]->read();
180   }
181   else
182      return read_inputs(4) >> (offset*4) & 0xf;
183}
184
185
186
187/***************************************************************************
188
189  Inputs
190
191***************************************************************************/
192
19360static INPUT_PORTS_START( tb303 )
194   PORT_START("IN.0") // H0 port A/B
195   PORT_CONFNAME( 0x03, 0x03, "Mode" )
196   PORT_CONFSETTING(    0x03, "Track Write" )
197   PORT_CONFSETTING(    0x02, "Track Play" )
198   PORT_CONFSETTING(    0x00, "Pattern Play" )
199   PORT_CONFSETTING(    0x01, "Pattern Write" )
200   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Q) PORT_NAME("DEL  C#")
201   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_W) PORT_NAME("INS  D#")
202   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_NAME("1  C")
203   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_NAME("2  D")
204   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_NAME("3  E")
205   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_NAME("4  F")
206
207   PORT_START("IN.1") // H1 port A/B
208   PORT_CONFNAME( 0x07, 0x00, "Track / Patt.Group" )
209   PORT_CONFSETTING(    0x00, "1 / I" )
210   PORT_CONFSETTING(    0x01, "2 / I" )
211   PORT_CONFSETTING(    0x02, "3 / II" )
212   PORT_CONFSETTING(    0x03, "4 / II" )
213   PORT_CONFSETTING(    0x04, "5 / III" )
214   PORT_CONFSETTING(    0x05, "6 / III" )
215   PORT_CONFSETTING(    0x06, "7 / IV" )
216   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
217   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_NAME("5  G")
218   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_NAME("6  A")
219   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_NAME("7  B")
220   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_NAME("8  C")
221
222   PORT_START("IN.2") // H2 port A/B
223   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_NAME("Pattern Clear")
224   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_NAME("Function")
225   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("Pitch Mode")
226   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("Time Mode")
227   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_NAME("9  Step")
228   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_NAME("0  3n")
229   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS) PORT_NAME("100  A")
230   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("200  B")
231
232   PORT_START("IN.3") // H3 port B
233   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED )
234   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_NAME("F#")
235   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_T) PORT_NAME("G#")
236   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Y) PORT_NAME("A#")
237   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("Back")
238
239   PORT_START("IN.4") // H=0 port A
240   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_NAME("Run/Stop")
241   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SPACE) PORT_NAME("Tap")
242   PORT_BIT( 0xfc, IP_ACTIVE_HIGH, IPT_UNUSED )
24361INPUT_PORTS_END
24462
24563
r248389r248390
25270
25371void tb303_state::machine_start()
25472{
255   hh_ucom4_state::machine_start();
256   
257   // zerofill
258   memset(m_ram, 0, sizeof(m_ram));
259   m_ram_address = 0;
260   m_ram_ce = false;
261   m_ram_we = false;
262   
263   // register for savestates
264   save_item(NAME(m_ram));
265   save_item(NAME(m_ram_address));
266   save_item(NAME(m_ram_ce));
267   save_item(NAME(m_ram_we));
26873}
26974
75
27076static MACHINE_CONFIG_START( tb303, tb303_state )
27177
27278   /* basic machine hardware */
27379   MCFG_CPU_ADD("maincpu", NEC_D650, TB303_T2_CLOCK_HZ)
274   MCFG_UCOM4_READ_A_CB(READ8(tb303_state, input_r))
275   MCFG_UCOM4_READ_B_CB(READ8(tb303_state, input_r))
276   MCFG_UCOM4_READ_C_CB(READ8(tb303_state, ram_r))
277   MCFG_UCOM4_WRITE_C_CB(WRITE8(tb303_state, ram_w))
278   MCFG_UCOM4_WRITE_D_CB(WRITE8(tb303_state, ram_w))
279   MCFG_UCOM4_WRITE_E_CB(WRITE8(tb303_state, ram_w))
280   MCFG_UCOM4_WRITE_F_CB(WRITE8(tb303_state, ram_w))
281   MCFG_UCOM4_WRITE_G_CB(WRITE8(tb303_state, switch_w))
282   MCFG_UCOM4_WRITE_H_CB(WRITE8(tb303_state, switch_w))
283   MCFG_UCOM4_WRITE_I_CB(WRITE8(tb303_state, strobe_w))
28480
28581   MCFG_TIMER_DRIVER_ADD_PERIODIC("t3_clock", tb303_state, t3_clock, TB303_T3_CLOCK)
28682   MCFG_TIMER_START_DELAY(TB303_T3_CLOCK)
28783   MCFG_TIMER_DRIVER_ADD("t3_off", tb303_state, t3_off)
28884
289   MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_ucom4_state, display_decay_tick, attotime::from_msec(1))
29085   MCFG_DEFAULT_LAYOUT(layout_tb303)
29186
29287   /* no video! */
r248389r248390
305100
306101ROM_START( tb303 )
307102   ROM_REGION( 0x0800, "maincpu", 0 )
308   ROM_LOAD( "d650c-133.ic8", 0x0000, 0x0800, CRC(268a8d8b) SHA1(7a4236b2bc9a5cd4c80c63ca1a193e03becfcb4c) )
103   ROM_LOAD( "d650c-133.ic8", 0x0000, 0x0800, CRC(dd2f26ae) SHA1(7f5e37f38d970219dc9e5d49a20dc5335a5c0b30) )
309104ROM_END
310105
311106
trunk/src/mess/drivers/vk100.c
r248389r248390
3737
3838 Tony DiCenzo, now the director of standards and architecture at Oracle, was on the team that developed the VK100
3939 see http://startup.nmnaturalhistory.org/visitorstories/view.php?ii=79
40 Robert "Bob" C. Quinn was definitely lead engineer on the VT125
41 Robert "Bob" T. Collins was the lead engineer on the VK100
42 Pedro Ortiz (https://www.linkedin.com/pub/pedro-ortiz/16/68b/196) did the drafting for the enclosure and case
40 Robert "Bob" C. Quinn was definitely lead engineer on the VT125 and may have been lead engineer on the VK100 as well
4341
4442 The prototype name for the VK100 was 'SMAKY' (Smart Keyboard)
4543
r248389r248390
222220   UINT8 m_VG_MODE; // 2 bits, latched on EXEC
223221   UINT8 m_vgGO; // activated on next SYNC pulse after EXEC
224222   UINT8 m_ACTS;
225   UINT8 m_ADSR;
226223   ioport_port* m_col_array[16];
227224
228225   DECLARE_WRITE8_MEMBER(vgLD_X);
r248389r248390
247244   DECLARE_WRITE_LINE_MEMBER(i8251_txrdy_int);
248245   DECLARE_WRITE_LINE_MEMBER(i8251_rts);
249246   UINT8 vram_read();
250   UINT8 vram_attr_read();
251247   MC6845_UPDATE_ROW(crtc_update_row);
252248   void vram_write(UINT8 data);
253249
r248389r248390
290286   return (block>>(4*nybbleNum))&0xF;
291287}
292288
293// returns the attribute nybble for the current pixel based on X and Y regs
294UINT8 vk100_state::vram_attr_read()
295{
296   // XFinal is (X'&0x3FC)|(X&0x3)
297   UINT16 XFinal = m_trans[(m_vgX&0x3FC)>>2]<<2|(m_vgX&0x3); // appears correct
298   // EA is the effective ram address for a 16-bit block
299   UINT16 EA = ((m_vgY&0x1FE)<<5)|(XFinal>>4); // appears correct
300   // block is the 16 bit block directly (note EA has to be <<1 to correctly index a byte)
301   UINT16 block = m_vram[(EA<<1)+1] | (m_vram[(EA<<1)]<<8);
302   // nybbleNum is the attribute nybble, which in this case is always 3
303   UINT8 nybbleNum = 3;
304   return (block>>(4*nybbleNum))&0xF;
305}
306
307// writes one nybble to vram array based on X and Y regs, and updates the attrib ram if needed
308289void vk100_state::vram_write(UINT8 data)
309290{
310291   // XFinal is (X'&0x3FC)|(X&0x3)
r248389r248390
449430}
450431
451432/* port 0x45: "SOPS" screen options
452 * (handled by 74LS273 @ E55, schematic sheet 10, all signals called 'VVG1 BDx' where x is 7 to 0)
453 * Blink   --Background color--    Blink   Serial  Serial  Reverse
454 * Enable  Green   Red     Blue    Control SL1     SL0     BG/FG
455 * d7      d6      d5      d4      d3      d2      d1      d0
456 * apparently, SLx: 00 = rs232/eia(J6), 01 = 20ma(J1), 10 = hardcopy(J7), 11 = test/loopback
457 * Serial Select (SLx) routing controls are rather complex, shown on schematic
458 * page 9:
459 * VDC2    |  I8251 pins                                                      |  SYSTAT_B bits
460 * SL1 SL0 |  8251RXD   8251RTS    8251TXD    8251/DTR    8251/DSR    8251CTS |  SYSTATB_ACTS   SYSTATB_ADSR
461 * 0   0      J6 /RXD   J6 /RTS    J6 TXD     J6 /DTR     J7 URTS     GND        J6 /CTS        J6 /DSR
462 * 0   1      J1 +-R    ACTS(loop) J1 +-T     J6 /DTR     J7 URTS     GND        8251RTS(loop)  J6 /DSR
463 * 1   0      J7 DRXD   J7 DRTS*   J7 DTXD    J6 /DTR     J7 URTS     GND        J7 /DCTS       J6 /DSR
464 * 1   1      8251TXD   ACTS(loop) 8251RXD    J6 /DTR     J7 URTS     GND        8251RTS(loop)  J6 /DSR
465 *                      * and UCTS, the pin drives both pins on J7
433 * Blink --Background color--  Blink Serial Select  Reverse
434 * Enable Green  Red    Blue   Control              BG/FG
435 * d7     d6     d5     d4     d3     d2     d1     d0
436 * apparently, 00 = rs232/eia, 01 = 20ma, 10 = hardcopy, 11 = test/loopback
466437 */
467438WRITE8_MEMBER(vk100_state::vgSOPS)
468439{
r248389r248390
615586}
616587
617588/* port 0x40-0x47: "SYSTAT A"; various status bits, poorly documented in the tech manual
618 * /GO    VDM1   VDM1   VDM1   VDM1   Dip     RST7.5 GND***
619 *        BIT3   BIT2   BIT1   BIT0   Switch  VSYNC
589 * /GO    BIT3   BIT2   BIT1   BIT0   Dip     RST7.5 GND
590 *                                    Switch  VSYNC
620591 * d7     d6     d5     d4     d3     d2      d1     d0
621592  bit3, 2, 1, 0 are the 4 bits output from the VRAM 12->4 multiplexer
622593   which are also inputs to the pattern rom; they are constantly updated
r248389r248390
626597  d6,5,4,3 are from the 74ls298 at ic4 (right edge of pcb)
627598  d2 is where the dipswitch values are read from, based on the offset
628599  d1 is connected to 8085 rst7.5 (pin 7) and crtc pin 40 (VSYNC) [verified via tracing]
629  d0 is tied to GND [verified via tracing] but the schematics both tie it to GND
630     and call it LP FLAG, may be a leftover from development.
600  d0 is tied to GND [verified via tracing]
631601
632602 31D reads and checks d7 in a loop
633603 205 reads, xors with 0x55 (from reg D), ANDS result with 0x78 and branches if it is not zero (checking for bit pattern 1010?)
r248389r248390
653623 * after this it does something and waits for an rxrdy interrupt
654624
655625 shows the results of:
656 * ACTS (/CTS)  ADSR (/DSR)  GND    GND    ATTR3  ATTR2  ATTR1  ATTR0
657 * d7           d6           d5     d4     d3     d2     d1     d0
626 * ACTS (/CTS)  ?      ?      ?      ?      ?      ?      ?
627 * d7           d6     d5     d4     d3     d2     d1     d0
658628 * the ACTS (inverse of DCTS) signal lives in one of these bits (see 5-62)
659629 * it XORs the read of systat_b with the E register (which holds 0x6)
660630 * and checks the result
661 * The 4 attribute ram bits for the cell being pointed at by the X and Y regs are readable as the low nybble.
662 * The DSR pin is readable as bit 6.
663631 */
664632READ8_MEMBER(vk100_state::SYSTAT_B)
665633{
666634#ifdef SYSTAT_B_VERBOSE
667635   logerror("0x%04X: SYSTAT_B Read!\n", m_maincpu->pc());
668636#endif
669   return (m_ACTS<<7)|(m_ADSR<<6)|vram_attr_read();
637   return (m_ACTS<<7)|0x7F;
670638}
671639
672640READ8_MEMBER(vk100_state::vk100_keyboard_column_r)
r248389r248390
945913   m_VG_MODE = 0;
946914   m_vgGO = 0;
947915   m_ACTS = 1;
948   m_ADSR = 1;
949916   char kbdcol[8];
950917   // look up all 16 tags 'the slow way' but only once on reset
951918   for (int i = 0; i < 16; i++)
r248389r248390
11061073    *    Complement: M=A^(P^N)
11071074    *    Erase: M=N
11081075    */
1109   ROM_LOAD( "wb8201_656f1.m1-7643-5.pr4.ic14", 0x0000, 0x0400, CRC(e8ecf59f) SHA1(49e9d109dad3d203d45471a3f4ca4985d556161f)) // label verified from nigwil's board
1076   ROM_LOAD( "wb8201_656f1.m1-7643-5.pr4.ic17", 0x0000, 0x0400, CRC(e8ecf59f) SHA1(49e9d109dad3d203d45471a3f4ca4985d556161f)) // label verified from nigwil's board
11101077
11111078   ROM_REGION(0x100, "trans", ROMREGION_ERASEFF )
11121079   /* this is the "TRANSLATOR ROM" described in figure 5-17 on page 5-27 (256*8, 82s135)
r248389r248390
11201087    *            \\\\\\\\- X'9 thru X'2
11211088    * The VT125 prom @ E60 is literally identical to this, the same exact part: 23-060B1
11221089    */
1123   ROM_LOAD( "wb---0_060b1.mmi6309.pr2.ic82", 0x0000, 0x0100, CRC(198317fc) SHA1(00e97104952b3fbe03a4f18d800d608b837d10ae)) // label verified from nigwil's board
1090   ROM_LOAD( "wb---0_060b1.mmi6309.pr2.ic77", 0x0000, 0x0100, CRC(198317fc) SHA1(00e97104952b3fbe03a4f18d800d608b837d10ae)) // label verified from nigwil's board
11241091
11251092   ROM_REGION(0x100, "dir", ROMREGION_ERASEFF )
11261093      /* this is the "DIRECTION ROM"  == mb6309 (256x8, 82s135)
r248389r248390
11471114      *            \--------- UNUSED, always 0
11481115      * The VT125 prom @ E41 is literally identical to this, the same exact part: 23-059B1
11491116      */
1150   ROM_LOAD( "wb8141_059b1.tbp18s22.pr5.ic111", 0x0000, 0x0100, CRC(4b63857a) SHA1(3217247d983521f0b0499b5c4ef6b5de9844c465))  // label verified from andy's board
1117   ROM_LOAD( "wb8141_059b1.tbp18s22.pr5.ic108", 0x0000, 0x0100, CRC(4b63857a) SHA1(3217247d983521f0b0499b5c4ef6b5de9844c465))  // label verified from andy's board
11511118
11521119   ROM_REGION( 0x100, "ras_erase", ROMREGION_ERASEFF )
11531120   /* this is the "RAS/ERASE ROM" involved with driving the RAS lines and erasing VRAM dram (256*4, 82s129)
r248389r248390
11651132    *            |\-------- Y11 (D out of ls191 left of hd46505) [verified via tracing]
11661133    *            \--------- ERASE L/d5 on the vector rom [verified via tracing]
11671134    * data bits: 3210
1168    *            |||\-- /WE for VRAM Attribute bits
1169    *            ||\--- /WE for VRAM bits 0-3 (leftmost bits, first to be shifted out)
1170    *            |\---- /WE for VRAM bits 4-7
1171    *            \----- /WE for VRAM bits 8-11 (rightmost bits, last to be shifted out)
1135    *            |||\-- ? wr_1?
1136    *            ||\--- ? wr_2?
1137    *            |\---- ? wr_3?
1138    *            \----- ? wr_4?
11721139    * The VT125 prom E93 is mostly equivalent to the ras/erase prom; On the vt125 version, the inputs are:
11731140    *  (X'10 NOR X'11)
11741141    *  (Y9 NOR Y10)
r248389r248390
11881155      X'2 inputs lend credence to this.
11891156    *
11901157    */
1191   ROM_LOAD( "wb8151_573a2.mmi6301.pr3.ic41", 0x0000, 0x0100, CRC(75885a9f) SHA1(c721dad6a69c291dd86dad102ed3a8ddd620ecc4)) // label verified from nigwil's and andy's board
1158   ROM_LOAD( "wb8151_573a2.mmi6301.pr3.ic44", 0x0000, 0x0100, CRC(75885a9f) SHA1(c721dad6a69c291dd86dad102ed3a8ddd620ecc4)) // label verified from nigwil's and andy's board
11921159
11931160   ROM_REGION( 0x100, "vector", ROMREGION_ERASEFF )
11941161   // WARNING: it is possible that the first two bytes of this prom are bad!
1195   // The PROM on andy's board appears to be damaged, this will need to be redumped from another board.
11961162   /* this is the "VECTOR ROM" (256*8, 82s135) which runs the vector generator state machine
11971163    * the vector rom bits are complex and are unfortunately poorly documented
11981164    * in the tech manual. see figure 5-23.
r248389r248390
12281194    *
12291195    * The VT125 prom E71 and its latch E70 is mostly equivalent to the vector prom, but the address order is different
12301196    */
1231   ROM_LOAD( "wb8146_058b1.mmi6309.pr1.ic99", 0x0000, 0x0100, BAD_DUMP CRC(71b01864) SHA1(e552f5b0bc3f443299282b1da7e9dbfec60e12bf))  // label verified from nigwil's and andy's board
1197   ROM_LOAD( "wb8146_058b1.mmi6309.pr1.ic99", 0x0000, 0x0100, CRC(71b01864) SHA1(e552f5b0bc3f443299282b1da7e9dbfec60e12bf))  // label verified from nigwil's and andy's board
12321198
12331199   ROM_REGION( 0x20, "sync", ROMREGION_ERASEFF )
12341200   /* this is the "SYNC ROM" == mb6331 (32x8, 82s123)
trunk/src/mess/includes/hh_ucom4.h
r248389r248390
1// license:BSD-3-Clause
2// copyright-holders:hap, Kevin Horton
3/*
4
5  NEC uCOM4 MCU tabletops/handhelds or other simple devices,
6
7*/
8
9#ifndef _HH_UCOM4_H_
10#define _HH_UCOM4_H_
11
12
13#include "emu.h"
14#include "cpu/ucom4/ucom4.h"
15#include "sound/speaker.h"
16
17
18class hh_ucom4_state : public driver_device
19{
20public:
21   hh_ucom4_state(const machine_config &mconfig, device_type type, const char *tag)
22      : driver_device(mconfig, type, tag),
23      m_maincpu(*this, "maincpu"),
24      m_inp_matrix(*this, "IN"),
25      m_speaker(*this, "speaker"),
26      m_display_wait(33),
27      m_display_maxy(1),
28      m_display_maxx(0)
29   { }
30
31   // devices
32   required_device<cpu_device> m_maincpu;
33   optional_ioport_array<5> m_inp_matrix; // max 5
34   optional_device<speaker_sound_device> m_speaker;
35
36   // misc common
37   UINT8 m_port[9];                    // MCU port A-I write data (optional)
38   UINT16 m_inp_mux;                   // multiplexed inputs mask
39
40   UINT8 read_inputs(int columns);
41
42   // display common
43   int m_display_wait;                 // led/lamp off-delay in microseconds (default 33ms)
44   int m_display_maxy;                 // display matrix number of rows
45   int m_display_maxx;                 // display matrix number of columns (max 31 for now)
46
47   UINT32 m_grid;                      // VFD current row data
48   UINT32 m_plate;                     // VFD current column data
49
50   UINT32 m_display_state[0x20];       // display matrix rows data (last bit is used for always-on)
51   UINT16 m_display_segmask[0x20];     // if not 0, display matrix row is a digit, mask indicates connected segments
52   UINT32 m_display_cache[0x20];       // (internal use)
53   UINT8 m_display_decay[0x20][0x20];  // (internal use)
54
55   TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
56   void display_update();
57   void set_display_size(int maxx, int maxy);
58   void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety);
59
60protected:
61   virtual void machine_start();
62   virtual void machine_reset();
63};
64
65
66#endif /* _HH_UCOM4_H_ */
trunk/src/mess/layout/tb303.lay
r248389r248390
44<!-- define elements -->
55
66   <element name="led" defstate="0">
7      <disk state="0"><color red="0.2" green="0.04" blue="0.046" /></disk>
8      <disk state="1"><color red="1.0" green="0.2" blue="0.23" /></disk>
7      <disk state="0"><color red="0.15" green="0.03" blue="0.03" /></disk>
8      <disk state="1"><color red="1.0" green="0.3" blue="0.3" /></disk>
99   </element>
1010
1111
12
1213<!-- build screen -->
1314
1415   <view name="Internal Layout">
1516      <bounds left="0" right="100" top="0" bottom="100" />
1617
17   <!-- 21 LEDs: D201-D221 -->
18     
19      <bezel name="x.0" element="led"><bounds x="1" y="10" width="1" height="1" /></bezel> <!-- d201 -->
2018
21      <bezel name="x.0" element="led"><bounds x="10" y="2" width="1" height="1" /></bezel> <!-- d202 -->
22      <bezel name="x.0" element="led"><bounds x="14" y="10" width="1" height="1" /></bezel> <!-- d203 -->
23
24      <bezel name="0.0" element="led"><bounds x="20" y="10" width="1" height="1" /></bezel>
25      <bezel name="3.0" element="led"><bounds x="23" y="2" width="1" height="1" /></bezel>
26      <bezel name="0.1" element="led"><bounds x="26" y="10" width="1" height="1" /></bezel>
27      <bezel name="3.1" element="led"><bounds x="29" y="2" width="1" height="1" /></bezel>
28      <bezel name="0.2" element="led"><bounds x="32" y="10" width="1" height="1" /></bezel>
29      <bezel name="0.3" element="led"><bounds x="38" y="10" width="1" height="1" /></bezel>
30      <bezel name="3.2" element="led"><bounds x="41" y="2" width="1" height="1" /></bezel>
31      <bezel name="1.0" element="led"><bounds x="44" y="10" width="1" height="1" /></bezel>
32      <bezel name="3.3" element="led"><bounds x="47" y="2" width="1" height="1" /></bezel>
33      <bezel name="1.1" element="led"><bounds x="50" y="10" width="1" height="1" /></bezel>
34      <bezel name="x.0" element="led"><bounds x="53" y="2" width="1" height="1" /></bezel> <!-- d214 -->
35      <bezel name="1.2" element="led"><bounds x="56" y="10" width="1" height="1" /></bezel>
36      <bezel name="1.3" element="led"><bounds x="62" y="10" width="1" height="1" /></bezel>
37
38      <bezel name="2.0" element="led"><bounds x="68" y="10" width="1" height="1" /></bezel>
39      <bezel name="2.1" element="led"><bounds x="74" y="10" width="1" height="1" /></bezel>
40      <bezel name="x.0" element="led"><bounds x="77" y="2" width="1" height="1" /></bezel> <!-- d219 -->
41      <bezel name="2.2" element="led"><bounds x="80" y="10" width="1" height="1" /></bezel>
42      <bezel name="2.3" element="led"><bounds x="86" y="10" width="1" height="1" /></bezel>
43
4419   </view>
4520</mamelayout>
trunk/src/mess/machine/msx.c
r248389r248390
214214
215215TIMER_DEVICE_CALLBACK_MEMBER(msx_state::msx2_interrupt)
216216{
217   m_v9938->set_resolution(m_io_dsw->read() & 0x03);
217218   m_v9938->interrupt();
218219}
219220
220221TIMER_DEVICE_CALLBACK_MEMBER(msx_state::msx2p_interrupt)
221222{
223   m_v9958->set_resolution(m_io_dsw->read() & 0x03);
222224   m_v9958->interrupt();
223225}
224226
trunk/src/osd/modules/render/drawogl.c
r248389r248390
447447//  Textures
448448//============================================================
449449
450/* ogl_texture_info holds information about a texture */
451class ogl_texture_info
450/* texture_info holds information about a texture */
451class texture_info
452452{
453453public:
454   ogl_texture_info()
454   texture_info()
455455   :   hash(0), flags(0), rawwidth(0), rawheight(0),
456456      rawwidth_create(0), rawheight_create(0),
457457      type(0), format(0), borderpix(0), xprescale(0), yprescale(0), nocopy(0),
r248389r248390
567567   void loadGLExtensions();
568568   void initialize_gl();
569569   void set_blendmode(int blendmode);
570   void texture_compute_type_subroutine(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags);
571   void texture_compute_size_subroutine(ogl_texture_info *texture, UINT32 flags,
570   void texture_compute_type_subroutine(const render_texinfo *texsource, texture_info *texture, UINT32 flags);
571   void texture_compute_size_subroutine(texture_info *texture, UINT32 flags,
572572            UINT32 width, UINT32 height,
573573            int* p_width, int* p_height, int* p_width_create, int* p_height_create);
574   void texture_compute_size_type(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags);
575   ogl_texture_info *texture_create(const render_texinfo *texsource, UINT32 flags);
576   int texture_shader_create(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags);
577   ogl_texture_info *texture_find(const render_primitive *prim);
578   void texture_coord_update(ogl_texture_info *texture, const render_primitive *prim, int shaderIdx);
579   void texture_mpass_flip(ogl_texture_info *texture, int shaderIdx);
580   void texture_shader_update(ogl_texture_info *texture, render_container *container,  int shaderIdx);
581   ogl_texture_info * texture_update(const render_primitive *prim, int shaderIdx);
582   void texture_disable(ogl_texture_info * texture);
574   void texture_compute_size_type(const render_texinfo *texsource, texture_info *texture, UINT32 flags);
575   texture_info *texture_create(const render_texinfo *texsource, UINT32 flags);
576   int texture_shader_create(const render_texinfo *texsource, texture_info *texture, UINT32 flags);
577   texture_info *texture_find(const render_primitive *prim);
578   void texture_coord_update(texture_info *texture, const render_primitive *prim, int shaderIdx);
579   void texture_mpass_flip(texture_info *texture, int shaderIdx);
580   void texture_shader_update(texture_info *texture, render_container *container,  int shaderIdx);
581   texture_info * texture_update(const render_primitive *prim, int shaderIdx);
582   void texture_disable(texture_info * texture);
583583   void texture_all_disable();
584584
585585   INT32           m_blittimer;
r248389r248390
591591
592592   int             m_initialized;        // is everything well initialized, i.e. all GL stuff etc.
593593   // 3D info (GL mode only)
594   ogl_texture_info *  m_texhash[HASH_SIZE + OVERFLOW_SIZE];
594   texture_info *  m_texhash[HASH_SIZE + OVERFLOW_SIZE];
595595   int             m_last_blendmode;     // previous blendmode
596596   INT32           m_texture_max_width;      // texture maximum width
597597   INT32           m_texture_max_height;     // texture maximum height
r248389r248390
734734//  Textures
735735//============================================================
736736
737static void texture_set_data(ogl_texture_info *texture, const render_texinfo *texsource, UINT32 flags);
737static void texture_set_data(texture_info *texture, const render_texinfo *texsource, UINT32 flags);
738738
739739//============================================================
740740//  Static Variables
r248389r248390
11061106
11071107void sdl_info_ogl::destroy_all_textures()
11081108{
1109   ogl_texture_info *texture = NULL;
1109   texture_info *texture = NULL;
11101110   int lock=FALSE;
11111111   int i;
11121112
r248389r248390
14991499int sdl_info_ogl::draw(const int update)
15001500{
15011501   render_primitive *prim;
1502   ogl_texture_info *texture=NULL;
1502   texture_info *texture=NULL;
15031503   float vofs, hofs;
15041504   int  pendingPrimitive=GL_NO_PRIMITIVE, curPrimitive=GL_NO_PRIMITIVE;
15051505
r248389r248390
19461946// we also don't want to use PBO's in the case of nocopy==TRUE,
19471947// since we now might have GLSL shaders - this decision simplifies out life ;-)
19481948//
1949void sdl_info_ogl::texture_compute_type_subroutine(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags)
1949void sdl_info_ogl::texture_compute_type_subroutine(const render_texinfo *texsource, texture_info *texture, UINT32 flags)
19501950{
19511951   texture->type = TEXTURE_TYPE_NONE;
19521952   texture->nocopy = FALSE;
r248389r248390
20002000   return (needPow2)?gl_round_to_pow2(v):v;
20012001}
20022002
2003void sdl_info_ogl::texture_compute_size_subroutine(ogl_texture_info *texture, UINT32 flags,
2003void sdl_info_ogl::texture_compute_size_subroutine(texture_info *texture, UINT32 flags,
20042004                                 UINT32 width, UINT32 height,
20052005                                 int* p_width, int* p_height, int* p_width_create, int* p_height_create)
20062006{
r248389r248390
20512051      *p_height_create=height_create;
20522052}
20532053
2054void sdl_info_ogl::texture_compute_size_type(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags)
2054void sdl_info_ogl::texture_compute_size_type(const render_texinfo *texsource, texture_info *texture, UINT32 flags)
20552055{
20562056   int finalheight, finalwidth;
20572057   int finalheight_create, finalwidth_create;
r248389r248390
22042204   return 0;
22052205}
22062206
2207int sdl_info_ogl::texture_shader_create(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags)
2207int sdl_info_ogl::texture_shader_create(const render_texinfo *texsource, texture_info *texture, UINT32 flags)
22082208{
22092209   int uniform_location;
22102210   int i;
r248389r248390
23772377   return 0;
23782378}
23792379
2380ogl_texture_info *sdl_info_ogl::texture_create(const render_texinfo *texsource, UINT32 flags)
2380texture_info *sdl_info_ogl::texture_create(const render_texinfo *texsource, UINT32 flags)
23812381{
2382   ogl_texture_info *texture;
2382   texture_info *texture;
23832383
23842384   // allocate a new texture
2385   texture = global_alloc(ogl_texture_info);
2385   texture = global_alloc(texture_info);
23862386
23872387   // fill in the core data
23882388   texture->hash = texture_compute_hash(texsource, flags);
r248389r248390
28322832//  texture_set_data
28332833//============================================================
28342834
2835static void texture_set_data(ogl_texture_info *texture, const render_texinfo *texsource, UINT32 flags)
2835static void texture_set_data(texture_info *texture, const render_texinfo *texsource, UINT32 flags)
28362836{
28372837   if ( texture->type == TEXTURE_TYPE_DYNAMIC )
28382838   {
r248389r248390
29552955//  texture_find
29562956//============================================================
29572957
2958static int compare_texture_primitive(const ogl_texture_info *texture, const render_primitive *prim)
2958static int compare_texture_primitive(const texture_info *texture, const render_primitive *prim)
29592959{
29602960   if (texture->texinfo.base == prim->texture.base &&
29612961      texture->texinfo.width == prim->texture.width &&
r248389r248390
29682968      return 0;
29692969}
29702970
2971ogl_texture_info *sdl_info_ogl::texture_find(const render_primitive *prim)
2971texture_info *sdl_info_ogl::texture_find(const render_primitive *prim)
29722972{
29732973   HashT texhash = texture_compute_hash(&prim->texture, prim->flags);
2974   ogl_texture_info *texture;
2974   texture_info *texture;
29752975
29762976   texture = m_texhash[texhash];
29772977   if (texture != NULL)
r248389r248390
29932993//  texture_update
29942994//============================================================
29952995
2996void sdl_info_ogl::texture_coord_update(ogl_texture_info *texture, const render_primitive *prim, int shaderIdx)
2996void sdl_info_ogl::texture_coord_update(texture_info *texture, const render_primitive *prim, int shaderIdx)
29972997{
29982998   float ustart = 0.0f, ustop = 0.0f;            // beginning/ending U coordinates
29992999   float vstart = 0.0f, vstop = 0.0f;            // beginning/ending V coordinates
r248389r248390
30703070   }
30713071}
30723072
3073void sdl_info_ogl::texture_mpass_flip(ogl_texture_info *texture, int shaderIdx)
3073void sdl_info_ogl::texture_mpass_flip(texture_info *texture, int shaderIdx)
30743074{
30753075   UINT32 mpass_src_idx = texture->mpass_dest_idx;
30763076
r248389r248390
31413141   }
31423142}
31433143
3144void sdl_info_ogl::texture_shader_update(ogl_texture_info *texture, render_container *container, int shaderIdx)
3144void sdl_info_ogl::texture_shader_update(texture_info *texture, render_container *container, int shaderIdx)
31453145{
31463146   int uniform_location;
31473147   GLfloat vid_attributes[4];
r248389r248390
31663166   }
31673167}
31683168
3169ogl_texture_info * sdl_info_ogl::texture_update(const render_primitive *prim, int shaderIdx)
3169texture_info * sdl_info_ogl::texture_update(const render_primitive *prim, int shaderIdx)
31703170{
3171   ogl_texture_info *texture = texture_find(prim);
3171   texture_info *texture = texture_find(prim);
31723172   int texBound = 0;
31733173
31743174   // if we didn't find one, create a new texture
r248389r248390
32393239      return texture;
32403240}
32413241
3242void sdl_info_ogl::texture_disable(ogl_texture_info * texture)
3242void sdl_info_ogl::texture_disable(texture_info * texture)
32433243{
32443244   if ( texture->type == TEXTURE_TYPE_SHADER )
32453245   {
trunk/src/osd/osdmini/minifile.c
r248389r248390
102102
103103
104104//============================================================
105//  osd_truncate
106//============================================================
107
108file_error osd_truncate(osd_file *file, UINT64 offset)
109{
110   UINT32 result;
111
112   if (!file)
113      return FILERR_FAILURE;
114
115   result = ftruncate(fileno((FILE *)file), offset);
116   if (!result)
117      return FILERR_FAILURE;
118
119   return FILERR_NONE;
120}
121
122
123//============================================================
105124//  osd_rmfile
106125//============================================================
107126
trunk/src/osd/sdl/sdlfile.c
r248389r248390
375375   {
376376      case SDLFILE_FILE:
377377         result = ftruncate(file->handle, offset);
378         if (result)
378         if (!result)
379379            return error_to_file_error(errno);
380380         return FILERR_NONE;
381381
trunk/src/tools/nltool.c
r248389r248390
105105      opt_type("y", "type",        "spice", "spice:eagle", "type of file to be converted: spice,eagle", this),
106106      opt_cmd ("c", "cmd",         "run",   "run|convert|listdevices", this),
107107      opt_verb("v", "verbose",              "be verbose - this produces lots of output", this),
108      opt_quiet("q", "quiet",               "be quiet - no warnings", this),
109108      opt_help("h", "help",                 "display help", this)
110109   {}
111110
r248389r248390
116115   poption_str_limit opt_type;
117116   poption_str    opt_cmd;
118117   poption_bool   opt_verb;
119   poption_bool   opt_quiet;
120118   poption_bool   opt_help;
121119};
122120
r248389r248390
173171public:
174172
175173   netlist_tool_t()
176   : netlist::netlist_t(), m_opts(NULL), m_setup(NULL)
174   : netlist::netlist_t(), m_logs(""), m_verbose(false), m_setup(NULL)
177175   {
178176   }
179177
r248389r248390
208206   void log_setup()
209207   {
210208      NL_VERBOSE_OUT(("Creating dynamic logs ...\n"));
211      pstring_list_t ll(m_opts ? m_opts->opt_logs() : "" , ":");
209      pstring_list_t ll(m_logs, ":");
212210      for (int i=0; i < ll.size(); i++)
213211      {
214212         pstring name = "log_" + ll[i];
215         /*netlist_device_t *nc = */ m_setup->register_dev("LOG", name);
213         /*netlist_device_t *nc = */ m_setup->register_dev("nld_log", name);
216214         m_setup->register_link(name + ".I", ll[i]);
217215      }
218216   }
219217
220   tool_options_t *m_opts;
218   pstring m_logs;
221219
220   bool m_verbose;
221
222222protected:
223223
224224   void verror(const loglevel_e level, const char *format, va_list ap) const
r248389r248390
226226      switch (level)
227227      {
228228         case NL_LOG:
229            if (m_opts ? m_opts->opt_verb() : false)
229            if (m_verbose)
230230            {
231231               vprintf(format, ap);
232232               printf("\n");
233233            }
234234            break;
235235         case NL_WARNING:
236            if (!(m_opts ? m_opts->opt_quiet() : false))
237            {
238               vprintf(format, ap);
239               printf("\n");
240            }
236            vprintf(format, ap);
237            printf("\n");
241238            break;
242239         case NL_ERROR:
243240            vprintf(format, ap);
r248389r248390
268265   netlist_tool_t nt;
269266   osd_ticks_t t = osd_ticks();
270267
271   nt.m_opts = &opts;
272268   nt.init();
269   nt.m_logs = opts.opt_logs();
270   nt.m_verbose = opts.opt_verb();
273271   nt.read_netlist(filetobuf(opts.opt_file()), opts.opt_name());
274272   double ttr = opts.opt_ttr();
275273
r248389r248390
292290{
293291   netlist_tool_t nt;
294292   nt.init();
295   const netlist::factory_list_t &list = nt.setup().factory();
293   const netlist::factory_list_t::list_t &list = nt.setup().factory().list();
296294
297295   nt.setup().register_source(palloc(netlist::source_proc_t("dummy", &netlist_dummy)));
298296   nt.setup().include("dummy");
r248389r248390
302300
303301   for (int i=0; i < list.size(); i++)
304302   {
305      netlist::base_factory_t *f = list.value_at(i);
306      pstring out = pstring::sprintf("%-20s %s(<id>", f->classname().cstr(),
307            f->name().cstr() );
303      pstring out = pstring::sprintf("%-20s %s(<id>", list[i]->classname().cstr(),
304            list[i]->name().cstr() );
308305      pstring terms("");
309306
307      netlist::base_factory_t *f = list[i];
310308      netlist::device_t *d = f->Create();
311309      d->init(nt, pstring::sprintf("dummy%d", i));
312310      d->start_dev();
r248389r248390
320318         terms += "," + inp;
321319      }
322320
323      if (f->param_desc().startsWith("+"))
321      if (list[i]->param_desc().startsWith("+"))
324322      {
325         out += "," + f->param_desc().substr(1);
323         out += "," + list[i]->param_desc().substr(1);
326324         terms = "";
327325      }
328      else if (f->param_desc() == "-")
326      else if (list[i]->param_desc() == "-")
329327      {
330328         /* no params at all */
331329      }
332330      else
333331      {
334         out += "," + f->param_desc();
332         out += "," + list[i]->param_desc();
335333      }
336334      out += ")";
337335      printf("%s\n", out.cstr());

Previous 199869 Revisions Next


© 1997-2024 The MAME Team