src/mess/formats/atom_tap.c
| r0 | r7874 | |
| 1 | /********************************************************************* |
| 2 | |
| 3 | formats/atom_tap.c |
| 4 | |
| 5 | Cassette code for Acorn Atom tap files |
| 6 | |
| 7 | *********************************************************************/ |
| 8 | |
| 9 | #include "emu.h" |
| 10 | #include "formats/atom_tap.h" |
| 11 | |
| 12 | /*************************************************************************** |
| 13 | PARAMETERS |
| 14 | ***************************************************************************/ |
| 15 | |
| 16 | #define LOG 1 |
| 17 | |
| 18 | /*************************************************************************** |
| 19 | IMPLEMENTATION |
| 20 | ***************************************************************************/ |
| 21 | |
| 22 | /*------------------------------------------------- |
| 23 | CassetteLegacyWaveFiller atom_legacy_fill_wave |
| 24 | -------------------------------------------------*/ |
| 25 | |
| 26 | static const struct CassetteLegacyWaveFiller atom_legacy_fill_wave = |
| 27 | { |
| 28 | NULL, /* fill_wave */ |
| 29 | -1, /* chunk_size */ |
| 30 | 0, /* chunk_samples */ |
| 31 | NULL, /* chunk_sample_calc */ |
| 32 | 22050, /* sample_frequency */ |
| 33 | 0, /* header_samples */ |
| 34 | 0 /* trailer_samples */ |
| 35 | }; |
| 36 | |
| 37 | /*------------------------------------------------- |
| 38 | atom_cassette_identify - identify cassette |
| 39 | -------------------------------------------------*/ |
| 40 | |
| 41 | static casserr_t atom_cassette_identify( cassette_image *cassette, struct CassetteOptions *opts ) |
| 42 | { |
| 43 | return cassette_legacy_identify( cassette, opts, &atom_legacy_fill_wave ); |
| 44 | } |
| 45 | |
| 46 | /*------------------------------------------------- |
| 47 | atom_cassette_load - load cassette |
| 48 | -------------------------------------------------*/ |
| 49 | |
| 50 | static casserr_t atom_cassette_load( cassette_image *cassette ) |
| 51 | { |
| 52 | return cassette_legacy_construct( cassette, &atom_legacy_fill_wave ); |
| 53 | } |
| 54 | |
| 55 | /*------------------------------------------------- |
| 56 | CassetteFormat atom_tap_cassette_format |
| 57 | -------------------------------------------------*/ |
| 58 | |
| 59 | static const struct CassetteFormat atom_tap_cassette_format = |
| 60 | { |
| 61 | "tap", |
| 62 | atom_cassette_identify, |
| 63 | atom_cassette_load, |
| 64 | NULL |
| 65 | }; |
| 66 | |
| 67 | /*------------------------------------------------- |
| 68 | CASSETTE_FORMATLIST( atom_cassette_formats ) |
| 69 | -------------------------------------------------*/ |
| 70 | |
| 71 | CASSETTE_FORMATLIST_START( atom_cassette_formats ) |
| 72 | CASSETTE_FORMAT(atom_tap_cassette_format) |
| 73 | CASSETTE_FORMATLIST_END |
src/mess/drivers/atom.c
| r7873 | r7874 | |
| 71 | 71 | /* Devices */ |
| 72 | 72 | #include "devices/flopdrv.h" |
| 73 | 73 | #include "formats/atom_atm.h" |
| 74 | #include "formats/atom_tap.h" |
| 74 | 75 | #include "formats/basicdsk.h" |
| 75 | 76 | #include "devices/cassette.h" |
| 76 | 77 | #include "devices/snapquik.h" |
| r7873 | r7874 | |
| 278 | 279 | DO_NOT_KEEP_GEOMETRY |
| 279 | 280 | }; |
| 280 | 281 | |
| 282 | static const cassette_config atom_cassette_config = |
| 283 | { |
| 284 | atom_cassette_formats, |
| 285 | NULL, |
| 286 | (cassette_state) (CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED) |
| 287 | }; |
| 288 | |
| 281 | 289 | static const mc6847_interface atom_mc6847_intf = |
| 282 | 290 | { |
| 283 | 291 | DEVCB_HANDLER(atom_mc6847_videoram_r), |
| r7873 | r7874 | |
| 328 | 336 | MDRV_QUICKLOAD_ADD("quickload", atom_atm, "atm", 0) |
| 329 | 337 | |
| 330 | 338 | /* cassette */ |
| 331 | | MDRV_CASSETTE_ADD( "cassette", default_cassette_config ) |
| 339 | MDRV_CASSETTE_ADD( "cassette", atom_cassette_config ) |
| 332 | 340 | |
| 333 | 341 | /* via */ |
| 334 | 342 | MDRV_VIA6522_ADD("via6522_0", X2 / 4, atom_6522_interface) |