| 74 | }; |
| 75 | |
| 76 | class Rjp1 : public Paula { |
| 77 | public: |
| 78 | |
| 79 | struct Vars { |
| 80 | int8 *instData; |
| 81 | uint32 instDataSize; |
| 82 | |
| 83 | uint8 *songData[7]; |
| 84 | uint32 songDataSize[7]; |
| 85 | |
| 86 | uint8 activeChannelsMask; |
| 87 | uint8 currentChannel; |
| 88 | int subsongsCount; |
| 89 | int instrumentsCount; |
| 90 | }; |
| 91 | |
| 92 | Rjp1(int rate, bool stereo); |
| 93 | virtual ~Rjp1(); |
| 94 | |
| 95 | bool load(tSharedBuffer songData, tSharedBuffer instrumentsData); |
| 96 | void unload(); |
| 97 | |
| 98 | void startPattern(int ch, int pat); |
| 99 | void startSong(int song); |
| 100 | |
| 101 | protected: |
| 102 | |
| 103 | void startSequence(uint8 channelNum, uint8 seqNum); |
| 104 | void turnOffChannel(Rjp1Channel *channel); |
| 105 | void playChannel(Rjp1Channel *channel); |
| 106 | void turnOnChannel(Rjp1Channel *channel); |
| 107 | bool executeSfxSequenceOp(Rjp1Channel *channel, uint8 code, const uint8 *&p); |
| 108 | bool executeSongSequenceOp(Rjp1Channel *channel, uint8 code, const uint8 *&p); |
| 109 | void playSongSequence(Rjp1Channel *channel); |
| 110 | void modulateVolume(Rjp1Channel *channel); |
| 111 | void modulatePeriod(Rjp1Channel *channel); |
| 112 | void setupNote(Rjp1Channel *channel, int16 freq); |
| 113 | void setupInstrument(Rjp1Channel *channel, uint8 num); |
| 114 | void setRelease(Rjp1Channel *channel); |
| 115 | void modulateVolumeEnvelope(Rjp1Channel *channel); |
| 116 | void setSustain(Rjp1Channel *channel); |
| 117 | void setDecay(Rjp1Channel *channel); |
| 118 | void modulateVolumeWaveform(Rjp1Channel *channel); |
| 119 | void setVolume(Rjp1Channel *channel); |
| 120 | |
| 121 | void stopPaulaChannel(size_t channel); |
| 122 | void setupPaulaChannel(size_t channel, const int8 *waveData, uint16 offset, uint16 len, uint16 repeatPos, uint16 repeatLen); |
| 123 | |
| 124 | virtual void interrupt(); |
| 125 | |
| 126 | Vars _vars; |
| 127 | Rjp1Channel _channelsTable[4]; |
| 128 | |
| 129 | static const int16 _periodsTable[]; |
| 130 | static const int _periodsCount; |
| 131 | }; |
| 132 | class AudioStream; |
| 133 |
nothing calls this directly
no outgoing calls
no test coverage detected