LMMS
Loading...
Searching...
No Matches
rol.cpp File Reference
#include <cstring>
#include <algorithm>
#include "rol.h"
#include "debug.h"

Functions

static float fmin (int const a, int const b)

Variables

static uint32_t const skMidPitch = 0x2000U
static int16_t const skNrStepPitch = 25
static int16_t const skVersionMajor = 4
static int16_t const skVersionMinor = 0
static uint8_t const skMaxVolume = 0x7FU
static uint8_t const skMaxNotes = 96U
static uint8_t const skCarrierOpOffset = 3U
static uint8_t const skNumSemitonesInOctave = 12U
static uint8_t const skOPL2_WaveCtrlBaseAddress = 0x01U
static uint8_t const skOPL2_AaMultiBaseAddress = 0x20U
static uint8_t const skOPL2_KSLTLBaseAddress = 0x40U
static uint8_t const skOPL2_ArDrBaseAddress = 0x60U
static uint8_t const skOPL2_SlrrBaseAddress = 0x80U
static uint8_t const skOPL2_FreqLoBaseAddress = 0xA0U
static uint8_t const skOPL2_KeyOnFreqHiBaseAddress = 0xB0U
static uint8_t const skOPL2_AmVibRhythmBaseAddress = 0xBDU
static uint8_t const skOPL2_FeedConBaseAddress = 0xC0U
static uint8_t const skOPL2_WaveformBaseAddress = 0xE0U
static uint8_t const skOPL2_EnableWaveformSelectMask = 0x20U
static uint8_t const skOPL2_KeyOnMask = 0x20U
static uint8_t const skOPL2_RhythmMask = 0x20U
static uint8_t const skOPL2_KSLMask = 0xC0U
static uint8_t const skOPL2_TLMask = 0x3FU
static uint8_t const skOPL2_TLMinLevel = 0x3FU
static uint8_t const skOPL2_FNumLSBMask = 0xFFU
static uint8_t const skOPL2_FNumMSBMask = 0x03U
static uint8_t const skOPL2_FNumMSBShift = 0x08U
static uint8_t const skOPL2_BlockNumberShift = 0x02U
static uint8_t const skNoteOctave [skMaxNotes]
static uint8_t const skNoteIndex [skMaxNotes]
static uint16_t const skFNumNotes [skNrStepPitch][skNumSemitonesInOctave]
static uint8_t const drum_op_table [4] = { 0x14, 0x12, 0x15, 0x11 }

Function Documentation

◆ fmin()

float fmin ( int const a,
int const b )
inlinestatic

Variable Documentation

◆ drum_op_table

uint8_t const drum_op_table[4] = { 0x14, 0x12, 0x15, 0x11 }
static

◆ skCarrierOpOffset

uint8_t const skCarrierOpOffset = 3U
static

◆ skFNumNotes

Initial value:
=
{
343, 364, 385, 408, 433, 459, 486, 515, 546, 579, 614, 650,
344, 365, 387, 410, 434, 460, 488, 517, 548, 581, 615, 652,
345, 365, 387, 410, 435, 461, 489, 518, 549, 582, 617, 653,
346, 366, 388, 411, 436, 462, 490, 519, 550, 583, 618, 655,
346, 367, 389, 412, 437, 463, 491, 520, 551, 584, 619, 657,
347, 368, 390, 413, 438, 464, 492, 522, 553, 586, 621, 658,
348, 369, 391, 415, 439, 466, 493, 523, 554, 587, 622, 660,
349, 370, 392, 415, 440, 467, 495, 524, 556, 589, 624, 661,
350, 371, 393, 416, 441, 468, 496, 525, 557, 590, 625, 663,
351, 372, 394, 417, 442, 469, 497, 527, 558, 592, 627, 665,
351, 372, 395, 418, 443, 470, 498, 528, 559, 593, 628, 666,
352, 373, 396, 419, 444, 471, 499, 529, 561, 594, 630, 668,
353, 374, 397, 420, 445, 472, 500, 530, 562, 596, 631, 669,
354, 375, 398, 421, 447, 473, 502, 532, 564, 597, 633, 671,
355, 376, 398, 422, 448, 474, 503, 533, 565, 599, 634, 672,
356, 377, 399, 423, 449, 475, 504, 534, 566, 600, 636, 674,
356, 378, 400, 424, 450, 477, 505, 535, 567, 601, 637, 675,
357, 379, 401, 425, 451, 478, 506, 537, 569, 603, 639, 677,
358, 379, 402, 426, 452, 479, 507, 538, 570, 604, 640, 679,
359, 380, 403, 427, 453, 480, 509, 539, 571, 606, 642, 680,
360, 381, 404, 428, 454, 481, 510, 540, 572, 607, 643, 682,
360, 382, 405, 429, 455, 482, 511, 541, 574, 608, 645, 683,
361, 383, 406, 430, 456, 483, 512, 543, 575, 610, 646, 685,
362, 384, 407, 431, 457, 484, 513, 544, 577, 611, 648, 687,
363, 385, 408, 432, 458, 485, 514, 545, 578, 612, 649, 688
}

◆ skMaxNotes

uint8_t const skMaxNotes = 96U
static

◆ skMaxVolume

uint8_t const skMaxVolume = 0x7FU
static

◆ skMidPitch

uint32_t const skMidPitch = 0x2000U
static

◆ skNoteIndex

uint8_t const skNoteIndex[skMaxNotes]
static
Initial value:
=
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
}

◆ skNoteOctave

uint8_t const skNoteOctave[skMaxNotes]
static
Initial value:
=
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
}

◆ skNrStepPitch

int16_t const skNrStepPitch = 25
static

◆ skNumSemitonesInOctave

uint8_t const skNumSemitonesInOctave = 12U
static

◆ skOPL2_AaMultiBaseAddress

uint8_t const skOPL2_AaMultiBaseAddress = 0x20U
static

◆ skOPL2_AmVibRhythmBaseAddress

uint8_t const skOPL2_AmVibRhythmBaseAddress = 0xBDU
static

◆ skOPL2_ArDrBaseAddress

uint8_t const skOPL2_ArDrBaseAddress = 0x60U
static

◆ skOPL2_BlockNumberShift

uint8_t const skOPL2_BlockNumberShift = 0x02U
static

◆ skOPL2_EnableWaveformSelectMask

uint8_t const skOPL2_EnableWaveformSelectMask = 0x20U
static

◆ skOPL2_FeedConBaseAddress

uint8_t const skOPL2_FeedConBaseAddress = 0xC0U
static

◆ skOPL2_FNumLSBMask

uint8_t const skOPL2_FNumLSBMask = 0xFFU
static

◆ skOPL2_FNumMSBMask

uint8_t const skOPL2_FNumMSBMask = 0x03U
static

◆ skOPL2_FNumMSBShift

uint8_t const skOPL2_FNumMSBShift = 0x08U
static

◆ skOPL2_FreqLoBaseAddress

uint8_t const skOPL2_FreqLoBaseAddress = 0xA0U
static

◆ skOPL2_KeyOnFreqHiBaseAddress

uint8_t const skOPL2_KeyOnFreqHiBaseAddress = 0xB0U
static

◆ skOPL2_KeyOnMask

uint8_t const skOPL2_KeyOnMask = 0x20U
static

◆ skOPL2_KSLMask

uint8_t const skOPL2_KSLMask = 0xC0U
static

◆ skOPL2_KSLTLBaseAddress

uint8_t const skOPL2_KSLTLBaseAddress = 0x40U
static

◆ skOPL2_RhythmMask

uint8_t const skOPL2_RhythmMask = 0x20U
static

◆ skOPL2_SlrrBaseAddress

uint8_t const skOPL2_SlrrBaseAddress = 0x80U
static

◆ skOPL2_TLMask

uint8_t const skOPL2_TLMask = 0x3FU
static

◆ skOPL2_TLMinLevel

uint8_t const skOPL2_TLMinLevel = 0x3FU
static

◆ skOPL2_WaveCtrlBaseAddress

uint8_t const skOPL2_WaveCtrlBaseAddress = 0x01U
static

◆ skOPL2_WaveformBaseAddress

uint8_t const skOPL2_WaveformBaseAddress = 0xE0U
static

◆ skVersionMajor

int16_t const skVersionMajor = 4
static

◆ skVersionMinor

int16_t const skVersionMinor = 0
static