libfusefdc: better TR-DOS boot setting
[zymosis.git] / src / ZXEmuT / tapeldrx_ftl.c
blobe7ccb3009114fe79ae041a6e4868c03ba6657c67
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_ftl[] = {
21 -4, 0xD3, 0xFE, // OUT (#FE),A
22 -12,
23 0x263D, // LD H,#3D
24 0x01, 0x0140, // LD BC,#4001
25 0xD9, // EXX
26 0, 8, 0xCD, // CALL LD-EDGE2
27 0, 23, 0xCD, // CALL LD-EDGE
28 0, 131,
29 0x7C, // LD A,H
30 0xFE, 0x01, // CP #01
31 0x21, // LD HL,...
32 0, 137,
33 0xE5, // PUSH HL
34 0xC3, // JP ...
35 // check constants
36 0, 28, 0x069C, // LD B,#9C
37 0, 35, 0x3EC6, // LD A,#C6
38 0, 43, 0x06C9, // LD B,#C9
39 0, 51, 0xFE, 0xD4, // CP #D4
40 0, 72, 0x06B0, // LD B,#B0
41 0, 106, 0x06B0, // LD B,#B0
42 0, 114, 0x3ED4, // LD A,#D4
43 0, 119, 0x06B0, // LD B,#B0
44 // end
45 0, 0
49 static int doFTL (void) {
50 const tape_loader_info_t loader_info = {
51 .pilot_minlen = 807,
52 .pilot = 2168,
53 .sync1 = 667,
54 .sync2 = 735,
55 .bit0 = 829,
56 .bit1 = 1658
58 return emuTapeDoFlashLoadEx(&loader_info);
62 ////////////////////////////////////////////////////////////////////////////////
63 __attribute__((constructor)) static void fl_loader_ctor_ftl (void) {
64 const fl_loader_info_t nfo = {
65 .name="FTL Loader",
66 .pattern=pattern_ftl,
67 .detectFn=NULL,
68 .accelFn=doFTL,
69 .exitOfs=131,
71 fl_register_loader(&nfo);