22#ifndef FREESCAPE_ECLIPSE_C64_MUSIC_H
23#define FREESCAPE_ECLIPSE_C64_MUSIC_H
26#include "common/array.h"
27#include "freescape/music.h"
36 void startMusic()
override;
37 void stopMusic()
override;
38 bool isPlaying()
const override;
41 static const uint16 kLoadAddress = 0x0410;
42 static const uint16 kOrderPointerTable = 0x1041;
43 static const uint16 kInstrumentTable = 0x1047;
44 static const uint16 kPatternPointerLowTable = 0x10A7;
45 static const uint16 kPatternPointerHighTable = 0x10C6;
46 static const uint16 kFrequencyHighTable = 0x0F5F;
47 static const uint16 kFrequencyLowTable = 0x0FBE;
48 static const uint16 kArpeggioIntervalTable = 0x148B;
50 static const byte kChannelCount = 3;
51 static const byte kInstrumentCount = 12;
52 static const byte kPatternCount = 31;
53 static const byte kMaxNote = 94;
62 byte instrumentOffset;
78 byte arpeggioSequencePos;
79 byte arpeggioSequence[9];
80 byte arpeggioSequenceLen;
87 byte pulseWidthDirection;
101 byte _arpeggioIntervals[8];
105 ChannelState _channels[kChannelCount];
107 byte readByte(uint16 address)
const;
108 uint16 readWordLE(uint16 address)
const;
109 uint16 readPatternPointer(
byte index)
const;
110 byte readInstrumentByte(
byte instrumentOffset,
byte field)
const;
111 byte readPatternByte(
int channel);
112 byte clampNote(
byte note)
const;
114 void sidWrite(
int reg,
byte data);
118 void loadNextPattern(
int channel);
119 void buildEffectArpeggio(
int channel);
120 void loadCurrentFrequency(
int channel);
121 void finalizeChannel(
int channel);
122 void processChannel(
int channel,
bool newBeat);
123 void parseCommands(
int channel);
124 void applyNote(
int channel,
byte note);
125 void applyFrameEffects(
int channel);
126 bool applyInstrumentVibrato(
int channel);
127 void applyEffectArpeggio(
int channel);
128 void applyTimedSlide(
int channel);
129 void applyPulseWidthModulation(
int channel);
Definition: c64.music.h:31