| 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 |
#ifndef _FMSHARED_OPM_H |
| 21 |
#define _FMSHARED_OPM_H |
| 22 |
|
| 23 |
#include "fmsharedbase.h" |
| 24 |
|
| 25 |
#define NOTE_LINEAR(x) ((x)<<7) |
| 26 |
#define OFFSET_LINEAR (baseFreqOff+log2(parent->song.tuning/440.0)*12.0*128.0) |
| 27 |
|
| 28 |
|
| 29 |
class DivPlatformOPM: public DivPlatformFMBase { |
| 30 |
protected: |
| 31 |
const unsigned short ADDR_MULT_DT=0x40; |
| 32 |
const unsigned short ADDR_TL=0x60; |
| 33 |
const unsigned short ADDR_RS_AR=0x80; |
| 34 |
const unsigned short ADDR_AM_DR=0xa0; |
| 35 |
const unsigned short ADDR_DT2_D2R=0xc0; |
| 36 |
const unsigned short ADDR_SL_RR=0xe0; |
| 37 |
const unsigned short ADDR_NOTE=0x28; |
| 38 |
const unsigned short ADDR_KF=0x30; |
| 39 |
const unsigned short ADDR_FMS_AMS=0x38; |
| 40 |
const unsigned short ADDR_LR_FB_ALG=0x20; |
| 41 |
|
| 42 |
const unsigned short opOffs[4]={ |
| 43 |
0x00, 0x08, 0x10, 0x18 |
| 44 |
}; |
| 45 |
|
| 46 |
unsigned char lfoValue, lfoValue2, lfoShape, lfoShape2; |
| 47 |
bool brokenPitch; |
| 48 |
|
| 49 |
DivPlatformOPM(): |
| 50 |
DivPlatformFMBase(), |
| 51 |
lfoValue(0), |
| 52 |
lfoValue2(0), |
| 53 |
lfoShape(0), |
| 54 |
lfoShape2(0), |
| 55 |
brokenPitch(false) {} |
| 56 |
}; |
| 57 |
|
| 58 |
#endif |