Previous 199869 Revisions Next

r32625 Friday 10th October, 2014 at 15:28:46 UTC by Fabio Priuli
(MESS) converted vectrex and crvision to use slot devices for
their carts. nw.

(with these, we are done for the moment with new slot devices for carts...)
[hash]crvision.xml vectrex.xml
[src/emu/bus]bus.mak
[src/emu/bus/crvision]rom.c* rom.h* slot.c* slot.h*
[src/emu/bus/vectrex]rom.c* rom.h* slot.c* slot.h*
[src/mame]mame.mak
[src/mame/drivers]vectrex.c
[src/mame/includes]vectrex.h
[src/mame/machine]vectrex.c
[src/mame/video]vectrex.c
[src/mess]mess.mak
[src/mess/drivers]crvision.c
[src/mess/includes]crvision.h

trunk/hash/vectrex.xml
r32624r32625
1818      <year>1983</year>
1919      <publisher>GCE</publisher>
2020      <part name="cart" interface="vectrex_cart">
21      <feature name="slot" value="vec_rom" />
2122         <dataarea name="rom" size="8192">
2223            <rom name="3dmnstrm.bin" size="8192" crc="b2313487" sha1="1731e892da8945fe4945b43847d23960c581682a" offset="0" />
2324         </dataarea>
r32624r32625
2930      <year>1983</year>
3031      <publisher>GCE</publisher>
3132      <part name="cart" interface="vectrex_cart">
33      <feature name="slot" value="vec_rom" />
3234         <dataarea name="rom" size="8192">
3335            <rom name="animactn.bin" size="8192" crc="9f62e167" sha1="71946be47debae89ad191ac382c2015d6a862072" offset="0" />
3436         </dataarea>
r32624r32625
4042      <year>1982</year>
4143      <publisher>GCE</publisher>
4244      <part name="cart" interface="vectrex_cart">
45      <feature name="slot" value="vec_rom" />
4346         <dataarea name="rom" size="4096">
4447            <rom name="armora.bin" size="4096" crc="b7510971" sha1="eb76f860130f8cc87826fa931350467760511213" offset="0" />
4548         </dataarea>
r32624r32625
5154      <year>1983</year>
5255      <publisher>GCE</publisher>
5356      <part name="cart" interface="vectrex_cart">
57      <feature name="slot" value="vec_rom" />
5458         <dataarea name="rom" size="4096">
5559            <rom name="artmastr.bin" size="4096" crc="c8e2f247" sha1="8f35bac5e8e0fc4ad7291bbfe5ae6e693272de06" offset="0" />
5660         </dataarea>
r32624r32625
6266      <year>1982</year>
6367      <publisher>GCE</publisher>
6468      <part name="cart" interface="vectrex_cart">
69      <feature name="slot" value="vec_rom" />
6570         <dataarea name="rom" size="4096">
6671            <rom name="bedlam.bin" size="4096" crc="a2fa649b" sha1="3ff3fa4feda6d562dedff2a10cfa8679d8318044" offset="0" />
6772         </dataarea>
r32624r32625
7378      <year>1982</year>
7479      <publisher>GCE</publisher>
7580      <part name="cart" interface="vectrex_cart">
81      <feature name="slot" value="vec_rom" />
7682         <dataarea name="rom" size="4096">
7783            <rom name="berzerk.bin" size="4096" crc="eafe2455" sha1="e4badd494ed548721328ef869d33ad70e3e522c9" offset="0" />
7884         </dataarea>
r32624r32625
8490      <year>1982</year>
8591      <publisher>GCE</publisher>
8692      <part name="cart" interface="vectrex_cart">
93      <feature name="slot" value="vec_rom" />
8794         <dataarea name="rom" size="8192">
8895            <rom name="blitz.bin" size="8192" crc="0f11ce0c" sha1="60893dfada42cf50c94083d45ad5bd14d0c031c8" offset="0" />
8996         </dataarea>
r32624r32625
95102      <year>1982</year>
96103      <publisher>GCE</publisher>
97104      <part name="cart" interface="vectrex_cart">
105      <feature name="slot" value="vec_rom" />
98106         <dataarea name="rom" size="8192">
99107            <rom name="blitza.bin" size="8192" crc="881b27c5" sha1="aa1aa811c9ce5e19f43b78a6531cdd0e707337bd" offset="0" />
100108         </dataarea>
r32624r32625
106114      <year>1982</year>
107115      <publisher>GCE</publisher>
108116      <part name="cart" interface="vectrex_cart">
117      <feature name="slot" value="vec_rom" />
109118         <dataarea name="rom" size="4096">
110119            <rom name="cleanswp.bin" size="4096" crc="f1b1de78" sha1="67f8513958c04e936b135740ed4ec6e6fa1763d5" offset="0" />
111120         </dataarea>
r32624r32625
117126      <year>1982</year>
118127      <publisher>GCE</publisher>
119128      <part name="cart" interface="vectrex_cart">
129      <feature name="slot" value="vec_rom" />
120130         <dataarea name="rom" size="8192">
121131            <rom name="mrboston.bin" size="8192" crc="bd4da4c2" sha1="299841a116e59399af4e74ccae23ddfc078e007b" offset="0" />
122132         </dataarea>
r32624r32625
128138      <year>1982</year>
129139      <publisher>GCE</publisher>
130140      <part name="cart" interface="vectrex_cart">
141      <feature name="slot" value="vec_rom" />
131142         <dataarea name="rom" size="4096">
132143            <rom name="cchasm.bin" size="4096" crc="6c1afa52" sha1="56a7f277bf09f94461dda542c04c36266d838b86" offset="0" />
133144         </dataarea>
r32624r32625
139150      <year>1983</year>
140151      <publisher>GCE</publisher>
141152      <part name="cart" interface="vectrex_cart">
153      <feature name="slot" value="vec_rom" />
142154         <dataarea name="rom" size="8192">
143155            <rom name="crzycstr.bin" size="8192" crc="92709b11" sha1="4a833e4869221f832dacb7ef0fb2997c870b7d7f" offset="0" />
144156         </dataarea>
r32624r32625
150162      <year>1983</year>
151163      <publisher>GCE</publisher>
152164      <part name="cart" interface="vectrex_cart">
165      <feature name="slot" value="vec_rom" />
153166         <dataarea name="rom" size="12288">
154167            <rom name="darktwer.bin" size="12288" crc="9dcfd5b7" sha1="dbb0b378aacc2a18dfb476aa99ab00d6ab395205" offset="0" />
155168         </dataarea>
r32624r32625
161174      <year>1983</year>
162175      <publisher>GCE</publisher>
163176      <part name="cart" interface="vectrex_cart">
177      <feature name="slot" value="vec_rom" />
164178         <dataarea name="rom" size="4096">
165179            <rom name="enginean.bin" size="4096" crc="fe9a501a" sha1="c226d78301dbe40f2194c165f2124d5afa885be4" offset="0" />
166180         </dataarea>
r32624r32625
172186      <year>1982</year>
173187      <publisher>GCE</publisher>
174188      <part name="cart" interface="vectrex_cart">
189      <feature name="slot" value="vec_rom" />
175190         <dataarea name="rom" size="8192">
176191            <rom name="fnarzod.bin" size="8192" crc="13a35c8a" sha1="286e061331289b031de33725a4966c379c1df47f" offset="0" />
177192         </dataarea>
r32624r32625
183198      <year>1983</year>
184199      <publisher>GCE</publisher>
185200      <part name="cart" interface="vectrex_cart">
201      <feature name="slot" value="vec_rom" />
186202         <dataarea name="rom" size="8192">
187203            <rom name="headsup.bin" size="8192" crc="e61a7de3" sha1="0406c13952fb0bd6adc68298ae163ebc6160484c" offset="0" />
188204         </dataarea>
r32624r32625
194210      <year>1982</year>
195211      <publisher>GCE</publisher>
196212      <part name="cart" interface="vectrex_cart">
213      <feature name="slot" value="vec_rom" />
197214         <dataarea name="rom" size="4096">
198215            <rom name="hyprchse.bin" size="4096" crc="4bb13472" sha1="a246f1d94a5b062b60784787a1d6d499b21c10cd" offset="0" />
199216         </dataarea>
r32624r32625
205222      <year>1983</year>
206223      <publisher>GCE</publisher>
207224      <part name="cart" interface="vectrex_cart">
225      <feature name="slot" value="vec_rom" />
208226         <dataarea name="rom" size="8192">
209227            <rom name="mail_plane.bin" size="8192" crc="da1ac0db" sha1="05f56e708f752ca801f8013c7da9b0db01508ba5" offset="0" />
210228         </dataarea>
r32624r32625
217235      <year>1983</year>
218236      <publisher>GCE</publisher>
219237      <part name="cart" interface="vectrex_cart">
238      <feature name="slot" value="vec_rom" />
220239         <dataarea name="rom" size="8192">
221240            <rom name="mailplne.bin" size="8192" crc="05838962" sha1="969d5ec7d7aba9ac25e54069149d9586217ab63d" offset="0" />
222241         </dataarea>
r32624r32625
228247      <year>1983</year>
229248      <publisher>GCE</publisher>
230249      <part name="cart" interface="vectrex_cart">
250      <feature name="slot" value="vec_rom" />
231251         <dataarea name="rom" size="8192">
232252            <rom name="mldymstr.bin" size="8192" crc="afefa29c" sha1="58aecc7fb1d26a22b09e9a13d845e4ed12e2449d" offset="0" />
233253         </dataarea>
r32624r32625
239259      <year>1982</year>
240260      <publisher>GCE</publisher>
241261      <part name="cart" interface="vectrex_cart">
262      <feature name="slot" value="vec_rom" />
242263         <dataarea name="rom" size="4096">
243264            <rom name="minestrm.bin" size="4096" crc="6d509566" sha1="5f00ed35f189357b4a16a190520166371ca57906" offset="0" />
244265         </dataarea>
r32624r32625
250271      <year>1983</year>
251272      <publisher>GCE</publisher>
252273      <part name="cart" interface="vectrex_cart">
274      <feature name="slot" value="vec_rom" />
253275         <dataarea name="rom" size="4096">
254276            <rom name="minestr2.bin" size="4096" crc="f5b3b374" sha1="1fdcc6e54ae5177bc9cdc79ce616ae3401e5c229" offset="0" />
255277         </dataarea>
r32624r32625
261283      <year>1983</year>
262284      <publisher>GCE</publisher>
263285      <part name="cart" interface="vectrex_cart">
286      <feature name="slot" value="vec_rom" />
264287         <dataarea name="rom" size="8192">
265288            <rom name="nrrwescp.bin" size="8192" crc="050bd949" sha1="9e5d23cb7ef111394e1804e105b6dd277c062df6" offset="0" />
266289         </dataarea>
r32624r32625
272295      <year>1983</year>
273296      <publisher>GCE</publisher>
274297      <part name="cart" interface="vectrex_cart">
298      <feature name="slot" value="vec_rom" />
275299         <dataarea name="rom" size="8192">
276300            <rom name="ptchduel.bin" size="8192" crc="c25f2e0e" sha1="f6f26beb20bb364761a9466ff4087c7b9713d048" offset="0" />
277301         </dataarea>
r32624r32625
283307      <year>1983</year>
284308      <publisher>GCE</publisher>
285309      <part name="cart" interface="vectrex_cart">
310      <feature name="slot" value="vec_rom" />
286311         <dataarea name="rom" size="8192">
287312            <rom name="polarres.bin" size="8192" crc="a7471784" sha1="87248dcd3db51c1ebf3f8e07e21ec021eec0b9be" offset="0" />
288313         </dataarea>
r32624r32625
294319      <year>1983</year>
295320      <publisher>GCE</publisher>
296321      <part name="cart" interface="vectrex_cart">
322      <feature name="slot" value="vec_rom" />
297323         <dataarea name="rom" size="8192">
298324            <rom name="polarrsb.bin" size="8192" crc="ad844645" sha1="b7bd8c8003c60535e1e776758f5c289aa9a77e81" offset="0" />
299325         </dataarea>
r32624r32625
305331      <year>1983</year>
306332      <publisher>GCE / Namco Ltd.</publisher>
307333      <part name="cart" interface="vectrex_cart">
334      <feature name="slot" value="vec_rom" />
308335         <dataarea name="rom" size="8192">
309336            <rom name="polepos.bin" size="8192" crc="a00ed3d6" sha1="8454d472435e7a6a4ca5fe129162480ca6e84b87" offset="0" />
310337         </dataarea>
r32624r32625
316343      <year>1983</year>
317344      <publisher>GCE / Namco Ltd.</publisher>
318345      <part name="cart" interface="vectrex_cart">
346      <feature name="slot" value="vec_rom" />
319347         <dataarea name="rom" size="8192">
320348            <rom name="poleposa.bin" size="8192" crc="c10f37d8" sha1="9f5b0b5e6caf6d887d3637ace70ad6a6258b999d" offset="0" />
321349         </dataarea>
r32624r32625
327355      <year>1982</year>
328356      <publisher>GCE</publisher>
329357      <part name="cart" interface="vectrex_cart">
358      <feature name="slot" value="vec_rom" />
330359         <dataarea name="rom" size="4096">
331360            <rom name="ripoff.bin" size="4096" crc="34a98132" sha1="22f7a490f6f7aaa31e892b03a85178af211f62e3" offset="0" />
332361         </dataarea>
r32624r32625
338367      <year>1983</year>
339368      <publisher>GCE</publisher>
340369      <part name="cart" interface="vectrex_cart">
370      <feature name="slot" value="vec_rom" />
341371         <dataarea name="rom" size="3671">
342372            <rom name="rcktsldg.bin" size="3671" crc="863b89e8" sha1="526b347bc02a47c8bda326b1f6da50284127f038" offset="0" />
343373         </dataarea>
r32624r32625
349379      <year>1982</year>
350380      <publisher>GCE</publisher>
351381      <part name="cart" interface="vectrex_cart">
382      <feature name="slot" value="vec_rom" />
352383         <dataarea name="rom" size="4096">
353384            <rom name="scramble.bin" size="4096" crc="707c8ffe" sha1="38e38b5c60466146d4648f8929b5ce3a08dcbe0d" offset="0" />
354385         </dataarea>
r32624r32625
360391      <year>1982</year>
361392      <publisher>GCE</publisher>
362393      <part name="cart" interface="vectrex_cart">
394      <feature name="slot" value="vec_rom" />
363395         <dataarea name="rom" size="4096">
364396            <rom name="solarq.bin" size="4096" crc="5c4611c8" sha1="38072dc491d5c729c06f4c50bc310d361e0ff62a" offset="0" />
365397         </dataarea>
r32624r32625
371403      <year>1982</year>
372404      <publisher>GCE</publisher>
373405      <part name="cart" interface="vectrex_cart">
406      <feature name="slot" value="vec_rom" />
374407         <dataarea name="rom" size="4096">
375408            <rom name="spacewar.bin" size="4096" crc="a3be5aff" sha1="0c229dd12a55044681585f7fdabd37dbc1243b59" offset="0" />
376409         </dataarea>
r32624r32625
382415      <year>1983</year>
383416      <publisher>GCE</publisher>
384417      <part name="cart" interface="vectrex_cart">
418      <feature name="slot" value="vec_rom" />
385419         <dataarea name="rom" size="8192">
386420            <rom name="spike.bin" size="8192" crc="62a61843" sha1="8bba6705e6f69f55ab6d105eac2fd5b0c0d16d9f" offset="0" />
387421         </dataarea>
r32624r32625
393427      <year>1983</year>
394428      <publisher>GCE</publisher>
395429      <part name="cart" interface="vectrex_cart">
430      <feature name="slot" value="vec_rom" />
396431         <dataarea name="rom" size="8192">
397432            <rom name="spinball.bin" size="8192" crc="02f41733" sha1="2e8285061530ccadfa2d8d11c374ae244449ebfa" offset="0" />
398433         </dataarea>
r32624r32625
404439      <year>1982</year>
405440      <publisher>GCE</publisher>
406441      <part name="cart" interface="vectrex_cart">
442      <feature name="slot" value="vec_rom" />
407443         <dataarea name="rom" size="4096">
408444            <rom name="starcas.bin" size="4096" crc="c9039623" sha1="c9b79f1ba30dcbce5a068b606a97775cf863fe0a" offset="0" />
409445         </dataarea>
r32624r32625
415451      <year>1982</year>
416452      <publisher>GCE</publisher>
417453      <part name="cart" interface="vectrex_cart">
454      <feature name="slot" value="vec_rom" />
418455         <dataarea name="rom" size="4096">
419456            <rom name="starship.bin" size="4096" crc="7967a8cb" sha1="d182eac5a54ffc642fcbe4a495c7c09f87b43585" offset="0" />
420457         </dataarea>
r32624r32625
426463      <year>1982</year>
427464      <publisher>GCE</publisher>
428465      <part name="cart" interface="vectrex_cart">
466      <feature name="slot" value="vec_rom" />
429467         <dataarea name="rom" size="4096">
430468            <rom name="startrek.bin" size="4096" crc="3768d8c3" sha1="3a2ee61316fb316d9e9efdf5ee405e813475b466" offset="0" />
431469         </dataarea>
r32624r32625
437475      <year>1982</year>
438476      <publisher>GCE</publisher>
439477      <part name="cart" interface="vectrex_cart">
478      <feature name="slot" value="vec_rom" />
440479         <dataarea name="rom" size="4096">
441480            <rom name="starhawk.bin" size="4096" crc="4de1f06b" sha1="d6b388b3951e34971c1b00c7fdf8dd00ad52df09" offset="0" />
442481         </dataarea>
r32624r32625
448487      <year>1982</year>
449488      <publisher>GCE</publisher>
450489      <part name="cart" interface="vectrex_cart">
490      <feature name="slot" value="vec_rom" />
451491         <dataarea name="rom" size="4096">
452492            <rom name="testrev4.bin" size="4096" crc="7297e815" sha1="e3418055f1e79a2300572c557e71bf2ce8badbfa" offset="0" />
453493         </dataarea>
r32624r32625
459499      <year>1983</year>
460500      <publisher>GCE</publisher>
461501      <part name="cart" interface="vectrex_cart">
502      <feature name="slot" value="vec_rom" />
462503         <dataarea name="rom" size="8192">
463504            <rom name="tourdefr.bin" size="8192" crc="bb4791f1" sha1="4f461b0b51c82433e70130eac5494f26239b4453" offset="0" />
464505         </dataarea>
r32624r32625
470511      <year>1983</year>
471512      <publisher>GCE</publisher>
472513      <part name="cart" interface="vectrex_cart">
514      <feature name="slot" value="vec_rom" />
473515         <dataarea name="rom" size="8192">
474516            <rom name="webwarp.bin" size="8192" crc="521107c3" sha1="9681dc5d38a31cb0d0c6c3bd0fc76bfdde531cce" offset="0" />
475517         </dataarea>
r32624r32625
481523      <year>1983</year>
482524      <publisher>GCE</publisher>
483525      <part name="cart" interface="vectrex_cart">
526      <feature name="slot" value="vec_rom" />
484527         <dataarea name="rom" size="8192">
485528            <rom name="webwars.bin" size="8192" crc="2ee20103" sha1="08e2df9f7769c16a4d730adf8d659f8ea4be7f9d" offset="0" />
486529         </dataarea>
r32624r32625
495538      <year>1982</year>
496539      <publisher>GCE</publisher>
497540      <part name="cart" interface="vectrex_cart">
541      <feature name="slot" value="vec_rom" />
498542         <dataarea name="rom" size="32768">
499543            <rom name="berzerkd.bin" size="32768" crc="2adc4eaa" sha1="88031823ed2af95e8a7a6239cd83b158f9b7c16a" offset="0" />
500544         </dataarea>
r32624r32625
506550      <year>1982</year>
507551      <publisher>GCE</publisher>
508552      <part name="cart" interface="vectrex_cart">
553      <feature name="slot" value="vec_rom" />
509554         <dataarea name="rom" size="4096">
510555            <rom name="startrekp.bin" size="4096" crc="563f846b" sha1="21707811e544edae66ca076351bf0743842b46e5" offset="0" />
511556         </dataarea>
trunk/hash/crvision.xml
r32624r32625
3737      <publisher>Video Technology Ltd.</publisher>
3838      <info name="serial" value="8008" />
3939      <part name="cart" interface="crvision_cart">
40         <feature name="slot" value="crv_rom4k" />
4041         <dataarea name="rom" size="4096">
4142            <rom name="airsea.bin" size="4096" crc="81a9257d" sha1="1fbc52f335c0d8bb96578a6ba764f5631c41fd36" offset="000000" />
4243         </dataarea>
r32624r32625
4950      <publisher>Video Technology Ltd.</publisher>
5051      <info name="serial" value="8014" />
5152      <part name="cart" interface="crvision_cart">
53         <feature name="slot" value="crv_rom8k" />
5254         <dataarea name="rom" size="8192">
5355            <rom name="astropin.bin" size="8192" crc="d03c0603" sha1="e7cb096d4d16fd8193f7e39c2f73bdf0930c9654" offset="000000" />
5456         </dataarea>
r32624r32625
6163      <publisher>Video Technology Ltd.</publisher>
6264      <info name="serial" value="8014" />
6365      <part name="cart" interface="crvision_cart">
66         <feature name="slot" value="crv_rom8k" />
6467         <dataarea name="rom" size="8192">
6568            <rom name="astropina_01.bin" size="4096" crc="93794d02" sha1="922152e70d614180d7e5614d61c5ced913ecfcd3" offset="0x0000" />
6669            <rom name="astropina_02.bin" size="4096" crc="aacba2e2" sha1="cf2fffe9ca93e1935efba5d264471b1a0b792971" offset="0x1000" />
r32624r32625
7780      <publisher>Video Technology Ltd.</publisher>
7881      <info name="serial" value="8014" />
7982      <part name="cart" interface="crvision_cart">
83         <feature name="slot" value="crv_rom8k" />
8084         <dataarea name="rom" size="8192">
8185            <rom name="astropinb.bin" size="8192" crc="cf7bdfc2" sha1="38bcc856d604567dc6453205a8f858bdf2000330" offset="000000" />
8286         </dataarea>
r32624r32625
8993      <publisher>Video Technology Ltd.</publisher>
9094      <info name="serial" value="8006" />
9195      <part name="cart" interface="crvision_cart">
96         <feature name="slot" value="crv_rom8k" />
9297         <dataarea name="rom" size="8192">
9398            <rom name="autochas.bin" size="8192" crc="bd091ee0" sha1="369dc9aa55dd2c09376be840f8ebeca450db8b9c" offset="000000" />
9499         </dataarea>
r32624r32625
101106      <publisher>Video Technology Ltd.</publisher>
102107      <info name="serial" value="8006" />
103108      <part name="cart" interface="crvision_cart">
109         <feature name="slot" value="crv_rom8k" />
104110         <dataarea name="rom" size="8192">
105111            <rom name="autochas_01.bin" size="4096" crc="fad237b9" sha1="7762d1b5e12bdc5f32157e6ea820da3566b2c3cd" offset="0x0000" />
106112            <rom name="autochas_02.bin" size="4096" crc="bebde090" sha1="b8af1085bdb47bcc8cf9e667313ab3bcf4cc99ea" offset="0x1000" />
r32624r32625
115121      <publisher>Video Technology Ltd.</publisher>
116122      <info name="serial" value="8011" />
117123      <part name="cart" interface="crvision_cart">
124         <feature name="slot" value="crv_rom12k" />
118125         <dataarea name="rom" size="12288">
119126            <rom name="basic82a_01.bin" size="4096" crc="9b2aeef8" sha1="73950bf03abc8f6646a8d283e12760de453eddf2" offset="0x0000" />
120127            <rom name="basic82a_02.bin" size="4096" crc="d713b2d1" sha1="e1af1debb8a05f38aaf14dc79cacbc713f02e6fd" offset="0x1000" />
r32624r32625
129136      <publisher>Video Technology Ltd.</publisher>
130137      <info name="serial" value="8011" />
131138      <part name="cart" interface="crvision_cart">
139         <feature name="slot" value="crv_rom12k" />
132140         <dataarea name="rom" size="12288">
133141            <rom name="basic82b_01.bin" size="4096" crc="5ee092d0" sha1="c02b0a7e81a2f43a704376381c167b7c6632119c" offset="0x0000" />
134142            <rom name="basic82b_02.bin" size="4096" crc="19a12d7e" sha1="181c27465e7e2da58e7432eaa0ae03e186b6c365" offset="0x1000" />
r32624r32625
143151      <publisher>Video Technology Ltd.</publisher>
144152      <info name="serial" value="8011" />
145153      <part name="cart" interface="crvision_cart">
154         <feature name="slot" value="crv_rom12k" />
146155         <dataarea name="rom" size="12288">
147156            <rom name="basic83_01.bin" size="8192" crc="3ce2a7ca" sha1="f2171867767d0b658eea0b072aa1891869073bb9" offset="0x0000" />
148157            <rom name="basic83_02.bin" size="4096" crc="40f388b9" sha1="989a54e92768baae81cd179808adf1f9943212ee" offset="0x2000" />
r32624r32625
156165      <publisher>Video Technology Ltd.</publisher>
157166      <info name="serial" value="8011" />
158167      <part name="cart" interface="crvision_cart">
168         <feature name="slot" value="crv_rom12k" />
159169         <dataarea name="rom" size="12288">
160170            <rom name="basicram_01.bin" size="4096" crc="5ee092d0" sha1="c02b0a7e81a2f43a704376381c167b7c6632119c" offset="0x0000" />
161171            <rom name="basicram_02.bin" size="4096" crc="76e661db" sha1="ad0aff12c7bee9dd4f256942614b7e99586698f5" offset="0x1000" />
r32624r32625
170180      <publisher>Video Technology Ltd.</publisher>
171181      <info name="serial" value="8021" />
172182      <part name="cart" interface="crvision_cart">
183         <feature name="slot" value="crv_rom18k" />
173184         <dataarea name="rom" size="18432">
174185            <rom name="chopper_01.bin" size="8192" crc="23a6bb47" sha1="748e4c98ed419999063edfe98f26f9e86c877962" offset="0x0000" />
175186            <rom name="chopper_02.bin" size="8192" crc="3980d7ed" sha1="abac0f2a0b73ab5c45e1a617f7c862408086eb66" offset="0x2000" />
r32624r32625
184195      <publisher>Video Technology Ltd.</publisher>
185196      <info name="serial" value="8001" />
186197      <part name="cart" interface="crvision_cart">
198         <feature name="slot" value="crv_rom4k" />
187199         <dataarea name="rom" size="4096">
188200            <rom name="crazych.bin" size="4096" crc="b1b5bfe5" sha1="c0eed370267644d142a42de6201f7ac6d275104d" offset="000000" />
189201         </dataarea>
r32624r32625
196208      <publisher>Video Technology Ltd.</publisher>
197209      <info name="serial" value="8001" />
198210      <part name="cart" interface="crvision_cart">
211         <feature name="slot" value="crv_rom4k" />
199212         <dataarea name="rom" size="4096">
200213            <rom name="crazypuc.bin" size="4096" crc="c673be37" sha1="0762ba98e9a08b7e6063e2a54734becd83df6eb3" offset="000000" />
201214         </dataarea>
r32624r32625
208221      <publisher>Video Technology Ltd.</publisher>
209222      <info name="serial" value="8013" />
210223      <part name="cart" interface="crvision_cart">
224         <feature name="slot" value="crv_rom6k" />
211225         <dataarea name="rom" size="6144">
212226            <rom name="deeps6k_01.bin" size="4096" crc="5112b792" sha1="af917b6ab438b87cde5325d27ccf94c4544c4c9e" offset="0x0000" />
213227            <rom name="deeps6k_02.bin" size="2048" crc="2410042a" sha1="e3813c79b8e504f10d6bfc8a6d39ea284fbc26b6" offset="0x1000" />
r32624r32625
221235      <publisher>Video Technology Ltd.</publisher>
222236      <info name="serial" value="8013" />
223237      <part name="cart" interface="crvision_cart">
238         <feature name="slot" value="crv_rom8k" />
224239         <dataarea name="rom" size="8192">
225240            <rom name="deeps8k.bin" size="8192" crc="2e0ddd86" sha1="d25f82aab473d4c7850ab626ae92d1eac69dbb32" offset="000000" />
226241         </dataarea>
r32624r32625
233248      <publisher>Video Technology Ltd.</publisher>
234249      <info name="serial" value="8020" />
235250      <part name="cart" interface="crvision_cart">
251         <feature name="slot" value="crv_rom10k" />
236252         <dataarea name="rom" size="10240">
237253            <rom name="locom10k_01.bin" size="8192" crc="5d2e1c6e" sha1="f327434889ac91397c61cdacb88d21cd0df256ce" offset="0x0000" />
238254            <rom name="locom10k_02.bin" size="2048" crc="a4e5c224" sha1="ffa0fcb1fa524ee51e63017412007881a50b8971" offset="0x2000" />
r32624r32625
246262      <publisher>Video Technology Ltd.</publisher>
247263      <info name="serial" value="8020" />
248264      <part name="cart" interface="crvision_cart">
265         <feature name="slot" value="crv_rom12k" />
249266         <dataarea name="rom" size="12288">
250267            <rom name="locom12k_01.bin" size="8192" crc="5d2e1c6e" sha1="f327434889ac91397c61cdacb88d21cd0df256ce" offset="0x0000" />
251268            <rom name="locom12k_02.bin" size="4096" crc="62c6b8e0" sha1="2ebf87eaf6a60bc0d79020a20360916a2c1f0f80" offset="0x2000" />
r32624r32625
259276      <publisher>Video Technology Ltd.</publisher>
260277      <info name="serial" value="8015" />
261278      <part name="cart" interface="crvision_cart">
279         <feature name="slot" value="crv_rom8k" />
262280         <dataarea name="rom" size="8192">
263281            <rom name="mousepuz.bin" size="8192" crc="e954c46b" sha1="c3aa8077756a6101009645711687edd59bf90a98" offset="000000" />
264282         </dataarea>
r32624r32625
271289      <publisher>Video Technology Ltd.</publisher>
272290      <info name="serial" value="8015" />
273291      <part name="cart" interface="crvision_cart">
292         <feature name="slot" value="crv_rom8k" />
274293         <dataarea name="rom" size="8192">
275294            <rom name="mousepuza_01.bin" size="4096" crc="42fa1f8b" sha1="d8da4361cd2c3eb87abb41c4a05ee5136ac1b8b0" offset="0x0000" />
276295            <rom name="mousepuza_02.bin" size="4096" crc="09f79bd9" sha1="8325d9b017eab11e24c637599961736b6c25e24e" offset="0x1000" />
r32624r32625
284303      <publisher>Video Technology Ltd.</publisher>
285304      <info name="serial" value="8016" />
286305      <part name="cart" interface="crvision_cart">
306         <feature name="slot" value="crv_rom12k" />
287307         <dataarea name="rom" size="12288">
288308            <rom name="musicmak_01.bin" size="8192" crc="47ac1882" sha1="bdf343bff5436a4b91ffad20971c3b1c05711307" offset="0x0000" />
289309            <rom name="musicmak_02.bin" size="4096" crc="e8caa6d2" sha1="9d3d95e18416fbe0ab30b7d5e3e2518b6a520323" offset="0x2000" />
r32624r32625
297317      <publisher>Video Technology Ltd.</publisher>
298318      <info name="serial" value="8005" />
299319      <part name="cart" interface="crvision_cart">
320         <feature name="slot" value="crv_rom6k" />
300321         <dataarea name="rom" size="6144">
301322            <rom name="planetd_01.bin" size="4096" crc="71cffcdd" sha1="cd72a22d44c9a4be2346847b8ef6e32d929533ae" offset="0x0000" />
302323            <rom name="planetd_02.bin" size="2048" crc="734528a9" sha1="39772785538bb7ee061c9bcaa14768328d45674d" offset="0x1000" />
r32624r32625
310331      <publisher>Video Technology Ltd.</publisher>
311332      <info name="serial" value="8005" />
312333      <part name="cart" interface="crvision_cart">
334         <feature name="slot" value="crv_rom8k" />
313335         <dataarea name="rom" size="8192">
314336            <rom name="planet8k.bin" size="8192" crc="4457c7b3" sha1="0be7935db55ecf3e70b96e071ecbc489bd22dc73" offset="000000" />
315337         </dataarea>
r32624r32625
321343      <year>1981</year>
322344      <publisher>Video Technology Ltd.</publisher>
323345      <part name="cart" interface="crvision_cart">
346         <feature name="slot" value="crv_rom8k" />
324347         <dataarea name="rom" size="8192">
325348            <rom name="planetd2.bin" size="8192" crc="4b463c18" sha1="1fd80a3921f2487d9eee2b6d8bb3955d22857d0e" offset="000000" />
326349         </dataarea>
r32624r32625
333356      <publisher>Video Technology Ltd.</publisher>
334357      <info name="serial" value="8009" />
335358      <part name="cart" interface="crvision_cart">
359         <feature name="slot" value="crv_rom8k" />
336360         <dataarea name="rom" size="8192">
337361            <rom name="policej.bin" size="8192" crc="db3d50b2" sha1="0fe6d15c973c73b53c33945e213bc2671ff5d7df" offset="000000" />
338362         </dataarea>
r32624r32625
345369      <publisher>Video Technology Ltd.</publisher>
346370      <info name="serial" value="8009" />
347371      <part name="cart" interface="crvision_cart">
372         <feature name="slot" value="crv_rom8k" />
348373         <dataarea name="rom" size="8192">
349374            <rom name="policej_01.bin" size="4096" crc="c6c4e3f4" sha1="8d4f056f77d79b0a9a76d14772f76a0b81b526c6" offset="0x0000" />
350375            <rom name="policej_02.bin" size="4096" crc="bd48d4dc" sha1="20e11659285172e6579d57d6a1a769818762c856" offset="0x1000" />
r32624r32625
358383      <publisher>Video Technology Ltd.</publisher>
359384      <info name="serial" value="8009" />
360385      <part name="cart" interface="crvision_cart">
386         <feature name="slot" value="crv_rom8k" />
361387         <dataarea name="rom" size="8192">
362388            <!-- Apparently, even internally to V-Tech this Donkey Kong clone was acknowledged as such ;-) -->
363389            <rom name="dk a.bin" size="4096" crc="3033cafe" sha1="a626fd7e1e117d4dba8770f7ac3f85886a6d7022" offset="0x0000" />
r32624r32625
372398      <publisher>Video Technology Ltd.</publisher>
373399      <info name="serial" value="8017" />
374400      <part name="cart" interface="crvision_cart">
401         <feature name="slot" value="crv_rom12k" />
375402         <dataarea name="rom" size="12288">
376403            <rom name="soccer_01.bin" size="8192" crc="9247087c" sha1="3fe1364024895f8f0e83235a429f884a8831553e" offset="0x0000" />
377404            <rom name="soccer_02.bin" size="4096" crc="de284150" sha1="a07befd3a2b1689b2d493ab84928d3aa109f88e6" offset="0x2000" />
r32624r32625
385412      <publisher>Video Technology Ltd.</publisher>
386413      <info name="serial" value="8003" />
387414      <part name="cart" interface="crvision_cart">
415         <feature name="slot" value="crv_rom4k" />
388416         <dataarea name="rom" size="4096">
389417            <rom name="sonicinv.bin" size="4096" crc="767a1f38" sha1="d77f49bfa951ce0ba505ad4f05f3d0adb697811f" offset="000000" />
390418         </dataarea>
r32624r32625
396424      <year>1984</year>
397425      <publisher>Video Technology Ltd.</publisher>
398426      <part name="cart" interface="crvision_cart">
427         <feature name="slot" value="crv_rom8k" />
399428         <dataarea name="rom" size="8192">
400429            <rom name="stoneage.bin" size="8192" crc="74365e94" sha1="dafe57b0ea5da7431bd5b0393bae7cf256c9a562" offset="000000" />
401430         </dataarea>
r32624r32625
408437      <publisher>Video Technology Ltd.</publisher>
409438      <info name="serial" value="8002" />
410439      <part name="cart" interface="crvision_cart">
440         <feature name="slot" value="crv_rom6k" />
411441         <dataarea name="rom" size="6144">
412442            <rom name="tankatk_01.bin" size="4096" crc="3bd183ff" sha1="c5b7c59ea282238550acd5055fb197aa83163eea" offset="0x0000" />
413443            <rom name="tankatk_02.bin" size="2048" crc="114a3a00" sha1="54a7ae46ab79109cbda7401204e3cec13a0b6152" offset="0x1000" />
r32624r32625
421451      <publisher>Video Technology Ltd.</publisher>
422452      <info name="serial" value="8002" />
423453      <part name="cart" interface="crvision_cart">
454         <feature name="slot" value="crv_rom8k" />
424455         <dataarea name="rom" size="8192">
425456            <rom name="tankat8k.bin" size="8192" crc="2621ffca" sha1="f3c69a848f1246faf6f9558c0badddd3db626e5f" offset="000000" />
426457         </dataarea>
r32624r32625
433464      <publisher>Video Technology Ltd.</publisher>
434465      <info name="serial" value="8004" />
435466      <part name="cart" interface="crvision_cart">
467         <feature name="slot" value="crv_rom6k" />
436468         <dataarea name="rom" size="6144">
437469            <rom name="tens6k_01.bin" size="4096" crc="42d5be57" sha1="e8ddc68c418f43dacc9170c335bd66bd7802821c" offset="0x0000" />
438470            <rom name="tens6k_02.bin" size="2048" crc="9fac0db1" sha1="ecfb92eb58f916d5b5520bb351c71fc78837a165" offset="0x1000" />
r32624r32625
447479      <publisher>Video Technology Ltd.</publisher>
448480      <info name="serial" value="8004" />
449481      <part name="cart" interface="crvision_cart">
482         <feature name="slot" value="crv_rom8k" />
450483         <dataarea name="rom" size="8192">
451484            <rom name="tens8k.bin" size="8192" crc="8bed8745" sha1="690a4dcb412e517b172ec5b44c86863ef63b1246" offset="000000" />
452485         </dataarea>
r32624r32625
459492      <publisher>Video Technology Ltd.</publisher>
460493      <info name="serial" value="8004" />
461494      <part name="cart" interface="crvision_cart">
495         <feature name="slot" value="crv_rom8k" />
462496         <dataarea name="rom" size="8192">
463497            <rom name="tens8k_01.bin" size="4096" crc="bfa874cd" sha1="91d1f66ac850728b65045c61b403fb52557336be" offset="0x0000" />
464498            <rom name="tens8k_02.bin" size="4096" crc="42d5be57" sha1="e8ddc68c418f43dacc9170c335bd66bd7802821c" offset="0x1000" />
r32624r32625
472506      <publisher>Video Technology Ltd.</publisher>
473507      <info name="serial" value="8004" />
474508      <part name="cart" interface="crvision_cart">
509         <feature name="slot" value="crv_rom8k" />
475510         <dataarea name="rom" size="8192">
476511            <rom name="tenscs8k.bin" size="8192" crc="098d1cbb" sha1="7ea0c5aa6072e2c9eab711f278fd939986a92602" offset="000000" />
477512         </dataarea>
r32624r32625
484519      <publisher>Video Technology Ltd.</publisher>
485520      <info name="serial" value="Y-1620" />
486521      <part name="cart" interface="crvision_cart">
522         <feature name="slot" value="crv_rom6k" />
487523         <dataarea name="rom" size="6144">
488524            <rom name="tensds6k_01.bin" size="4096" crc="97ab341a" sha1="7cf7ea8a2f70bdbd165a9a523fe50f15b36c9a0e" offset="0x0000" />
489525            <rom name="tensds6k_02.bin" size="2048" crc="d669020b" sha1="523bf43e6c237d04e9649bf7beb1da278a346752" offset="0x1000" />
r32624r32625
498534      <publisher>Video Technology Ltd.</publisher>
499535      <info name="serial" value="Y-1620" />
500536      <part name="cart" interface="crvision_cart">
537         <feature name="slot" value="crv_rom8k" />
501538         <dataarea name="rom" size="8192">
502539            <rom name="tensds8k.bin" size="8192" crc="c914c092" sha1="7b64efddb590332c192f6c4a6accce85a6d402c3" offset="000000" />
503540         </dataarea>
r32624r32625
512549      <year>198?</year>
513550      <publisher>Richard Hayter</publisher>
514551      <part name="cart" interface="crvision_cart">
552         <feature name="slot" value="crv_rom4k" />
515553         <dataarea name="rom" size="4096">
516554            <rom name="hapmon.bin" size="4096" crc="15d07b96" sha1="89359dca952bc90644dfd7f546c184a8165faa14" offset="000000" />
517555         </dataarea>
r32624r32625
524562        <year>1983</year>
525563        <publisher>Video Technology Ltd.</publisher>
526564        <part name="cart" interface="crvision_cart">
565            <feature name="slot" value="crv_rom18k">
527566            <dataarea name="rom" size="18432">
528567                <rom name="chopper rescue (alt).rom" size="18432" crc="48e7e8b8" sha1="037088f15830fdd43081edddc5d683318d67ee01" offset="000000" />
529568            </dataarea>
r32624r32625
535574        <year>1983</year>
536575        <publisher>Video Technology Ltd.</publisher>
537576        <part name="cart" interface="crvision_cart">
577            <feature name="slot" value="crv_rom18k">
538578            <dataarea name="rom" size="18432">
539579                <rom name="chopper rescue.rom" size="18432" crc="14179570" sha1="fde339c8dbd44b3332e888cd24d3d492cf066b94" offset="000000" />
540580            </dataarea>
trunk/src/mame/drivers/vectrex.c
r32624r32625
1313#include "video/vector.h"
1414#include "machine/6522via.h"
1515#include "includes/vectrex.h"
16#include "imagedev/cartslot.h"
1716#include "sound/ay8910.h"
1817#include "sound/dac.h"
1918#include "machine/nvram.h"
2019
2120
2221static ADDRESS_MAP_START(vectrex_map, AS_PROGRAM, 8, vectrex_state )
23   AM_RANGE(0x0000, 0x7fff) AM_RAMBANK("bank1") AM_REGION("maincpu", 0)
22   AM_RANGE(0x0000, 0x7fff) AM_NOP   // cart area, handled at machine_start
2423   AM_RANGE(0xc800, 0xcbff) AM_RAM AM_MIRROR(0x0400) AM_SHARE("gce_vectorram")
2524   AM_RANGE(0xd000, 0xd7ff) AM_READWRITE(vectrex_via_r, vectrex_via_w)
26   AM_RANGE(0xe000, 0xffff) AM_ROM
25   AM_RANGE(0xe000, 0xffff) AM_ROM AM_REGION("maincpu", 0)
2726ADDRESS_MAP_END
2827
2928static INPUT_PORTS_START(vectrex)
r32624r32625
8483
8584INPUT_PORTS_END
8685
86static SLOT_INTERFACE_START(vectrex_cart)
87   SLOT_INTERFACE_INTERNAL("vec_rom",    VECTREX_ROM_STD)
88   SLOT_INTERFACE_INTERNAL("vec_rom64k", VECTREX_ROM_64K)
89   SLOT_INTERFACE_INTERNAL("vec_sram",   VECTREX_ROM_SRAM)
90SLOT_INTERFACE_END
91
8792static MACHINE_CONFIG_START( vectrex, vectrex_state )
8893   /* basic machine hardware */
8994   MCFG_CPU_ADD("maincpu", M6809, XTAL_6MHz / 4)
r32624r32625
97102   MCFG_SCREEN_VISIBLE_AREA(0, 399, 0, 299)
98103   MCFG_SCREEN_UPDATE_DRIVER(vectrex_state, screen_update_vectrex)
99104
100
101105   /* sound hardware */
102106   MCFG_SPEAKER_STANDARD_MONO("mono")
103107   MCFG_DAC_ADD("dac")
r32624r32625
118122   MCFG_VIA6522_IRQ_HANDLER(WRITELINE(vectrex_state, vectrex_via_irq))
119123
120124   /* cartridge */
121   MCFG_CARTSLOT_ADD("cart")
122   MCFG_CARTSLOT_EXTENSION_LIST("bin,gam,vec")
123   MCFG_CARTSLOT_NOT_MANDATORY
124   MCFG_CARTSLOT_LOAD(vectrex_state,vectrex_cart)
125   MCFG_CARTSLOT_INTERFACE("vectrex_cart")
125   MCFG_VECTREX_CARTRIDGE_ADD("cartslot", vectrex_cart, NULL)
126126
127127   /* software lists */
128128   MCFG_SOFTWARE_LIST_ADD("cart_list","vectrex")
129129MACHINE_CONFIG_END
130130
131131ROM_START(vectrex)
132   ROM_REGION(0x18000,"maincpu", 0)
132   ROM_REGION(0x2000,"maincpu", 0)
133133   ROM_SYSTEM_BIOS(0, "bios0", "exec rom")
134   ROMX_LOAD("exec_rom.bin", 0xe000, 0x2000, CRC(ba13fb57) SHA1(65d07426b520ddd3115d40f255511e0fd2e20ae7), ROM_BIOS(1) )
134   ROMX_LOAD("exec_rom.bin", 0x0000, 0x2000, CRC(ba13fb57) SHA1(65d07426b520ddd3115d40f255511e0fd2e20ae7), ROM_BIOS(1) )
135135   ROM_SYSTEM_BIOS(1, "bios1", "exec rom intl 284001-1")
136   ROMX_LOAD("exec_rom_intl_284001-1.bin", 0xe000, 0x2000, CRC(6d2bd167) SHA1(77a220d5d98846b606dff608f7b5d00183ec3bab), ROM_BIOS(2) )
136   ROMX_LOAD("exec_rom_intl_284001-1.bin", 0x0000, 0x2000, CRC(6d2bd167) SHA1(77a220d5d98846b606dff608f7b5d00183ec3bab), ROM_BIOS(2) )
137137
138138//  The following fastboots are listed here for reference and documentation
139139//  ROM_SYSTEM_BIOS(2, "bios2", "us-fastboot hack")
140//  ROMX_LOAD("us-fastboot.bin", 0xe000, 0x2000, CRa6e4dac4) SHA1(e0900be6d6858b985fd7f0999d864b2fceaf01a1), ROM_BIOS(3) )
140//  ROMX_LOAD("us-fastboot.bin", 0x0000, 0x2000, CRa6e4dac4) SHA1(e0900be6d6858b985fd7f0999d864b2fceaf01a1), ROM_BIOS(3) )
141141//  ROM_SYSTEM_BIOS(3, "bios3", "intl-fastboot hack")
142//  ROMX_LOAD("intl-fastboot.bin", 0xe000, 0x2000, CRC(71dcf0f4) SHA1(2a257c5111f5cee841bd14acaa9df6496aaf3d8b), ROM_BIOS(4) )
142//  ROMX_LOAD("intl-fastboot.bin", 0x0000, 0x2000, CRC(71dcf0f4) SHA1(2a257c5111f5cee841bd14acaa9df6496aaf3d8b), ROM_BIOS(4) )
143143
144144ROM_END
145145
r32624r32625
218218   MCFG_DEVICE_MODIFY("via6522_0")
219219   MCFG_VIA6522_READPB_HANDLER(READ8(vectrex_state, vectrex_s1_via_pb_r))
220220
221   MCFG_DEVICE_REMOVE("cart")
221   MCFG_DEVICE_REMOVE("cartslot")
222222MACHINE_CONFIG_END
223223
224224ROM_START(raaspec)
trunk/src/mame/machine/vectrex.c
r32624r32625
4242static const double narrow_escape_angles[3] = {0, 0.1631, 0.3305};
4343static const double crazy_coaster_angles[3] = {0, 0.1631, 0.3305};
4444
45
4645static const double unknown_game_angles[3] = {0,0.16666666, 0.33333333};
4746
4847
49int vectrex_state::vectrex_verify_cart(char *data)
50{
51   /* Verify the file is accepted by the Vectrex bios */
52   if (!memcmp(data,"g GCE", 5))
53      return IMAGE_VERIFY_PASS;
54   else
55      return IMAGE_VERIFY_FAIL;
56}
5748
58
5949void vectrex_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
6050{
6151   switch (id)
r32624r32625
8777}
8878
8979
90/*********************************************************************
9180
92   ROM load and id functions
93
94*********************************************************************/
95
96DEVICE_IMAGE_LOAD_MEMBER(vectrex_state,vectrex_cart)
97{
98   UINT8 *mem = memregion("maincpu")->base();
99   if (image.software_entry() == NULL)
100   {
101      image.fread( mem, 0x8000);
102      if (image.length() > 0x8000)
103      {
104         image.fread( mem+0x10000, 0x8000);
105         m_64k_cart = 1;
106      }
107   } else {
108      int size = image.get_software_region_length("rom");
109      memcpy(mem, image.get_software_region("rom"), size);
110   }
111
112   /* check image! */
113   if (vectrex_verify_cart((char*)mem) == IMAGE_VERIFY_FAIL)
114   {
115      logerror("Invalid image!\n");
116      return IMAGE_INIT_FAIL;
117   }
118
119   if (memcmp(mem + 0x06,"SRAM",4)) {
120      m_maincpu->space(AS_PROGRAM).unmap_write(0x0000, 0x7fff);
121   }
122
123   /* If VIA T2 starts, reset refresh timer.
124      This is the best strategy for most games. */
125   m_reset_refresh = 1;
126
127   m_imager_angles = narrow_escape_angles;
128
129   /* let's do this 3D detection with a strcmp using data inside the cart images */
130   /* slightly prettier than having to hardcode CRCs */
131
132   /* handle 3D Narrow Escape but skip the 2-d hack of it from Fred Taft */
133   if (!memcmp(mem + 0x11,"NARROW",6) && (((char*)mem)[0x39] == 0x0c))
134   {
135      m_imager_angles = narrow_escape_angles;
136   }
137
138   if (!memcmp(mem + 0x11,"CRAZY COASTER", 13))
139   {
140      m_imager_angles = crazy_coaster_angles;
141   }
142
143   if (!memcmp(mem + 0x11,"3D MINE STORM", 13))
144   {
145      m_imager_angles = minestorm_3d_angles;
146
147      /* Don't reset T2 each time it's written.
148         This would cause jerking in mine3. */
149      m_reset_refresh = 0;
150   }
151
152   return IMAGE_INIT_PASS;
153}
154
155
15681/*********************************************************************
15782
15883   Vectrex configuration (mainly 3D Imager)
r32624r32625
377302
378303DRIVER_INIT_MEMBER(vectrex_state,vectrex)
379304{
380   int i;
381
382   m_64k_cart = 0;
383305   m_imager_angles = unknown_game_angles;
384306   m_beam_color = rgb_t::white;
385   for (i=0; i<ARRAY_LENGTH(m_imager_colors); i++)
307   for (int i = 0; i < ARRAY_LENGTH(m_imager_colors); i++)
386308      m_imager_colors[i] = rgb_t::white;
387309
388310   /*
r32624r32625
394316   m_gce_vectorram[0x7e] = machine().rand() | 1;
395317   m_gce_vectorram[0x7f] = machine().rand() | 1;
396318}
319
320void vectrex_state::machine_start()
321{
322   if (m_cart && m_cart->exists())
323   {
324      // install cart accesses
325      if (m_cart->get_type() == VECTREX_SRAM)
326         m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x0000, 0x7fff, read8_delegate(FUNC(vectrex_cart_slot_device::read_rom),(vectrex_cart_slot_device*)m_cart), write8_delegate(FUNC(vectrex_cart_slot_device::write_ram),(vectrex_cart_slot_device*)m_cart));
327      else
328         m_maincpu->space(AS_PROGRAM).install_read_handler(0x0000, 0x7fff, read8_delegate(FUNC(vectrex_cart_slot_device::read_rom),(vectrex_cart_slot_device*)m_cart));
329
330      // setup 3d imager and refresh timer
331     
332      // If VIA T2 starts, reset refresh timer. This is the best strategy for most games.
333      m_reset_refresh = 1;
334      m_imager_angles = narrow_escape_angles;
335     
336      // let's do this 3D detection
337      switch (m_cart->get_vec3d())
338      {
339         case VEC3D_MINEST:
340            m_imager_angles = minestorm_3d_angles;
341            // Don't reset T2 each time it's written. This would cause jerking in mine3.
342            m_reset_refresh = 0;
343            break;
344         case VEC3D_CCOAST:
345            m_imager_angles = crazy_coaster_angles;
346            break;
347         case VEC3D_NARROW:
348            m_imager_angles = narrow_escape_angles;
349            break;
350         default:
351            break;
352      }
353   }
354}
trunk/src/mame/includes/vectrex.h
r32624r32625
1212#include "sound/ay8910.h"
1313#include "video/vector.h"
1414
15#include "bus/vectrex/slot.h"
16#include "bus/vectrex/rom.h"
1517
1618#define NVECT 10000
1719
r32624r32625
4446      m_dac(*this, "dac"),
4547      m_ay8912(*this, "ay8912"),
4648      m_vector(*this, "vector"),
49      m_cart(*this, "cartslot"),
4750      m_io_contr1x(*this, "CONTR1X"),
4851      m_io_contr1y(*this, "CONTR1Y"),
4952      m_io_contr2x(*this, "CONTR2X"),
r32624r32625
5457      m_io_lpenx(*this, "LPENX"),
5558      m_io_lpeny(*this, "LPENY"),
5659      m_io_coin(*this, "COIN"),
57      m_screen(*this, "screen") { }
60      m_screen(*this, "screen")
61   { }
5862
5963   required_shared_ptr<UINT8> m_gce_vectorram;
60   int m_64k_cart;
6164   int m_imager_status;
6265   UINT32 m_beam_color;
6366   unsigned char m_via_out[2];
r32624r32625
99102   DECLARE_WRITE8_MEMBER(raaspec_led_w);
100103   DECLARE_DRIVER_INIT(vectrex);
101104   virtual void video_start();
105   virtual void machine_start();
102106   DECLARE_VIDEO_START(raaspec);
103107   UINT32 screen_update_vectrex(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
104108   TIMER_CALLBACK_MEMBER(vectrex_imager_change_color);
r32624r32625
126130   required_device<dac_device> m_dac;
127131   required_device<ay8910_device> m_ay8912;
128132   required_device<vector_device> m_vector;
133   optional_device<vectrex_cart_slot_device> m_cart;
129134   optional_ioport m_io_contr1x;
130135   optional_ioport m_io_contr1y;
131136   optional_ioport m_io_contr2x;
r32624r32625
142147   void vectrex_multiplexer(int mux);
143148   void vectrex_add_point(int x, int y, rgb_t color, int intensity);
144149   void vectrex_add_point_stereo(int x, int y, rgb_t color, int intensity);
145   int vectrex_verify_cart(char *data);
146150};
147151
148152#endif /* VECTREX_H_ */
trunk/src/mame/mame.mak
r32624r32625
575575#BUSES += ABCKB
576576#BUSES += ADAM
577577#BUSES += ADAMNET
578#BUSES += APF
579#BUSES += ARCADIA
578580#BUSES += BML3
579581#BUSES += BW2
580582#BUSES += C64
581583#BUSES += CBM2
582584#BUSES += CBMIEC
583585BUSES += CENTRONICS
586#BUSES += CHANNELF
584587#BUSES += COCO
585588#BUSES += COLECO
586589#BUSES += COMPUCOLOR
587590#BUSES += COMX35
588591#BUSES += CPC
592#BUSES += CRVISION
589593#BUSES += DMV
590594#BUSES += ECBBUS
591595#BUSES += ECONET
r32624r32625
596600BUSES += GENERIC
597601#BUSES += IEEE488
598602#BUSES += IMI7000
603#BUSES += INTV
599604#BUSES += IQ151
600605BUSES += ISA
601606#BUSES += ISBX
r32624r32625
607612BUSES += NEOGEO
608613#BUSES += NES
609614#BUSES += NUBUS
615#BUSES += O2
610616#BUSES += ORICEXT
611617#BUSES += PCE
612618#BUSES += PCI
r32624r32625
627633#BUSES += TI99PEB
628634#BUSES += TVC
629635#BUSES += VBOY
636#BUSES += VC4000
630637#BUSES += VCS
631638#BUSES += VCS_CTRL
639BUSES += VECTREX
632640#BUSES += VIC10
633641#BUSES += VIC20
634642#BUSES += VIDBRAIN
r32624r32625
636644#BUSES += VTECH_IOEXP
637645#BUSES += VTECH_MEMEXP
638646#BUSES += WANGPC
647#BUSES += WSWAN
639648#BUSES += X68K
640649#BUSES += Z88
641650#BUSES += ZORRO
trunk/src/mame/video/vectrex.c
r32624r32625
330330   }
331331
332332   /* Cartridge bank-switching */
333   if (m_64k_cart && ((data ^ m_via_out[PORTB]) & 0x40))
334   {
335      membank("bank1")->set_base(memregion("maincpu")->base() + ((data & 0x40) ? 0x10000 : 0x0000));
336   }
333   if (m_cart && ((data ^ m_via_out[PORTB]) & 0x40))
334      m_cart->write_bank(space, 0, data);
337335
338336   /* Sound */
339337   if (data & 0x10)
trunk/src/emu/bus/bus.mak
r32624r32625
298298
299299#-------------------------------------------------
300300#
301#@src/emu/bus/crvision/slot.h,BUSES += CRVISION
302#-------------------------------------------------
303
304ifneq ($(filter CRVISION,$(BUSES)),)
305OBJDIRS += $(BUSOBJ)/crvision
306BUSOBJS += $(BUSOBJ)/crvision/slot.o
307BUSOBJS += $(BUSOBJ)/crvision/rom.o
308endif
309
310
311#-------------------------------------------------
312#
301313#@src/emu/bus/dmv/dmv.h,BUSES += DMV
302314#-------------------------------------------------
303315
r32624r32625
716728
717729#-------------------------------------------------
718730#
731#@src/emu/bus/vectrex/slot.h,BUSES += VECTREX
732#-------------------------------------------------
733
734ifneq ($(filter VECTREX,$(BUSES)),)
735OBJDIRS += $(BUSOBJ)/vectrex
736BUSOBJS += $(BUSOBJ)/vectrex/slot.o
737BUSOBJS += $(BUSOBJ)/vectrex/rom.o
738endif
739
740
741#-------------------------------------------------
742#
719743#@src/emu/bus/vic10/exp.h,BUSES += VIC10
720744#-------------------------------------------------
721745
trunk/src/emu/bus/crvision/rom.c
r0r32625
1/***********************************************************************************************************
2
3
4 V-Tech CreatiVision cart emulation
5
6
7 ***********************************************************************************************************/
8
9
10#include "emu.h"
11#include "rom.h"
12
13
14//-------------------------------------------------
15//  crvision_rom_device - constructor
16//-------------------------------------------------
17
18const device_type CRVISION_ROM_4K = &device_creator<crvision_rom_device>;
19const device_type CRVISION_ROM_6K = &device_creator<crvision_rom6k_device>;
20const device_type CRVISION_ROM_8K = &device_creator<crvision_rom8k_device>;
21const device_type CRVISION_ROM_10K = &device_creator<crvision_rom10k_device>;
22const device_type CRVISION_ROM_12K = &device_creator<crvision_rom12k_device>;
23const device_type CRVISION_ROM_16K = &device_creator<crvision_rom16k_device>;
24const device_type CRVISION_ROM_18K = &device_creator<crvision_rom18k_device>;
25
26
27crvision_rom_device::crvision_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
28               : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
29                  device_crvision_cart_interface(mconfig, *this)
30{
31}
32
33crvision_rom_device::crvision_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
34               : device_t(mconfig, CRVISION_ROM_4K, "CreatiVision 4K Carts", tag, owner, clock, "crvision_4k", __FILE__),
35                  device_crvision_cart_interface(mconfig, *this)
36{
37}
38
39crvision_rom6k_device::crvision_rom6k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
40               : crvision_rom_device(mconfig, CRVISION_ROM_6K, "CreatiVision 6K Carts", tag, owner, clock, "crvision_6k", __FILE__)
41{
42}
43
44crvision_rom8k_device::crvision_rom8k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
45               : crvision_rom_device(mconfig, CRVISION_ROM_8K, "CreatiVision 8K Carts", tag, owner, clock, "crvision_8k", __FILE__)
46{
47}
48
49crvision_rom10k_device::crvision_rom10k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
50               : crvision_rom_device(mconfig, CRVISION_ROM_10K, "CreatiVision 10K Carts", tag, owner, clock, "crvision_10k", __FILE__)
51{
52}
53
54crvision_rom12k_device::crvision_rom12k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
55               : crvision_rom_device(mconfig, CRVISION_ROM_12K, "CreatiVision 12K Carts", tag, owner, clock, "crvision_12k", __FILE__)
56{
57}
58
59crvision_rom16k_device::crvision_rom16k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
60               : crvision_rom_device(mconfig, CRVISION_ROM_16K, "CreatiVision 16K Carts", tag, owner, clock, "crvision_16k", __FILE__)
61{
62}
63
64crvision_rom18k_device::crvision_rom18k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
65               : crvision_rom_device(mconfig, CRVISION_ROM_18K, "CreatiVision 18K Carts", tag, owner, clock, "crvision_18k", __FILE__)
66{
67}
68
69
70/*-------------------------------------------------
71 mapper specific handlers
72 -------------------------------------------------*/
73
74READ8_MEMBER(crvision_rom_device::read_rom80)
75{
76   offset &= 0x1fff;
77   if (offset < 0x1000)
78      return 0xff;
79
80   return m_rom[offset & 0xfff];
81}
82
83
84READ8_MEMBER(crvision_rom6k_device::read_rom80)
85{
86   offset &= 0x1fff;
87   if (offset < 0x1000)
88      return m_rom[0x1000 + (offset & 0x7ff)];
89   
90   return m_rom[offset & 0xfff];
91}
92
93
94READ8_MEMBER(crvision_rom8k_device::read_rom80)
95{
96   return m_rom[offset & 0x1fff];
97}
98
99
100READ8_MEMBER(crvision_rom10k_device::read_rom80)
101{
102   return m_rom[offset & 0x1fff];
103}
104
105READ8_MEMBER(crvision_rom10k_device::read_rom40)
106{
107   return m_rom[0x2000 + (offset & 0x7ff)];
108}
109
110
111READ8_MEMBER(crvision_rom12k_device::read_rom80)
112{
113   return m_rom[offset & 0x1fff];
114}
115
116READ8_MEMBER(crvision_rom12k_device::read_rom40)
117{
118   return m_rom[0x2000 + (offset & 0xfff)];
119}
120
121
122READ8_MEMBER(crvision_rom16k_device::read_rom80)
123{
124   // lower 8K in 0xa000-0xbfff, higher 8K in 0x8000-0x9fff
125   return m_rom[offset ^ 0x2000];
126}
127
128
129READ8_MEMBER(crvision_rom18k_device::read_rom80)
130{
131   // lower 8K in 0xa000-0xbfff, higher 8K in 0x8000-0x9fff
132   return m_rom[offset ^ 0x2000];
133}
134
135READ8_MEMBER(crvision_rom18k_device::read_rom40)
136{
137   return m_rom[0x4000 + (offset & 0x7ff)];
138}
Property changes on: trunk/src/emu/bus/crvision/rom.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/crvision/slot.c
r0r32625
1/***********************************************************************************************************
2
3    V-Tech CreatiVision cart emulation
4    (through slot devices)
5
6 ***********************************************************************************************************/
7
8
9#include "emu.h"
10#include "slot.h"
11
12//**************************************************************************
13//  GLOBAL VARIABLES
14//**************************************************************************
15
16const device_type CRVISION_CART_SLOT = &device_creator<crvision_cart_slot_device>;
17
18//**************************************************************************
19//    CreatiVision Cartridges Interface
20//**************************************************************************
21
22//-------------------------------------------------
23//  device_crvision_cart_interface - constructor
24//-------------------------------------------------
25
26device_crvision_cart_interface::device_crvision_cart_interface(const machine_config &mconfig, device_t &device)
27   : device_slot_card_interface(mconfig, device),
28      m_rom(NULL),
29      m_rom_size(0)
30{
31}
32
33
34//-------------------------------------------------
35//  ~device_crvision_cart_interface - destructor
36//-------------------------------------------------
37
38device_crvision_cart_interface::~device_crvision_cart_interface()
39{
40}
41
42//-------------------------------------------------
43//  rom_alloc - alloc the space for the cart
44//-------------------------------------------------
45
46void device_crvision_cart_interface::rom_alloc(UINT32 size, const char *tag)
47{
48   if (m_rom == NULL)
49   {
50      astring tempstring(tag);
51      tempstring.cat(CRVSLOT_ROM_REGION_TAG);
52      m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base();
53      m_rom_size = size;
54   }
55}
56
57
58//**************************************************************************
59//  LIVE DEVICE
60//**************************************************************************
61
62//-------------------------------------------------
63//  crvision_cart_slot_device - constructor
64//-------------------------------------------------
65crvision_cart_slot_device::crvision_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
66                  device_t(mconfig, CRVISION_CART_SLOT, "APF Cartridge Slot", tag, owner, clock, "crvision_cart_slot", __FILE__),
67                  device_image_interface(mconfig, *this),
68                  device_slot_interface(mconfig, *this),
69                  m_type(CRV_4K)
70{
71}
72
73
74//-------------------------------------------------
75//  crvision_cart_slot_device - destructor
76//-------------------------------------------------
77
78crvision_cart_slot_device::~crvision_cart_slot_device()
79{
80}
81
82//-------------------------------------------------
83//  device_start - device-specific startup
84//-------------------------------------------------
85
86void crvision_cart_slot_device::device_start()
87{
88   m_cart = dynamic_cast<device_crvision_cart_interface *>(get_card_device());
89}
90
91//-------------------------------------------------
92//  device_config_complete - perform any
93//  operations now that the configuration is
94//  complete
95//-------------------------------------------------
96
97void crvision_cart_slot_device::device_config_complete()
98{
99   // set brief and instance name
100   update_names();
101}
102
103
104//-------------------------------------------------
105//  APF PCB
106//-------------------------------------------------
107
108struct crvision_slot
109{
110   int                     pcb_id;
111   const char              *slot_option;
112};
113
114// Here, we take the feature attribute from .xml (i.e. the PCB name) and we assign a unique ID to it
115static const crvision_slot slot_list[] =
116{
117   { CRV_4K,  "crv_rom4k" },
118   { CRV_6K,  "crv_rom6k" },
119   { CRV_8K,  "crv_rom8k" },
120   { CRV_10K, "crv_rom10k" },
121   { CRV_12K, "crv_rom12k" },
122   { CRV_16K, "crv_rom16k" },
123   { CRV_18K, "crv_rom18k" }
124};
125
126static int crvision_get_pcb_id(const char *slot)
127{
128   for (int i = 0; i < ARRAY_LENGTH(slot_list); i++)
129   {
130      if (!core_stricmp(slot_list[i].slot_option, slot))
131         return slot_list[i].pcb_id;
132   }
133
134   return 0;
135}
136
137static const char *crvision_get_slot(int type)
138{
139   for (int i = 0; i < ARRAY_LENGTH(slot_list); i++)
140   {
141      if (slot_list[i].pcb_id == type)
142         return slot_list[i].slot_option;
143   }
144
145   return "crv_rom4k";
146}
147
148
149/*-------------------------------------------------
150 call load
151 -------------------------------------------------*/
152
153bool crvision_cart_slot_device::call_load()
154{
155   if (m_cart)
156   {
157      UINT32 size = (software_entry() == NULL) ? length() : get_software_region_length("rom");
158
159      if (size > 0x4800)
160      {
161         seterror(IMAGE_ERROR_UNSPECIFIED, "Image extends beyond the expected size for an APF cart");
162         return IMAGE_INIT_FAIL;
163      }
164     
165      m_cart->rom_alloc(size, tag());
166         
167      if (software_entry() == NULL)
168         fread(m_cart->get_rom_base(), size);
169      else
170         memcpy(m_cart->get_rom_base(), get_software_region("rom"), size);
171
172      if (software_entry() == NULL)
173      {
174         m_type = CRV_4K;
175
176         switch (size)
177         {
178            case 0x4800:
179               m_type = CRV_18K;
180               break;
181            case 0x4000:
182               m_type = CRV_16K;
183               break;
184            case 0x3000:
185               m_type = CRV_12K;
186               break;
187            case 0x2800:
188               m_type = CRV_10K;
189               break;
190            case 0x2000:
191               m_type = CRV_8K;
192               break;
193            case 0x1800:
194               m_type = CRV_6K;
195               break;
196            case 0x1000:
197            default:
198               break;
199         }
200      }
201      else
202      {
203         const char *pcb_name = get_feature("slot");
204         if (pcb_name)
205            m_type = crvision_get_pcb_id(pcb_name);
206      }
207
208      printf("Type: %s\n", crvision_get_slot(m_type));
209
210      return IMAGE_INIT_PASS;
211   }
212
213   return IMAGE_INIT_PASS;
214}
215
216
217/*-------------------------------------------------
218 call softlist load
219 -------------------------------------------------*/
220
221bool crvision_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
222{
223   load_software_part_region(*this, swlist, swname, start_entry);
224   return TRUE;
225}
226
227
228/*-------------------------------------------------
229 get default card software
230 -------------------------------------------------*/
231
232void crvision_cart_slot_device::get_default_card_software(astring &result)
233{
234   if (open_image_file(mconfig().options()))
235   {
236      const char *slot_string = "crv_rom4k";
237      UINT32 size = core_fsize(m_file);
238      int type = CRV_4K;
239
240      switch (size)
241      {
242         case 0x4800:
243            type = CRV_18K;
244            break;
245         case 0x4000:
246            type = CRV_16K;
247            break;
248         case 0x3000:
249            type = CRV_12K;
250            break;
251         case 0x2800:
252            type = CRV_10K;
253            break;
254         case 0x2000:
255            type = CRV_8K;
256            break;
257         case 0x1800:
258            type = CRV_6K;
259            break;
260         case 0x1000:
261         default:
262            break;
263      }
264
265      slot_string = crvision_get_slot(type);
266
267      //printf("type: %s\n", slot_string);
268      clear();
269
270      result.cpy(slot_string);
271      return;
272   }
273
274   software_get_default_slot(result, "crv_rom4k");
275}
276
277/*-------------------------------------------------
278 read_rom
279 -------------------------------------------------*/
280
281READ8_MEMBER(crvision_cart_slot_device::read_rom40)
282{
283   if (m_cart)
284      return m_cart->read_rom40(space, offset);
285   else
286      return 0xff;
287}
288
289READ8_MEMBER(crvision_cart_slot_device::read_rom80)
290{
291   if (m_cart)
292      return m_cart->read_rom80(space, offset);
293   else
294      return 0xff;
295}
296
Property changes on: trunk/src/emu/bus/crvision/slot.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/crvision/rom.h
r0r32625
1#ifndef __CRVISION_ROM_H
2#define __CRVISION_ROM_H
3
4#include "slot.h"
5
6
7// ======================> crvision_rom_device
8
9class crvision_rom_device : public device_t,
10                  public device_crvision_cart_interface
11{
12public:
13   // construction/destruction
14   crvision_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
15   crvision_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
16
17   // device-level overrides
18   virtual void device_start() {}
19   virtual void device_reset() {}
20
21   // reading and writing
22   virtual DECLARE_READ8_MEMBER(read_rom80);
23};
24
25// ======================> crvision_rom6k_device
26
27class crvision_rom6k_device : public crvision_rom_device
28{
29public:
30   // construction/destruction
31   crvision_rom6k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
32
33   // reading and writing
34   virtual DECLARE_READ8_MEMBER(read_rom80);
35};
36
37// ======================> crvision_rom8k_device
38
39class crvision_rom8k_device : public crvision_rom_device
40{
41public:
42   // construction/destruction
43   crvision_rom8k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
44   
45   // reading and writing
46   virtual DECLARE_READ8_MEMBER(read_rom80);
47};
48
49// ======================> crvision_rom10k_device
50
51class crvision_rom10k_device : public crvision_rom_device
52{
53public:
54   // construction/destruction
55   crvision_rom10k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
56   
57   // reading and writing
58   virtual DECLARE_READ8_MEMBER(read_rom40);
59   virtual DECLARE_READ8_MEMBER(read_rom80);
60};
61
62// ======================> crvision_rom12k_device
63
64class crvision_rom12k_device : public crvision_rom_device
65{
66public:
67   // construction/destruction
68   crvision_rom12k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
69   
70   // reading and writing
71   virtual DECLARE_READ8_MEMBER(read_rom40);
72   virtual DECLARE_READ8_MEMBER(read_rom80);
73};
74
75// ======================> crvision_rom16k_device
76
77class crvision_rom16k_device : public crvision_rom_device
78{
79public:
80   // construction/destruction
81   crvision_rom16k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
82   
83   // reading and writing
84   virtual DECLARE_READ8_MEMBER(read_rom80);
85};
86
87// ======================> crvision_rom18k_device
88
89class crvision_rom18k_device : public crvision_rom_device
90{
91public:
92   // construction/destruction
93   crvision_rom18k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
94   
95   // reading and writing
96   virtual DECLARE_READ8_MEMBER(read_rom40);
97   virtual DECLARE_READ8_MEMBER(read_rom80);
98};
99
100
101
102
103
104// device type definition
105extern const device_type CRVISION_ROM_4K;
106extern const device_type CRVISION_ROM_6K;
107extern const device_type CRVISION_ROM_8K;
108extern const device_type CRVISION_ROM_10K;
109extern const device_type CRVISION_ROM_12K;
110extern const device_type CRVISION_ROM_16K;
111extern const device_type CRVISION_ROM_18K;
112
113
114#endif
Property changes on: trunk/src/emu/bus/crvision/rom.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/crvision/slot.h
r0r32625
1#ifndef __CRVISION_SLOT_H
2#define __CRVISION_SLOT_H
3
4/***************************************************************************
5 TYPE DEFINITIONS
6 ***************************************************************************/
7
8
9/* PCB */
10enum
11{
12   CRV_4K = 0,
13   CRV_6K,
14   CRV_8K,
15   CRV_10K,
16   CRV_12K,
17   CRV_16K,
18   CRV_18K
19};
20
21
22// ======================> device_crvision_cart_interface
23
24class device_crvision_cart_interface : public device_slot_card_interface
25{
26public:
27   // construction/destruction
28   device_crvision_cart_interface(const machine_config &mconfig, device_t &device);
29   virtual ~device_crvision_cart_interface();
30
31   // reading and writing
32   virtual DECLARE_READ8_MEMBER(read_rom40) { return 0xff; }
33   virtual DECLARE_READ8_MEMBER(read_rom80) { return 0xff; }
34
35   void rom_alloc(UINT32 size, const char *tag);
36   UINT8* get_rom_base() { return m_rom; }
37   UINT32 get_rom_size() { return m_rom_size; }
38
39protected:
40   // internal state
41   UINT8 *m_rom;
42   UINT32 m_rom_size;
43};
44
45
46// ======================> crvision_cart_slot_device
47
48class crvision_cart_slot_device : public device_t,
49                        public device_image_interface,
50                        public device_slot_interface
51{
52public:
53   // construction/destruction
54   crvision_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
55   virtual ~crvision_cart_slot_device();
56
57   // device-level overrides
58   virtual void device_start();
59   virtual void device_config_complete();
60
61   // image-level overrides
62   virtual bool call_load();
63   virtual void call_unload() {}
64   virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry);
65
66   int get_type() { return m_type; }
67
68   virtual iodevice_t image_type() const { return IO_CARTSLOT; }
69   virtual bool is_readable()  const { return 1; }
70   virtual bool is_writeable() const { return 0; }
71   virtual bool is_creatable() const { return 0; }
72   virtual bool must_be_loaded() const { return 0; }
73   virtual bool is_reset_on_load() const { return 1; }
74   virtual const option_guide *create_option_guide() const { return NULL; }
75   virtual const char *image_interface() const { return "crvision_cart"; }
76   virtual const char *file_extensions() const { return "bin,rom"; }
77
78   // slot interface overrides
79   virtual void get_default_card_software(astring &result);
80
81   // reading and writing
82   virtual DECLARE_READ8_MEMBER(read_rom40);
83   virtual DECLARE_READ8_MEMBER(read_rom80);
84
85protected:
86
87   int m_type;
88   device_crvision_cart_interface*       m_cart;
89};
90
91
92
93// device type definition
94extern const device_type CRVISION_CART_SLOT;
95
96
97/***************************************************************************
98 DEVICE CONFIGURATION MACROS
99 ***************************************************************************/
100
101#define CRVSLOT_ROM_REGION_TAG ":cart:rom"
102
103#define MCFG_CRVISION_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
104   MCFG_DEVICE_ADD(_tag, CRVISION_CART_SLOT, 0) \
105   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
106
107#endif
Property changes on: trunk/src/emu/bus/crvision/slot.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/vectrex/slot.c
r0r32625
1/***********************************************************************************************************
2
3    GCE Vectrex cart emulation
4    (through slot devices)
5
6 ***********************************************************************************************************/
7
8
9#include "emu.h"
10#include "slot.h"
11
12//**************************************************************************
13//  GLOBAL VARIABLES
14//**************************************************************************
15
16const device_type VECTREX_CART_SLOT = &device_creator<vectrex_cart_slot_device>;
17
18//**************************************************************************
19//    Vectrex Cartridges Interface
20//**************************************************************************
21
22//-------------------------------------------------
23//  device_vectrex_cart_interface - constructor
24//-------------------------------------------------
25
26device_vectrex_cart_interface::device_vectrex_cart_interface(const machine_config &mconfig, device_t &device)
27   : device_slot_card_interface(mconfig, device),
28      m_rom(NULL),
29      m_rom_size(0)
30{
31}
32
33
34//-------------------------------------------------
35//  ~device_vectrex_cart_interface - destructor
36//-------------------------------------------------
37
38device_vectrex_cart_interface::~device_vectrex_cart_interface()
39{
40}
41
42//-------------------------------------------------
43//  rom_alloc - alloc the space for the cart
44//-------------------------------------------------
45
46void device_vectrex_cart_interface::rom_alloc(UINT32 size, const char *tag)
47{
48   if (m_rom == NULL)
49   {
50      astring tempstring(tag);
51      tempstring.cat(VECSLOT_ROM_REGION_TAG);
52      m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base();
53      m_rom_size = size;
54   }
55}
56
57
58//**************************************************************************
59//  LIVE DEVICE
60//**************************************************************************
61
62//-------------------------------------------------
63//  vectrex_cart_slot_device - constructor
64//-------------------------------------------------
65vectrex_cart_slot_device::vectrex_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
66                  device_t(mconfig, VECTREX_CART_SLOT, "GCE Vectrex Cartridge Slot", tag, owner, clock, "vectrex_cart_slot", __FILE__),
67                  device_image_interface(mconfig, *this),
68                  device_slot_interface(mconfig, *this),
69                  m_type(VECTREX_STD),
70                  m_vec3d(VEC3D_NONE)
71{
72}
73
74
75//-------------------------------------------------
76//  vectrex_cart_slot_device - destructor
77//-------------------------------------------------
78
79vectrex_cart_slot_device::~vectrex_cart_slot_device()
80{
81}
82
83//-------------------------------------------------
84//  device_start - device-specific startup
85//-------------------------------------------------
86
87void vectrex_cart_slot_device::device_start()
88{
89   m_cart = dynamic_cast<device_vectrex_cart_interface *>(get_card_device());
90}
91
92//-------------------------------------------------
93//  device_config_complete - perform any
94//  operations now that the configuration is
95//  complete
96//-------------------------------------------------
97
98void vectrex_cart_slot_device::device_config_complete()
99{
100   // set brief and instance name
101   update_names();
102}
103
104
105//-------------------------------------------------
106//  Vectrex PCB
107//-------------------------------------------------
108
109struct vectrex_slot
110{
111   int                     pcb_id;
112   const char              *slot_option;
113};
114
115// Here, we take the feature attribute from .xml (i.e. the PCB name) and we assign a unique ID to it
116static const vectrex_slot slot_list[] =
117{
118   { VECTREX_STD,    "vec_rom" },
119   { VECTREX_64K,    "vec_rom64k" },
120   { VECTREX_SRAM,   "vec_sram" }
121};
122
123#if 0
124static int vectrex_get_pcb_id(const char *slot)
125{
126   for (int i = 0; i < ARRAY_LENGTH(slot_list); i++)
127   {
128      if (!core_stricmp(slot_list[i].slot_option, slot))
129         return slot_list[i].pcb_id;
130   }
131
132   return 0;
133}
134#endif
135
136static const char *vectrex_get_slot(int type)
137{
138   for (int i = 0; i < ARRAY_LENGTH(slot_list); i++)
139   {
140      if (slot_list[i].pcb_id == type)
141         return slot_list[i].slot_option;
142   }
143
144   return "vec_rom";
145}
146
147/*-------------------------------------------------
148 call load
149 -------------------------------------------------*/
150
151bool vectrex_cart_slot_device::call_load()
152{
153   if (m_cart)
154   {
155      UINT32 size = (software_entry() == NULL) ? length() : get_software_region_length("rom");
156      UINT8 *ROM;
157     
158      if (size > 0x10000)
159      {
160         seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
161         return IMAGE_INIT_FAIL;
162      }
163     
164      m_cart->rom_alloc((size < 0x1000) ? 0x1000 : size, tag());
165      ROM = m_cart->get_rom_base();
166     
167      if (software_entry() == NULL)
168         fread(ROM, size);
169      else
170         memcpy(ROM, get_software_region("rom"), size);
171     
172      // Verify the file is accepted by the Vectrex bios
173      if (memcmp(ROM, "g GCE", 5))
174      {
175         seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid image");
176         return IMAGE_INIT_FAIL;
177      }
178     
179      // determine type
180      m_type = VECTREX_STD;
181      if (!memcmp(ROM + 0x06, "SRAM", 4))
182         m_type = VECTREX_SRAM;     
183      if (size > 0x8000)
184         m_type = VECTREX_64K;
185     
186      //printf("Type: %s\n", vectrex_get_slot(m_type));
187
188      // determine 3D setup (to help video setup at machine_start)
189      if (!memcmp(ROM + 0x11, "NARROW", 6) && (ROM[0x39] == 0x0c))
190         m_vec3d = VEC3D_NARROW;
191     
192      if (!memcmp(ROM + 0x11, "CRAZY COASTER", 13))
193         m_vec3d = VEC3D_CCOAST;
194     
195      if (!memcmp(ROM + 0x11, "3D MINE STORM", 13))
196         m_vec3d = VEC3D_MINEST;
197
198      return IMAGE_INIT_PASS;
199   }
200
201   return IMAGE_INIT_PASS;
202}
203
204
205/*-------------------------------------------------
206 call softlist load
207 -------------------------------------------------*/
208
209bool vectrex_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
210{
211   load_software_part_region(*this, swlist, swname, start_entry);
212   return TRUE;
213}
214
215
216/*-------------------------------------------------
217 get default card software
218 -------------------------------------------------*/
219
220void vectrex_cart_slot_device::get_default_card_software(astring &result)
221{
222   if (open_image_file(mconfig().options()))
223   {
224      const char *slot_string = "vec_rom";
225      UINT32 size = core_fsize(m_file);
226      dynamic_buffer rom(size);
227      int type = VECTREX_STD;
228
229      core_fread(m_file, rom, size);
230     
231      if (!memcmp(rom + 0x06, "SRAM", 4))
232         type = VECTREX_SRAM;     
233      if (size > 0x8000)
234         type = VECTREX_64K;
235
236      slot_string = vectrex_get_slot(type);
237
238      //printf("type: %s\n", slot_string);
239      clear();
240
241      result.cpy(slot_string);
242      return;
243   }
244
245   software_get_default_slot(result, "vec_rom");
246}
247
248/*-------------------------------------------------
249 read_rom
250 -------------------------------------------------*/
251
252READ8_MEMBER(vectrex_cart_slot_device::read_rom)
253{
254   if (m_cart)
255      return m_cart->read_rom(space, offset);
256   else
257      return 0xff;
258}
259
260/*-------------------------------------------------
261 write_ram
262 -------------------------------------------------*/
263
264WRITE8_MEMBER(vectrex_cart_slot_device::write_ram)
265{
266   if (m_cart)
267      m_cart->write_ram(space, offset, data);
268}
269
270/*-------------------------------------------------
271 write_bank
272 -------------------------------------------------*/
273
274WRITE8_MEMBER(vectrex_cart_slot_device::write_bank)
275{
276   if (m_cart)
277      m_cart->write_bank(space, offset, data);
278}
279
280
Property changes on: trunk/src/emu/bus/vectrex/slot.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/vectrex/rom.h
r0r32625
1#ifndef __VECTREX_ROM_H
2#define __VECTREX_ROM_H
3
4#include "slot.h"
5
6
7// ======================> vectrex_rom_device
8
9class vectrex_rom_device : public device_t,
10                  public device_vectrex_cart_interface
11{
12public:
13   // construction/destruction
14   vectrex_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
15   vectrex_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
16
17   // device-level overrides
18   virtual void device_start() {}
19   virtual void device_reset() {}
20
21   // reading and writing
22   virtual DECLARE_READ8_MEMBER(read_rom);
23};
24
25// ======================> vectrex_rom64k_device
26
27class vectrex_rom64k_device : public vectrex_rom_device
28{
29public:
30   // construction/destruction
31   vectrex_rom64k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
32   
33   // device-level overrides
34   virtual void device_start();
35   virtual void device_reset();
36   
37   // reading and writing
38   virtual DECLARE_READ8_MEMBER(read_rom);
39   virtual DECLARE_WRITE8_MEMBER(write_bank);
40
41private:
42   int m_bank;
43};
44
45// ======================> vectrex_sram_device
46
47class vectrex_sram_device : public vectrex_rom_device
48{
49public:
50   // construction/destruction
51   vectrex_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
52   
53   // reading and writing
54   virtual DECLARE_WRITE8_MEMBER(write_ram);
55};
56
57
58
59// device type definition
60extern const device_type VECTREX_ROM_STD;
61extern const device_type VECTREX_ROM_64K;
62extern const device_type VECTREX_ROM_SRAM;
63
64
65#endif
Property changes on: trunk/src/emu/bus/vectrex/rom.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/vectrex/slot.h
r0r32625
1#ifndef __VECTREX_SLOT_H
2#define __VECTREX_SLOT_H
3
4/***************************************************************************
5 TYPE DEFINITIONS
6 ***************************************************************************/
7
8
9/* PCB */
10enum
11{
12   VECTREX_STD = 0,
13   VECTREX_64K,
14   VECTREX_SRAM
15};
16
17// 3D setup
18enum
19{
20   VEC3D_NONE = 0,
21   VEC3D_MINEST,
22   VEC3D_CCOAST,
23   VEC3D_NARROW
24};
25
26// ======================> device_vectrex_cart_interface
27
28class device_vectrex_cart_interface : public device_slot_card_interface
29{
30public:
31   // construction/destruction
32   device_vectrex_cart_interface(const machine_config &mconfig, device_t &device);
33   virtual ~device_vectrex_cart_interface();
34
35   // reading and writing
36   virtual DECLARE_READ8_MEMBER(read_rom) { return 0xff; }
37   virtual DECLARE_WRITE8_MEMBER(write_ram) {}
38   virtual DECLARE_WRITE8_MEMBER(write_bank) {}
39
40   void rom_alloc(UINT32 size, const char *tag);
41   UINT8* get_rom_base() { return m_rom; }
42   UINT32 get_rom_size() { return m_rom_size; }
43
44protected:
45   // internal state
46   UINT8 *m_rom;
47   UINT32 m_rom_size;
48};
49
50
51// ======================> vectrex_cart_slot_device
52
53class vectrex_cart_slot_device : public device_t,
54                        public device_image_interface,
55                        public device_slot_interface
56{
57public:
58   // construction/destruction
59   vectrex_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
60   virtual ~vectrex_cart_slot_device();
61
62   // device-level overrides
63   virtual void device_start();
64   virtual void device_config_complete();
65
66   // image-level overrides
67   virtual bool call_load();
68   virtual void call_unload() {}
69   virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry);
70
71   int get_type() { return m_type; }
72   int get_vec3d() { return m_vec3d; }
73
74   virtual iodevice_t image_type() const { return IO_CARTSLOT; }
75   virtual bool is_readable()  const { return 1; }
76   virtual bool is_writeable() const { return 0; }
77   virtual bool is_creatable() const { return 0; }
78   virtual bool must_be_loaded() const { return 0; }
79   virtual bool is_reset_on_load() const { return 1; }
80   virtual const option_guide *create_option_guide() const { return NULL; }
81   virtual const char *image_interface() const { return "vectrex_cart"; }
82   virtual const char *file_extensions() const { return "bin,gam,vec"; }
83
84   // slot interface overrides
85   virtual void get_default_card_software(astring &result);
86
87   // reading and writing
88   virtual DECLARE_READ8_MEMBER(read_rom);
89   virtual DECLARE_WRITE8_MEMBER(write_ram);
90   virtual DECLARE_WRITE8_MEMBER(write_bank);
91
92protected:
93
94   int m_type, m_vec3d;
95   device_vectrex_cart_interface*       m_cart;
96};
97
98
99
100// device type definition
101extern const device_type VECTREX_CART_SLOT;
102
103
104/***************************************************************************
105 DEVICE CONFIGURATION MACROS
106 ***************************************************************************/
107
108#define VECSLOT_ROM_REGION_TAG ":cart:rom"
109
110#define MCFG_VECTREX_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
111   MCFG_DEVICE_ADD(_tag, VECTREX_CART_SLOT, 0) \
112   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
113
114#endif
Property changes on: trunk/src/emu/bus/vectrex/slot.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/vectrex/rom.c
r0r32625
1/***********************************************************************************************************
2
3
4 GCE Vectrex cart emulation
5
6 TODO:
7   - better understand how much SRAM is expected to be present by the homebrew using
8     this cart type and use a RAM array instead of the ROM region for writes
9
10 ***********************************************************************************************************/
11
12
13#include "emu.h"
14#include "rom.h"
15
16
17//-------------------------------------------------
18//  vectrex_rom_device - constructor
19//-------------------------------------------------
20
21const device_type VECTREX_ROM_STD = &device_creator<vectrex_rom_device>;
22const device_type VECTREX_ROM_64K = &device_creator<vectrex_rom64k_device>;
23const device_type VECTREX_ROM_SRAM = &device_creator<vectrex_sram_device>;
24
25
26vectrex_rom_device::vectrex_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
27               : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
28                  device_vectrex_cart_interface(mconfig, *this)
29{
30}
31
32vectrex_rom_device::vectrex_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
33               : device_t(mconfig, VECTREX_ROM_STD, "Vectrex Standard Carts", tag, owner, clock, "vectrex_rom", __FILE__),
34                  device_vectrex_cart_interface(mconfig, *this)
35{
36}
37
38vectrex_rom64k_device::vectrex_rom64k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
39               : vectrex_rom_device(mconfig, VECTREX_ROM_64K, "Vectrex Carts w/ Bankswitch", tag, owner, clock, "vectrex_64k", __FILE__)
40{
41}
42
43vectrex_sram_device::vectrex_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
44               : vectrex_rom_device(mconfig, VECTREX_ROM_SRAM, "Vectrex Carts w/ SRAM", tag, owner, clock, "vectrex_sram", __FILE__)
45{
46}
47
48
49void vectrex_rom64k_device::device_start()
50{
51   save_item(NAME(m_bank));
52}
53
54void vectrex_rom64k_device::device_reset()
55{
56   m_bank = 0;
57}
58
59
60/*-------------------------------------------------
61 mapper specific handlers
62 -------------------------------------------------*/
63
64READ8_MEMBER(vectrex_rom_device::read_rom)
65{
66   if (offset < m_rom_size)
67      return m_rom[offset];
68   else
69      return 0xff;
70}
71
72
73READ8_MEMBER(vectrex_rom64k_device::read_rom)
74{
75   return m_rom[(offset + m_bank * 0x8000) & (m_rom_size - 1)];
76}
77
78WRITE8_MEMBER(vectrex_rom64k_device::write_bank)
79{
80   m_bank = data >> 6;
81}
82
83WRITE8_MEMBER(vectrex_sram_device::write_ram)
84{
85   m_rom[offset & (m_rom_size - 1)] = data;
86}
Property changes on: trunk/src/emu/bus/vectrex/rom.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mess/includes/crvision.h
r32624r32625
66
77#include "emu.h"
88#include "cpu/m6502/m6502.h"
9#include "imagedev/cartslot.h"
109#include "imagedev/cassette.h"
1110#include "machine/6821pia.h"
1211#include "machine/buffer.h"
1312#include "bus/centronics/ctronics.h"
13#include "bus/crvision/slot.h"
14#include "bus/crvision/rom.h"
1415#include "machine/ram.h"
1516#include "sound/sn76496.h"
1617#include "sound/wave.h"
r32624r32625
3536      m_pia(*this, PIA6821_TAG),
3637      m_psg(*this, SN76489_TAG),
3738      m_cassette(*this, "cassette"),
39      m_cart(*this, "cartslot"),
3840      m_cent_data_out(*this, "cent_data_out"),
3941      m_ram(*this, RAM_TAG)
4042   {
r32624r32625
4446   required_device<pia6821_device> m_pia;
4547   required_device<sn76496_base_device> m_psg;
4648   required_device<cassette_image_device> m_cassette;
49   required_device<crvision_cart_slot_device> m_cart;
4750   required_device<output_latch_device> m_cent_data_out;
4851   required_device<ram_device> m_ram;
4952
r32624r32625
5356   DECLARE_READ8_MEMBER( pia_pa_r );
5457   DECLARE_READ8_MEMBER( pia_pb_r );
5558   DECLARE_INPUT_CHANGED_MEMBER( trigger_nmi );
56   DECLARE_DEVICE_IMAGE_LOAD_MEMBER( crvision_cart );
5759
5860   UINT8 read_keyboard(int pa);
5961
trunk/src/mess/drivers/crvision.c
r32624r32625
699699   // state saving
700700   save_item(NAME(m_keylatch));
701701   save_item(NAME(m_joylatch));
702
703   if (m_cart->exists())
704   {
705      m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000, 0x7fff, read8_delegate(FUNC(crvision_cart_slot_device::read_rom40),(crvision_cart_slot_device*)m_cart));
706      m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0xbfff, read8_delegate(FUNC(crvision_cart_slot_device::read_rom80),(crvision_cart_slot_device*)m_cart));
707   }
702708}
703709
704710void crvision_pal_state::machine_start()
r32624r32625
706712   // state saving
707713   save_item(NAME(m_keylatch));
708714   save_item(NAME(m_joylatch));
715   
716   if (m_cart->exists())
717   {
718      m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000, 0x7fff, read8_delegate(FUNC(crvision_cart_slot_device::read_rom40),(crvision_cart_slot_device*)m_cart));
719      m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0xbfff, read8_delegate(FUNC(crvision_cart_slot_device::read_rom80),(crvision_cart_slot_device*)m_cart));
720   }
709721}
710722
711723/*-------------------------------------------------
r32624r32625
717729   // state saving
718730   save_item(NAME(m_keylatch));
719731   save_item(NAME(m_joylatch));
720}
721
722/***************************************************************************
723    CARTRIDGE
724***************************************************************************/
725
726DEVICE_IMAGE_LOAD_MEMBER( crvision_state, crvision_cart )
727{
728   UINT32 size;
729   dynamic_buffer temp_copy;
730   UINT8 *mem = memregion(M6502_TAG)->base();
731   address_space &program = m_maincpu->space(AS_PROGRAM);
732
733   if (image.software_entry() == NULL)
732   
733   if (m_cart->exists())
734734   {
735      size = image.length();
736      temp_copy.resize(size);
737      image.fread( temp_copy, size);
735      m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000, 0x7fff, read8_delegate(FUNC(crvision_cart_slot_device::read_rom40),(crvision_cart_slot_device*)m_cart));
736      m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0xbfff, read8_delegate(FUNC(crvision_cart_slot_device::read_rom80),(crvision_cart_slot_device*)m_cart));
738737   }
739   else
740   {
741      size= image.get_software_region_length("rom");
742      temp_copy.resize(size);
743      memcpy(temp_copy, image.get_software_region("rom"), size);
744   }
745
746   switch (size)
747   {
748   case 0x1000: // 4K
749      memcpy(mem + 0x9000, temp_copy, 0x1000);            // load 4KB at 0x9000
750      memcpy(mem + 0xb000, mem + 0x9000, 0x1000);         // mirror 4KB at 0xb000
751      program.install_read_bank(0x8000, 0xbfff, 0, 0x2000, BANK_ROM1);
752      break;
753
754   case 0x1800: // 6K
755      memcpy(mem + 0x9000, temp_copy, 0x1000);            // load lower 4KB at 0x9000
756      memcpy(mem + 0xb000, mem + 0x9000, 0x1000);         // mirror lower 4KB at 0xb000
757      memcpy(mem + 0x8000, temp_copy + 0x1000, 0x0800);   // load higher 2KB at 0x8000
758      memcpy(mem + 0x8800, mem + 0x8000, 0x0800);         // mirror higher 2KB at 0x8800
759      memcpy(mem + 0xa000, mem + 0x8000, 0x0800);         // mirror higher 2KB at 0xa000
760      memcpy(mem + 0xa800, mem + 0x8000, 0x0800);         // mirror higher 2KB at 0xa800
761      program.install_read_bank(0x8000, 0xbfff, 0, 0x2000, BANK_ROM1);
762      break;
763
764   case 0x2000: // 8K
765      memcpy(mem + 0x8000, temp_copy, 0x2000);            // load 8KB at 0x8000
766      memcpy(mem + 0xa000, mem + 0x8000, 0x2000);         // mirror 8KB at 0xa000
767      program.install_read_bank(0x8000, 0xbfff, 0, 0x2000, BANK_ROM1);
768      break;
769
770   case 0x2800: // 10K
771      memcpy(mem + 0x8000, temp_copy, 0x2000);            // load lower 8KB at 0x8000
772      memcpy(mem + 0xa000, mem + 0x8000, 0x2000);         // mirror lower 8KB at 0xa000
773      memcpy(mem + 0x4000, temp_copy + 0x2000, 0x0800);   // load higher 2KB at 0x4000
774      memcpy(mem + 0x4800, mem + 0x4000, 0x0800);         // mirror higher 2KB at 0x4800
775      memcpy(mem + 0x5000, mem + 0x4000, 0x0800);         // mirror higher 2KB at 0x5000
776      memcpy(mem + 0x5800, mem + 0x4000, 0x0800);         // mirror higher 2KB at 0x5800
777      memcpy(mem + 0x6000, mem + 0x4000, 0x0800);         // mirror higher 2KB at 0x6000
778      memcpy(mem + 0x6800, mem + 0x4000, 0x0800);         // mirror higher 2KB at 0x6800
779      memcpy(mem + 0x7000, mem + 0x4000, 0x0800);         // mirror higher 2KB at 0x7000
780      memcpy(mem + 0x7800, mem + 0x4000, 0x0800);         // mirror higher 2KB at 0x7800
781      program.install_read_bank(0x8000, 0xbfff, BANK_ROM1);
782      program.install_read_bank(0x4000, 0x7fff, BANK_ROM2);
783      break;
784
785   case 0x3000: // 12K
786      memcpy(mem + 0x8000, temp_copy, 0x2000);            // load lower 8KB at 0x8000
787      memcpy(mem + 0xa000, mem + 0x8000, 0x2000);         // mirror lower 8KB at 0xa000
788      memcpy(mem + 0x4000, temp_copy + 0x2000, 0x1000);   // load higher 4KB at 0x4000
789      memcpy(mem + 0x5000, mem + 0x4000, 0x1000);         // mirror higher 4KB at 0x5000
790      memcpy(mem + 0x6000, mem + 0x4000, 0x1000);         // mirror higher 4KB at 0x6000
791      memcpy(mem + 0x7000, mem + 0x4000, 0x1000);         // mirror higher 4KB at 0x7000
792      program.install_read_bank(0x8000, 0xbfff, BANK_ROM1);
793      program.install_read_bank(0x4000, 0x7fff, BANK_ROM2);
794      break;
795
796   case 0x4000: // 16K
797      memcpy(mem + 0xa000, temp_copy, 0x2000);            // load lower 8KB at 0xa000
798      memcpy(mem + 0x8000, temp_copy + 0x2000, 0x2000);   // load higher 8KB at 0x8000
799      program.install_read_bank(0x8000, 0xbfff, BANK_ROM1);
800      program.install_read_bank(0x4000, 0x7fff, BANK_ROM2);
801      break;
802
803   case 0x4800: // 18K
804      memcpy(mem + 0xa000, temp_copy, 0x2000);            // load lower 8KB at 0xa000
805      memcpy(mem + 0x8000, temp_copy + 0x2000, 0x2000);   // load higher 8KB at 0x8000
806      memcpy(mem + 0x4000, temp_copy + 0x4000, 0x0800);   // load higher 2KB at 0x4000
807      memcpy(mem + 0x4800, mem + 0x4000, 0x0800);         // mirror higher 2KB at 0x4800
808      memcpy(mem + 0x5000, mem + 0x4000, 0x0800);         // mirror higher 2KB at 0x5000
809      memcpy(mem + 0x5800, mem + 0x4000, 0x0800);         // mirror higher 2KB at 0x5800
810      memcpy(mem + 0x6000, mem + 0x4000, 0x0800);         // mirror higher 2KB at 0x6000
811      memcpy(mem + 0x6800, mem + 0x4000, 0x0800);         // mirror higher 2KB at 0x6800
812      memcpy(mem + 0x7000, mem + 0x4000, 0x0800);         // mirror higher 2KB at 0x7000
813      memcpy(mem + 0x7800, mem + 0x4000, 0x0800);         // mirror higher 2KB at 0x7800
814      program.install_read_bank(0x8000, 0xbfff, BANK_ROM1);
815      program.install_read_bank(0x4000, 0x7fff, BANK_ROM2);
816      break;
817
818   default:
819      auto_free(machine(), temp_copy);
820      return IMAGE_INIT_FAIL;
821   }
822
823   membank(BANK_ROM1)->configure_entry(0, mem + 0x8000);
824   membank(BANK_ROM1)->set_entry(0);
825
826   membank(BANK_ROM2)->configure_entry(0, mem + 0x4000);
827   membank(BANK_ROM2)->set_entry(0);
828
829   return IMAGE_INIT_PASS;
830738}
831739
740
832741/***************************************************************************
833742    MACHINE DRIVERS
834743***************************************************************************/
835744
745static SLOT_INTERFACE_START(crvision_cart)
746   SLOT_INTERFACE_INTERNAL("crv_rom4k",  CRVISION_ROM_4K)
747   SLOT_INTERFACE_INTERNAL("crv_rom6k",  CRVISION_ROM_6K)
748   SLOT_INTERFACE_INTERNAL("crv_rom8k",  CRVISION_ROM_8K)
749   SLOT_INTERFACE_INTERNAL("crv_rom10k", CRVISION_ROM_10K)
750   SLOT_INTERFACE_INTERNAL("crv_rom12k", CRVISION_ROM_12K)
751   SLOT_INTERFACE_INTERNAL("crv_rom16k", CRVISION_ROM_16K)
752   SLOT_INTERFACE_INTERNAL("crv_rom18k", CRVISION_ROM_18K)
753SLOT_INTERFACE_END
754
836755/*-------------------------------------------------
837756    MACHINE_CONFIG_START( creativision, crvision_state )
838757-------------------------------------------------*/
r32624r32625
872791   MCFG_SOUND_ROUTE(1, "mono", 0.25)
873792
874793   // cartridge
875   MCFG_CARTSLOT_ADD("cart")
876   MCFG_CARTSLOT_EXTENSION_LIST("bin,rom")
877   MCFG_CARTSLOT_MANDATORY
878   MCFG_CARTSLOT_INTERFACE("crvision_cart")
879   MCFG_CARTSLOT_LOAD(crvision_state, crvision_cart)
794   MCFG_CRVISION_CARTRIDGE_ADD("cartslot", crvision_cart, NULL)
880795
881796   // internal ram
882797   MCFG_RAM_ADD(RAM_TAG)
r32624r32625
884799   MCFG_RAM_EXTRA_OPTIONS("15K") // 16K expansion (lower 14K available only, upper 2K shared with BIOS ROM)
885800
886801   // software lists
887   MCFG_SOFTWARE_LIST_ADD("cart_list","crvision")
802   MCFG_SOFTWARE_LIST_ADD("cart_list", "crvision")
888803MACHINE_CONFIG_END
889804
890805/*-------------------------------------------------
r32624r32625
958873   MCFG_SOUND_ROUTE(1, "mono", 0.25)
959874
960875   // cartridge
961   MCFG_CARTSLOT_ADD("cart")
962   MCFG_CARTSLOT_EXTENSION_LIST("bin,rom")
963   MCFG_CARTSLOT_INTERFACE("crvision_cart")
964   MCFG_CARTSLOT_LOAD(crvision_state, crvision_cart)
876   MCFG_CRVISION_CARTRIDGE_ADD("cartslot", crvision_cart, NULL)
965877
966878   // internal ram
967879   MCFG_RAM_ADD(RAM_TAG)
trunk/src/mess/mess.mak
r32624r32625
582582BUSES += COMPUCOLOR
583583BUSES += COMX35
584584BUSES += CPC
585BUSES += CRVISION
585586BUSES += DMV
586587BUSES += ECBBUS
587588BUSES += ECONET
r32624r32625
628629BUSES += VC4000
629630BUSES += VCS
630631BUSES += VCS_CTRL
632BUSES += VECTREX
631633BUSES += VIC10
632634BUSES += VIC20
633635BUSES += VIDBRAIN

Previous 199869 Revisions Next


© 1997-2024 The MAME Team