trunk/src/mess/drivers/electron.c
| r22667 | r22668 | |
| 13 | 13 | - Graphics (seems to be wrong for several games) |
| 14 | 14 | - 1 MHz bus is not emulated |
| 15 | 15 | - Bus claiming by ULA is not implemented |
| 16 | - Currently the cartridge support always loads the upper rom in page 12 |
| 17 | and the lower rom in page 0. This might need further documentation in |
| 18 | the software list and loading code. |
| 16 | 19 | |
| 17 | 20 | Missing: |
| 18 | | - Support for ROM images |
| 19 | 21 | - Support for floppy disks |
| 20 | 22 | - Other peripherals |
| 21 | 23 | - Keyboard is missing the 'Break' key |
| r22667 | r22668 | |
| 26 | 28 | #include "cpu/m6502/m6502.h" |
| 27 | 29 | #include "includes/electron.h" |
| 28 | 30 | #include "imagedev/cassette.h" |
| 31 | #include "imagedev/cartslot.h" |
| 29 | 32 | #include "formats/uef_cas.h" |
| 30 | 33 | #include "sound/beep.h" |
| 31 | 34 | |
| r22667 | r22668 | |
| 196 | 199 | MCFG_SOUND_ROUTE( ALL_OUTPUTS, "mono", 1.00 ) |
| 197 | 200 | |
| 198 | 201 | MCFG_CASSETTE_ADD( "cassette", electron_cassette_interface ) |
| 202 | |
| 203 | MCFG_CARTSLOT_ADD("cart") |
| 204 | MCFG_CARTSLOT_EXTENSION_LIST("bin") |
| 205 | MCFG_CARTSLOT_NOT_MANDATORY |
| 206 | MCFG_CARTSLOT_LOAD(electron_state, electron_cart) |
| 207 | MCFG_CARTSLOT_INTERFACE("electron_cart") |
| 208 | /* software lists */ |
| 209 | MCFG_SOFTWARE_LIST_ADD("cart_list","electron_cart") |
| 199 | 210 | MACHINE_CONFIG_END |
| 200 | 211 | |
| 201 | 212 | |
trunk/src/mess/machine/electron.c
| r22667 | r22668 | |
| 338 | 338 | machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(electron_state::setup_beep),this)); |
| 339 | 339 | m_tape_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(electron_state::electron_tape_timer_handler),this)); |
| 340 | 340 | } |
| 341 | |
| 342 | DEVICE_IMAGE_LOAD_MEMBER( electron_state, electron_cart ) |
| 343 | { |
| 344 | UINT8 *user1 = memregion("user1")->base() + 0x4000; |
| 345 | |
| 346 | if (image.software_entry() == NULL) |
| 347 | { |
| 348 | UINT32 filesize = image.length(); |
| 349 | |
| 350 | if ( filesize != 16384 ) |
| 351 | { |
| 352 | image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid size. Only size 16384 is supported"); |
| 353 | return IMAGE_INIT_FAIL; |
| 354 | } |
| 355 | |
| 356 | if (image.fread( user1 + 12 * 16384, filesize) != filesize) |
| 357 | { |
| 358 | image.seterror(IMAGE_ERROR_UNSPECIFIED, "Error loading file"); |
| 359 | return IMAGE_INIT_FAIL; |
| 360 | } |
| 361 | |
| 362 | return IMAGE_INIT_PASS; |
| 363 | } |
| 364 | |
| 365 | int upsize = image.get_software_region_length("uprom"); |
| 366 | int losize = image.get_software_region_length("lorom"); |
| 367 | |
| 368 | if ( upsize != 16384 && upsize != 0 ) |
| 369 | { |
| 370 | image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid size for uprom"); |
| 371 | return IMAGE_INIT_FAIL; |
| 372 | } |
| 373 | |
| 374 | if ( losize != 16384 && losize != 0 ) |
| 375 | { |
| 376 | image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid size for lorom"); |
| 377 | return IMAGE_INIT_FAIL; |
| 378 | } |
| 379 | |
| 380 | if ( upsize ) |
| 381 | { |
| 382 | memcpy( user1 + 12 * 16384, image.get_software_region("uprom"), upsize ); |
| 383 | } |
| 384 | |
| 385 | if ( losize ) |
| 386 | { |
| 387 | memcpy( user1 + 0 * 16384, image.get_software_region("lorom"), losize ); |
| 388 | } |
| 389 | |
| 390 | return IMAGE_INIT_PASS; |
| 391 | } |