Debian Codegraph @

src/engine/fileOps/fileOpsCommon.h

raw
1 /**
2 * Furnace Tracker - multi-system chiptune tracker
3 * Copyright (C) 2021-2025 tildearrow and contributors
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #include "../dataErrors.h"
21 #include "../engine.h"
22 #include "../../ta-log.h"
23 #include <zlib.h>
24 #include <fmt/printf.h>
25
26 #define DIV_READ_SIZE 131072
27
28 struct InflateBlock {
29 unsigned char* buf;
30 size_t len;
31 size_t blockSize;
32 InflateBlock(size_t s) {
33 buf=new unsigned char[s];
34 len=s;
35 blockSize=0;
36 }
37 ~InflateBlock() {
38 delete[] buf;
39 len=0;
40 }
41 };
42
43 struct NotZlibException {
44 int what;
45 NotZlibException(int w):
46 what(w) {}
47 };
48
49 #define DIV_DMF_MAGIC ".DelekDefleMask."
50 #define DIV_FUR_MAGIC "-Furnace module-"
51 #define DIV_FTM_MAGIC "FamiTracker Module"
52 #define DIV_DNM_MAGIC "Dn-FamiTracker Module"
53 #define DIV_FC13_MAGIC "SMOD"
54 #define DIV_FC14_MAGIC "FC14"
55 #define DIV_S3M_MAGIC "SCRM"
56 #define DIV_XM_MAGIC "Extended Module: "
57 #define DIV_IT_MAGIC "IMPM"
58 #define DIV_TFM_MAGIC "TFMfmtV2"
59
60 #define DIV_FUR_MAGIC_DS0 "Furnace-B module"
61
62 enum DivFurVariants: int {
63 DIV_FUR_VARIANT_VANILLA=0,
64 DIV_FUR_VARIANT_B=1,
65 };
66
67 // MIDI-related
68 struct midibank_t {
69 String name;
70 uint8_t bankMsb,
71 bankLsb;
72 };
73
74 // Reused patch data structures
75
76 // SBI and some other OPL containers
77
78 struct sbi_t {
79 uint8_t Mcharacteristics,
80 Ccharacteristics,
81 Mscaling_output,
82 Cscaling_output,
83 Meg_AD,
84 Ceg_AD,
85 Meg_SR,
86 Ceg_SR,
87 Mwave,
88 Cwave,
89 FeedConnect;
90 };
91
92 //bool stringNotBlank(String& str);
93 // detune needs extra translation from register to furnace format
94 //uint8_t fmDtRegisterToFurnace(uint8_t&& dtNative);
95
96 //void readSbiOpData(sbi_t& sbi, SafeReader& reader);