src/mess/tools/castool/main.c
| r8313 | r8314 | |
| 44 | 44 | #include "formats/trs_cas.h" |
| 45 | 45 | #include "formats/tzx_cas.h" |
| 46 | 46 | #include "formats/uef_cas.h" |
| 47 | #include "formats/vg5k_cas.h" |
| 47 | 48 | #include "formats/vt_cas.h" |
| 48 | 49 | #include "formats/zx81_p.h" |
| 49 | 50 | |
| r8313 | r8314 | |
| 87 | 88 | {"tzx", tzx_cassette_formats ,"ZX Spectrum"}, |
| 88 | 89 | {"cdt", cdt_cassette_formats ,"Amstrad CPC"}, |
| 89 | 90 | {"uef", uef_cassette_formats ,"Acorn Electron"}, |
| 91 | {"vg5k", vg5k_cassette_formats ,"VG 5000 k7"}, |
| 90 | 92 | {"vtech1", vtech1_cassette_formats ,"Video Technology Laser 110-310"}, |
| 91 | 93 | {"vtech2", vtech2_cassette_formats ,"Video Technology Laser 350-700"}, |
| 92 | 94 | {"zx81_p", zx81_p_format ,"Sinclair ZX81"}, |
src/mess/formats/vg5k_cas.c
| r8313 | r8314 | |
| 125 | 125 | /* Identify type of block */ |
| 126 | 126 | if (casdata[data_pos] == 0xd3) |
| 127 | 127 | { |
| 128 | | /* head block have fixed size of 20 byte */ |
| 128 | /* head block have fixed size of 32 byte */ |
| 129 | 129 | block_size = 0x20; |
| 130 | 130 | |
| 131 | 131 | /* 1 sec of silence before the head block */ |
| 132 | 132 | sample_count += vg5k_cas_silence(buffer, sample_count, 44100); |
| 133 | 133 | |
| 134 | | /* head block starts with 15000 samples of synchro */ |
| 135 | | sample_count += vg5k_k7_synchro( buffer, sample_count, 15000 ); |
| 134 | /* head block starts with 30000 samples of synchro */ |
| 135 | sample_count += vg5k_k7_synchro( buffer, sample_count, 30000 ); |
| 136 | 136 | } |
| 137 | 137 | else if (casdata[data_pos] == 0xd6) |
| 138 | 138 | { |
| r8313 | r8314 | |
| 142 | 142 | /* 10000 samples of silence before the data block */ |
| 143 | 143 | sample_count += vg5k_cas_silence(buffer, sample_count, 10000); |
| 144 | 144 | |
| 145 | | /* data block starts with 3600 samples of synchro */ |
| 146 | | sample_count += vg5k_k7_synchro( buffer, sample_count, 3600); |
| 145 | /* data block starts with 7200 samples of synchro */ |
| 146 | sample_count += vg5k_k7_synchro( buffer, sample_count, 7200); |
| 147 | 147 | } |
| 148 | 148 | else |
| 149 | 149 | return -1; |
src/mess/drivers/vg5k.c
| r8313 | r8314 | |
| 121 | 121 | { |
| 122 | 122 | vg5k_state *vg5k = (vg5k_state *)space->machine->driver_data; |
| 123 | 123 | |
| 124 | | dac_signed_data_w(vg5k->dac, data <<2); |
| 124 | dac_data_w(vg5k->dac, data <<2); |
| 125 | |
| 126 | if (data == 0x03) |
| 127 | cassette_output(vg5k->cassette, +1); |
| 128 | else if (data == 0x02) |
| 129 | cassette_output(vg5k->cassette, -1); |
| 130 | else |
| 131 | cassette_output(vg5k->cassette, 0); |
| 125 | 132 | } |
| 126 | 133 | |
| 127 | 134 | |
| r8313 | r8314 | |
| 268 | 275 | INPUT_PORTS_END |
| 269 | 276 | |
| 270 | 277 | |
| 278 | static TIMER_CALLBACK( z80_irq_clear ) |
| 279 | { |
| 280 | cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE); |
| 281 | } |
| 282 | |
| 283 | |
| 271 | 284 | static TIMER_CALLBACK( z80_irq ) |
| 272 | 285 | { |
| 273 | | cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE); |
| 286 | cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); |
| 287 | |
| 288 | timer_set(machine, ATTOTIME_IN_USEC(100), NULL, 0, z80_irq_clear); |
| 274 | 289 | } |
| 275 | 290 | |
| 276 | 291 | static TIMER_DEVICE_CALLBACK( vg5k_scanline ) |
| r8313 | r8314 | |
| 363 | 378 | 300 /* screen height */ |
| 364 | 379 | }; |
| 365 | 380 | |
| 366 | | static const struct CassetteOptions vg5kr_cassette_options = |
| 381 | static const struct CassetteOptions vg5k_cassette_options = |
| 367 | 382 | { |
| 368 | 383 | 1, /* channels */ |
| 369 | 384 | 16, /* bits per sample */ |
| r8313 | r8314 | |
| 373 | 388 | static const cassette_config vg5k_cassette_config = |
| 374 | 389 | { |
| 375 | 390 | vg5k_cassette_formats, |
| 376 | | &vg5kr_cassette_options, |
| 391 | &vg5k_cassette_options, |
| 377 | 392 | (cassette_state)(CASSETTE_STOPPED | CASSETTE_MASK_SPEAKER) |
| 378 | 393 | }; |
| 379 | 394 | |