| Previous | 199869 Revisions | Next |
| r32493 Thursday 2nd October, 2014 at 12:07:03 UTC by Fabio Priuli |
|---|
| (MESS) converted channelf and apfm1000/apfimag to use slot devices for their carts. this allows to remove on-cart RAM from the driver class (since it does not belong there). also added (partial) support for Channel F multicart. nw. |
| [hash] | apfm1000.xml channelf.xml |
| [src/emu/bus] | bus.mak |
| [src/emu/bus/apf] | rom.c* rom.h* slot.c* slot.h* |
| [src/emu/bus/chanf] | rom.c* rom.h* slot.c* slot.h* |
| [src/mess] | mess.mak |
| [src/mess/drivers] | apf.c channelf.c |
| [src/mess/includes] | channelf.h |
| r32492 | r32493 | |
|---|---|---|
| 8 | 8 | <publisher>Fairchild</publisher> |
| 9 | 9 | <info name="series" value="Democart 1" /> |
| 10 | 10 | <part name="cart" interface="channelf_cart"> |
| 11 | <feature name="slot" value="std" /> | |
| 11 | 12 | <dataarea name="rom" size="2048"> |
| 12 | 13 | <rom name="democrt1.bin" size="2048" crc="42727ad5" sha1="e462e594c14cdb10ddc4c263b74e753316c3b358" offset="0" /> |
| 13 | 14 | </dataarea> |
| r32492 | r32493 | |
| 20 | 21 | <publisher>Fairchild</publisher> |
| 21 | 22 | <info name="series" value="Democart 2" /> |
| 22 | 23 | <part name="cart" interface="channelf_cart"> |
| 24 | <feature name="slot" value="std" /> | |
| 23 | 25 | <dataarea name="rom" size="2048"> |
| 24 | 26 | <rom name="democrt2.bin" size="2048" crc="44cf1d89" sha1="13a5ca0471e6f4a7a5a2fc4d2b8f881516a28ec4" offset="0" /> |
| 25 | 27 | </dataarea> |
| r32492 | r32493 | |
| 32 | 34 | <publisher>Fairchild</publisher> |
| 33 | 35 | <info name="series" value="Videocart 1" /> |
| 34 | 36 | <part name="cart" interface="channelf_cart"> |
| 37 | <feature name="slot" value="std" /> | |
| 35 | 38 | <dataarea name="rom" size="2048"> |
| 36 | 39 | <rom name="tctactoe.bin" size="2048" crc="ff4768b0" sha1="8edfb668b3eb759f8597fb13b1aeaf43aaf53680" offset="0" /> |
| 37 | 40 | </dataarea> |
| r32492 | r32493 | |
| 44 | 47 | <publisher>SABA</publisher> |
| 45 | 48 | <info name="series" value="Videocart 1" /> |
| 46 | 49 | <part name="cart" interface="channelf_cart"> |
| 50 | <feature name="slot" value="std" /> | |
| 47 | 51 | <dataarea name="rom" size="2048"> |
| 48 | 52 | <rom name="muehle.bin" size="2048" crc="7124dc59" sha1="15d5e6d152d93a2099b97a2bd5dcf7134dd1a770" offset="0" /> |
| 49 | 53 | </dataarea> |
| r32492 | r32493 | |
| 56 | 60 | <publisher>Fairchild</publisher> |
| 57 | 61 | <info name="series" value="Videocart 2" /> |
| 58 | 62 | <part name="cart" interface="channelf_cart"> |
| 63 | <feature name="slot" value="std" /> | |
| 59 | 64 | <dataarea name="rom" size="2048"> |
| 60 | 65 | <rom name="dsrtfox.bin" size="2048" crc="1570934b" sha1="3440928903f39354e1358018cebf12a00c8dff77" offset="0" /> |
| 61 | 66 | </dataarea> |
| r32492 | r32493 | |
| 68 | 73 | <publisher>Fairchild</publisher> |
| 69 | 74 | <info name="series" value="Videocart 3" /> |
| 70 | 75 | <part name="cart" interface="channelf_cart"> |
| 76 | <feature name="slot" value="std" /> | |
| 71 | 77 | <dataarea name="rom" size="2048"> |
| 72 | 78 | <rom name="vblckjck.bin" size="2048" crc="e98d4456" sha1="86579196567c9686009ad271263269181496a9c7" offset="0" /> |
| 73 | 79 | </dataarea> |
| r32492 | r32493 | |
| 80 | 86 | <publisher>Fairchild</publisher> |
| 81 | 87 | <info name="series" value="Videocart 4" /> |
| 82 | 88 | <part name="cart" interface="channelf_cart"> |
| 89 | <feature name="slot" value="std" /> | |
| 83 | 90 | <dataarea name="rom" size="2048"> |
| 84 | 91 | <rom name="spitfire.bin" size="2048" crc="5357c5f6" sha1="9af18e7fa3b2d040f33cbe2286392ce5fe31d0df" offset="0" /> |
| 85 | 92 | </dataarea> |
| r32492 | r32493 | |
| 91 | 98 | <year>1976</year> |
| 92 | 99 | <publisher>Fairchild</publisher> |
| 93 | 100 | <part name="cart" interface="channelf_cart"> |
| 101 | <feature name="slot" value="std" /> | |
| 94 | 102 | <dataarea name="rom" size="2048"> |
| 95 | 103 | <rom name="spitfire (proto).bin" size="2048" crc="0a728afc" sha1="66e2d158095721c0c9b4d50de4a6d9925ec62c73" offset="0" /> |
| 96 | 104 | </dataarea> |
| r32492 | r32493 | |
| 103 | 111 | <publisher>Fairchild</publisher> |
| 104 | 112 | <info name="series" value="Videocart 5" /> |
| 105 | 113 | <part name="cart" interface="channelf_cart"> |
| 114 | <feature name="slot" value="std" /> | |
| 106 | 115 | <dataarea name="rom" size="2048"> |
| 107 | 116 | <rom name="spacewar.bin" size="2048" crc="22ef49e8" sha1="c1d83b1e89d11465456bd5829a85db06c4ef322f" offset="0" /> |
| 108 | 117 | </dataarea> |
| r32492 | r32493 | |
| 115 | 124 | <publisher>Fairchild</publisher> |
| 116 | 125 | <info name="series" value="Videocart 6" /> |
| 117 | 126 | <part name="cart" interface="channelf_cart"> |
| 127 | <feature name="slot" value="std" /> | |
| 118 | 128 | <dataarea name="rom" size="2048"> |
| 119 | 129 | <rom name="mthquiz1.bin" size="2048" crc="bb4c24a2" sha1="f0bfdc8f6beed2ef54add820c5e164005d2d1d25" offset="0" /> |
| 120 | 130 | </dataarea> |
| r32492 | r32493 | |
| 127 | 137 | <publisher>Fairchild</publisher> |
| 128 | 138 | <info name="series" value="Videocart 7" /> |
| 129 | 139 | <part name="cart" interface="channelf_cart"> |
| 140 | <feature name="slot" value="std" /> | |
| 130 | 141 | <dataarea name="rom" size="2048"> |
| 131 | 142 | <rom name="mthquiz2.bin" size="2048" crc="4aa7ea97" sha1="4c643e00f32629c066e778be92f37e3f7bfd1ad6" offset="0" /> |
| 132 | 143 | </dataarea> |
| r32492 | r32493 | |
| 139 | 150 | <publisher>Fairchild</publisher> |
| 140 | 151 | <info name="series" value="Videocart 8" /> |
| 141 | 152 | <part name="cart" interface="channelf_cart"> |
| 153 | <feature name="slot" value="std" /> | |
| 142 | 154 | <dataarea name="rom" size="2048"> |
| 143 | 155 | <rom name="magicnum.bin" size="2048" crc="24da0529" sha1="4b696a4f8a20f6dcd6a4ba690756d862956515a4" offset="0" /> |
| 144 | 156 | </dataarea> |
| r32492 | r32493 | |
| 151 | 163 | <publisher>Fairchild</publisher> |
| 152 | 164 | <info name="series" value="Videocart 9" /> |
| 153 | 165 | <part name="cart" interface="channelf_cart"> |
| 166 | <feature name="slot" value="std" /> | |
| 154 | 167 | <dataarea name="rom" size="2048"> |
| 155 | 168 | <rom name="dragrace.bin" size="2048" crc="6a64dda3" sha1="d915c8997f56ae09548498feecebf3c3bfcdf6c4" offset="0" /> |
| 156 | 169 | </dataarea> |
| r32492 | r32493 | |
| 163 | 176 | <publisher>Fairchild</publisher> |
| 164 | 177 | <info name="series" value="Videocart 10" /> |
| 165 | 178 | <part name="cart" interface="channelf_cart"> |
| 179 | <feature name="slot" value="maze" /> | |
| 166 | 180 | <dataarea name="rom" size="2048"> |
| 167 | 181 | <rom name="maze.bin" size="2048" crc="4d42b296" sha1="a7b70fb6f24bb1dd79f2cbb1e57b3edb04332e04" offset="0" /> |
| 168 | 182 | </dataarea> |
| 183 | <dataarea name="ram" size="1024"> | |
| 184 | </dataarea> | |
| 169 | 185 | </part> |
| 170 | 186 | </software> |
| 171 | 187 | |
| r32492 | r32493 | |
| 175 | 191 | <publisher>Fairchild</publisher> |
| 176 | 192 | <info name="series" value="Videocart 10" /> |
| 177 | 193 | <part name="cart" interface="channelf_cart"> |
| 194 | <feature name="slot" value="maze" /> | |
| 178 | 195 | <dataarea name="rom" size="2048"> |
| 179 | 196 | <rom name="mazealt.bin" size="2048" crc="0a948b61" sha1="b53ba16c6d91e2f62e020d18445217b91907a83b" offset="0" /> |
| 180 | 197 | </dataarea> |
| 198 | <dataarea name="ram" size="1024"> | |
| 199 | </dataarea> | |
| 181 | 200 | </part> |
| 182 | 201 | </software> |
| 183 | 202 | |
| r32492 | r32493 | |
| 187 | 206 | <publisher>Fairchild</publisher> |
| 188 | 207 | <info name="series" value="Videocart 11" /> |
| 189 | 208 | <part name="cart" interface="channelf_cart"> |
| 209 | <feature name="slot" value="std" /> | |
| 190 | 210 | <dataarea name="rom" size="2048"> |
| 191 | 211 | <rom name="backgmmn.bin" size="2048" crc="a1731b52" sha1="9ac23df58c95bdbe68e3a0d0a477f07cd4e951d0" offset="0" /> |
| 192 | 212 | </dataarea> |
| r32492 | r32493 | |
| 200 | 220 | <info name="series" value="Videocart 12" /> |
| 201 | 221 | <info name="usage" value="Hit CTRL and A to start." /> |
| 202 | 222 | <part name="cart" interface="channelf_cart"> |
| 223 | <feature name="slot" value="std" /> | |
| 203 | 224 | <dataarea name="rom" size="2048"> |
| 204 | 225 | <rom name="baseball.bin" size="2048" crc="01129bcd" sha1="9b0c9bd3e52da22ca7f2aab6fbb5f3c24f89ef75" offset="0" /> |
| 205 | 226 | </dataarea> |
| r32492 | r32493 | |
| 212 | 233 | <publisher>Fairchild</publisher> |
| 213 | 234 | <info name="series" value="Videocart 13" /> |
| 214 | 235 | <part name="cart" interface="channelf_cart"> |
| 236 | <feature name="slot" value="std" /> | |
| 215 | 237 | <dataarea name="rom" size="2048"> |
| 216 | 238 | <rom name="robotwar.bin" size="2048" crc="38241e4f" sha1="87f3f9afcc232d767cf6a5040c88b31283f76199" offset="0" /> |
| 217 | 239 | </dataarea> |
| r32492 | r32493 | |
| 223 | 245 | <year>1977</year> |
| 224 | 246 | <publisher>Fairchild</publisher> |
| 225 | 247 | <part name="cart" interface="channelf_cart"> |
| 248 | <feature name="slot" value="std" /> | |
| 226 | 249 | <dataarea name="rom" size="2048"> |
| 227 | 250 | <rom name="robot war (proto).bin" size="2048" crc="7f62a23c" sha1="7e5966c1c393dc1b02ac34d57733a357bbcd4d5c" offset="0" /> |
| 228 | 251 | </dataarea> |
| r32492 | r32493 | |
| 235 | 258 | <publisher>Fairchild</publisher> |
| 236 | 259 | <info name="series" value="Videocart 14" /> |
| 237 | 260 | <part name="cart" interface="channelf_cart"> |
| 261 | <feature name="slot" value="std" /> | |
| 238 | 262 | <dataarea name="rom" size="2048"> |
| 239 | 263 | <rom name="sonrsrch.bin" size="2048" crc="dbdc56bf" sha1="a15449eec75382af6dd71e766cae1171308d192c" offset="0" /> |
| 240 | 264 | </dataarea> |
| r32492 | r32493 | |
| 247 | 271 | <publisher>Fairchild</publisher> |
| 248 | 272 | <info name="series" value="Videocart 15" /> |
| 249 | 273 | <part name="cart" interface="channelf_cart"> |
| 274 | <feature name="slot" value="std" /> | |
| 250 | 275 | <dataarea name="rom" size="2048"> |
| 251 | 276 | <rom name="mmrymtch.bin" size="2048" crc="104b5e18" sha1="e46406119020c85002513b1c01352f76dcd604a4" offset="0" /> |
| 252 | 277 | </dataarea> |
| r32492 | r32493 | |
| 259 | 284 | <publisher>Fairchild</publisher> |
| 260 | 285 | <info name="series" value="Videocart 16" /> |
| 261 | 286 | <part name="cart" interface="channelf_cart"> |
| 287 | <feature name="slot" value="std" /> | |
| 262 | 288 | <dataarea name="rom" size="2048"> |
| 263 | 289 | <rom name="dodgeit.bin" size="2048" crc="e3c1811c" sha1="54fdab06a07f84d073858f56a054a59ec0b1142e" offset="0" /> |
| 264 | 290 | </dataarea> |
| r32492 | r32493 | |
| 271 | 297 | <publisher>Fairchild</publisher> |
| 272 | 298 | <info name="series" value="Videocart 17" /> |
| 273 | 299 | <part name="cart" interface="channelf_cart"> |
| 300 | <feature name="slot" value="std" /> | |
| 274 | 301 | <dataarea name="rom" size="2048"> |
| 275 | 302 | <rom name="pinball.bin" size="2048" crc="c610b330" sha1="9267d85982414af753172e4c9998863463c32c99" offset="0" /> |
| 276 | 303 | </dataarea> |
| r32492 | r32493 | |
| 283 | 310 | <publisher>Fairchild</publisher> |
| 284 | 311 | <info name="series" value="Videocart 17" /> |
| 285 | 312 | <part name="cart" interface="channelf_cart"> |
| 313 | <feature name="slot" value="std" /> | |
| 286 | 314 | <dataarea name="rom" size="2048"> |
| 287 | 315 | <rom name="pinballa.bin" size="2048" crc="7cadf0fd" sha1="cc69feb8243e6fce3e6317bf9ea82d70a85eae1c" offset="0" /> |
| 288 | 316 | </dataarea> |
| r32492 | r32493 | |
| 295 | 323 | <publisher>Fairchild</publisher> |
| 296 | 324 | <info name="series" value="Videocart 18" /> |
| 297 | 325 | <part name="cart" interface="channelf_cart"> |
| 326 | <feature name="slot" value="hangman" /> | |
| 298 | 327 | <dataarea name="rom" size="3072"> |
| 299 | 328 | <rom name="hangman.bin" size="3072" crc="9238d6ce" sha1="19166d49dec273cae1f2dbac983b130d282ed231" offset="0" /> |
| 300 | 329 | </dataarea> |
| 330 | <dataarea name="ram" size="1024"> | |
| 331 | </dataarea> | |
| 301 | 332 | </part> |
| 302 | 333 | </software> |
| 303 | 334 | |
| r32492 | r32493 | |
| 307 | 338 | <publisher>Luxor</publisher> |
| 308 | 339 | <info name="series" value="Luxor 18" /> |
| 309 | 340 | <part name="cart" interface="channelf_cart"> |
| 341 | <feature name="slot" value="hangman" /> | |
| 310 | 342 | <dataarea name="rom" size="3072"> |
| 311 | 343 | <rom name="ordtvlng.bin" size="3072" crc="3a386e79" sha1="62509545b8eef641c432705ff82cd8264c3e1d82" offset="0" /> |
| 312 | 344 | </dataarea> |
| 345 | <dataarea name="ram" size="1024"> | |
| 346 | </dataarea> | |
| 313 | 347 | </part> |
| 314 | 348 | </software> |
| 315 | 349 | |
| r32492 | r32493 | |
| 319 | 353 | <publisher>SABA</publisher> |
| 320 | 354 | <info name="series" value="SABA 16" /> |
| 321 | 355 | <part name="cart" interface="channelf_cart"> |
| 356 | <feature name="slot" value="hangman" /> | |
| 322 | 357 | <dataarea name="rom" size="3072"> |
| 323 | 358 | <rom name="ratmal.bin" size="3072" crc="87752425" sha1="35f3fb741b643c4b8e8fdbff4ed0ea24402c4528" offset="0" /> |
| 324 | 359 | </dataarea> |
| 360 | <dataarea name="ram" size="1024"> | |
| 361 | </dataarea> | |
| 325 | 362 | </part> |
| 326 | 363 | </software> |
| 327 | 364 | |
| r32492 | r32493 | |
| 331 | 368 | <publisher>Zircon</publisher> |
| 332 | 369 | <info name="series" value="Videocart 19" /> |
| 333 | 370 | <part name="cart" interface="channelf_cart"> |
| 371 | <feature name="slot" value="std" /> | |
| 334 | 372 | <dataarea name="rom" size="2048"> |
| 335 | 373 | <rom name="checkers.bin" size="2048" crc="fdae7044" sha1="2683b330dc2350341a51f1e3bdf75922bb425a9e" offset="0" /> |
| 336 | 374 | </dataarea> |
| r32492 | r32493 | |
| 343 | 381 | <publisher>Fairchild</publisher> |
| 344 | 382 | <info name="series" value="Videocart 20" /> |
| 345 | 383 | <part name="cart" interface="channelf_cart"> |
| 384 | <feature name="slot" value="std" /> | |
| 346 | 385 | <dataarea name="rom" size="3072"> |
| 347 | 386 | <rom name="vwhzball.bin" size="3072" crc="65fdfe49" sha1="61babb950ebc0b0acab29acf5dcbecc60dcd70a3" offset="0" /> |
| 348 | 387 | </dataarea> |
| r32492 | r32493 | |
| 355 | 394 | <publisher>SABA</publisher> |
| 356 | 395 | <info name="series" value="SABA 20" /> |
| 357 | 396 | <part name="cart" interface="channelf_cart"> |
| 397 | <feature name="slot" value="chess" /> | |
| 358 | 398 | <dataarea name="rom" size="6144"> |
| 359 | 399 | <rom name="schach.bin" size="6144" crc="04fb6dce" sha1="cbbaa8522fee16a0cc13ed3140d41e22919da24b" offset="0" /> |
| 360 | 400 | </dataarea> |
| 401 | <dataarea name="ram" size="2048"> | |
| 402 | </dataarea> | |
| 361 | 403 | </part> |
| 362 | 404 | </software> |
| 363 | 405 | |
| r32492 | r32493 | |
| 367 | 409 | <publisher>Fairchild/Zircon</publisher> |
| 368 | 410 | <info name="series" value="Videocart 21" /> |
| 369 | 411 | <part name="cart" interface="channelf_cart"> |
| 412 | <feature name="slot" value="std" /> | |
| 370 | 413 | <dataarea name="rom" size="2048"> |
| 371 | 414 | <rom name="bowling.bin" size="2048" crc="94322c79" sha1="82d49201ee82e8cba6a907aca80969796a84d7f4" offset="0" /> |
| 372 | 415 | </dataarea> |
| r32492 | r32493 | |
| 379 | 422 | <publisher>Zircon</publisher> |
| 380 | 423 | <info name="series" value="Videocart 22" /> |
| 381 | 424 | <part name="cart" interface="channelf_cart"> |
| 425 | <feature name="slot" value="std" /> | |
| 382 | 426 | <dataarea name="rom" size="2048"> |
| 383 | 427 | <rom name="slotmchn.bin" size="2048" crc="b7eabd08" sha1="97e12dba298460ce466509e9aefb82fe2503ef6f" offset="0" /> |
| 384 | 428 | </dataarea> |
| r32492 | r32493 | |
| 391 | 435 | <publisher>Zircon</publisher> |
| 392 | 436 | <info name="series" value="Videocart 23" /> |
| 393 | 437 | <part name="cart" interface="channelf_cart"> |
| 438 | <feature name="slot" value="std" /> | |
| 394 | 439 | <dataarea name="rom" size="2048"> |
| 395 | 440 | <rom name="galactic.bin" size="2048" crc="c8ef3410" sha1="fc3cadc90d73ce7e3b32b5c9a855d621e79c592a" offset="0" /> |
| 396 | 441 | </dataarea> |
| r32492 | r32493 | |
| 402 | 447 | <year>1980</year> |
| 403 | 448 | <publisher>Zircon</publisher> |
| 404 | 449 | <part name="cart" interface="channelf_cart"> |
| 450 | <feature name="slot" value="std" /> | |
| 405 | 451 | <dataarea name="rom" size="2048"> |
| 406 | 452 | <rom name="glactic space war (proto).bin" size="2048" crc="a61258a8" sha1="7077e42b2e8a101da05bb2188d7b65858ca8ec1e" offset="0" /> |
| 407 | 453 | </dataarea> |
| r32492 | r32493 | |
| 414 | 460 | <publisher>Zircon</publisher> |
| 415 | 461 | <info name="series" value="Videocart 24" /> |
| 416 | 462 | <part name="cart" interface="channelf_cart"> |
| 463 | <feature name="slot" value="std" /> | |
| 417 | 464 | <dataarea name="rom" size="4096"> |
| 418 | 465 | <rom name="pfootbll.bin" size="4096" crc="a1ae99be" sha1="9be97cace9b99f15a373bd95f3996034d633fff5" offset="0" /> |
| 419 | 466 | </dataarea> |
| r32492 | r32493 | |
| 425 | 472 | <year>1981</year> |
| 426 | 473 | <publisher>Zircon</publisher> |
| 427 | 474 | <part name="cart" interface="channelf_cart"> |
| 475 | <feature name="slot" value="std" /> | |
| 428 | 476 | <dataarea name="rom" size="4096"> |
| 429 | 477 | <rom name="football (proto).bin" size="4096" crc="7e5dafea" sha1="db17bbc4f3f64bc5cb698de66b0f4838be430afa" offset="0" /> |
| 430 | 478 | </dataarea> |
| r32492 | r32493 | |
| 437 | 485 | <publisher>Zircon</publisher> |
| 438 | 486 | <info name="series" value="Videocart 25" /> |
| 439 | 487 | <part name="cart" interface="channelf_cart"> |
| 488 | <feature name="slot" value="std" /> | |
| 440 | 489 | <dataarea name="rom" size="4096"> |
| 441 | 490 | <rom name="casinop.bin" size="4096" crc="5aa30c12" sha1="4540b1cfca461d6eba26754c34090aa74822a4bd" offset="0" /> |
| 442 | 491 | </dataarea> |
| r32492 | r32493 | |
| 448 | 497 | <year>1980</year> |
| 449 | 498 | <publisher>Zircon</publisher> |
| 450 | 499 | <part name="cart" interface="channelf_cart"> |
| 500 | <feature name="slot" value="std" /> | |
| 451 | 501 | <dataarea name="rom" size="4096"> |
| 452 | 502 | <rom name="draw poker (proto).bin" size="4096" crc="619fcc00" sha1="f1bd458f1efc4e9afe06db190a2a7ddb660418bf" offset="0" /> |
| 453 | 503 | </dataarea> |
| r32492 | r32493 | |
| 460 | 510 | <publisher>Zircon</publisher> |
| 461 | 511 | <info name="series" value="Videocart 26" /> |
| 462 | 512 | <part name="cart" interface="channelf_cart"> |
| 513 | <feature name="slot" value="std" /> | |
| 463 | 514 | <dataarea name="rom" size="4096"> |
| 464 | 515 | <rom name="alieninv.bin" size="4096" crc="85e00865" sha1="1837e95e6631687fc6d008207e56a31705d55cdf" offset="0" /> |
| 465 | 516 | </dataarea> |
| r32492 | r32493 | |
| 471 | 522 | <year>19??</year> |
| 472 | 523 | <publisher>Zircon</publisher> |
| 473 | 524 | <part name="cart" interface="channelf_cart"> |
| 525 | <feature name="slot" value="std" /> | |
| 474 | 526 | <dataarea name="rom" size="2048"> |
| 475 | 527 | <rom name="color organ (proto).bin" size="2048" crc="3fa2d4eb" sha1="1ccc13a2f4aeb4538379d77d08ac7bf425bc4780" offset="0" /> |
| 476 | 528 | </dataarea> |
| 477 | 529 | </part> |
| 478 | 530 | </software> |
| 479 | 531 | |
| 532 | ||
| 533 | <software name="multicrt"> | |
| 534 | <description>Channel F Multi-Cart</description> | |
| 535 | <year>2004</year> | |
| 536 | <publisher><homebrew></publisher> | |
| 537 | <part name="cart" interface="channelf_cart"> | |
| 538 | <feature name="slot" value="multi" /> | |
| 539 | <dataarea name="rom" size="262144"> | |
| 540 | <rom name="multigame rom.bin" size="262144" crc="a1ecbd58" sha1="d8d266846a01db69c0bb436093634ada7558f37f" offset="0" /> | |
| 541 | </dataarea> | |
| 542 | </part> | |
| 543 | </software> | |
| 544 | ||
| 545 | ||
| 480 | 546 | </softwarelist> |
| r32492 | r32493 | |
|---|---|---|
| 7 | 7 | <publisher>APF</publisher> |
| 8 | 8 | <info name="serial" value="MG1008" /> |
| 9 | 9 | <part name="cart" interface="apfm1000_cart"> |
| 10 | <feature name="slot" value="std" /> | |
| 10 | 11 | <dataarea name="rom" size="4096"> |
| 11 | 12 | <rom name="backgmmn.bin" size="4096" crc="811c6269" sha1="f820334bb6df9b856f54f1957b60a5e70bdd6d7e" offset="0" /> |
| 12 | 13 | </dataarea> |
| r32492 | r32493 | |
| 19 | 20 | <publisher>APF</publisher> |
| 20 | 21 | <info name="serial" value="MG1006" /> |
| 21 | 22 | <part name="cart" interface="apfm1000_cart"> |
| 23 | <feature name="slot" value="std" /> | |
| 22 | 24 | <dataarea name="rom" size="4096"> |
| 23 | 25 | <rom name="baseball.bin" size="4096" crc="1fb354b7" sha1="2c93d8e764b1e1dfdc1bde7888b385cc28064f86" offset="0" /> |
| 24 | 26 | </dataarea> |
| r32492 | r32493 | |
| 31 | 33 | <publisher>APF</publisher> |
| 32 | 34 | <info name="serial" value="MG1007" /> |
| 33 | 35 | <part name="cart" interface="apfm1000_cart"> |
| 36 | <feature name="slot" value="std" /> | |
| 34 | 37 | <dataarea name="rom" size="4096"> |
| 35 | 38 | <rom name="blackjck.bin" size="4096" crc="38faa709" sha1="1a99f4781ce4604a550f4ec9d8559e3456303464" offset="0" /> |
| 36 | 39 | </dataarea> |
| r32492 | r32493 | |
| 43 | 46 | <publisher>APF</publisher> |
| 44 | 47 | <info name="serial" value="MG1004" /> |
| 45 | 48 | <part name="cart" interface="apfm1000_cart"> |
| 49 | <feature name="slot" value="std" /> | |
| 46 | 50 | <dataarea name="rom" size="4096"> |
| 47 | 51 | <rom name="bowling.bin" size="4096" crc="cca5836b" sha1="4ff1c4ffa46c543bbf48a519a4285b5d2c697ae3" offset="0" /> |
| 48 | 52 | </dataarea> |
| r32492 | r32493 | |
| 55 | 59 | <publisher>APF</publisher> |
| 56 | 60 | <info name="serial" value="MG1012" /> |
| 57 | 61 | <part name="cart" interface="apfm1000_cart"> |
| 62 | <feature name="slot" value="std" /> | |
| 58 | 63 | <dataarea name="rom" size="4096"> |
| 59 | 64 | <rom name="boxing.bin" size="4096" crc="7121f8b1" sha1="e7ae8571b496444ded77aaaa3c1d5f5ee97c651f" offset="0" /> |
| 60 | 65 | </dataarea> |
| r32492 | r32493 | |
| 67 | 72 | <publisher>APF</publisher> |
| 68 | 73 | <info name="serial" value="MG1005" /> |
| 69 | 74 | <part name="cart" interface="apfm1000_cart"> |
| 75 | <feature name="slot" value="std" /> | |
| 70 | 76 | <dataarea name="rom" size="2048"> |
| 71 | 77 | <rom name="brickdwn.bin" size="2048" crc="bc1f5b8b" sha1="3e2f1e93501cd0dd2c9b747c594b784360e5b175" offset="0" /> |
| 72 | 78 | </dataarea> |
| r32492 | r32493 | |
| 79 | 85 | <publisher>APF</publisher> |
| 80 | 86 | <info name="serial" value="MG1009" /> |
| 81 | 87 | <part name="cart" interface="apfm1000_cart"> |
| 88 | <feature name="slot" value="std" /> | |
| 82 | 89 | <dataarea name="rom" size="4096"> |
| 83 | 90 | <rom name="casino.bin" size="4096" crc="21d5f63f" sha1="fa34ebdb799ccd2bff9f63ce4189a4ee690706fa" offset="0" /> |
| 84 | 91 | </dataarea> |
| r32492 | r32493 | |
| 91 | 98 | <publisher>APF</publisher> |
| 92 | 99 | <info name="serial" value="MG1001" /> |
| 93 | 100 | <part name="cart" interface="apfm1000_cart"> |
| 101 | <feature name="slot" value="std" /> | |
| 94 | 102 | <dataarea name="rom" size="2048"> |
| 95 | 103 | <rom name="catena.bin" size="2048" crc="6baad95f" sha1="b63ad3a60b59aad9b4605ff96f77839565144278" offset="0" /> |
| 96 | 104 | </dataarea> |
| r32492 | r32493 | |
| 103 | 111 | <publisher>APF</publisher> |
| 104 | 112 | <info name="serial" value="MG1002" /> |
| 105 | 113 | <part name="cart" interface="apfm1000_cart"> |
| 114 | <feature name="slot" value="std" /> | |
| 106 | 115 | <dataarea name="rom" size="2048"> |
| 107 | 116 | <rom name="catenaa.bin" size="2048" crc="5d03a812" sha1="29db4ca3c8b76c413b84b6d2bfd3499a70eccd3d" offset="0" /> |
| 108 | 117 | </dataarea> |
| r32492 | r32493 | |
| 115 | 124 | <publisher>APF</publisher> |
| 116 | 125 | <info name="serial" value="MG1003" /> |
| 117 | 126 | <part name="cart" interface="apfm1000_cart"> |
| 127 | <feature name="slot" value="std" /> | |
| 118 | 128 | <dataarea name="rom" size="4096"> |
| 119 | 129 | <rom name="hangman.bin" size="4096" crc="e58a5d5b" sha1="205d659db0e0ab0292d33b5b4a9c2b46ca9d1dd5" offset="0" /> |
| 120 | 130 | </dataarea> |
| r32492 | r32493 | |
| 127 | 137 | <publisher>APF</publisher> |
| 128 | 138 | <info name="serial" value="MG1011" /> |
| 129 | 139 | <part name="cart" interface="apfm1000_cart"> |
| 140 | <feature name="slot" value="std" /> | |
| 130 | 141 | <dataarea name="rom" size="4096"> |
| 131 | 142 | <rom name="pinball.bin" size="4096" crc="3f4b8c83" sha1="1f5bca6e96777ccbe830d1143a3549f51a3e386e" offset="0" /> |
| 132 | 143 | </dataarea> |
| r32492 | r32493 | |
| 157 | 168 | |
| 158 | 169 | --> |
| 159 | 170 | <part name="cart" interface="apfm1000_cart"> |
| 160 | <feature name=" | |
| 171 | <feature name="slot" value="spacedst"/> | |
| 161 | 172 | <dataarea name="rom" size="8192"> |
| 162 | 173 | <rom name="apf1013a.bin" size="4096" crc="f25215a0" sha1="72da492092b883eb31cffb41ea353e919c86d285" offset="0" /> |
| 163 | 174 | <rom name="apf1013b.bin" size="2048" crc="8c3a9faa" sha1="b3cfc23c65558ef7b67c9afa01a306c8123e227f" offset="0x1000" /> |
| r32492 | r32493 | |
| 167 | 178 | </part> |
| 168 | 179 | </software> |
| 169 | 180 | |
| 170 | <software name="ufo" | |
| 181 | <software name="ufo"> | |
| 171 | 182 | <description>Ufo / Sea Monsters / Break It Down / Rebuild / Shoot</description> |
| 172 | 183 | <year>1979</year> |
| 173 | 184 | <publisher>APF</publisher> |
| 174 | 185 | <info name="serial" value="MG1010" /> |
| 175 | 186 | <part name="cart" interface="apfm1000_cart"> |
| 187 | <feature name="slot" value="std" /> | |
| 176 | 188 | <dataarea name="rom" size="4096"> |
| 177 | 189 | <rom name="ufo.bin" size="4096" crc="0504d667" sha1="6e33593f9e7a4551bc31b347741d9ff87ce618ca" offset="0" /> |
| 178 | 190 | </dataarea> |
| r32492 | r32493 | |
| 181 | 193 | |
| 182 | 194 | <!-- Homebrew --> |
| 183 | 195 | |
| 184 | <software name="chardump" | |
| 196 | <software name="chardump"> | |
| 185 | 197 | <description>Character Dump</description> |
| 186 | 198 | <year>2010</year> |
| 187 | 199 | <publisher>Adam Trionfo</publisher> |
| 188 | 200 | <part name="cart" interface="apfm1000_cart"> |
| 201 | <feature name="slot" value="std" /> | |
| 189 | 202 | <dataarea name="rom" size="4096"> |
| 190 | 203 | <rom name="chardump.bin" size="4096" crc="27bd1c3c" sha1="826b608b6c33798942bd716928eef70cc8e83bda" offset="0" /> |
| 191 | 204 | </dataarea> |
| r32492 | r32493 | |
| 205 | 218 | </part> |
| 206 | 219 | </software> |
| 207 | 220 | |
| 208 | <software name="movblock" | |
| 221 | <software name="movblock"> | |
| 209 | 222 | <description>Move Block</description> |
| 210 | 223 | <year>2010</year> |
| 211 | 224 | <publisher>Adam Trionfo</publisher> |
| 212 | 225 | <part name="cart" interface="apfm1000_cart"> |
| 226 | <feature name="slot" value="std" /> | |
| 213 | 227 | <dataarea name="rom" size="4096"> |
| 214 | 228 | <rom name="movblock.bin" size="4096" crc="f77f72f4" sha1="2cf3a82d584b2a2e4c7e5ae751da8d0255c2295a" offset="0" /> |
| 215 | 229 | </dataarea> |
| 216 | 230 | </part> |
| 217 | 231 | </software> |
| 218 | 232 | |
| 219 | <software name="mblock02" | |
| 233 | <software name="mblock02"> | |
| 220 | 234 | <description>Move Block 2</description> |
| 221 | 235 | <year>2010</year> |
| 222 | 236 | <publisher>Adam Trionfo</publisher> |
| 223 | 237 | <part name="cart" interface="apfm1000_cart"> |
| 238 | <feature name="slot" value="std" /> | |
| 224 | 239 | <dataarea name="rom" size="4096"> |
| 225 | 240 | <rom name="mblock02.bin" size="4096" crc="cf63865a" sha1="8c8e6924ab511d69a31eb52faaaad5efb7888f33" offset="0" /> |
| 226 | 241 | </dataarea> |
| 227 | 242 | </part> |
| 228 | 243 | </software> |
| 229 | 244 | |
| 230 | <software name="readpia" | |
| 245 | <software name="readpia"> | |
| 231 | 246 | <description>Read PIA</description> |
| 232 | 247 | <year>2010</year> |
| 233 | 248 | <publisher>Adam Trionfo</publisher> |
| 234 | 249 | <part name="cart" interface="apfm1000_cart"> |
| 250 | <feature name="slot" value="std" /> | |
| 235 | 251 | <dataarea name="rom" size="4096"> |
| 236 | 252 | <rom name="readpia.bin" size="4096" crc="700c1e39" sha1="701c4f8a9fc20c8f28a5c0562592ed873d9d9ab4" offset="0" /> |
| 237 | 253 | </dataarea> |
| r32492 | r32493 | |
| 240 | 256 | |
| 241 | 257 | <!-- apfimag only --> |
| 242 | 258 | |
| 243 | <software name="basic" | |
| 259 | <software name="basic"> | |
| 244 | 260 | <description>APF Basic</description> |
| 245 | 261 | <year>1979</year> |
| 246 | 262 | <publisher>APF</publisher> |
| 247 | 263 | <info name="serial" value="AL100A" /> |
| 248 | 264 | <part name="cart" interface="apfm1000_cart"> |
| 249 | <feature name=" | |
| 265 | <feature name="slot" value="basic"/> | |
| 250 | 266 | <dataarea name="rom" size="12288"> |
| 251 | 267 | <rom name="basic_80.rom" size="8192" crc="a4c69fae" sha1="7f98aa482589bf7c5a26d338fec105e797ba43f6" offset="0" /> |
| 252 | 268 | <rom name="basic_68.rom" size="4096" crc="5f30370b" sha1="cf11bd975749b88df4d82cd460035cb92563ceff" offset="0x2000" /> |
| r32492 | r32493 | |
| 254 | 270 | </part> |
| 255 | 271 | </software> |
| 256 | 272 | |
| 257 | <software name="ebasic" | |
| 273 | <software name="ebasic"> | |
| 258 | 274 | <description>Extended Basic</description> |
| 259 | 275 | <year>1983</year> |
| 260 | <publisher>R.L.Recker</publisher> | |
| 276 | <publisher>R.L. Recker</publisher> | |
| 261 | 277 | <part name="cart" interface="apfm1000_cart"> |
| 262 | <feature name=" | |
| 278 | <feature name="slot" value="basic"/> | |
| 263 | 279 | <dataarea name="rom" size="14336"> |
| 264 | 280 | <rom name="basic_80.bin" size="8192" crc="3fefbd81" sha1="d8c3ea8a152da50f71b98c464f47919e16743d29" offset="0" /> |
| 265 | 281 | <rom name="basic_68.bin" size="4096" crc="e99b5102" sha1="62a79dc5f25a60d9007c90adf778fba432dfb900" offset="0x2000" /> |
| r0 | r32493 | |
|---|---|---|
| 1 | /*********************************************************************************************************** | |
| 2 | ||
| 3 | Fairchild Channel F 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 | ||
| 16 | const device_type CHANF_CART_SLOT = &device_creator<channelf_cart_slot_device>; | |
| 17 | ||
| 18 | //************************************************************************** | |
| 19 | // Channel F cartridges Interface | |
| 20 | //************************************************************************** | |
| 21 | ||
| 22 | //------------------------------------------------- | |
| 23 | // device_channelf_cart_interface - constructor | |
| 24 | //------------------------------------------------- | |
| 25 | ||
| 26 | device_channelf_cart_interface::device_channelf_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_channelf_cart_interface - destructor | |
| 36 | //------------------------------------------------- | |
| 37 | ||
| 38 | device_channelf_cart_interface::~device_channelf_cart_interface() | |
| 39 | { | |
| 40 | } | |
| 41 | ||
| 42 | //------------------------------------------------- | |
| 43 | // rom_alloc - alloc the space for the cart | |
| 44 | //------------------------------------------------- | |
| 45 | ||
| 46 | void device_channelf_cart_interface::rom_alloc(UINT32 size, const char *tag) | |
| 47 | { | |
| 48 | if (m_rom == NULL) | |
| 49 | { | |
| 50 | astring tempstring(tag); | |
| 51 | tempstring.cat(CHANFSLOT_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 | // ram_alloc - alloc the space for the ram | |
| 60 | //------------------------------------------------- | |
| 61 | ||
| 62 | void device_channelf_cart_interface::ram_alloc(UINT32 size) | |
| 63 | { | |
| 64 | m_ram.resize(size); | |
| 65 | } | |
| 66 | ||
| 67 | ||
| 68 | //************************************************************************** | |
| 69 | // LIVE DEVICE | |
| 70 | //************************************************************************** | |
| 71 | ||
| 72 | //------------------------------------------------- | |
| 73 | // channelf_cart_slot_device - constructor | |
| 74 | //------------------------------------------------- | |
| 75 | channelf_cart_slot_device::channelf_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 76 | device_t(mconfig, CHANF_CART_SLOT, "Fairchild Channel F Cartridge Slot", tag, owner, clock, "cf_cart_slot", __FILE__), | |
| 77 | device_image_interface(mconfig, *this), | |
| 78 | device_slot_interface(mconfig, *this), | |
| 79 | m_type(CF_CHESS) | |
| 80 | { | |
| 81 | } | |
| 82 | ||
| 83 | ||
| 84 | //------------------------------------------------- | |
| 85 | // ~channelf_cart_slot_device - destructor | |
| 86 | //------------------------------------------------- | |
| 87 | ||
| 88 | channelf_cart_slot_device::~channelf_cart_slot_device() | |
| 89 | { | |
| 90 | } | |
| 91 | ||
| 92 | //------------------------------------------------- | |
| 93 | // device_start - device-specific startup | |
| 94 | //------------------------------------------------- | |
| 95 | ||
| 96 | void channelf_cart_slot_device::device_start() | |
| 97 | { | |
| 98 | m_cart = dynamic_cast<device_channelf_cart_interface *>(get_card_device()); | |
| 99 | } | |
| 100 | ||
| 101 | //------------------------------------------------- | |
| 102 | // device_config_complete - perform any | |
| 103 | // operations now that the configuration is | |
| 104 | // complete | |
| 105 | //------------------------------------------------- | |
| 106 | ||
| 107 | void channelf_cart_slot_device::device_config_complete() | |
| 108 | { | |
| 109 | // set brief and instance name | |
| 110 | update_names(); | |
| 111 | } | |
| 112 | ||
| 113 | ||
| 114 | //------------------------------------------------- | |
| 115 | // Channel F PCB | |
| 116 | //------------------------------------------------- | |
| 117 | ||
| 118 | struct chanf_slot | |
| 119 | { | |
| 120 | int pcb_id; | |
| 121 | const char *slot_option; | |
| 122 | }; | |
| 123 | ||
| 124 | // Here, we take the feature attribute from .xml (i.e. the PCB name) and we assign a unique ID to it | |
| 125 | static const chanf_slot slot_list[] = | |
| 126 | { | |
| 127 | { CF_STD, "std" }, | |
| 128 | { CF_MAZE, "maze" }, | |
| 129 | { CF_HANGMAN, "hangman" }, | |
| 130 | { CF_CHESS, "chess" }, | |
| 131 | { CF_MULTI, "multi" } | |
| 132 | }; | |
| 133 | ||
| 134 | static int chanf_get_pcb_id(const char *slot) | |
| 135 | { | |
| 136 | for (int i = 0; i < ARRAY_LENGTH(slot_list); i++) | |
| 137 | { | |
| 138 | if (!core_stricmp(slot_list[i].slot_option, slot)) | |
| 139 | return slot_list[i].pcb_id; | |
| 140 | } | |
| 141 | ||
| 142 | return 0; | |
| 143 | } | |
| 144 | ||
| 145 | static const char *chanf_get_slot(int type) | |
| 146 | { | |
| 147 | for (int i = 0; i < ARRAY_LENGTH(slot_list); i++) | |
| 148 | { | |
| 149 | if (slot_list[i].pcb_id == type) | |
| 150 | return slot_list[i].slot_option; | |
| 151 | } | |
| 152 | ||
| 153 | return "chess"; | |
| 154 | } | |
| 155 | ||
| 156 | ||
| 157 | /*------------------------------------------------- | |
| 158 | call load | |
| 159 | -------------------------------------------------*/ | |
| 160 | ||
| 161 | bool channelf_cart_slot_device::call_load() | |
| 162 | { | |
| 163 | if (m_cart) | |
| 164 | { | |
| 165 | UINT32 len = (software_entry() == NULL) ? length() : get_software_region_length("rom"); | |
| 166 | m_cart->rom_alloc(len, tag()); | |
| 167 | ||
| 168 | if (software_entry() == NULL) | |
| 169 | fread(m_cart->get_rom_base(), len); | |
| 170 | else | |
| 171 | memcpy(m_cart->get_rom_base(), get_software_region("rom"), len); | |
| 172 | ||
| 173 | if (software_entry() == NULL) | |
| 174 | { | |
| 175 | // we default to "chess" slot because some homebrew programs have been written to run | |
| 176 | // on PCBs with RAM at $2000-$2800 as Saba Schach! | |
| 177 | if (len == 0x40000) | |
| 178 | m_type = CF_MULTI; | |
| 179 | else | |
| 180 | m_type = CF_CHESS; // is there any way to detect Maze and Hangman from fullpath? | |
| 181 | ||
| 182 | m_cart->ram_alloc(0x800); | |
| 183 | } | |
| 184 | else | |
| 185 | { | |
| 186 | const char *pcb_name = get_feature("slot"); | |
| 187 | if (pcb_name) | |
| 188 | m_type = chanf_get_pcb_id(pcb_name); | |
| 189 | ||
| 190 | if (get_software_region("ram")) | |
| 191 | m_cart->ram_alloc(get_software_region_length("ram")); | |
| 192 | } | |
| 193 | ||
| 194 | //printf("Type: %s\n", chanf_get_slot(m_type)); | |
| 195 | ||
| 196 | return IMAGE_INIT_PASS; | |
| 197 | } | |
| 198 | ||
| 199 | return IMAGE_INIT_PASS; | |
| 200 | } | |
| 201 | ||
| 202 | ||
| 203 | /*------------------------------------------------- | |
| 204 | call softlist load | |
| 205 | -------------------------------------------------*/ | |
| 206 | ||
| 207 | bool channelf_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) | |
| 208 | { | |
| 209 | load_software_part_region(*this, swlist, swname, start_entry); | |
| 210 | return TRUE; | |
| 211 | } | |
| 212 | ||
| 213 | ||
| 214 | ||
| 215 | /*------------------------------------------------- | |
| 216 | get default card software | |
| 217 | -------------------------------------------------*/ | |
| 218 | ||
| 219 | void channelf_cart_slot_device::get_default_card_software(astring &result) | |
| 220 | { | |
| 221 | if (open_image_file(mconfig().options())) | |
| 222 | { | |
| 223 | const char *slot_string = "chess"; | |
| 224 | UINT32 len = core_fsize(m_file); | |
| 225 | int type; | |
| 226 | ||
| 227 | if (len == 0x40000) | |
| 228 | type = CF_MULTI; | |
| 229 | else | |
| 230 | type = CF_CHESS; // is there any way to detect the other carts from fullpath? | |
| 231 | ||
| 232 | slot_string = chanf_get_slot(type); | |
| 233 | ||
| 234 | //printf("type: %s\n", slot_string); | |
| 235 | clear(); | |
| 236 | ||
| 237 | result.cpy(slot_string); | |
| 238 | return; | |
| 239 | } | |
| 240 | software_get_default_slot(result, "chess"); | |
| 241 | } | |
| 242 | ||
| 243 | /*------------------------------------------------- | |
| 244 | read | |
| 245 | -------------------------------------------------*/ | |
| 246 | ||
| 247 | READ8_MEMBER(channelf_cart_slot_device::read_rom) | |
| 248 | { | |
| 249 | if (m_cart) | |
| 250 | return m_cart->read_rom(space, offset); | |
| 251 | else | |
| 252 | return 0xff; | |
| 253 | } | |
| 254 | ||
| 255 | /*------------------------------------------------- | |
| 256 | read | |
| 257 | -------------------------------------------------*/ | |
| 258 | ||
| 259 | READ8_MEMBER(channelf_cart_slot_device::read_ram) | |
| 260 | { | |
| 261 | if (m_cart) | |
| 262 | return m_cart->read_ram(space, offset); | |
| 263 | else | |
| 264 | return 0xff; | |
| 265 | } | |
| 266 | ||
| 267 | /*------------------------------------------------- | |
| 268 | write | |
| 269 | -------------------------------------------------*/ | |
| 270 | ||
| 271 | WRITE8_MEMBER(channelf_cart_slot_device::write_ram) | |
| 272 | { | |
| 273 | if (m_cart) | |
| 274 | m_cart->write_ram(space, offset, data); | |
| 275 | } | |
| 276 | ||
| 277 | /*------------------------------------------------- | |
| 278 | write | |
| 279 | -------------------------------------------------*/ | |
| 280 | ||
| 281 | WRITE8_MEMBER(channelf_cart_slot_device::write_bank) | |
| 282 | { | |
| 283 | if (m_cart) | |
| 284 | m_cart->write_bank(space, offset, data); | |
| 285 | } |
| Added: svn:eol-style + native Added: svn:mime-type + text/plain |
| r0 | r32493 | |
|---|---|---|
| 1 | #ifndef __CHANF_ROM_H | |
| 2 | #define __CHANF_ROM_H | |
| 3 | ||
| 4 | #include "slot.h" | |
| 5 | ||
| 6 | ||
| 7 | // ======================> chanf_rom_device | |
| 8 | ||
| 9 | class chanf_rom_device : public device_t, | |
| 10 | public device_channelf_cart_interface | |
| 11 | { | |
| 12 | public: | |
| 13 | // construction/destruction | |
| 14 | chanf_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 | chanf_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 | UINT8 common_read_2102(UINT32 offset); | |
| 22 | UINT8 common_read_3853(UINT32 offset); | |
| 23 | void common_write_2102(UINT32 offset, UINT8 data); | |
| 24 | void common_write_3853(UINT32 offset, UINT8 data); | |
| 25 | ||
| 26 | // reading and writing | |
| 27 | virtual DECLARE_READ8_MEMBER(read_rom); | |
| 28 | ||
| 29 | ||
| 30 | protected: | |
| 31 | // used for RAM chip in Hangman & Maze | |
| 32 | UINT8 m_latch[2]; // PORT A & PORT B | |
| 33 | UINT16 m_addr_latch, m_addr; | |
| 34 | int m_read_write, m_data0; | |
| 35 | }; | |
| 36 | ||
| 37 | // ======================> chanf_maze_device | |
| 38 | ||
| 39 | class chanf_maze_device : public chanf_rom_device | |
| 40 | { | |
| 41 | public: | |
| 42 | // construction/destruction | |
| 43 | chanf_maze_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 44 | ||
| 45 | // device-level overrides | |
| 46 | virtual void device_start(); | |
| 47 | virtual void device_reset(); | |
| 48 | ||
| 49 | // reading and writing | |
| 50 | virtual DECLARE_READ8_MEMBER(read_ram) { return common_read_2102(offset); } | |
| 51 | virtual DECLARE_WRITE8_MEMBER(write_ram) { common_write_2102(offset, data); } | |
| 52 | }; | |
| 53 | ||
| 54 | ||
| 55 | // ======================> chanf_hangman_device | |
| 56 | ||
| 57 | class chanf_hangman_device : public chanf_rom_device | |
| 58 | { | |
| 59 | public: | |
| 60 | // construction/destruction | |
| 61 | chanf_hangman_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 62 | ||
| 63 | // device-level overrides | |
| 64 | virtual void device_start(); | |
| 65 | virtual void device_reset(); | |
| 66 | ||
| 67 | // reading and writing | |
| 68 | virtual DECLARE_READ8_MEMBER(read_ram) { return common_read_2102(offset); } | |
| 69 | virtual DECLARE_WRITE8_MEMBER(write_ram) { common_write_2102(offset, data); } | |
| 70 | }; | |
| 71 | ||
| 72 | ||
| 73 | // ======================> chanf_chess_device | |
| 74 | ||
| 75 | class chanf_chess_device : public chanf_rom_device | |
| 76 | { | |
| 77 | public: | |
| 78 | // construction/destruction | |
| 79 | chanf_chess_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 80 | ||
| 81 | // reading and writing | |
| 82 | virtual DECLARE_READ8_MEMBER(read_ram) { return common_read_3853(offset); } | |
| 83 | virtual DECLARE_WRITE8_MEMBER(write_ram) { common_write_3853(offset, data); } | |
| 84 | }; | |
| 85 | ||
| 86 | ||
| 87 | // ======================> chanf_multi_device | |
| 88 | ||
| 89 | class chanf_multi_device : public chanf_rom_device | |
| 90 | { | |
| 91 | public: | |
| 92 | // construction/destruction | |
| 93 | chanf_multi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 94 | ||
| 95 | // device-level overrides | |
| 96 | virtual void device_start(); | |
| 97 | virtual void device_reset(); | |
| 98 | ||
| 99 | // reading and writing | |
| 100 | virtual DECLARE_READ8_MEMBER(read_rom); | |
| 101 | virtual DECLARE_READ8_MEMBER(read_ram) { return common_read_3853(offset); } | |
| 102 | virtual DECLARE_WRITE8_MEMBER(write_ram) { common_write_3853(offset, data); } | |
| 103 | virtual DECLARE_WRITE8_MEMBER(write_bank); | |
| 104 | ||
| 105 | private: | |
| 106 | int m_base_bank; | |
| 107 | }; | |
| 108 | ||
| 109 | ||
| 110 | ||
| 111 | // device type definition | |
| 112 | extern const device_type CHANF_ROM_STD; | |
| 113 | extern const device_type CHANF_ROM_MAZE; | |
| 114 | extern const device_type CHANF_ROM_HANGMAN; | |
| 115 | extern const device_type CHANF_ROM_CHESS; | |
| 116 | extern const device_type CHANF_ROM_MULTI; | |
| 117 | ||
| 118 | ||
| 119 | #endif |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r32493 | |
|---|---|---|
| 1 | #ifndef __CHANF_SLOT_H | |
| 2 | #define __CHANF_SLOT_H | |
| 3 | ||
| 4 | /*************************************************************************** | |
| 5 | TYPE DEFINITIONS | |
| 6 | ***************************************************************************/ | |
| 7 | ||
| 8 | ||
| 9 | /* PCB */ | |
| 10 | enum | |
| 11 | { | |
| 12 | CF_STD = 0, | |
| 13 | CF_MAZE, | |
| 14 | CF_HANGMAN, | |
| 15 | CF_CHESS, | |
| 16 | CF_MULTI | |
| 17 | }; | |
| 18 | ||
| 19 | ||
| 20 | // ======================> device_channelf_cart_interface | |
| 21 | ||
| 22 | class device_channelf_cart_interface : public device_slot_card_interface | |
| 23 | { | |
| 24 | public: | |
| 25 | // device_channelf_cart_interface/destruction | |
| 26 | device_channelf_cart_interface(const machine_config &mconfig, device_t &device); | |
| 27 | virtual ~device_channelf_cart_interface(); | |
| 28 | ||
| 29 | // reading and writing | |
| 30 | virtual DECLARE_READ8_MEMBER(read_rom) { return 0xff; } | |
| 31 | virtual DECLARE_READ8_MEMBER(read_ram) { return 0xff; } | |
| 32 | virtual DECLARE_WRITE8_MEMBER(write_ram) {} | |
| 33 | virtual DECLARE_WRITE8_MEMBER(write_bank) {} | |
| 34 | ||
| 35 | void rom_alloc(UINT32 size, const char *tag); | |
| 36 | void ram_alloc(UINT32 size); | |
| 37 | UINT8* get_rom_base() { return m_rom; } | |
| 38 | UINT8* get_ram_base() { return m_ram; } | |
| 39 | UINT32 get_rom_size() { return m_rom_size; } | |
| 40 | UINT32 get_ram_size() { return m_ram.count(); } | |
| 41 | ||
| 42 | void save_ram() { device().save_item(NAME(m_ram)); } | |
| 43 | ||
| 44 | protected: | |
| 45 | // internal state | |
| 46 | UINT8 *m_rom; | |
| 47 | UINT32 m_rom_size; | |
| 48 | dynamic_buffer m_ram; | |
| 49 | }; | |
| 50 | ||
| 51 | ||
| 52 | // ======================> channelf_cart_slot_device | |
| 53 | ||
| 54 | class channelf_cart_slot_device : public device_t, | |
| 55 | public device_image_interface, | |
| 56 | public device_slot_interface | |
| 57 | { | |
| 58 | public: | |
| 59 | // construction/destruction | |
| 60 | channelf_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 61 | virtual ~channelf_cart_slot_device(); | |
| 62 | ||
| 63 | // device-level overrides | |
| 64 | virtual void device_start(); | |
| 65 | virtual void device_config_complete(); | |
| 66 | ||
| 67 | // image-level overrides | |
| 68 | virtual bool call_load(); | |
| 69 | virtual void call_unload() {} | |
| 70 | virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry); | |
| 71 | ||
| 72 | int get_type() { return m_type; } | |
| 73 | ||
| 74 | void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); } | |
| 75 | ||
| 76 | virtual iodevice_t image_type() const { return IO_CARTSLOT; } | |
| 77 | virtual bool is_readable() const { return 1; } | |
| 78 | virtual bool is_writeable() const { return 0; } | |
| 79 | virtual bool is_creatable() const { return 0; } | |
| 80 | virtual bool must_be_loaded() const { return 0; } | |
| 81 | virtual bool is_reset_on_load() const { return 1; } | |
| 82 | virtual const option_guide *create_option_guide() const { return NULL; } | |
| 83 | virtual const char *image_interface() const { return "channelf_cart"; } | |
| 84 | virtual const char *file_extensions() const { return "bin,chf"; } | |
| 85 | ||
| 86 | // slot interface overrides | |
| 87 | virtual void get_default_card_software(astring &result); | |
| 88 | ||
| 89 | // reading and writing | |
| 90 | virtual DECLARE_READ8_MEMBER(read_rom); | |
| 91 | virtual DECLARE_READ8_MEMBER(read_ram); | |
| 92 | virtual DECLARE_WRITE8_MEMBER(write_ram); | |
| 93 | virtual DECLARE_WRITE8_MEMBER(write_bank); | |
| 94 | ||
| 95 | protected: | |
| 96 | ||
| 97 | int m_type; | |
| 98 | device_channelf_cart_interface* m_cart; | |
| 99 | }; | |
| 100 | ||
| 101 | ||
| 102 | ||
| 103 | // device type definition | |
| 104 | extern const device_type CHANF_CART_SLOT; | |
| 105 | ||
| 106 | ||
| 107 | /*************************************************************************** | |
| 108 | DEVICE CONFIGURATION MACROS | |
| 109 | ***************************************************************************/ | |
| 110 | ||
| 111 | #define CHANFSLOT_ROM_REGION_TAG ":cart:rom" | |
| 112 | ||
| 113 | #define MCFG_CHANNELF_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \ | |
| 114 | MCFG_DEVICE_ADD(_tag, CHANF_CART_SLOT, 0) \ | |
| 115 | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \ | |
| 116 | ||
| 117 | #endif |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r32493 | |
|---|---|---|
| 1 | /*********************************************************************************************************** | |
| 2 | ||
| 3 | ||
| 4 | Fairchild Channel F cart emulation | |
| 5 | ||
| 6 | Three kind of carts: | |
| 7 | - ROM only (the vast majority of carts) | |
| 8 | - ROM + 2102 RAM chip (used by carts 10 and 18, with different I/O ports) | |
| 9 | - ROM + 3853 RAM chip (used by Schach + some homebrew) | |
| 10 | ||
| 11 | Based on Sean Riddle's documentation (especially for the 2102 RAM!) | |
| 12 | ||
| 13 | ***********************************************************************************************************/ | |
| 14 | ||
| 15 | ||
| 16 | #include "emu.h" | |
| 17 | #include "rom.h" | |
| 18 | ||
| 19 | ||
| 20 | //------------------------------------------------- | |
| 21 | // chanf_rom_device - constructor | |
| 22 | //------------------------------------------------- | |
| 23 | ||
| 24 | const device_type CHANF_ROM_STD = &device_creator<chanf_rom_device>; | |
| 25 | const device_type CHANF_ROM_MAZE = &device_creator<chanf_maze_device>; | |
| 26 | const device_type CHANF_ROM_HANGMAN = &device_creator<chanf_hangman_device>; | |
| 27 | const device_type CHANF_ROM_CHESS = &device_creator<chanf_chess_device>; | |
| 28 | const device_type CHANF_ROM_MULTI = &device_creator<chanf_multi_device>; | |
| 29 | ||
| 30 | ||
| 31 | chanf_rom_device::chanf_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) | |
| 32 | : device_t(mconfig, type, name, tag, owner, clock, shortname, source), | |
| 33 | device_channelf_cart_interface( mconfig, *this ) | |
| 34 | { | |
| 35 | } | |
| 36 | ||
| 37 | chanf_rom_device::chanf_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 38 | : device_t(mconfig, CHANF_ROM_STD, "Channel F Standard Carts", tag, owner, clock, "chanf_rom", __FILE__), | |
| 39 | device_channelf_cart_interface( mconfig, *this ) | |
| 40 | { | |
| 41 | } | |
| 42 | ||
| 43 | chanf_maze_device::chanf_maze_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 44 | : chanf_rom_device(mconfig, CHANF_ROM_MAZE, "Channel F Maze Cart", tag, owner, clock, "chanf_maze", __FILE__) | |
| 45 | { | |
| 46 | } | |
| 47 | ||
| 48 | chanf_hangman_device::chanf_hangman_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 49 | : chanf_rom_device(mconfig, CHANF_ROM_HANGMAN, "Channel F Hangman Cart", tag, owner, clock, "chanf_hang", __FILE__) | |
| 50 | { | |
| 51 | } | |
| 52 | ||
| 53 | chanf_chess_device::chanf_chess_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 54 | : chanf_rom_device(mconfig, CHANF_ROM_CHESS, "Channel F Chess Cart", tag, owner, clock, "chanf_chess", __FILE__) | |
| 55 | { | |
| 56 | } | |
| 57 | ||
| 58 | chanf_multi_device::chanf_multi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 59 | : chanf_rom_device(mconfig, CHANF_ROM_MULTI, "Channel F Multigame Cart", tag, owner, clock, "chanf_multi", __FILE__) | |
| 60 | { | |
| 61 | } | |
| 62 | ||
| 63 | ||
| 64 | ||
| 65 | //------------------------------------------------- | |
| 66 | // mapper specific start/reset | |
| 67 | //------------------------------------------------- | |
| 68 | ||
| 69 | ||
| 70 | void chanf_maze_device::device_start() | |
| 71 | { | |
| 72 | // 2012 RAM related | |
| 73 | save_item(NAME(m_latch)); | |
| 74 | save_item(NAME(m_addr_latch)); | |
| 75 | save_item(NAME(m_addr)); | |
| 76 | save_item(NAME(m_read_write)); | |
| 77 | save_item(NAME(m_data0)); | |
| 78 | } | |
| 79 | ||
| 80 | void chanf_maze_device::device_reset() | |
| 81 | { | |
| 82 | m_latch[0] = 0; | |
| 83 | m_latch[1] = 0; | |
| 84 | m_addr = 0; | |
| 85 | m_addr_latch = 0; | |
| 86 | m_read_write = 0; | |
| 87 | m_data0 = 0; | |
| 88 | } | |
| 89 | ||
| 90 | ||
| 91 | void chanf_hangman_device::device_start() | |
| 92 | { | |
| 93 | // 2012 RAM related | |
| 94 | save_item(NAME(m_latch)); | |
| 95 | save_item(NAME(m_addr_latch)); | |
| 96 | save_item(NAME(m_addr)); | |
| 97 | save_item(NAME(m_read_write)); | |
| 98 | save_item(NAME(m_data0)); | |
| 99 | } | |
| 100 | ||
| 101 | void chanf_hangman_device::device_reset() | |
| 102 | { | |
| 103 | m_latch[0] = 0; | |
| 104 | m_latch[1] = 0; | |
| 105 | m_addr = 0; | |
| 106 | m_addr_latch = 0; | |
| 107 | m_read_write = 0; | |
| 108 | m_data0 = 0; | |
| 109 | } | |
| 110 | ||
| 111 | ||
| 112 | void chanf_multi_device::device_start() | |
| 113 | { | |
| 114 | save_item(NAME(m_base_bank)); | |
| 115 | } | |
| 116 | ||
| 117 | void chanf_multi_device::device_reset() | |
| 118 | { | |
| 119 | m_base_bank = 0; | |
| 120 | } | |
| 121 | ||
| 122 | ||
| 123 | /*------------------------------------------------- | |
| 124 | mapper specific handlers | |
| 125 | -------------------------------------------------*/ | |
| 126 | ||
| 127 | READ8_MEMBER(chanf_rom_device::read_rom) | |
| 128 | { | |
| 129 | if (offset < m_rom_size) | |
| 130 | return m_rom[offset]; | |
| 131 | else | |
| 132 | return 0xff; | |
| 133 | } | |
| 134 | ||
| 135 | // These are shared among Maze & Hangman cart types (not directly used by base chanf_rom_device) | |
| 136 | UINT8 chanf_rom_device::common_read_2102(UINT32 offset) | |
| 137 | { | |
| 138 | if (offset == 0) | |
| 139 | { | |
| 140 | if (m_read_write == 0) | |
| 141 | { | |
| 142 | m_addr = m_addr_latch; | |
| 143 | m_data0 = m_ram[m_addr] & 1; | |
| 144 | return (m_latch[0] & 0x7f | (m_data0 << 7)); | |
| 145 | } | |
| 146 | ||
| 147 | return m_latch[0]; | |
| 148 | } | |
| 149 | else | |
| 150 | return m_latch[1]; | |
| 151 | } | |
| 152 | ||
| 153 | void chanf_rom_device::common_write_2102(UINT32 offset, UINT8 data) | |
| 154 | { | |
| 155 | if (offset == 0) | |
| 156 | { | |
| 157 | m_latch[0] = data; | |
| 158 | ||
| 159 | m_read_write = BIT(data, 0); | |
| 160 | ||
| 161 | m_addr_latch = (m_addr_latch & 0x3f3) | (BIT(data, 2) << 2) | (BIT(data, 1) << 3); // bits 2,3 come from this write! | |
| 162 | m_addr = m_addr_latch; | |
| 163 | ||
| 164 | m_data0 = BIT(data, 3); | |
| 165 | ||
| 166 | if (m_read_write == 1) | |
| 167 | m_ram[m_addr] = m_data0; | |
| 168 | } | |
| 169 | else | |
| 170 | { | |
| 171 | m_latch[1] = data; | |
| 172 | // all bits but 2,3 come from this write, but they are shuffled | |
| 173 | // notice that data is 8bits, so when swapping bit8 & bit9 are always 0! | |
| 174 | m_addr_latch = (m_addr_latch & 0x0c) | (BITSWAP16(data, 15, 14, 13, 12, 11, 10, 7, 6, 5, 3, 2, 1, 9, 8, 4, 0)); | |
| 175 | } | |
| 176 | } | |
| 177 | ||
| 178 | ||
| 179 | // These are shared among Schach & Multigame cart types (not directly used by base chanf_rom_device) | |
| 180 | UINT8 chanf_rom_device::common_read_3853(UINT32 offset) | |
| 181 | { | |
| 182 | if (offset < m_ram.count()) | |
| 183 | return m_ram[offset]; | |
| 184 | else | |
| 185 | return 0xff; | |
| 186 | } | |
| 187 | ||
| 188 | void chanf_rom_device::common_write_3853(UINT32 offset, UINT8 data) | |
| 189 | { | |
| 190 | if (offset < m_ram.count()) | |
| 191 | m_ram[offset] = data; | |
| 192 | } | |
| 193 | ||
| 194 | READ8_MEMBER(chanf_multi_device::read_rom) | |
| 195 | { | |
| 196 | if (offset < 0x2000) | |
| 197 | return m_rom[offset + (m_base_bank * 0x2000)]; | |
| 198 | else | |
| 199 | return 0xff; | |
| 200 | } | |
| 201 | ||
| 202 | WRITE8_MEMBER(chanf_multi_device::write_bank) | |
| 203 | { | |
| 204 | m_base_bank = data; | |
| 205 | } | |
| 206 |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r32492 | r32493 | |
|---|---|---|
| 98 | 98 | |
| 99 | 99 | #------------------------------------------------- |
| 100 | 100 | # |
| 101 | #@src/emu/bus/apf/slot.h,BUSES += APF | |
| 102 | #------------------------------------------------- | |
| 103 | ||
| 104 | ifneq ($(filter APF,$(BUSES)),) | |
| 105 | OBJDIRS += $(BUSOBJ)/apf | |
| 106 | BUSOBJS += $(BUSOBJ)/apf/slot.o | |
| 107 | BUSOBJS += $(BUSOBJ)/apf/rom.o | |
| 108 | endif | |
| 109 | ||
| 110 | ||
| 111 | #------------------------------------------------- | |
| 112 | # | |
| 101 | 113 | #@src/emu/bus/bw2/exp.h,BUSES += BW2 |
| 102 | 114 | #------------------------------------------------- |
| 103 | 115 | |
| r32492 | r32493 | |
| 228 | 240 | |
| 229 | 241 | #------------------------------------------------- |
| 230 | 242 | # |
| 243 | #@src/emu/bus/chanf/slot.h,BUSES += CHANNELF | |
| 244 | #------------------------------------------------- | |
| 245 | ||
| 246 | ifneq ($(filter CHANNELF,$(BUSES)),) | |
| 247 | OBJDIRS += $(BUSOBJ)/chanf | |
| 248 | BUSOBJS += $(BUSOBJ)/chanf/slot.o | |
| 249 | BUSOBJS += $(BUSOBJ)/chanf/rom.o | |
| 250 | endif | |
| 251 | ||
| 252 | ||
| 253 | #------------------------------------------------- | |
| 254 | # | |
| 231 | 255 | #@src/emu/bus/comx35/exp.h,BUSES += COMX35 |
| 232 | 256 | #------------------------------------------------- |
| 233 | 257 |
| r0 | r32493 | |
|---|---|---|
| 1 | #ifndef __APF_SLOT_H | |
| 2 | #define __APF_SLOT_H | |
| 3 | ||
| 4 | /*************************************************************************** | |
| 5 | TYPE DEFINITIONS | |
| 6 | ***************************************************************************/ | |
| 7 | ||
| 8 | ||
| 9 | /* PCB */ | |
| 10 | enum | |
| 11 | { | |
| 12 | APF_STD = 0, | |
| 13 | APF_BASIC, | |
| 14 | APF_SPACEDST | |
| 15 | }; | |
| 16 | ||
| 17 | ||
| 18 | // ======================> device_apf_cart_interface | |
| 19 | ||
| 20 | class device_apf_cart_interface : public device_slot_card_interface | |
| 21 | { | |
| 22 | public: | |
| 23 | // construction/destruction | |
| 24 | device_apf_cart_interface(const machine_config &mconfig, device_t &device); | |
| 25 | virtual ~device_apf_cart_interface(); | |
| 26 | ||
| 27 | // reading and writing | |
| 28 | virtual DECLARE_READ8_MEMBER(read_rom) { return 0xff; } | |
| 29 | virtual DECLARE_READ8_MEMBER(extra_rom) { return 0xff; } | |
| 30 | virtual DECLARE_READ8_MEMBER(read_ram) { return 0xff; } | |
| 31 | virtual DECLARE_WRITE8_MEMBER(write_ram) {} | |
| 32 | ||
| 33 | void rom_alloc(UINT32 size, const char *tag); | |
| 34 | void ram_alloc(UINT32 size); | |
| 35 | UINT8* get_rom_base() { return m_rom; } | |
| 36 | UINT8* get_ram_base() { return m_ram; } | |
| 37 | UINT32 get_rom_size() { return m_rom_size; } | |
| 38 | UINT32 get_ram_size() { return m_ram.count(); } | |
| 39 | ||
| 40 | void save_ram() { device().save_item(NAME(m_ram)); } | |
| 41 | ||
| 42 | protected: | |
| 43 | // internal state | |
| 44 | UINT8 *m_rom; | |
| 45 | UINT32 m_rom_size; | |
| 46 | dynamic_buffer m_ram; | |
| 47 | }; | |
| 48 | ||
| 49 | ||
| 50 | // ======================> apf_cart_slot_device | |
| 51 | ||
| 52 | class apf_cart_slot_device : public device_t, | |
| 53 | public device_image_interface, | |
| 54 | public device_slot_interface | |
| 55 | { | |
| 56 | public: | |
| 57 | // construction/destruction | |
| 58 | apf_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 59 | virtual ~apf_cart_slot_device(); | |
| 60 | ||
| 61 | // device-level overrides | |
| 62 | virtual void device_start(); | |
| 63 | virtual void device_config_complete(); | |
| 64 | ||
| 65 | // image-level overrides | |
| 66 | virtual bool call_load(); | |
| 67 | virtual void call_unload() {} | |
| 68 | virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry); | |
| 69 | ||
| 70 | int get_type() { return m_type; } | |
| 71 | ||
| 72 | void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); } | |
| 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 "apfm1000_cart"; } | |
| 82 | virtual const char *file_extensions() const { return "bin"; } | |
| 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_READ8_MEMBER(extra_rom); | |
| 90 | virtual DECLARE_READ8_MEMBER(read_ram); | |
| 91 | virtual DECLARE_WRITE8_MEMBER(write_ram); | |
| 92 | ||
| 93 | protected: | |
| 94 | ||
| 95 | int m_type; | |
| 96 | device_apf_cart_interface* m_cart; | |
| 97 | }; | |
| 98 | ||
| 99 | ||
| 100 | ||
| 101 | // device type definition | |
| 102 | extern const device_type APF_CART_SLOT; | |
| 103 | ||
| 104 | ||
| 105 | /*************************************************************************** | |
| 106 | DEVICE CONFIGURATION MACROS | |
| 107 | ***************************************************************************/ | |
| 108 | ||
| 109 | #define APFSLOT_ROM_REGION_TAG ":cart:rom" | |
| 110 | ||
| 111 | #define MCFG_APF_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \ | |
| 112 | MCFG_DEVICE_ADD(_tag, APF_CART_SLOT, 0) \ | |
| 113 | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \ | |
| 114 | ||
| 115 | #endif |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r32493 | |
|---|---|---|
| 1 | /*********************************************************************************************************** | |
| 2 | ||
| 3 | ||
| 4 | APF Imagination / M-1000 cart emulation | |
| 5 | ||
| 6 | ||
| 7 | ***********************************************************************************************************/ | |
| 8 | ||
| 9 | ||
| 10 | #include "emu.h" | |
| 11 | #include "rom.h" | |
| 12 | ||
| 13 | ||
| 14 | //------------------------------------------------- | |
| 15 | // apf_rom_device - constructor | |
| 16 | //------------------------------------------------- | |
| 17 | ||
| 18 | const device_type APF_ROM_STD = &device_creator<apf_rom_device>; | |
| 19 | const device_type APF_ROM_BASIC = &device_creator<apf_basic_device>; | |
| 20 | const device_type APF_ROM_SPACEDST = &device_creator<apf_spacedst_device>; | |
| 21 | ||
| 22 | ||
| 23 | apf_rom_device::apf_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) | |
| 24 | : device_t(mconfig, type, name, tag, owner, clock, shortname, source), | |
| 25 | device_apf_cart_interface( mconfig, *this ) | |
| 26 | { | |
| 27 | } | |
| 28 | ||
| 29 | apf_rom_device::apf_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 30 | : device_t(mconfig, APF_ROM_STD, "APF Standard Carts", tag, owner, clock, "apf_rom", __FILE__), | |
| 31 | device_apf_cart_interface( mconfig, *this ) | |
| 32 | { | |
| 33 | } | |
| 34 | ||
| 35 | apf_basic_device::apf_basic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 36 | : apf_rom_device(mconfig, APF_ROM_BASIC, "APF BASIC Carts", tag, owner, clock, "apf_basic", __FILE__) | |
| 37 | { | |
| 38 | } | |
| 39 | ||
| 40 | apf_spacedst_device::apf_spacedst_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 41 | : apf_rom_device(mconfig, APF_ROM_SPACEDST, "APF Space Destroyer Cart", tag, owner, clock, "apf_spacedst", __FILE__) | |
| 42 | { | |
| 43 | } | |
| 44 | ||
| 45 | ||
| 46 | /*------------------------------------------------- | |
| 47 | mapper specific handlers | |
| 48 | -------------------------------------------------*/ | |
| 49 | ||
| 50 | READ8_MEMBER(apf_rom_device::read_rom) | |
| 51 | { | |
| 52 | if (offset < m_rom_size) | |
| 53 | return m_rom[offset]; | |
| 54 | else | |
| 55 | return 0xff; | |
| 56 | } | |
| 57 | ||
| 58 | ||
| 59 | READ8_MEMBER(apf_basic_device::extra_rom) | |
| 60 | { | |
| 61 | if (offset < (m_rom_size - 0x2000)) | |
| 62 | return m_rom[offset + 0x2000]; | |
| 63 | else | |
| 64 | return 0xff; | |
| 65 | } | |
| 66 | ||
| 67 | ||
| 68 | READ8_MEMBER(apf_spacedst_device::read_ram) | |
| 69 | { | |
| 70 | return m_ram[offset]; | |
| 71 | } | |
| 72 | ||
| 73 | WRITE8_MEMBER(apf_spacedst_device::write_ram) | |
| 74 | { | |
| 75 | m_ram[offset] = data; | |
| 76 | } |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r32493 | |
|---|---|---|
| 1 | /*********************************************************************************************************** | |
| 2 | ||
| 3 | APF Imagination / M-1000 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 | ||
| 16 | const device_type APF_CART_SLOT = &device_creator<apf_cart_slot_device>; | |
| 17 | ||
| 18 | //************************************************************************** | |
| 19 | // APF Cartridges Interface | |
| 20 | //************************************************************************** | |
| 21 | ||
| 22 | //------------------------------------------------- | |
| 23 | // device_apf_cart_interface - constructor | |
| 24 | //------------------------------------------------- | |
| 25 | ||
| 26 | device_apf_cart_interface::device_apf_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_apf_cart_interface - destructor | |
| 36 | //------------------------------------------------- | |
| 37 | ||
| 38 | device_apf_cart_interface::~device_apf_cart_interface() | |
| 39 | { | |
| 40 | } | |
| 41 | ||
| 42 | //------------------------------------------------- | |
| 43 | // rom_alloc - alloc the space for the cart | |
| 44 | //------------------------------------------------- | |
| 45 | ||
| 46 | void device_apf_cart_interface::rom_alloc(UINT32 size, const char *tag) | |
| 47 | { | |
| 48 | if (m_rom == NULL) | |
| 49 | { | |
| 50 | astring tempstring(tag); | |
| 51 | tempstring.cat(APFSLOT_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 | // ram_alloc - alloc the space for the ram | |
| 60 | //------------------------------------------------- | |
| 61 | ||
| 62 | void device_apf_cart_interface::ram_alloc(UINT32 size) | |
| 63 | { | |
| 64 | m_ram.resize(size); | |
| 65 | } | |
| 66 | ||
| 67 | ||
| 68 | //************************************************************************** | |
| 69 | // LIVE DEVICE | |
| 70 | //************************************************************************** | |
| 71 | ||
| 72 | //------------------------------------------------- | |
| 73 | // apf_cart_slot_device - constructor | |
| 74 | //------------------------------------------------- | |
| 75 | apf_cart_slot_device::apf_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 76 | device_t(mconfig, APF_CART_SLOT, "APF Cartridge Slot", tag, owner, clock, "apf_cart_slot", __FILE__), | |
| 77 | device_image_interface(mconfig, *this), | |
| 78 | device_slot_interface(mconfig, *this), | |
| 79 | m_type(APF_STD) | |
| 80 | { | |
| 81 | } | |
| 82 | ||
| 83 | ||
| 84 | //------------------------------------------------- | |
| 85 | // apf_cart_slot_device - destructor | |
| 86 | //------------------------------------------------- | |
| 87 | ||
| 88 | apf_cart_slot_device::~apf_cart_slot_device() | |
| 89 | { | |
| 90 | } | |
| 91 | ||
| 92 | //------------------------------------------------- | |
| 93 | // device_start - device-specific startup | |
| 94 | //------------------------------------------------- | |
| 95 | ||
| 96 | void apf_cart_slot_device::device_start() | |
| 97 | { | |
| 98 | m_cart = dynamic_cast<device_apf_cart_interface *>(get_card_device()); | |
| 99 | } | |
| 100 | ||
| 101 | //------------------------------------------------- | |
| 102 | // device_config_complete - perform any | |
| 103 | // operations now that the configuration is | |
| 104 | // complete | |
| 105 | //------------------------------------------------- | |
| 106 | ||
| 107 | void apf_cart_slot_device::device_config_complete() | |
| 108 | { | |
| 109 | // set brief and instance name | |
| 110 | update_names(); | |
| 111 | } | |
| 112 | ||
| 113 | ||
| 114 | //------------------------------------------------- | |
| 115 | // APF PCB | |
| 116 | //------------------------------------------------- | |
| 117 | ||
| 118 | struct apf_slot | |
| 119 | { | |
| 120 | int pcb_id; | |
| 121 | const char *slot_option; | |
| 122 | }; | |
| 123 | ||
| 124 | // Here, we take the feature attribute from .xml (i.e. the PCB name) and we assign a unique ID to it | |
| 125 | static const apf_slot slot_list[] = | |
| 126 | { | |
| 127 | { APF_STD, "std" }, | |
| 128 | { APF_BASIC, "basic" }, | |
| 129 | { APF_SPACEDST, "spacedst" } | |
| 130 | }; | |
| 131 | ||
| 132 | static int apf_get_pcb_id(const char *slot) | |
| 133 | { | |
| 134 | for (int i = 0; i < ARRAY_LENGTH(slot_list); i++) | |
| 135 | { | |
| 136 | if (!core_stricmp(slot_list[i].slot_option, slot)) | |
| 137 | return slot_list[i].pcb_id; | |
| 138 | } | |
| 139 | ||
| 140 | return 0; | |
| 141 | } | |
| 142 | ||
| 143 | static const char *apf_get_slot(int type) | |
| 144 | { | |
| 145 | for (int i = 0; i < ARRAY_LENGTH(slot_list); i++) | |
| 146 | { | |
| 147 | if (slot_list[i].pcb_id == type) | |
| 148 | return slot_list[i].slot_option; | |
| 149 | } | |
| 150 | ||
| 151 | return "std"; | |
| 152 | } | |
| 153 | ||
| 154 | ||
| 155 | /*------------------------------------------------- | |
| 156 | call load | |
| 157 | -------------------------------------------------*/ | |
| 158 | ||
| 159 | bool apf_cart_slot_device::call_load() | |
| 160 | { | |
| 161 | if (m_cart) | |
| 162 | { | |
| 163 | UINT32 size = (software_entry() == NULL) ? length() : get_software_region_length("rom"); | |
| 164 | ||
| 165 | if (size > 0x3800) | |
| 166 | { | |
| 167 | seterror(IMAGE_ERROR_UNSPECIFIED, "Image extends beyond the expected size for an APF cart"); | |
| 168 | return IMAGE_INIT_FAIL; | |
| 169 | } | |
| 170 | ||
| 171 | m_cart->rom_alloc(size, tag()); | |
| 172 | ||
| 173 | if (software_entry() == NULL) | |
| 174 | fread(m_cart->get_rom_base(), size); | |
| 175 | else | |
| 176 | memcpy(m_cart->get_rom_base(), get_software_region("rom"), size); | |
| 177 | ||
| 178 | if (software_entry() == NULL) | |
| 179 | { | |
| 180 | m_type = APF_STD; | |
| 181 | // attempt to identify Space Destroyer, which needs 1K of additional RAM | |
| 182 | if (size == 0x1800) | |
| 183 | { | |
| 184 | m_type = APF_SPACEDST; | |
| 185 | m_cart->ram_alloc(0x400); | |
| 186 | } | |
| 187 | if (size > 0x2000) | |
| 188 | m_type = APF_BASIC; | |
| 189 | } | |
| 190 | else | |
| 191 | { | |
| 192 | const char *pcb_name = get_feature("slot"); | |
| 193 | if (pcb_name) | |
| 194 | m_type = apf_get_pcb_id(pcb_name); | |
| 195 | ||
| 196 | if (get_software_region("ram")) | |
| 197 | m_cart->ram_alloc(get_software_region_length("ram")); | |
| 198 | } | |
| 199 | ||
| 200 | printf("Type: %s\n", apf_get_slot(m_type)); | |
| 201 | ||
| 202 | return IMAGE_INIT_PASS; | |
| 203 | } | |
| 204 | ||
| 205 | return IMAGE_INIT_PASS; | |
| 206 | } | |
| 207 | ||
| 208 | ||
| 209 | /*------------------------------------------------- | |
| 210 | call softlist load | |
| 211 | -------------------------------------------------*/ | |
| 212 | ||
| 213 | bool apf_cart_slot_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) | |
| 214 | { | |
| 215 | load_software_part_region(*this, swlist, swname, start_entry); | |
| 216 | return TRUE; | |
| 217 | } | |
| 218 | ||
| 219 | ||
| 220 | /*------------------------------------------------- | |
| 221 | get default card software | |
| 222 | -------------------------------------------------*/ | |
| 223 | ||
| 224 | void apf_cart_slot_device::get_default_card_software(astring &result) | |
| 225 | { | |
| 226 | if (open_image_file(mconfig().options())) | |
| 227 | { | |
| 228 | const char *slot_string = "std"; | |
| 229 | UINT32 size = core_fsize(m_file); | |
| 230 | int type = APF_STD; | |
| 231 | ||
| 232 | // attempt to identify Space Destroyer, which needs 1K of additional RAM | |
| 233 | if (size == 0x1800) | |
| 234 | type = APF_SPACEDST; | |
| 235 | if (size > 0x2000) | |
| 236 | type = APF_BASIC; | |
| 237 | ||
| 238 | slot_string = apf_get_slot(type); | |
| 239 | ||
| 240 | //printf("type: %s\n", slot_string); | |
| 241 | clear(); | |
| 242 | ||
| 243 | result.cpy(slot_string); | |
| 244 | return; | |
| 245 | } | |
| 246 | ||
| 247 | software_get_default_slot(result, "std"); | |
| 248 | } | |
| 249 | ||
| 250 | /*------------------------------------------------- | |
| 251 | read | |
| 252 | -------------------------------------------------*/ | |
| 253 | ||
| 254 | READ8_MEMBER(apf_cart_slot_device::read_rom) | |
| 255 | { | |
| 256 | if (m_cart) | |
| 257 | return m_cart->read_rom(space, offset); | |
| 258 | else | |
| 259 | return 0xff; | |
| 260 | } | |
| 261 | ||
| 262 | /*------------------------------------------------- | |
| 263 | read | |
| 264 | -------------------------------------------------*/ | |
| 265 | ||
| 266 | READ8_MEMBER(apf_cart_slot_device::extra_rom) | |
| 267 | { | |
| 268 | if (m_cart) | |
| 269 | return m_cart->extra_rom(space, offset); | |
| 270 | else | |
| 271 | return 0xff; | |
| 272 | } | |
| 273 | ||
| 274 | /*------------------------------------------------- | |
| 275 | read | |
| 276 | -------------------------------------------------*/ | |
| 277 | ||
| 278 | READ8_MEMBER(apf_cart_slot_device::read_ram) | |
| 279 | { | |
| 280 | if (m_cart) | |
| 281 | return m_cart->read_ram(space, offset); | |
| 282 | else | |
| 283 | return 0xff; | |
| 284 | } | |
| 285 | ||
| 286 | /*------------------------------------------------- | |
| 287 | write | |
| 288 | -------------------------------------------------*/ | |
| 289 | ||
| 290 | WRITE8_MEMBER(apf_cart_slot_device::write_ram) | |
| 291 | { | |
| 292 | if (m_cart) | |
| 293 | m_cart->write_ram(space, offset, data); | |
| 294 | } | |
| 295 | ||
| 296 |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r32493 | |
|---|---|---|
| 1 | #ifndef __APF_ROM_H | |
| 2 | #define __APF_ROM_H | |
| 3 | ||
| 4 | #include "slot.h" | |
| 5 | ||
| 6 | ||
| 7 | // ======================> apf_rom_device | |
| 8 | ||
| 9 | class apf_rom_device : public device_t, | |
| 10 | public device_apf_cart_interface | |
| 11 | { | |
| 12 | public: | |
| 13 | // construction/destruction | |
| 14 | apf_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 | apf_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 | // ======================> apf_basic_device | |
| 26 | ||
| 27 | class apf_basic_device : public apf_rom_device | |
| 28 | { | |
| 29 | public: | |
| 30 | // construction/destruction | |
| 31 | apf_basic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 32 | ||
| 33 | // reading and writing | |
| 34 | virtual DECLARE_READ8_MEMBER(extra_rom); | |
| 35 | }; | |
| 36 | ||
| 37 | // ======================> apf_spacedst_device | |
| 38 | ||
| 39 | class apf_spacedst_device : public apf_rom_device | |
| 40 | { | |
| 41 | public: | |
| 42 | // construction/destruction | |
| 43 | apf_spacedst_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 44 | ||
| 45 | // reading and writing | |
| 46 | virtual DECLARE_READ8_MEMBER(read_ram); | |
| 47 | virtual DECLARE_WRITE8_MEMBER(write_ram); | |
| 48 | }; | |
| 49 | ||
| 50 | ||
| 51 | ||
| 52 | ||
| 53 | ||
| 54 | // device type definition | |
| 55 | extern const device_type APF_ROM_STD; | |
| 56 | extern const device_type APF_ROM_BASIC; | |
| 57 | extern const device_type APF_ROM_SPACEDST; | |
| 58 | ||
| 59 | ||
| 60 | #endif |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r32492 | r32493 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "cpu/f8/f8.h" |
| 12 | #include "imagedev/cartslot.h" | |
| 13 | 12 | #include "audio/channelf.h" |
| 14 | 13 | |
| 14 | #include "bus/chanf/slot.h" | |
| 15 | #include "bus/chanf/rom.h" | |
| 15 | 16 | |
| 16 | /* SKR - 2102 RAM chip on carts 10 and 18 I/O ports */ | |
| 17 | struct r2102_t | |
| 18 | { | |
| 19 | UINT8 d; /* data bit:inverted logic, but reading/writing cancel out */ | |
| 20 | UINT8 r_w; /* inverted logic: 0 means read, 1 means write */ | |
| 21 | UINT8 a[10]; /* addr bits: inverted logic, but reading/writing cancel out */ | |
| 22 | UINT16 addr; /* calculated addr from addr bits */ | |
| 23 | UINT8 ram[1024]; /* RAM array */ | |
| 24 | }; | |
| 25 | 17 | |
| 26 | ||
| 27 | 18 | class channelf_state : public driver_device |
| 28 | 19 | { |
| 29 | 20 | public: |
| 30 | 21 | channelf_state(const machine_config &mconfig, device_type type, const char *tag) |
| 31 | 22 | : driver_device(mconfig, type, tag), |
| 32 | m_custom(*this,"custom") , | |
| 33 | m_maincpu(*this, "maincpu") { } | |
| 23 | m_maincpu(*this, "maincpu"), | |
| 24 | m_custom(*this,"custom"), | |
| 25 | m_cart(*this, "cartslot") | |
| 26 | { } | |
| 34 | 27 | |
| 35 | DECLARE_READ8_MEMBER(channelf_port_0_r); | |
| 36 | DECLARE_READ8_MEMBER(channelf_port_1_r); | |
| 37 | DECLARE_READ8_MEMBER(channelf_port_4_r); | |
| 38 | DECLARE_READ8_MEMBER(channelf_port_5_r); | |
| 39 | DECLARE_READ8_MEMBER(channelf_2102A_r); | |
| 40 | DECLARE_READ8_MEMBER(channelf_2102B_r); | |
| 41 | DECLARE_WRITE8_MEMBER(channelf_port_0_w); | |
| 42 | DECLARE_WRITE8_MEMBER(channelf_port_1_w); | |
| 43 | DECLARE_WRITE8_MEMBER(channelf_port_4_w); | |
| 44 | DECLARE_WRITE8_MEMBER(channelf_port_5_w); | |
| 45 | DECLARE_WRITE8_MEMBER(channelf_2102A_w); | |
| 46 | DECLARE_WRITE8_MEMBER(channelf_2102B_w); | |
| 28 | DECLARE_READ8_MEMBER(port_0_r); | |
| 29 | DECLARE_READ8_MEMBER(port_1_r); | |
| 30 | DECLARE_READ8_MEMBER(port_4_r); | |
| 31 | DECLARE_READ8_MEMBER(port_5_r); | |
| 32 | DECLARE_WRITE8_MEMBER(port_0_w); | |
| 33 | DECLARE_WRITE8_MEMBER(port_1_w); | |
| 34 | DECLARE_WRITE8_MEMBER(port_4_w); | |
| 35 | DECLARE_WRITE8_MEMBER(port_5_w); | |
| 47 | 36 | UINT8 *m_p_videoram; |
| 48 | 37 | UINT8 m_latch[6]; |
| 49 | r2102_t m_r2102; | |
| 50 | 38 | UINT8 m_val_reg; |
| 51 | 39 | UINT8 m_row_reg; |
| 52 | 40 | UINT8 m_col_reg; |
| 53 | 41 | UINT8 port_read_with_latch(UINT8 ext, UINT8 latch_state); |
| 54 | 42 | virtual void video_start(); |
| 43 | virtual void machine_start(); | |
| 55 | 44 | DECLARE_PALETTE_INIT(channelf); |
| 56 | 45 | UINT32 screen_update_channelf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 57 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( channelf_cart ); | |
| 58 | required_device<channelf_sound_device> m_custom; | |
| 59 | 46 | required_device<cpu_device> m_maincpu; |
| 47 | required_device<channelf_sound_device> m_custom; | |
| 48 | required_device<channelf_cart_slot_device> m_cart; | |
| 60 | 49 | int recalc_palette_offset(int reg1, int reg2); |
| 61 | 50 | }; |
| 62 | 51 |
| r32492 | r32493 | |
|---|---|---|
| 76 | 76 | #include "machine/6821pia.h" |
| 77 | 77 | #include "machine/wd_fdc.h" |
| 78 | 78 | #include "imagedev/cassette.h" |
| 79 | #include "imagedev/cartslot.h" | |
| 80 | 79 | #include "formats/apf_apt.h" |
| 81 | 80 | #include "machine/ram.h" |
| 82 | 81 | |
| 82 | #include "bus/apf/slot.h" | |
| 83 | #include "bus/apf/rom.h" | |
| 83 | 84 | |
| 85 | ||
| 84 | 86 | class apf_state : public driver_device |
| 85 | 87 | { |
| 86 | 88 | public: |
| 87 | 89 | apf_state(const machine_config &mconfig, device_type type, const char *tag) |
| 88 | 90 | : driver_device(mconfig, type, tag) |
| 89 | 91 | , m_has_cart_ram(false) |
| 90 | , m_p_videoram(*this, "videoram") | |
| 91 | 92 | , m_maincpu(*this, "maincpu") |
| 92 | 93 | , m_ram(*this, RAM_TAG) |
| 93 | 94 | , m_crtc(*this, "mc6847") |
| r32492 | r32493 | |
| 95 | 96 | , m_pia0(*this, "pia0") |
| 96 | 97 | , m_pia1(*this, "pia1") |
| 97 | 98 | , m_cass(*this, "cassette") |
| 99 | , m_cart(*this, "cartslot") | |
| 98 | 100 | , m_fdc(*this, "fdc") |
| 99 | 101 | , m_floppy0(*this, "fdc:0") |
| 100 | 102 | , m_floppy1(*this, "fdc:1") |
| 103 | , m_joy(*this, "joy") | |
| 104 | , m_key(*this, "key") | |
| 105 | , m_p_videoram(*this, "videoram") | |
| 101 | 106 | { } |
| 102 | 107 | |
| 103 | 108 | DECLARE_READ8_MEMBER(videoram_r); |
| r32492 | r32493 | |
| 110 | 115 | DECLARE_WRITE8_MEMBER(apf_dischw_w); |
| 111 | 116 | DECLARE_READ8_MEMBER(serial_r); |
| 112 | 117 | DECLARE_WRITE8_MEMBER(serial_w); |
| 113 | ||
| 118 | ||
| 114 | 119 | private: |
| 115 | 120 | UINT8 m_latch; |
| 116 | 121 | UINT8 m_keyboard_data; |
| r32492 | r32493 | |
| 118 | 123 | UINT8 m_portb; |
| 119 | 124 | bool m_ca2; |
| 120 | 125 | bool m_has_cart_ram; |
| 126 | virtual void machine_start(); | |
| 121 | 127 | virtual void machine_reset(); |
| 122 | required_shared_ptr<UINT8> m_p_videoram; | |
| 123 | 128 | required_device<m6800_cpu_device> m_maincpu; |
| 124 | 129 | required_device<ram_device> m_ram; |
| 125 | 130 | required_device<mc6847_base_device> m_crtc; |
| r32492 | r32493 | |
| 127 | 132 | required_device<pia6821_device> m_pia0; |
| 128 | 133 | optional_device<pia6821_device> m_pia1; |
| 129 | 134 | optional_device<cassette_image_device> m_cass; |
| 135 | required_device<apf_cart_slot_device> m_cart; | |
| 130 | 136 | optional_device<fd1771_t> m_fdc; |
| 131 | 137 | optional_device<floppy_connector> m_floppy0; |
| 132 | 138 | optional_device<floppy_connector> m_floppy1; |
| 133 | dynamic_buffer m_cart_ram; | |
| 139 | required_ioport_array<4> m_joy; | |
| 140 | optional_ioport_array<8> m_key; | |
| 141 | required_shared_ptr<UINT8> m_p_videoram; | |
| 134 | 142 | }; |
| 135 | 143 | |
| 136 | 144 | |
| r32492 | r32493 | |
| 169 | 177 | { |
| 170 | 178 | UINT8 data = 0xff; |
| 171 | 179 | |
| 172 | if (!BIT(m_pad_data, 3)) | |
| 173 | data &= ioport("joy3")->read(); | |
| 174 | if (!BIT(m_pad_data, 2)) | |
| 175 | data &= ioport("joy2")->read(); | |
| 176 | if (!BIT(m_pad_data, 1)) | |
| 177 | data &= ioport("joy1")->read(); | |
| 178 | if (!BIT(m_pad_data, 0)) | |
| 179 | data &= ioport("joy0")->read(); | |
| 180 | for (int i = 3; i >= 0; i--) | |
| 181 | if (!BIT(m_pad_data, i)) | |
| 182 | data &= m_joy[i]->read(); | |
| 180 | 183 | |
| 181 | 184 | return data; |
| 182 | 185 | } |
| r32492 | r32493 | |
| 198 | 201 | |
| 199 | 202 | READ8_MEMBER( apf_state::pia1_porta_r ) |
| 200 | 203 | { |
| 201 | static const char *const keynames[] = { "key0", "key1", "key2", "key3", "key4", "key5", "key6", "key7" }; | |
| 202 | return ioport(keynames[m_keyboard_data])->read(); | |
| 204 | return m_key[m_keyboard_data]->read(); | |
| 203 | 205 | } |
| 204 | 206 | |
| 205 | 207 | READ8_MEMBER( apf_state::pia1_portb_r ) |
| r32492 | r32493 | |
| 231 | 233 | m_cass->output(BIT(data, 6) ? -1.0 : 1.0); |
| 232 | 234 | } |
| 233 | 235 | |
| 236 | ||
| 237 | void apf_state::machine_start() | |
| 238 | { | |
| 239 | if (m_cart->exists()) | |
| 240 | { | |
| 241 | switch (m_cart->get_type()) | |
| 242 | { | |
| 243 | case APF_BASIC: | |
| 244 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x6800, 0x7fff, read8_delegate(FUNC(apf_cart_slot_device::extra_rom),(apf_cart_slot_device*)m_cart)); | |
| 245 | break; | |
| 246 | case APF_SPACEDST: | |
| 247 | m_maincpu->space(AS_PROGRAM).unmap_readwrite(0x9800, 0x9fff); | |
| 248 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x9800, 0x9bff, read8_delegate(FUNC(apf_cart_slot_device::read_ram),(apf_cart_slot_device*)m_cart), write8_delegate(FUNC(apf_cart_slot_device::write_ram),(apf_cart_slot_device*)m_cart)); | |
| 249 | m_has_cart_ram = true; | |
| 250 | break; | |
| 251 | } | |
| 252 | ||
| 253 | m_cart->save_ram(); | |
| 254 | } | |
| 255 | } | |
| 256 | ||
| 257 | ||
| 234 | 258 | void apf_state::machine_reset() |
| 235 | 259 | { |
| 236 | 260 | address_space &space = m_maincpu->space(AS_PROGRAM); |
| r32492 | r32493 | |
| 248 | 272 | else |
| 249 | 273 | space.write_byte(0xa002, 0xe5); |
| 250 | 274 | } |
| 251 | ||
| 252 | /* Space Destroyer has 1K of on-cart RAM */ | |
| 253 | if (m_has_cart_ram) | |
| 254 | { | |
| 255 | space.unmap_readwrite(0x9800, 0x9fff); | |
| 256 | space.install_ram(0x9800, 0x9bff, m_cart_ram); | |
| 257 | } | |
| 258 | 275 | } |
| 259 | 276 | |
| 260 | 277 | WRITE8_MEMBER( apf_state::apf_dischw_w) |
| r32492 | r32493 | |
| 290 | 307 | } |
| 291 | 308 | |
| 292 | 309 | static ADDRESS_MAP_START( apfm1000_map, AS_PROGRAM, 8, apf_state ) |
| 293 | AM_RANGE( 0x0000, 0x03ff) AM_MIRROR(0x1c00) AM_RAM AM_SHARE("videoram") | |
| 294 | AM_RANGE( 0x2000, 0x3fff) AM_MIRROR(0x1ffc) AM_DEVREADWRITE("pia0", pia6821_device, read, write) | |
| 295 | AM_RANGE( 0x4000, 0x4fff) AM_MIRROR(0x1000) AM_ROM AM_REGION("roms", 0) | |
| 296 | AM_RANGE( 0x6800, 0x7fff) AM_ROM AM_REGION("cart", 0x2000) | |
| 297 | AM_RANGE( 0x8000, 0x9fff) AM_ROM AM_REGION("cart", 0) | |
| 298 | AM_RANGE( 0xe000, 0xefff) AM_MIRROR(0x1000) AM_ROM AM_REGION("roms", 0) | |
| 310 | AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x1c00) AM_RAM AM_SHARE("videoram") | |
| 311 | AM_RANGE(0x2000, 0x3fff) AM_MIRROR(0x1ffc) AM_DEVREADWRITE("pia0", pia6821_device, read, write) | |
| 312 | AM_RANGE(0x4000, 0x4fff) AM_MIRROR(0x1000) AM_ROM AM_REGION("roms", 0) | |
| 313 | AM_RANGE(0x6800, 0x7fff) AM_NOP // BASIC accesses ROM here too, but this is installed at machine_start | |
| 314 | AM_RANGE(0x8000, 0x9fff) AM_DEVREAD("cartslot", apf_cart_slot_device, read_rom) | |
| 315 | AM_RANGE(0xe000, 0xefff) AM_MIRROR(0x1000) AM_ROM AM_REGION("roms", 0) | |
| 299 | 316 | ADDRESS_MAP_END |
| 300 | 317 | |
| 301 | 318 | static ADDRESS_MAP_START( apfimag_map, AS_PROGRAM, 8, apf_state ) |
| 302 | 319 | AM_IMPORT_FROM(apfm1000_map) |
| 303 | AM_RANGE( | |
| 320 | AM_RANGE(0x6000, 0x63ff) AM_MIRROR(0x03fc) AM_DEVREADWRITE("pia1", pia6821_device, read, write) | |
| 304 | 321 | // These need to be confirmed, disk does not work |
| 305 | AM_RANGE( 0x6400, 0x64ff) AM_READWRITE(serial_r, serial_w) | |
| 306 | AM_RANGE( 0x6500, 0x6503) AM_DEVREADWRITE("fdc", fd1771_t, read, write) | |
| 307 | AM_RANGE( 0x6600, 0x6600) AM_WRITE(apf_dischw_w) | |
| 308 | AM_RANGE( 0xa000, 0xbfff) AM_RAM // standard | |
| 309 | AM_RANGE( 0xc000, 0xdfff) AM_RAM // expansion | |
| 322 | AM_RANGE(0x6400, 0x64ff) AM_READWRITE(serial_r, serial_w) | |
| 323 | AM_RANGE(0x6500, 0x6503) AM_DEVREADWRITE("fdc", fd1771_t, read, write) | |
| 324 | AM_RANGE(0x6600, 0x6600) AM_WRITE(apf_dischw_w) | |
| 325 | AM_RANGE(0xa000, 0xbfff) AM_RAM // standard | |
| 326 | AM_RANGE(0xc000, 0xdfff) AM_RAM // expansion | |
| 310 | 327 | ADDRESS_MAP_END |
| 311 | 328 | |
| 312 | 329 | |
| r32492 | r32493 | |
| 352 | 369 | ? player right is player 1 |
| 353 | 370 | */ |
| 354 | 371 | |
| 355 | /* line 0 */ | |
| 356 | PORT_START("joy0") | |
| 372 | PORT_START("joy.0") | |
| 357 | 373 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PAD 1/RIGHT 1") PORT_CODE(KEYCODE_1) PORT_PLAYER(2) |
| 358 | 374 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PAD 1/RIGHT 0") PORT_CODE(KEYCODE_0) PORT_PLAYER(2) |
| 359 | 375 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PAD 1/RIGHT 4") PORT_CODE(KEYCODE_4) PORT_PLAYER(2) |
| r32492 | r32493 | |
| 363 | 379 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PAD 2/LEFT 4") PORT_CODE(KEYCODE_4_PAD) PORT_PLAYER(1) |
| 364 | 380 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PAD 2/LEFT 7") PORT_CODE(KEYCODE_7_PAD) PORT_PLAYER(1) |
| 365 | 381 | |
| 366 | /* line 1 */ | |
| 367 | PORT_START("joy1") | |
| 382 | PORT_START("joy.1") | |
| 368 | 383 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_NAME("PAD 1/RIGHT down") PORT_PLAYER(2) PORT_8WAY |
| 369 | 384 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_NAME("PAD 1/RIGHT right") PORT_PLAYER(2) PORT_8WAY |
| 370 | 385 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_NAME("PAD 1/RIGHT up") PORT_PLAYER(2) PORT_8WAY |
| r32492 | r32493 | |
| 374 | 389 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_NAME("PAD 2/LEFT up") PORT_PLAYER(1) PORT_8WAY |
| 375 | 390 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_NAME("PAD 2/LEFT left") PORT_PLAYER(1) PORT_8WAY |
| 376 | 391 | |
| 377 | /* line 2 */ | |
| 378 | PORT_START("joy2") | |
| 392 | PORT_START("joy.2") | |
| 379 | 393 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PAD 1/RIGHT 3") PORT_CODE(KEYCODE_3) PORT_PLAYER(2) |
| 380 | 394 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PAD 1/RIGHT clear") PORT_CODE(KEYCODE_DEL) PORT_PLAYER(2) |
| 381 | 395 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PAD 1/RIGHT 6") PORT_CODE(KEYCODE_6) PORT_PLAYER(2) |
| r32492 | r32493 | |
| 385 | 399 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PAD 2/LEFT 6") PORT_CODE(KEYCODE_6_PAD) PORT_PLAYER(1) |
| 386 | 400 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PAD 2/LEFT 9") PORT_CODE(KEYCODE_9_PAD) PORT_PLAYER(1) |
| 387 | 401 | |
| 388 | /* line 3 */ | |
| 389 | PORT_START("joy3") | |
| 402 | PORT_START("joy.3") | |
| 390 | 403 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PAD 1/RIGHT 2") PORT_CODE(KEYCODE_2) PORT_PLAYER(2) |
| 391 | 404 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PAD 1/RIGHT enter/fire") PORT_CODE(KEYCODE_ENTER) PORT_PLAYER(2) |
| 392 | 405 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PAD 1/RIGHT 5") PORT_CODE(KEYCODE_5) PORT_PLAYER(2) |
| r32492 | r32493 | |
| 404 | 417 | |
| 405 | 418 | /* Reference: http://www.nausicaa.net/~lgreenf/apfpage2.htm */ |
| 406 | 419 | |
| 407 | /* keyboard line 0 */ | |
| 408 | PORT_START("key0") | |
| 420 | PORT_START("key.0") | |
| 409 | 421 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('X') |
| 410 | 422 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') |
| 411 | 423 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q IF") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') |
| r32492 | r32493 | |
| 415 | 427 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W STEP") PORT_CODE(KEYCODE_W) PORT_CHAR('W') |
| 416 | 428 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('S') |
| 417 | 429 | |
| 418 | /* keyboard line 1 */ | |
| 419 | PORT_START("key1") | |
| 430 | PORT_START("key.1") | |
| 420 | 431 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 421 | 432 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) PORT_CHAR('V') |
| 422 | 433 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R READ") PORT_CODE(KEYCODE_R) PORT_CHAR('R') |
| r32492 | r32493 | |
| 426 | 437 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E STOP") PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 427 | 438 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 428 | 439 | |
| 429 | /* keyboard line 2 */ | |
| 430 | PORT_START("key2") | |
| 440 | PORT_START("key.2") | |
| 431 | 441 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N ^") PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('^') |
| 432 | 442 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 433 | 443 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T NEXT") PORT_CODE(KEYCODE_T) PORT_CHAR('T') |
| r32492 | r32493 | |
| 437 | 447 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y PRINT") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') |
| 438 | 448 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 439 | 449 | |
| 440 | /* keyboard line 3 */ | |
| 441 | PORT_START("key3") | |
| 450 | PORT_START("key.3") | |
| 442 | 451 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M ]") PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR(']') |
| 443 | 452 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(", <") PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| 444 | 453 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I LIST") PORT_CODE(KEYCODE_I) PORT_CHAR('I') |
| r32492 | r32493 | |
| 448 | 457 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U END") PORT_CODE(KEYCODE_U) PORT_CHAR('U') |
| 449 | 458 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) PORT_CHAR('J') |
| 450 | 459 | |
| 451 | /* keyboard line 4 */ | |
| 452 | PORT_START("key4") | |
| 460 | PORT_START("key.4") | |
| 453 | 461 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("/ ?") PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') |
| 454 | 462 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(". >") PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') |
| 455 | 463 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O _ REM") PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CHAR('_') |
| r32492 | r32493 | |
| 459 | 467 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P @ USING") PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('@') |
| 460 | 468 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("; +") PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+') |
| 461 | 469 | |
| 462 | /* keyboard line 5 */ | |
| 463 | PORT_START("key5") | |
| 470 | PORT_START("key.5") | |
| 464 | 471 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(32) |
| 465 | 472 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(": *") PORT_CODE(KEYCODE_MINUS) PORT_CHAR(':') PORT_CHAR('*') |
| 466 | 473 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Return") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(13) |
| r32492 | r32493 | |
| 470 | 477 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Line Feed") PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR(10) |
| 471 | 478 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Rubout") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(8) |
| 472 | 479 | |
| 473 | /* line 6 */ | |
| 474 | PORT_START("key6") | |
| 480 | PORT_START("key.6") | |
| 475 | 481 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_RSHIFT) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 476 | 482 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_TAB) PORT_CHAR(27) |
| 477 | 483 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) |
| r32492 | r32493 | |
| 481 | 487 | PORT_BIT(0x40, 0x40, IPT_UNUSED) // another X |
| 482 | 488 | PORT_BIT(0x80, 0x80, IPT_UNUSED) // another Z |
| 483 | 489 | |
| 484 | /* line 7 */ | |
| 485 | PORT_START("key7") | |
| 490 | PORT_START("key.7") | |
| 486 | 491 | PORT_BIT(0xff, 0xff, IPT_UNUSED) |
| 487 | 492 | INPUT_PORTS_END |
| 488 | 493 | |
| 489 | 494 | |
| 490 | DEVICE_IMAGE_LOAD_MEMBER( apf_state, apf_cart ) | |
| 491 | { | |
| 492 | UINT8 *ROM = memregion("cart")->base(); | |
| 493 | UINT32 cart_size; | |
| 494 | ||
| 495 | if (image.software_entry() == NULL) | |
| 496 | { | |
| 497 | cart_size = image.length(); | |
| 498 | if (cart_size > 0x3800) | |
| 499 | { | |
| 500 | logerror("%s extends beyond the expected size for an APF cart.\n", image.filename()); | |
| 501 | return IMAGE_INIT_FAIL; | |
| 502 | } | |
| 503 | ||
| 504 | image.fread(ROM, cart_size); | |
| 505 | ||
| 506 | // attempt to identify Space Destroyer, which needs 1K of additional RAM | |
| 507 | if (cart_size == 0x1800) | |
| 508 | { | |
| 509 | m_has_cart_ram = true; | |
| 510 | m_cart_ram.resize(0x400); | |
| 511 | } | |
| 512 | } | |
| 513 | else | |
| 514 | { | |
| 515 | cart_size = image.get_software_region_length("rom"); | |
| 516 | if (cart_size > 0x3800) | |
| 517 | { | |
| 518 | logerror("%s extends beyond the expected size for an APF cart.\n", image.filename()); | |
| 519 | return IMAGE_INIT_FAIL; | |
| 520 | } | |
| 521 | ||
| 522 | memcpy(ROM, image.get_software_region("rom"), cart_size); | |
| 523 | ||
| 524 | if (image.get_software_region("ram")) | |
| 525 | { | |
| 526 | m_has_cart_ram = true; | |
| 527 | m_cart_ram.resize(image.get_software_region_length("ram")); | |
| 528 | } | |
| 529 | } | |
| 530 | ||
| 531 | return IMAGE_INIT_PASS; | |
| 532 | } | |
| 533 | ||
| 534 | 495 | static SLOT_INTERFACE_START( apf_floppies ) |
| 535 | 496 | SLOT_INTERFACE( "525dd", FLOPPY_525_SSDD ) |
| 536 | 497 | SLOT_INTERFACE_END |
| r32492 | r32493 | |
| 553 | 514 | }; |
| 554 | 515 | #endif |
| 555 | 516 | |
| 517 | static SLOT_INTERFACE_START(apf_cart) | |
| 518 | SLOT_INTERFACE_INTERNAL("std", APF_ROM_STD) | |
| 519 | SLOT_INTERFACE_INTERNAL("basic", APF_ROM_BASIC) | |
| 520 | SLOT_INTERFACE_INTERNAL("spacedst", APF_ROM_SPACEDST) | |
| 521 | SLOT_INTERFACE_END | |
| 522 | ||
| 523 | ||
| 556 | 524 | static MACHINE_CONFIG_START( apfm1000, apf_state ) |
| 557 | 525 | |
| 558 | 526 | /* basic machine hardware */ |
| r32492 | r32493 | |
| 588 | 556 | MCFG_RAM_DEFAULT_SIZE("8K") |
| 589 | 557 | MCFG_RAM_EXTRA_OPTIONS("16K") |
| 590 | 558 | |
| 591 | MCFG_CARTSLOT_ADD("cart") | |
| 592 | MCFG_CARTSLOT_INTERFACE("apfm1000_cart") | |
| 593 | MCFG_CARTSLOT_LOAD(apf_state, apf_cart) | |
| 559 | MCFG_APF_CARTRIDGE_ADD("cartslot", apf_cart, NULL) | |
| 594 | 560 | |
| 595 | 561 | /* software lists */ |
| 596 | 562 | MCFG_SOFTWARE_LIST_ADD("cart_list","apfm1000") |
| r32492 | r32493 | |
| 635 | 601 | |
| 636 | 602 | ROM_SYSTEM_BIOS( 2, "mod", "Mod Bios" ) // (c) 1982 W.Lunquist - In Basic, CALL 18450 to get a machine-language monitor |
| 637 | 603 | ROMX_LOAD("mod_bios.bin", 0x0000, 0x1000, CRC(f320aba6) SHA1(9442349fca8b001a5765e2fe8b84db4ece7886c1), ROM_BIOS(3) ) |
| 638 | ||
| 639 | ROM_REGION(0x3800,"cart", ROMREGION_ERASEFF) | |
| 640 | 604 | ROM_END |
| 641 | 605 | |
| 642 | 606 | #define rom_apfimag rom_apfm1000 |
| r32492 | r32493 | |
|---|---|---|
| 8 | 8 | * |
| 9 | 9 | * Fredric "e5frog" Blaoholtz, added support large cartridges |
| 10 | 10 | * also spanning from $3000 to $FFFF. Added clones |
| 11 | * Fabio "etabeta" Priuli, moved carts to be slot devices | |
| 11 | 12 | * |
| 12 | 13 | ******************************************************************/ |
| 13 | 14 | |
| r32492 | r32493 | |
| 46 | 47 | return (~ext | latch_state); |
| 47 | 48 | } |
| 48 | 49 | |
| 49 | READ8_MEMBER( channelf_state:: | |
| 50 | READ8_MEMBER( channelf_state::port_0_r ) | |
| 50 | 51 | { |
| 51 | 52 | return port_read_with_latch(ioport("PANEL")->read(), m_latch[0]); |
| 52 | 53 | } |
| 53 | 54 | |
| 54 | READ8_MEMBER( channelf_state:: | |
| 55 | READ8_MEMBER( channelf_state::port_1_r ) | |
| 55 | 56 | { |
| 56 | 57 | UINT8 ext_value; |
| 57 | 58 | |
| r32492 | r32493 | |
| 63 | 64 | return port_read_with_latch(ext_value,m_latch[1]); |
| 64 | 65 | } |
| 65 | 66 | |
| 66 | READ8_MEMBER( channelf_state:: | |
| 67 | READ8_MEMBER( channelf_state::port_4_r ) | |
| 67 | 68 | { |
| 68 | 69 | UINT8 ext_value; |
| 69 | 70 | |
| r32492 | r32493 | |
| 75 | 76 | return port_read_with_latch(ext_value,m_latch[2]); |
| 76 | 77 | } |
| 77 | 78 | |
| 78 | READ8_MEMBER( channelf_state:: | |
| 79 | READ8_MEMBER( channelf_state::port_5_r ) | |
| 79 | 80 | { |
| 80 | 81 | return port_read_with_latch(0xff, m_latch[3]); |
| 81 | 82 | } |
| 82 | 83 | |
| 83 | RE | |
| 84 | WRITE8_MEMBER( channelf_state::port_0_w ) | |
| 84 | 85 | { |
| 85 | UINT8 pdata; | |
| 86 | ||
| 87 | if (m_r2102.r_w==0) | |
| 88 | { | |
| 89 | m_r2102.addr=(m_r2102.a[0]&1)+((m_r2102.a[1]<<1)&2)+((m_r2102.a[2]<<2)&4)+((m_r2102.a[3]<<3)&8)+((m_r2102.a[4]<<4)&16)+((m_r2102.a[5]<<5)&32)+((m_r2102.a[6]<<6)&64)+((m_r2102.a[7]<<7)&128)+((m_r2102.a[8]<<8)&256)+((m_r2102.a[9]<<9)&512); | |
| 90 | m_r2102.d=m_r2102.ram[m_r2102.addr]&1; | |
| 91 | pdata=m_latch[4]&0x7f; | |
| 92 | pdata|=(m_r2102.d<<7); | |
| 93 | LOG(("rhA: addr=%d, d=%d, r_w=%d, ram[%d]=%d, a[9]=%d, a[8]=%d, a[7]=%d, a[6]=%d, a[5]=%d, a[4]=%d, a[3]=%d, a[2]=%d, a[1]=%d, a[0]=%d\n",m_r2102.addr,m_r2102.d,m_r2102.r_w,m_r2102.addr,m_r2102.ram[m_r2102.addr],m_r2102.a[9],m_r2102.a[8],m_r2102.a[7],m_r2102.a[6],m_r2102.a[5],m_r2102.a[4],m_r2102.a[3],m_r2102.a[2],m_r2102.a[1],m_r2102.a[0])); | |
| 94 | return port_read_with_latch(0xff,pdata); | |
| 95 | } | |
| 96 | else | |
| 97 | LOG(("rhA: r_w=%d\n",m_r2102.r_w)); | |
| 98 | ||
| 99 | return port_read_with_latch(0xff, m_latch[4]); | |
| 100 | } | |
| 101 | ||
| 102 | READ8_MEMBER( channelf_state::channelf_2102B_r ) /* SKR */ | |
| 103 | { | |
| 104 | LOG(("rhB\n")); | |
| 105 | return port_read_with_latch(0xff, m_latch[5]); | |
| 106 | } | |
| 107 | ||
| 108 | WRITE8_MEMBER( channelf_state::channelf_port_0_w ) | |
| 109 | { | |
| 110 | 86 | int offs; |
| 111 | 87 | |
| 112 | 88 | m_latch[0] = data; |
| r32492 | r32493 | |
| 118 | 94 | } |
| 119 | 95 | } |
| 120 | 96 | |
| 121 | WRITE8_MEMBER( channelf_state:: | |
| 97 | WRITE8_MEMBER( channelf_state::port_1_w ) | |
| 122 | 98 | { |
| 123 | 99 | m_latch[1] = data; |
| 124 | 100 | m_val_reg = ((data ^ 0xff) >> 6) & 0x03; |
| 125 | 101 | } |
| 126 | 102 | |
| 127 | WRITE8_MEMBER( channelf_state:: | |
| 103 | WRITE8_MEMBER( channelf_state::port_4_w ) | |
| 128 | 104 | { |
| 129 | 105 | m_latch[2] = data; |
| 130 | 106 | m_col_reg = (data | 0x80) ^ 0xff; |
| 131 | 107 | } |
| 132 | 108 | |
| 133 | WRITE8_MEMBER( channelf_state:: | |
| 109 | WRITE8_MEMBER( channelf_state::port_5_w ) | |
| 134 | 110 | { |
| 135 | 111 | m_latch[3] = data; |
| 136 | 112 | m_custom->sound_w((data>>6)&3); |
| 137 | 113 | m_row_reg = (data | 0xc0) ^ 0xff; |
| 138 | 114 | } |
| 139 | 115 | |
| 140 | WRITE8_MEMBER( channelf_state::channelf_2102A_w ) /* SKR */ | |
| 141 | { | |
| 142 | m_latch[4]=data; | |
| 143 | m_r2102.a[2]=(data>>2)&1; | |
| 144 | m_r2102.a[3]=(data>>1)&1; | |
| 145 | m_r2102.r_w=data&1; | |
| 146 | m_r2102.addr=(m_r2102.a[0]&1)+((m_r2102.a[1]<<1)&2)+((m_r2102.a[2]<<2)&4)+((m_r2102.a[3]<<3)&8)+((m_r2102.a[4]<<4)&16)+((m_r2102.a[5]<<5)&32)+((m_r2102.a[6]<<6)&64)+((m_r2102.a[7]<<7)&128)+((m_r2102.a[8]<<8)&256)+((m_r2102.a[9]<<9)&512); | |
| 147 | m_r2102.d=(data>>3)&1; | |
| 148 | if(m_r2102.r_w==1) | |
| 149 | m_r2102.ram[m_r2102.addr]=m_r2102.d; | |
| 150 | LOG(("whA: data=%d, addr=%d, d=%d, r_w=%d, ram[%d]=%d\n",data,m_r2102.addr,m_r2102.d,m_r2102.r_w,m_r2102.addr,m_r2102.ram[m_r2102.addr])); | |
| 151 | } | |
| 152 | ||
| 153 | WRITE8_MEMBER( channelf_state::channelf_2102B_w ) /* SKR */ | |
| 154 | { | |
| 155 | m_latch[5]=data; | |
| 156 | m_r2102.a[9]=(data>>7)&1; | |
| 157 | m_r2102.a[8]=(data>>6)&1; | |
| 158 | m_r2102.a[7]=(data>>5)&1; | |
| 159 | m_r2102.a[1]=(data>>4)&1; | |
| 160 | m_r2102.a[6]=(data>>3)&1; | |
| 161 | m_r2102.a[5]=(data>>2)&1; | |
| 162 | m_r2102.a[4]=(data>>1)&1; | |
| 163 | m_r2102.a[0]=data&1; | |
| 164 | LOG(("whB: data=%d, a[9]=%d,a[8]=%d,a[0]=%d\n",data,m_r2102.a[9],m_r2102.a[8],m_r2102.a[0])); | |
| 165 | } | |
| 166 | ||
| 167 | 116 | static ADDRESS_MAP_START( channelf_map, AS_PROGRAM, 8, channelf_state ) |
| 168 | 117 | AM_RANGE(0x0000, 0x07ff) AM_ROM |
| 169 | AM_RANGE(0x0800, 0x27ff) AM_ROM /* Cartridge Data */ | |
| 170 | AM_RANGE(0x2800, 0x2fff) AM_RAM /* Schach RAM */ | |
| 171 | AM_RANGE(0x3000, 0xffff) AM_ROM /* Cartridge Data continued */ | |
| 118 | AM_RANGE(0x0800, 0xffff) AM_DEVREAD("cartslot", channelf_cart_slot_device, read_rom) | |
| 172 | 119 | ADDRESS_MAP_END |
| 173 | 120 | |
| 174 | 121 | static ADDRESS_MAP_START( channelf_io, AS_IO, 8, channelf_state ) |
| 175 | AM_RANGE(0x00, 0x00) AM_READWRITE(channelf_port_0_r, channelf_port_0_w) /* Front panel switches */ | |
| 176 | AM_RANGE(0x01, 0x01) AM_READWRITE(channelf_port_1_r, channelf_port_1_w) /* Right controller */ | |
| 177 | AM_RANGE(0x04, 0x04) AM_READWRITE(channelf_port_4_r, channelf_port_4_w) /* Left controller */ | |
| 178 | AM_RANGE(0x05, 0x05) AM_READWRITE(channelf_port_5_r, channelf_port_5_w) | |
| 179 | ||
| 180 | AM_RANGE(0x20, 0x20) AM_READWRITE(channelf_2102A_r, channelf_2102A_w) /* SKR 2102 control and addr for cart 18 */ | |
| 181 | AM_RANGE(0x21, 0x21) AM_READWRITE(channelf_2102B_r, channelf_2102B_w) /* SKR 2102 addr */ | |
| 182 | AM_RANGE(0x24, 0x24) AM_READWRITE(channelf_2102A_r, channelf_2102A_w) /* SKR 2102 control and addr for cart 10 */ | |
| 183 | AM_RANGE(0x25, 0x25) AM_READWRITE(channelf_2102B_r, channelf_2102B_w) /* SKR 2102 addr */ | |
| 122 | AM_RANGE(0x00, 0x00) AM_READWRITE(port_0_r, port_0_w) /* Front panel switches */ | |
| 123 | AM_RANGE(0x01, 0x01) AM_READWRITE(port_1_r, port_1_w) /* Right controller */ | |
| 124 | AM_RANGE(0x04, 0x04) AM_READWRITE(port_4_r, port_4_w) /* Left controller */ | |
| 125 | AM_RANGE(0x05, 0x05) AM_READWRITE(port_5_r, port_5_w) | |
| 184 | 126 | ADDRESS_MAP_END |
| 185 | 127 | |
| 186 | 128 | |
| 187 | 129 | |
| 188 | 130 | static INPUT_PORTS_START( channelf ) |
| 189 | PORT_START("PANEL") /* Front panel buttons */ | |
| 190 | PORT_BIT ( 0x01, IP_ACTIVE_HIGH, IPT_START ) /* TIME (1) */ | |
| 191 | PORT_BIT ( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON5 ) /* HOLD (2) */ | |
| 192 | PORT_BIT ( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON6 ) /* MODE (3) */ | |
| 193 | PORT_BIT ( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON7 ) /* START (4) */ | |
| 194 | PORT_BIT ( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 131 | PORT_START("PANEL") | |
| 132 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("TIME (Button 1)") PORT_CODE(KEYCODE_1) | |
| 133 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("HOLD (Button 2)") PORT_CODE(KEYCODE_2) | |
| 134 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MODE (Button 3)") PORT_CODE(KEYCODE_3) | |
| 135 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("START (Button 4)") PORT_CODE(KEYCODE_4) | |
| 136 | PORT_BIT(0xf0, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 195 | 137 | |
| 196 | PORT_START("RIGHT_C") /* Right controller */ | |
| 197 | PORT_BIT ( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT) PORT_PLAYER(1) | |
| 198 | PORT_BIT ( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT) PORT_PLAYER(1) | |
| 199 | PORT_BIT ( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN) PORT_PLAYER(1) | |
| 200 | PORT_BIT ( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_PLAYER(1) | |
| 201 | PORT_BIT ( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON4) /* C-CLOCKWISE */ PORT_PLAYER(1) | |
| 202 | PORT_BIT ( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON3) /* CLOCKWISE */ PORT_PLAYER(1) | |
| 203 | PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2) /* PULL UP */ PORT_PLAYER(1) | |
| 204 | PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1) /* PUSH DOWN */ PORT_PLAYER(1) | |
| 138 | PORT_START("RIGHT_C") | |
| 139 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT) PORT_PLAYER(1) | |
| 140 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT) PORT_PLAYER(1) | |
| 141 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN) PORT_PLAYER(1) | |
| 142 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_PLAYER(1) | |
| 143 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("P1 Twist Counterclockwise") PORT_PLAYER(1) | |
| 144 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("P1 Twist Clockwise")PORT_PLAYER(1) | |
| 145 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("P1 Pull Up") PORT_PLAYER(1) | |
| 146 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("P1 Push Down") PORT_PLAYER(1) | |
| 205 | 147 | |
| 206 | PORT_START("LEFT_C") /* Left controller */ | |
| 207 | PORT_BIT ( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2) | |
| 208 | PORT_BIT ( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT) PORT_PLAYER(2) | |
| 209 | PORT_BIT ( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN) PORT_PLAYER(2) | |
| 210 | PORT_BIT ( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_PLAYER(2) | |
| 211 | PORT_BIT ( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON4) /* C-CLOCKWISE */ PORT_PLAYER(2) | |
| 212 | PORT_BIT ( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON3) /* CLOCKWISE */ PORT_PLAYER(2) | |
| 213 | PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2) /* PULL UP */ PORT_PLAYER(2) | |
| 214 | PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1) /* PUSH DOWN */ PORT_PLAYER(2) | |
| 148 | PORT_START("LEFT_C") | |
| 149 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2) | |
| 150 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT) PORT_PLAYER(2) | |
| 151 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN) PORT_PLAYER(2) | |
| 152 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_PLAYER(2) | |
| 153 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("P2 Twist Counterclockwise") PORT_PLAYER(2) | |
| 154 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("P2 Twist Clockwise")PORT_PLAYER(2) | |
| 155 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("P2 Pull Up") PORT_PLAYER(2) | |
| 156 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("P2 Push Down") PORT_PLAYER(2) | |
| 215 | 157 | INPUT_PORTS_END |
| 216 | 158 | |
| 217 | 159 | |
| 218 | ||
| 219 | DEVICE_IMAGE_LOAD_MEMBER( channelf_state, channelf_cart ) | |
| 160 | void channelf_state::machine_start() | |
| 220 | 161 | { |
| 221 | UINT32 size; | |
| 222 | ||
| 223 | if (image.software_entry() == NULL) | |
| 162 | if (m_cart->exists()) | |
| 224 | 163 | { |
| 225 | size = image.length(); | |
| 226 | ||
| 227 | if (size > 0xf800) | |
| 164 | switch (m_cart->get_type()) | |
| 228 | 165 | { |
| 229 | image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size"); | |
| 230 | return IMAGE_INIT_FAIL; | |
| 166 | case CF_MAZE: | |
| 167 | m_maincpu->space(AS_IO).install_readwrite_handler(0x24, 0x25, read8_delegate(FUNC(channelf_cart_slot_device::read_ram),(channelf_cart_slot_device*)m_cart), write8_delegate(FUNC(channelf_cart_slot_device::write_ram),(channelf_cart_slot_device*)m_cart)); | |
| 168 | break; | |
| 169 | case CF_HANGMAN: | |
| 170 | m_maincpu->space(AS_IO).install_readwrite_handler(0x20, 0x21, read8_delegate(FUNC(channelf_cart_slot_device::read_ram),(channelf_cart_slot_device*)m_cart), write8_delegate(FUNC(channelf_cart_slot_device::write_ram),(channelf_cart_slot_device*)m_cart)); | |
| 171 | break; | |
| 172 | case CF_CHESS: | |
| 173 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x2800, 0x2fff, read8_delegate(FUNC(channelf_cart_slot_device::read_ram),(channelf_cart_slot_device*)m_cart), write8_delegate(FUNC(channelf_cart_slot_device::write_ram),(channelf_cart_slot_device*)m_cart)); | |
| 174 | break; | |
| 175 | case CF_MULTI: | |
| 176 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x2800, 0x2fff, read8_delegate(FUNC(channelf_cart_slot_device::read_ram),(channelf_cart_slot_device*)m_cart), write8_delegate(FUNC(channelf_cart_slot_device::write_ram),(channelf_cart_slot_device*)m_cart)); | |
| 177 | m_maincpu->space(AS_PROGRAM).install_write_handler(0x3000, 0x3fff, write8_delegate(FUNC(channelf_cart_slot_device::write_bank),(channelf_cart_slot_device*)m_cart)); | |
| 178 | break; | |
| 231 | 179 | } |
| 232 | ||
| 233 | if (image.fread( memregion("maincpu")->base() + 0x0800, size) != size) | |
| 234 | { | |
| 235 | image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unable to fully read from file"); | |
| 236 | return IMAGE_INIT_FAIL; | |
| 237 | } | |
| 238 | ||
| 180 | ||
| 181 | m_cart->save_ram(); | |
| 239 | 182 | } |
| 240 | else | |
| 241 | { | |
| 242 | size = image.get_software_region_length("rom"); | |
| 243 | memcpy(memregion("maincpu")->base() + 0x0800, image.get_software_region("rom"), size); | |
| 244 | } | |
| 245 | ||
| 246 | return IMAGE_INIT_PASS; | |
| 247 | 183 | } |
| 248 | 184 | |
| 185 | static SLOT_INTERFACE_START(cf_cart) | |
| 186 | SLOT_INTERFACE_INTERNAL("std", CHANF_ROM_STD) | |
| 187 | SLOT_INTERFACE_INTERNAL("maze", CHANF_ROM_MAZE) | |
| 188 | SLOT_INTERFACE_INTERNAL("hangman", CHANF_ROM_HANGMAN) | |
| 189 | SLOT_INTERFACE_INTERNAL("chess", CHANF_ROM_CHESS) | |
| 190 | SLOT_INTERFACE_INTERNAL("multi", CHANF_ROM_MULTI) | |
| 191 | SLOT_INTERFACE_END | |
| 192 | ||
| 193 | ||
| 249 | 194 | static MACHINE_CONFIG_FRAGMENT( channelf_cart ) |
| 250 | 195 | /* cartridge */ |
| 251 | MCFG_CARTSLOT_ADD("cart") | |
| 252 | MCFG_CARTSLOT_EXTENSION_LIST("bin,chf") | |
| 253 | MCFG_CARTSLOT_INTERFACE("channelf_cart") | |
| 254 | MCFG_CARTSLOT_LOAD(channelf_state,channelf_cart) | |
| 196 | MCFG_CHANNELF_CARTRIDGE_ADD("cartslot", cf_cart, NULL) | |
| 255 | 197 | |
| 256 | 198 | /* Software lists */ |
| 257 | 199 | MCFG_SOFTWARE_LIST_ADD("cart_list","channelf") |
| r32492 | r32493 | |
|---|---|---|
| 568 | 568 | BUSES += ABCKB |
| 569 | 569 | BUSES += ADAM |
| 570 | 570 | BUSES += ADAMNET |
| 571 | BUSES += APF | |
| 571 | 572 | BUSES += BML3 |
| 572 | 573 | BUSES += BW2 |
| 573 | 574 | BUSES += C64 |
| 574 | 575 | BUSES += CBM2 |
| 575 | 576 | BUSES += CBMIEC |
| 576 | 577 | BUSES += CENTRONICS |
| 578 | BUSES += CHANNELF | |
| 577 | 579 | BUSES += COCO |
| 578 | 580 | BUSES += COLECO |
| 579 | 581 | BUSES += COMPUCOLOR |
| Previous | 199869 Revisions | Next |