libfusefdc: better TR-DOS boot setting
[zymosis.git] / src / ZXEmuT / tapeldrx_edge.c
blob7852204c29038c2b22d923968ae942a1fd12277f
1 /***************************************************************************
3 * ZXEmuT -- ZX Spectrum Emulator with Tcl scripting
5 * Copyright (C) 2012-2020 Ketmar Dark <ketmar@ketmar.no-ip.org>
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, version 3 of the License ONLY.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 **************************************************************************/
20 static const int16_t pattern_edge[] = {
21 -10,
22 0xC5, // PUSH BC
23 0xDD, 0xE1, // POP IX
24 0xF3, // DI
25 0x3E, -32666, // LD A,xx
26 0xD3, 0xFE, // OUT (#FE),A
27 0, 10, 0xCD, 0xE7, 0x05, // CALL LD-EDGE1
28 0, 22, 0xCD, 0xE3, 0x05, // CALL LD-EDGE2
29 // check constants
30 0, 31, 0x069C, // LD B,#9C
31 0, 38, 0x3EC6, // LD A,#C6
32 0, 46, 0x06C9, // LD B,#C9
33 0, 54, 0xFE, 0xD4, // CP #D4
34 0, 79, 0x06B2, // LD B,#B2
35 0, 88, 0x3EBD, // LD A,#BD
36 0, 115, 0xED, 0x56, // IM 1
37 // exit
38 0, 105,
39 0x7C, // LD A,H
40 0xB7, // OR A
41 0x20, -32666, // JR NZ, ...
42 0xE1, // POP HL
43 0xC1, // POP BC
44 0x05, // DEC B
45 // end
46 0, 0
50 static int do_edge (void) {
51 const tape_loader_info_t loader_info = {
52 .pilot_minlen = 100,
53 .pilot = 2168,
54 .sync1 = 667,
55 .sync2 = 735,
56 .bit0 = 550,
57 .bit1 = 1110,
58 .flags = CFL_NO_TYPE
60 return emuTapeDoFlashLoadEx(&loader_info);
64 ////////////////////////////////////////////////////////////////////////////////
65 __attribute__((constructor)) static void fl_loader_ctor_edge (void) {
66 const fl_loader_info_t nfo = {
67 .name="Edge Loader",
68 .pattern=pattern_edge,
69 .detectFn=NULL,
70 .accelFn=do_edge,
71 .exitOfs=105,
73 fl_register_loader(&nfo);