diff --git a/CMakeLists.txt b/CMakeLists.txt index b851ce593..11bf00be7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -670,6 +670,8 @@ src/engine/platform/sound/sid2/wave8580_P_T.cc src/engine/platform/sound/sid2/wave8580__ST.cc src/engine/platform/sound/sid2/wave.cc +src/engine/platform/sound/sid3.c + src/engine/platform/oplAInterface.cpp src/engine/platform/ym2608Interface.cpp src/engine/platform/ym2610Interface.cpp @@ -796,6 +798,7 @@ src/engine/platform/gbaminmod.cpp src/engine/platform/nds.cpp src/engine/platform/bifurcator.cpp src/engine/platform/sid2.cpp +src/engine/platform/sid3.cpp src/engine/platform/pcmdac.cpp src/engine/platform/dummy.cpp diff --git a/doc/3-pattern/effects.md b/doc/3-pattern/effects.md index 98c2cd77f..4edcbbc0d 100644 --- a/doc/3-pattern/effects.md +++ b/doc/3-pattern/effects.md @@ -197,22 +197,22 @@ additionally, [each chip has its own effects](../7-systems/README.md). the interpretation of duty, wave and extra macros depends on chip/instrument type: -ex | FM | OPM | OPZ | OPLL | AY-3-8910 | AY8930 | Lynx | C64 | ----|--------|-----------|-----------|-------|------------|------------|----------|------------| - D | NoiseF | NoiseFreq | | | NoiseFreq | NoiseFreq | Duty/Int | Duty | - W | | LFO Shape | LFO Shape | Patch | Waveform | Waveform | | Waveform | - 1 | | AMD | AMD | | | Duty | | FilterMode | - 2 | | PMD | PMD | | Envelope | Envelope | | Resonance | - 3 | LFOSpd | LFO Speed | LFO Speed | | AutoEnvNum | AutoEnvNum | | | - A | ALG | ALG | ALG | | AutoEnvDen | AutoEnvDen | | Cutoff | - B | FB | FB | FB | | | Noise AND | | | - C | FMS | FMS | FMS | | | Noise OR | | | - D | AMS | AMS | AMS | | | | | | - 4 | OpMask | OpMask | | | | | | Special | - 5 | | | AMD2 | | | | | Attack | - 6 | | | PMD2 | | | | | Decay | - 7 | | | LFO2Speed | | | | | Sustain | - 8 | | | LFO2Shape | | | | | Release | +ex | FM | OPM | OPZ | OPLL | AY-3-8910 | AY8930 | Lynx | C64 | +---|--------|-----------|-----------|-------|------------|------------|----------|---------------| + D | NoiseF | NoiseFreq | | | NoiseFreq | NoiseFreq | Duty/Int | Duty | + W | | LFO Shape | LFO Shape | Patch | Waveform | Waveform | | Waveform | + 1 | | AMD | AMD | | | Duty | | FilterMode | + 2 | | PMD | PMD | | Envelope | Envelope | | Resonance | + 3 | LFOSpd | LFO Speed | LFO Speed | | AutoEnvNum | AutoEnvNum | | Filter Toggle | + A | ALG | ALG | ALG | | AutoEnvDen | AutoEnvDen | | Cutoff | + B | FB | FB | FB | | | Noise AND | | | + C | FMS | FMS | FMS | | | Noise OR | | | + D | AMS | AMS | AMS | | | | | | + 4 | OpMask | OpMask | | | | | | Special | + 5 | | | AMD2 | | | | | Attack | + 6 | | | PMD2 | | | | | Decay | + 7 | | | LFO2Speed | | | | | Sustain | + 8 | | | LFO2Shape | | | | | Release | ex | SAA1099 | X1-010 | Namco 163 | FDS | Sound Unit | ES5506 | MSM6258 | ---|----------|------------|------------|-----------|------------|-----------|----------| @@ -231,19 +231,61 @@ ex | SAA1099 | X1-010 | Namco 163 | FDS | Sound Unit | ES5506 | M 7 | | | | | | EnvRampK2 | | 8 | | | | | | Env Mode | | -ex | QSound | SNES | MSM5232 | ----|--------------|-----------|-----------| - D | Echo Level | NoiseFreq | GroupCtrl | - W | | Waveform | | - 1 | EchoFeedback | Special | GroupAtk | - 2 | Echo Length | Gain | GroupDec | - 3 | | | Noise | - A | | | | - B | | | | - C | | | | - D | | | | - 4 | | | | - 5 | | | | - 6 | | | | - 7 | | | | - 8 | | | | +ex | QSound | SNES | MSM5232 | SID2 | +---|--------------|-----------|-----------|---------------| + D | Echo Level | NoiseFreq | GroupCtrl | Duty | + W | | Waveform | | Waveform | + 1 | EchoFeedback | Special | GroupAtk | Filter mode | + 2 | Echo Length | Gain | GroupDec | Resonance | + 3 | | | Noise | Filter toggle | + A | | | | Filter cutoff | + B | | | | | + C | | | | Noise mode | + D | | | | Wave mix mode | + 4 | | | | Special | + 5 | | | | Attack | + 6 | | | | Decay | + 7 | | | | Sustain | + 8 | | | | Release | + + +SID3 instrument also uses some of the FM operators macros in main macros list: + +ex | SID3 | +------|-------------------------------| + D | Duty | + W | Waveform | + 1 | Special | + 2 | Attack | + 3 | Decay | + A | Special wave | + B | Phase Mod source | + C | Ring Mod source | + D | Hard sync source | + 4 | Sustain | + 5 | Sustain rate | + 6 | Release | + 7 | LFSR feedback bits | + 8 | Wave mix mode | +OP1 AM| Key On/Off | +OP2 AM| Noise phase reset | +OP3 AM| Envelope reset | +OP4 AM| Noise Arpeggio | +OP1 AR| Noise Pitch | +OP2 AR| 1-bit noise/PCM mode | +OP3 AR| Channel signal inversion | +OP4 AR| Feedback | + +SID3 instrument uses FM operators macros for filters: + +ex | SID3 | +-----|-------------------------------| +D2R | Cutoff | +DAM | Resonance | +DR | Filter toggle | +DT2 | Distortion level | +DT | Output volume | +DVB | Connect to channel input | +EGT | Connect to channel output | +KSL | Connection matrix row | +KSR | Filter mode | diff --git a/doc/4-instrument/README.md b/doc/4-instrument/README.md index 49314e831..8d585d79e 100644 --- a/doc/4-instrument/README.md +++ b/doc/4-instrument/README.md @@ -67,6 +67,7 @@ the following instrument types are available: - [SegaPCM](segapcm.md) - for use with SegaPCM sample chip. - [Seta/Allumer X1-010](x1_010.md) - for use with Wavetable portion in Seta/Allumer X1-010. - [SID2](sid2.md) - for use with SID2 fantasy chip. +- [SID3](sid3.md) - for use with SID3 fantasy chip. - [SM8521](sm8521.md) - for use with SM8521 chip, used in Tiger Game.com. - [SN76489/Sega PSG](psg.md) - for use with TI SN76489 and derivatives like Sega Master System's PSG. - [SNES](snes.md) - for use with SNES. diff --git a/doc/4-instrument/c64.md b/doc/4-instrument/c64.md index 8442560bf..e87f2842c 100644 --- a/doc/4-instrument/c64.md +++ b/doc/4-instrument/c64.md @@ -13,6 +13,8 @@ the C64 instrument editor consists of two tabs: "C64" to control various paramet - **Sustain**: sets the volume level at which the sound stops decaying and holds steady (0 to 15). - **Release**: determines the rate at which the sound fades out after note off. the higher the value, the longer the release (0 to 15). - **Duty**: specifies the width of a pulse wave (0 to 4095). +- **Reset duty on new note**: overwrite current duty value with the one that is specified in the instrument on new note. + - only useful when using relative duty macro. - **Ring Modulation**: when enabled, the channel's output will be multiplied with the previous channel's. - **Oscillator Sync**: enables oscillator hard sync. as the previous channel's oscillator finishes a cycle, it resets the period of the channel's oscillator, forcing the latter to have the same base frequency. this can produce a harmonically rich sound, the timbre of which can be altered by varying the synchronized oscillator's frequency. diff --git a/doc/4-instrument/sid2.md b/doc/4-instrument/sid2.md index 33f67a1b2..cd8901ed4 100644 --- a/doc/4-instrument/sid2.md +++ b/doc/4-instrument/sid2.md @@ -14,6 +14,8 @@ the SID2 instrument editor consists of two tabs: "SID2" to control various param - **Sustain**: sets the volume level at which the sound stops decaying and holds steady (0 to 15). - **Release**: determines the rate at which the sound fades out after note off. the higher the value, the longer the release (0 to 15). - **Duty**: specifies the width of a pulse wave (0 to 4095). +- **Reset duty on new note**: overwrite current duty value with the one that is specified in the instrument on new note. + - only useful when using relative duty macro. - **Ring Modulation**: when enabled, the channel's output will be multiplied with the previous channel's. - **Oscillator Sync**: enables oscillator hard sync. as the previous channel's oscillator finishes a cycle, it resets the period of the channel's oscillator, forcing the latter to have the same base frequency. this can produce a harmonically rich sound, the timbre of which can be altered by varying the synchronized oscillator's frequency. diff --git a/doc/4-instrument/sid3.md b/doc/4-instrument/sid3.md new file mode 100644 index 000000000..a414177fb --- /dev/null +++ b/doc/4-instrument/sid3.md @@ -0,0 +1,142 @@ +# SID3 instrument editor + +the SID3 editor is divided into 8 tabs: + +- **SID3**: for controlling the basic parameters of SID3 sound source. +- **Wavetable**: for controlling the wavetable synth. +- **Sample**: for various sample settings. +- **Macros (Filter 1)**: for macros controlling parameters of filter 1. +- **Macros (Filter 2)**: for macros controlling parameters of filter 2. +- **Macros (Filter 3)**: for macros controlling parameters of filter 3. +- **Macros (Filter 4)**: for macros controlling parameters of filter 4. +- **Macros**: for other macros. + +## Wavetable + +this allows you to enable and configure the Furnace wavetable synthesizer. see [this page](wavesynth.md) for more information. + +## Sample + +for sample settings, see [the Sample instrument editor](sample.md). + +the only differences are the lack of an "Use wavetable" option, and the presence of a "Use sample" one. + +## SID3 + +- **Waveform**: allows selecting a waveform. + - more than one waveform can be selected at once. in that case a logical AND mix of waves will occur... + - although with default mix mode it does occur a bit wrong (like on 8580 SID chip). see below what happens when other modes are in use. +- **Special wave**: allows selecting a special wave. the wave preview is to the right. +- **Wavetable channel**: replaces and hides some macros and UI elements, and makes instrument operate with last wavetable/sample channel: + - **Waveform** macro now selects a wavetable + - **Duty**, **Special Wave**, **Feedback**, **Noise Phase Reset**, **Noise LFSR bits** and **Wave Mix** macros are hidden + - **1-Bit Noise** macro now controls wavetable/PCM mode (it becomes **Sample Mode** macro) +- **Inv. left** and **Inv. right**: invert the signal of corresponding stereo channels. +- **Attack**: determines the rising time for the sound. the bigger the value, the slower the attack. (0 to 255). +- **Decay**: determines the diminishing time for the sound. the higher the value, the longer the decay (0 to 255). +- **Sustain**: sets the volume level at which the sound stops decaying and holds or also decays, but with different speed (0 to 255). +- **Sustain rate**: sets the speed at which the sound decays after reaching sustain volume level. (0 to 255). +- **Release**: determines the rate at which the sound fades out after note off. the higher the value, the longer the release (0 to 255). +- **Wave Mix Mode**: dictates how different waves on the same channel are mixed together. +- **Duty**: specifies the width of a pulse wave (0 to 65535). +- **Feedback**: specifies the feedback level (0 to 255). +- **Reset duty on new note**: overwrite current duty value with the one that is specified in the instrument on new note. + - only useful when using relative duty macro. +- **Absolute Duty Macro**: when enabled, the duty macro will go from 0 to 65535 (in other words, control the duty directly rather than being relative). +- **Ring Modulation**: when enabled, the channel's output will be multiplied with the source channel's. +- **Oscillator Sync**: enables oscillator hard sync. as the source channel's oscillator finishes a cycle, it resets the period of the channel's oscillator, forcing the latter to have the same base frequency. this can produce a harmonically rich sound, the timbre of which can be altered by varying the synchronized oscillator's frequency. +- **Phase Modulation**: when enabled, the channel's phase will be modified with the source channel's signal (signal is taken from filtered channel's output if filters are enabled). +- **Separate noise pitch**: when enabled, the noise frequency/pitch will be controllable via special macros: **Noise Arpeggio** and **Noise Pitch**. + +Then follow controls for each of the 4 filters: + +- **Enable filter**: when enabled, this instrument will go through the filter. +- **Initialize filter**: initializes the filter with the specified parameters: + - **Cutoff**: the filter's point in where frequencies are cut off (0 to 65535). + - **Resonance**: amplifies or focuses on the cutoff frequency, creating a secondary peak forms and colors the original pitch (0 to 255). + - **Filter mode**: sets the filter mode. you may pick one or more of the following: + - **low**: a low-pass filter. the lower the cutoff, the darker the sound. + - **high**: a high-pass filter. higher cutoff values result in a less "bassy" sound. + - **band**: a band-pass filter. cutoff determines which part of the sound is heard (from bass to treble). + - multiple filter modes can be selected simultaneously. for example, selecting both "low" and "high" results in a bandstop (notch) filter. + - **Output volume**: sets the filter output volume (0 to 255). + - **Distortion level**: dictates how hard the signal is distorted (soft clipping). distortion is slightly asymmetrical (0 to 255). +- **Absolute Cutoff Macro**: when enabled, the cutoff macro will go from 0 to 65535, and it will be absolute. +- **Change cutoff with pitch**: when enabled, the cutoff will be scaled according to the frequency offset from specified note. + - **Decrease cutoff when pitch increases**: if this is enabled, filter cutoff will decrease if you increase the pitch. if this is disabled, filter cutoff will increase if you increase the pitch. + - **Cutoff change center note**: this note marks the center frequency at which no cutoff scaling is happening. the further you go from it in each direction, the more the cutoff scaling will be. + - **Cutoff change strength**: how much cutoff will be scaled. +- **Change resonance with pitch**: when enabled, the resonance will be scaled according to the frequency offset from specified note. + - **Decrease resonance when pitch increases**: if this is enabled, filter resonance will decrease if you increase the pitch. if this is disabled, filter resonance will increase if you increase the pitch. + - **Resonance change center note**: this note marks the center frequency at which no resonance scaling is happening. the further you go from it in each direction, the more the resonance scaling will be. + - **Resonance change strength**: how much resonance will be scaled. +- **Filters connection matrix**: controls routing of the filters' signals. + - **In**: this column connects the filters to ADSR sound output. + - next 4 columns make up the inter-filters connection matrix. + - **Out**: this column connects the filters' output to final channel output. + + +### special noise LFSR configurations + +this table contains a list of LFSR configurations that are automatically detected and brought to tune by Furnace. a short description is given. number needs to be pasted into **Noise LFSR bits** macro. it is recommended to place a single bar in **Noise Phase Reset** macro for the consistency of the wave. + +| LFSR config | Description | +|--------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------:| +| 524288 | wave very close to [SID2](sid2.md) noise mode 1 wave. tonal, without very harsh overtones. | +| 541065280 | wave resembling vocals, has two main tones at least 2 octaves apart | +| 2068 | wave very close to SID2 noise mode 3 wave. tonal but with harsh timbre. | +| 66 | wave very close to SID2 noise mode 2 wave. timbre is somewhere in-between SID2's noise mode 1 and noise mode 3 waves. | + +if you find more interesting waves, please contact LTVA or tildearrow, so they can be added to Furnace frequency correction routine and to this table. + +## Filter `x` macros + +- **Cutoff**: filter `x` cutoff sequence. +- **Resonance**: filter `x` resonance sequence. +- **Filter toggle**: turns filter `x` on and off. +- **Filter mode**: select filter `x` mode. +- **Distortion level**: filter `x` distortion level sequence. +- **Output Volume**: filter `x` output volume sequence. +- **Channel Input Connection**: connect filter `x` to channel ADSR output. +- **Channel Output Connection**: connect filter `x` output to final channel output. +- **Connection Matrix Row**: connect other filters' outputs to filter `x` input. + +## Macros + +- **Volume**: volume sequence. +- **Arpeggio**: pitch sequence. +- **Pitch**: fine pitch. +- **Duty**: pulse width sequence. +- **Waveform**: select the waveform used by instrument. + - in wavetable channel mode controls the wavetable index. +- **Special Wave**: select the special wave used by instrument. +- **Noise Arpeggio**: noise pitch sequence. + - this macro is visible only if **Separate noise pitch** option is enabled. otherwise noise pitch is controlled by **Arpeggio** and **Pitch** macros. +- **Noise Pitch**: fine pitch. + - this macro is visible only if **Separate noise pitch** option is enabled. +- **Panning (left)**: output level for left channel. +- **Panning (right)**: output level for right channel. +- **Channel Inversion**: invert signal of left and right channels. +- **Key On/Off**: envelope release/start again control. +- **Special**: ring, oscillator sync and phase modulation selector. +- **Ring Mod Source**: ring modulation source channel. +- **Hard Sync Source**: oscillator sync source channel. +- **Phase Mod Source**: phase modulation source channel. +- **Feedback**: feedback sequence +- **Phase Reset**: trigger restart of waveform. +- **Noise Phase Reset**: trigger restart of noise accumulator and LFSR. +- **Envelope Reset**: trigger restart of envelope (unlike key on/off, envelope is forced to restart from 0 volume level no matter which volume it is outputting now). +- **Attack**: sets envelope attack speed. + - if you modify attack speed when the envelope is in attack phase it immediately changes. +- **Decay**: sets envelope decay speed. + - if you modify decay speed when envelope is in decay phase it immediately changes. +- **Sustain**: sets envelope sustain level. + - if you modify sustain level when envelope is in sustain phase it immediately changes. +- **Sustain Rate**: sets envelope sustain rate. + - if you modify sustain rate when envelope is in sustain phase it immediately changes. +- **Release**: sets envelope release speed. + - if you modify release speed when envelope is in release phase it immediately changes. +- **Noise LFSR bits**: sets feedback bits of noise LFSR. +- **1-Bit Noise**: controls noise mode. + - in wavetable channel mode it's called **Sample Mode**, and macro controls wave/PCM mode of the last channel. +- **Wave Mix**: select the waveform mix mode. diff --git a/doc/7-systems/README.md b/doc/7-systems/README.md index a77c10588..b89472683 100644 --- a/doc/7-systems/README.md +++ b/doc/7-systems/README.md @@ -102,6 +102,7 @@ this is the full list of chips that Furnace supports. - [SAA1099](saa1099.md) - [SegaPCM](segapcm.md) - [SID2](sid2.md) +- [SID3](sid3.md) - [SM8521](sm8521.md) - [SN76489/Sega PSG](sms.md) - [SNES](snes.md) diff --git a/doc/7-systems/c64.md b/doc/7-systems/c64.md index eb66d4027..06fc55796 100644 --- a/doc/7-systems/c64.md +++ b/doc/7-systems/c64.md @@ -62,6 +62,14 @@ two versions of aforementioned chip exist - 6581 (original chip) and 8580 (impro - `21xy`: **set sustain/release.** - `x` is the sustain. - `y` is the release. +- `22xx`: **pulse width slide up.** + - `xx` is speed. if it is `00`, the slide is stopped. +- `23xx`: **pulse width slide down.** + - `xx` is speed. if it is `00`, the slide is stopped. +- `24xx`: **filter cutoff slide up.** + - `xx` is speed. if it is `00`, the slide is stopped. +- `25xx`: **filter cutoff slide down.** + - `xx` is speed. if it is `00`, the slide is stopped. - `3xxx`: **set duty cycle.** `xxx` range is `000` to `FFF`. - `4xxx`: **set cutoff.** `xxx` range is `000` to `7FF`. diff --git a/doc/7-systems/sid2.md b/doc/7-systems/sid2.md index 0e84200af..6f5a370dd 100644 --- a/doc/7-systems/sid2.md +++ b/doc/7-systems/sid2.md @@ -1,10 +1,10 @@ # SID2 -a fictional chip created by LTVA. the idea is to fix SID flaws and add more features, but not too much. +a fictional chip created by LTVA. the idea is to fix [SID](c64.md) flaws and add more features, but not too much. unlike SID, it has per-channel volume control, better ADSR envelope which doesn't have bugs, more waveform mixing modes and the ability to play tonal noise waves. -filter cutoff and resonance ranges were extended, as well as the frequency - finally the chip can hit B-7 note with default clock speed! +each channel now has its own independent filter. filter cutoff and resonance ranges were extended, as well as the frequency - finally the chip can hit B-7 note with default clock speed! ## effects @@ -46,6 +46,14 @@ filter cutoff and resonance ranges were extended, as well as the frequency - fin - `9`: phase reset (`y` is a discarded parameter and does not matter) - `A`: envelope key on/key off (`y` is `0` (trigger envelope release) or `1` (restart envelope again)) - `B`: filter on/off (`y` is `0` (disable filter) or `1` (enable filter)) +- `17xx`: **pulse width slide up.** + - `xx` is speed. if it is `00`, the slide is stopped. +- `18xx`: **pulse width slide down.** + - `xx` is speed. if it is `00`, the slide is stopped. +- `19xx`: **filter cutoff slide up.** + - `xx` is speed. if it is `00`, the slide is stopped. +- `1Axx`: **filter cutoff slide down.** + - `xx` is speed. if it is `00`, the slide is stopped. - `3xxx`: **set duty cycle.** `xxx` range is `000` to `FFF`. - `4xxx`: **set cutoff.** `xxx` range is `000` to `FFF`. diff --git a/doc/7-systems/sid3.md b/doc/7-systems/sid3.md new file mode 100644 index 000000000..c00671295 --- /dev/null +++ b/doc/7-systems/sid3.md @@ -0,0 +1,123 @@ +# SID3 + +a fictional chip created by LTVA. the idea is to stay vaguely in [SID](c64.md)-like category of chips, but add a lot of features and more channels. + +chip has 6 synth channels and one channel capable of playing wavetable or streamed samples. + +each of synth channels has the following: + +- two phase accumulator based oscillators, one for tone and one for noise LFSR clocking; frequency range is from 0.001Hz to around 15kHz at default clock speed. +- 5 waveform types which can be enabled in any combination: pulse (with 16-bit pulse width control), triangle, sawtooth, noise and so called special wave. + - there are 58 different special waves, including all [OPL3](opl.md) and [OPZ](opz.md) waveforms, their clipped versions, cubed sawtooth and triangle variations, and more... + - noise is generated from 30-bit LFSR. like in C64, eight of the bits are used to form 8-bit noise signal. user can adjust feedback freely, any bit can be feedback bit. some feedback bits configurations produce very short looped noise which is perceived as tone. see SID3 instrument description for notable feedback bits configurations which are automatically detected by Furnace: upon detection noise frequency is adjusted in such a way that fundamental frequency of such tonal noise becomes the note frequency the channel is currently playing (noise stays in tune). + - 1-bit noise mode is available for [AY](ay8910.md) fans. it this mode the highest LFSR bit is read as output. by rapidly switching between usual and 1-bit noise modes one can produce interesting rattling-like percussive sound. +- 5 waveform mixing modes: 8580 SID (C64's combined waves; mode does bitwise AND with noise and special wave), bitwise AND, bitwise OR, bitwise XOR and sum of oscillators' signals. +- hard sync between channels. each channel can have any other channel as sync source, even itself. +- ring modulation between channels. each channel can have any other channel as modulation source, even itself. when you self-modulate, you effectively square the signal, but the behavior is a bit different. +- phase modulation between channels. each channel can have any other channel as modulation source, even itself. when you self-modulate, you have an effect similar to enabling strong feedback. channel output after filters is used as modulation source. +- ADSR envelope with sustain rate setting (how fast sound decays when envelope is in sustain phase). +- 4 independent filters. each filter has its own cutoff, resonance, output volume, mode, on/off and distortion setting. each filter can be connected to channel's ADSR output. each filter's output can be routed to the final channel output. each filter output can be connected to each filter's input (full connection matrix). + - distortion is a simple asymmetrical distortion with hyperbolic tangent function for positive half of the wave and exponential function for negative half. + - several filters can be chained for flexible subtractive synth or to increase filter's slope (which is 12 dB/octave for a single filter). + - multiple filter modes can be selected simultaneously. for example, selecting both "low" and "high" results in a bandstop (notch) filter. +- adjustable feedback. feedback saves two previous channel's outputs and adds them to accumulator on the next step before computing waveform signal. +- fine control over left and right channel panning. +- left and right channels' signals can be inverted to create simple "surround" sound. + +ADSR can be reset to the start of attack phase. phase of tone and noise oscillators can also be reset, and with noise oscillator reset noise LFSR is also reset to initial state. + +wave channel has all these features, except, obviously, waveform generation stage, as well as feedback and noise generator. + +## effects + +- `1xxx`: **set filter 1 cutoff.** `xxx` range is `000` to `FFF`. +- `2xxx`: **set filter 2 cutoff.** `xxx` range is `000` to `FFF`. +- `3xxx`: **set filter 3 cutoff.** `xxx` range is `000` to `FFF`. +- `4xxx`: **set filter 4 cutoff.** `xxx` range is `000` to `FFF`. +- `5xxx`: **set duty cycle.** `xxx` range is `000` to `FFF`. +- `60xx`: **change wave.** lower 5 bits specify the wave: + - `bit 0`: triangle + - `bit 1`: saw + - `bit 2`: pulse + - `bit 3`: noise + - `bit 4`: special wave +- `61xx`: **change special wave.** `xx` range is `00` to `39`. +- `62xx`: **modulation control.** lower 3 bits control the modulation: + - `bit 0`: ring modulation + - `bit 1`: oscillator sync + - `bit 2`: phase modulation +- `63xy`: **reset duty cycle**: + - if `x` is not 0: on new note + - if `y` is not 0: now +- `64xx`: **set ring modulation source channel.** `xx` range is `00` to `07` where `07` means self-modulation and lower values specify a source channel. +- `65xx`: **set hard sync source channel.** `xx` is `00` to `06`. +- `66xx`: **set phase modulation source channel.** `xx` is `00` to `06`. +- `67xx`: **set attack.** `xx` range is `00` to `FF`. +- `68xx`: **set decay.** `xx` range is `00` to `FF`. +- `69xx`: **set sustain level.** `xx` range is `00` to `FF`. +- `6Axx`: **set sustain rate.** `xx` range is `00` to `FF`. +- `6Bxx`: **set release.** `xx` range is `00` to `FF`. +- `6Cxx`: **set waveform mix mode.** `xx` range is `00` to `04`. +- `6Dxx`: **set noise LFSR feedback bits (lower byte).** `xx` range is `00` to `FF`. +- `6Exx`: **set noise LFSR feedback bits (medium byte).** `xx` range is `00` to `FF`. +- `6Fxx`: **set noise LFSR feedback bits (higher byte).** `xx` range is `00` to `FF`. +- `70xx`: **set noise LFSR feedback bits (highest bits).** `xx` range is `00` to `3F`. +- `71xx`: **set filter 1 resonance.** `xx` range is `00` to `FF`. +- `72xx`: **set filter 2 resonance.** `xx` range is `00` to `FF`. +- `73xx`: **set filter 3 resonance.** `xx` range is `00` to `FF`. +- `74xx`: **set filter 4 resonance.** `xx` range is `00` to `FF`. +- `75xx`: **set noise/wave channel mode.** `xx` range is `00` to `01`. on synth channels `00` sets usual noise mode and `01` sets 1-bit noise mode. on wave channel `00` sets wavetable mode and `01` sets streamed PCM sample playback mode. +- `76xx`: **set filter 1 output volume.** `xx` range is `00` to `FF`. +- `77xx`: **set filter 2 output volume.** `xx` range is `00` to `FF`. +- `78xx`: **set filter 3 output volume.** `xx` range is `00` to `FF`. +- `79xx`: **set filter 4 output volume.** `xx` range is `00` to `FF`. +- `7Axx`: **set filter 1 distortion.** `xx` range is `00` to `FF`. +- `7Bxx`: **set filter 2 distortion.** `xx` range is `00` to `FF`. +- `7Cxx`: **set filter 3 distortion.** `xx` range is `00` to `FF`. +- `7Dxx`: **set filter 4 distortion.** `xx` range is `00` to `FF`. +- `7Exx`: **set feedback.** `xx` range is `00` to `FF`. +- `7Fxx`: **channel inversion control.** lower 2 bits control the channel signal inversion: + - `bit 0`: invert right channel + - `bit 1`: invert left channel +- `A0xy`: **set filter mode.** `x` is the filter (`0-3`), and lower 3 bits of `y` control the mode: + - `bit 0`: low pass + - `bit 1`: band pass + - `bit 2`: high pass +- `A1xy`: **set filter connection.** `x` is the filter (`0-3`), and lower 2 bits of `y` control the connection: + - `bit 0`: connect filter input to channel's ADSR output + - `bit 1`: connect filter's output to final channel output +- `A2xy`: **set filter connection matrix row.** `x` is the filter (`0-3`), and lower 4 bits of `y` control the inter-filter connections: + - `bit 0`: connect filter input to filter 1 output + - `bit 1`: connect filter input to filter 2 output + - `bit 2`: connect filter input to filter 3 output + - `bit 3`: connect filter input to filter 4 output +- `A3xy`: **enable filter.** `x` is the filter (`0-3`), `y` is either `0` (filter disabled) or `1` (filter enabled). +- `A4xx`: **pulse width slide up.** `xx` is speed. `A400` stops the slide. +- `A5xx`: **pulse width slide down.** `xx` is speed. `A500` stops the slide. +- `A6xx`: **filter 1 cutoff slide up.** `xx` is speed. `A600` stops the slide. +- `A7xx`: **filter 1 cutoff slide down.** `xx` is speed. `A700` stops the slide. +- `A8xx`: **filter 2 cutoff slide up.** `xx` is speed. `A800` stops the slide. +- `A9xx`: **filter 2 cutoff slide down.** `xx` is speed. `A900` stops the slide. +- `AAxx`: **filter 3 cutoff slide up.** `xx` is speed. `AA00` stops the slide. +- `ABxx`: **filter 3 cutoff slide down.** `xx` is speed. `AB00` stops the slide. +- `ACxx`: **filter 4 cutoff slide up.** `xx` is speed. `AC00` stops the slide. +- `ADxx`: **filter 4 cutoff slide down.** `xx` is speed. `AD00` stops the slide. +- `AExx`: **tone phase reset.** `xx` is the tick on which the phase reset happens. +- `AFxx`: **noise phase reset.** `xx` is the tick on which the phase reset happens. +- `B0xx`: **envelope reset.** `xx` is the tick on which the envelope reset happens. +- `B1xy`: **filter cutoff scaling control.** `x` is the filter (`0-3`), and lower 2 bits of `y` control the scaling: + - `bit 0`: enable cutoff scaling + - `bit 1`: inverse cutoff scaling +- `B2xy`: **filter resonance scaling control.** `x` is the filter (`0-3`), and lower 2 bits of `y` control the scaling: + - `bit 0`: enable resonance scaling + - `bit 1`: inverse resonance scaling + +## info + +this chip uses the [SID3](../4-instrument/sid3.md) instrument editor. + +## chip config + +the following options are available in the Chip Manager window: + +- **Quarter clock speed**: make chip run on quarter the default clock rate (1MHz is default). this lowers CPU load almost 4 times at the cost of filters becoming unstable or having different timbre at high cutoff and resonance settings. option affects the chip only in playback mode. when you render module into audio file, option is not applied. diff --git a/papers/newIns.md b/papers/newIns.md index 96cb02755..d983a3d2e 100644 --- a/papers/newIns.md +++ b/papers/newIns.md @@ -158,9 +158,10 @@ the following feature codes are recognized: - `EF`: ESFM ins data - `PN`: PowerNoise ins data - `S2`: SID2 ins data +- `S3`: SID3 ins data - `EN`: end of features - if you find this feature code, stop reading the instrument. - - it will usually appear only when there sample/wave lists. + - it will usually appear only when there are sample/wave lists. - instruments in a .fur shall end with this feature code. # instrument name (NA) @@ -335,6 +336,8 @@ size | description | - bit 12-15: resonance | - bit 0-10: cutoff (0-11 on SID2) 1 | upper nibble of resonance (for SID2) (>=199) + | - bits 0-3 hold this upper nibble + | - bit 4: reset duty on new note (>=222) ``` ## C64 compatibility note (>=187) @@ -691,3 +694,78 @@ size | description | - bit 4-5: wave mix mode | - bit 0-3: volume ``` + +# SID3 data (S3) + +``` +size | description +-----|------------------------------------ + 1 | flags 1 + | - bit 7: dutyIsAbs + | - bit 3: noise on + | - bit 2: pulse on + | - bit 1: saw on + | - bit 0: triangle on + 1 | attack + 1 | decay + 1 | sustain + 1 | sustain rate + 1 | release + 1 | wave mix mode + 2 | duty + 1 | flags 2 + | - bit 7: phase modulation + | - bit 6: enable special wave + | - bit 5: 1-bit noise + | - bit 4: separate noise pitch + | - bit 3: do wavetable + | - bit 2: reset duty on new note + | - bit 1: osc sync + | - bit 0: ring mod + 1 | phase modulation source channel + 1 | ring modulation source channel + 1 | hard sync source channel + 1 | special wave + 1 | flags 3 + | - bit 1: left channel signal inversion + | - bit 0: right channel signal inversion + 1 | feedback + 1 | number of filters +``` + +then, `number of filters` times, come settings for each filter: + +``` +size | description +-----|------------------------------------ + 1 | parameters + | - bit 7: enable filter + | - bit 6: initialize filter + | - bit 5: absolute cutoff macro + | - bit 4: enable cutoff scaling + | - bit 3: decrease cutoff when pitch increases (for cutoff scaling) + | - bit 2: scale cutoff only once, on new note + | - bit 1: enable resonance scaling + | - bit 0: decrease resonance when pitch increases (for resonance scaling) + 1 | parameters + | - bit 7: scale resonance only once, on new note + 2 | filter cutoff + 1 | filter resonance + 1 | filter output volume + 1 | filter distortion level + 1 | filter mode: + | - bit 5: connect filter output to channel master output + | - bit 4: connect filter input to channel ADSR output + | - bit 2: band pass + | - bit 1: high pass + | - bit 0: low pass + 1 | matrix connection: + | - bit 3: connect output of filter 4 to input + | - bit 2: connect output of filter 3 to input + | - bit 1: connect output of filter 2 to input + | - bit 0: connect output of filter 1 to input + 1 | cutoff scaling level + 1 | cutoff scaling center note: `0` is `c_5`, `1` is `c+5`, ..., `179` is `B-9` + 1 | resonance scaling level + 1 | resonance scaling center note: `0` is `c_5`, `1` is `c+5`, ..., `179` is `B-9` +``` diff --git a/res/icons.sfd b/res/icons.sfd index d8f194a85..5d3c5e292 100644 --- a/res/icons.sfd +++ b/res/icons.sfd @@ -21,7 +21,7 @@ OS2Version: 0 OS2_WeightWidthSlopeOnly: 0 OS2_UseTypoMetrics: 0 CreationTime: 1691897631 -ModificationTime: 1714372595 +ModificationTime: 1726291788 PfmFamily: 81 TTFWeight: 400 TTFWidth: 5 @@ -53,7 +53,7 @@ FitToEm: 0 WinInfo: 57540 21 12 BeginPrivate: 0 EndPrivate -BeginChars: 65536 104 +BeginChars: 65536 107 StartChar: space Encoding: 32 32 0 @@ -7381,7 +7381,7 @@ EndChar StartChar: uniE161 Encoding: 57697 57697 103 Width: 1792 -Flags: HWO +Flags: HW LayerCount: 2 Fore SplineSet @@ -7483,5 +7483,239 @@ SplineSet 1289.22949219 805.58984375 1332.14550781 805.58984375 1375.0625 805.58984375 c 1 EndSplineSet EndChar + +StartChar: uniE162 +Encoding: 57698 57698 104 +Width: 1792 +Flags: HW +LayerCount: 2 +Fore +SplineSet +509.96484375 84.8447265625 m 0 + 439.5546875 84.8447265625 379.7890625 97.6376953125 330.5703125 123.223632812 c 128 + 281.3515625 148.809570312 239.1640625 183.184570312 204.0078125 226.446289062 c 1 + 235.192382812 255.645507812 266.377929688 284.844726562 297.5625 314.043945312 c 1 + 327.15234375 278.008789062 359.76953125 250.762695312 395.31640625 232.403320312 c 128 + 430.9609375 214.043945312 471.5859375 204.766601562 517.19140625 204.766601562 c 0 + 570.8046875 204.766601562 611.13671875 216.778320312 638.3828125 240.801757812 c 128 + 665.53125 264.825195312 679.203125 297.247070312 679.203125 337.969726562 c 0 + 679.203125 370.782226562 669.53515625 396.758789062 650.39453125 415.997070312 c 128 + 631.15625 435.235351562 597.171875 449.590820312 548.34375 459.161132812 c 1 + 523.5390625 463.587890625 498.734375 468.014648438 473.9296875 472.442382812 c 1 + 392.38671875 487.579101562 331.15625 514.434570312 290.3359375 552.813476562 c 128 + 249.515625 591.192382812 229.203125 644.024414062 229.203125 711.211914062 c 0 + 229.203125 748.028320312 236.13671875 781.426757812 250.19921875 811.407226562 c 128 + 264.1640625 841.387695312 283.79296875 866.583007812 308.98828125 886.993164062 c 128 + 334.18359375 907.403320312 364.75 923.223632812 400.78515625 934.356445312 c 128 + 436.72265625 945.586914062 477.15234375 951.153320312 521.9765625 951.153320312 c 0 + 585.16015625 951.153320312 639.9453125 940.215820312 686.33203125 918.243164062 c 128 + 732.71875 896.172851562 772.3671875 864.434570312 805.1796875 822.833007812 c 1 + 773.571289062 794.837890625 741.963867188 766.842773438 710.35546875 738.848632812 c 1 + 688.7734375 766.778320312 662.40625 789.239257812 631.15625 806.036132812 c 128 + 600.00390625 822.833007812 561.13671875 831.231445312 514.75 831.231445312 c 0 + 466.80078125 831.231445312 429.59375 821.563476562 403.12890625 802.422851562 c 128 + 376.76171875 783.184570312 363.578125 755.157226562 363.578125 718.438476562 c 0 + 363.578125 683.184570312 374.3203125 657.012695312 396 639.825195312 c 128 + 417.58203125 622.637695312 451.17578125 609.551757812 496.78125 600.762695312 c 1 + 521.5859375 595.586914062 546.390625 590.411132812 571.1953125 585.235351562 c 1 + 655.1796875 569.219726562 716.60546875 541.973632812 755.375 503.594726562 c 128 + 794.14453125 465.215820312 813.578125 412.383789062 813.578125 345.196289062 c 0 + 813.578125 306.036132812 806.7421875 270.391601562 793.16796875 238.360351562 c 128 + 779.59375 206.426757812 759.76953125 178.985351562 733.79296875 156.231445312 c 128 + 707.71875 133.379882812 675.98046875 115.801757812 638.3828125 103.399414062 c 128 + 600.78515625 90.9970703125 557.9140625 84.8447265625 509.96484375 84.8447265625 c 0 +1152.34765625 99.2001953125 m 1 + 1060.74609375 378.399414062 969.14453125 657.598632812 877.54296875 936.797851562 c 1 + 924.352539062 936.797851562 971.163085938 936.797851562 1017.97265625 936.797851562 c 1 + 1062.37402344 798.809570312 1106.77441406 660.821289062 1151.17578125 522.833007812 c 1 + 1177.96582031 425.631835938 1204.75683594 328.431640625 1231.546875 231.231445312 c 1 + 1233.14160156 231.231445312 1234.73730469 231.231445312 1236.33203125 231.231445312 c 1 + 1263.54589844 328.431640625 1290.75878906 425.631835938 1317.97265625 522.833007812 c 1 + 1362.37402344 660.821289062 1406.77441406 798.809570312 1451.17578125 936.797851562 c 1 + 1496.78125 936.797851562 1542.38671875 936.797851562 1587.9921875 936.797851562 c 1 + 1495.18652344 657.598632812 1402.37988281 378.399414062 1309.57421875 99.2001953125 c 1 + 1257.16503906 99.2001953125 1204.75683594 99.2001953125 1152.34765625 99.2001953125 c 1 +EndSplineSet +EndChar + +StartChar: uniE163 +Encoding: 57699 57699 105 +Width: 1792 +Flags: HW +LayerCount: 2 +Fore +SplineSet +232.71875 -140.838867188 m 1 + 232.71875 147.181640625 232.71875 435.202148438 232.71875 723.223632812 c 1 + 276.338867188 723.223632812 319.958007812 723.223632812 363.578125 723.223632812 c 1 + 363.578125 596.400390625 363.578125 469.577148438 363.578125 342.754882812 c 1 + 363.578125 245.977539062 403.6171875 197.637695312 483.6953125 197.637695312 c 0 + 500.4921875 197.637695312 516.8984375 199.786132812 532.71875 204.180664062 c 128 + 548.734375 208.575195312 562.9921875 215.215820312 575.4921875 224.004882812 c 128 + 587.796875 232.793945312 597.7578125 244.024414062 605.375 257.598632812 c 128 + 612.9921875 271.172851562 616.8984375 287.188476562 616.8984375 305.645507812 c 1 + 616.8984375 444.837890625 616.8984375 584.030273438 616.8984375 723.223632812 c 1 + 660.453125 723.223632812 704.0078125 723.223632812 747.5625 723.223632812 c 1 + 747.5625 515.215820312 747.5625 307.208007812 747.5625 99.2001953125 c 1 + 704.0078125 99.2001953125 660.453125 99.2001953125 616.8984375 99.2001953125 c 1 + 616.8984375 133.607421875 616.8984375 168.014648438 616.8984375 202.422851562 c 1 + 615.270507812 202.422851562 613.643554688 202.422851562 612.015625 202.422851562 c 1 + 606.3515625 187.188476562 599.125 172.442382812 590.3359375 157.989257812 c 128 + 581.546875 143.633789062 570.8046875 131.036132812 558.109375 120.196289062 c 128 + 545.21875 109.356445312 530.1796875 100.762695312 512.9921875 94.4150390625 c 128 + 495.8046875 87.9697265625 476.46875 84.8447265625 454.7890625 84.8447265625 c 0 + 402.8359375 84.8447265625 367.6796875 103.985351562 349.125 142.364257812 c 1 + 347.5625 142.364257812 346 142.364257812 344.4375 142.364257812 c 1 + 350.817382812 99.5908203125 357.198242188 56.8173828125 363.578125 14.0439453125 c 1 + 363.578125 -37.583984375 363.578125 -89.2119140625 363.578125 -140.838867188 c 1 + 319.958007812 -140.838867188 276.338867188 -140.838867188 232.71875 -140.838867188 c 1 +1256.7421875 84.8447265625 m 0 + 1147.171875 84.8447265625 1061.234375 121.758789062 998.734375 195.782226562 c 128 + 936.4296875 269.805664062 905.1796875 377.227539062 905.1796875 518.047851562 c 0 + 905.1796875 588.360351562 913.1875 650.372070312 929.203125 703.985351562 c 128 + 945.21875 757.598632812 968.4609375 802.813476562 998.734375 839.629882812 c 128 + 1029.203125 876.446289062 1066.1171875 904.180664062 1109.8671875 923.028320312 c 128 + 1153.421875 941.778320312 1202.4453125 951.153320312 1256.7421875 951.153320312 c 0 + 1329.59375 951.153320312 1390.53125 935.235351562 1439.75 903.204101562 c 128 + 1488.96875 871.172851562 1527.640625 824.004882812 1555.5703125 761.602539062 c 1 + 1517.61425781 740.801757812 1479.65917969 720.000976562 1441.703125 699.200195312 c 1 + 1427.25 739.239257812 1404.984375 770.977539062 1375.1015625 794.610351562 c 128 + 1345.0234375 818.243164062 1305.5703125 829.961914062 1256.7421875 829.961914062 c 0 + 1192.09375 829.961914062 1141.1171875 807.989257812 1104.3984375 764.043945312 c 128 + 1067.6796875 720.000976562 1049.125 659.161132812 1049.125 581.622070312 c 1 + 1049.125 539.206054688 1049.125 496.791015625 1049.125 454.375976562 c 1 + 1049.125 376.836914062 1067.6796875 315.997070312 1104.3984375 271.954101562 c 128 + 1141.1171875 228.008789062 1192.09375 206.036132812 1256.7421875 206.036132812 c 0 + 1307.1328125 206.036132812 1348.1484375 219.024414062 1379.7890625 245.000976562 c 128 + 1411.4296875 270.977539062 1434.8671875 304.375976562 1450.1015625 345.196289062 c 1 + 1486.49511719 323.190429688 1522.88769531 301.185546875 1559.28125 279.180664062 c 1 + 1531.15625 218.438476562 1492.09375 170.782226562 1441.703125 136.407226562 c 128 + 1391.1171875 102.032226562 1329.59375 84.8447265625 1256.7421875 84.8447265625 c 0 +EndSplineSet +EndChar + +StartChar: uniE164 +Encoding: 57700 57700 106 +Width: 1792 +Flags: HW +LayerCount: 2 +Fore +SplineSet +876.9375 252.015625 m 1 + 918.578125 252.015625 949.28125 260.84375 969.125 278.421875 c 128 + 988.96875 296.078125 998.890625 318.578125 998.890625 346.15625 c 1 + 998.890625 348.395507812 998.890625 350.635742188 998.890625 352.875 c 1 + 998.890625 383.578125 989.28125 407.09375 970.0625 423.421875 c 128 + 950.921875 439.75 924.984375 447.875 892.328125 447.875 c 0 + 860.296875 447.875 833.109375 440.6875 810.765625 426.3125 c 128 + 788.34375 411.859375 769.4375 391.859375 754.125 366.3125 c 1 + 730.114257812 387.09375 706.104492188 407.875 682.09375 428.65625 c 1 + 692.328125 443.421875 703.890625 457.484375 716.625 470.921875 c 128 + 729.4375 484.359375 744.515625 496.078125 761.78125 506 c 128 + 779.046875 515.921875 798.578125 523.890625 820.296875 529.984375 c 128 + 842.09375 536.078125 867.015625 539.046875 895.21875 539.046875 c 0 + 926.546875 539.046875 955.6875 535.21875 982.5625 527.5625 c 128 + 1009.4375 519.90625 1032.484375 508.5 1051.703125 493.5 c 128 + 1070.921875 478.421875 1085.921875 460.21875 1096.78125 438.734375 c 128 + 1107.71875 417.328125 1113.109375 393.1875 1113.109375 366.3125 c 0 + 1113.109375 345.140625 1109.75 326 1103.03125 308.65625 c 128 + 1096.3125 291.390625 1087.015625 276.234375 1075.21875 263.109375 c 128 + 1063.34375 249.984375 1049.59375 239.28125 1033.96875 230.921875 c 128 + 1018.265625 222.640625 1001.78125 216.546875 984.515625 212.71875 c 1 + 984.515625 211.104492188 984.515625 209.489257812 984.515625 207.875 c 1 + 1003.65625 204.046875 1021.78125 197.796875 1038.734375 189.203125 c 128 + 1055.6875 180.53125 1070.609375 169.359375 1083.34375 155.53125 c 128 + 1096.15625 141.78125 1106.234375 125.453125 1113.578125 106.625 c 128 + 1121 87.71875 1124.671875 66.15625 1124.671875 41.78125 c 0 + 1124.671875 12.328125 1118.890625 -14.390625 1107.40625 -38.375 c 128 + 1095.84375 -62.359375 1079.671875 -82.984375 1058.890625 -100.25 c 128 + 1038.109375 -117.59375 1012.953125 -130.796875 983.5 -140.09375 c 128 + 954.125 -149.390625 921.46875 -154 885.609375 -154 c 0 + 854.28125 -154 826.703125 -150.640625 803.03125 -143.921875 c 128 + 779.359375 -137.203125 758.421875 -128.296875 740.140625 -117.046875 c 128 + 721.9375 -105.875 705.921875 -93.0625 692.171875 -78.6875 c 128 + 678.421875 -64.3125 666.390625 -49.390625 656.15625 -34 c 1 + 682.71875 -13.21875 709.28125 7.5625 735.84375 28.34375 c 1 + 744.203125 14.90625 752.953125 2.640625 762.25 -8.609375 c 128 + 771.546875 -19.78125 782.09375 -29.390625 793.96875 -37.359375 c 128 + 805.765625 -45.40625 819.203125 -51.65625 834.28125 -56.109375 c 128 + 849.28125 -60.5625 866.390625 -62.828125 885.609375 -62.828125 c 0 + 926.546875 -62.828125 957.953125 -53.0625 979.671875 -33.53125 c 128 + 1001.46875 -14 1012.328125 13.03125 1012.328125 47.5625 c 1 + 1012.328125 49.8017578125 1012.328125 52.0419921875 1012.328125 54.28125 c 1 + 1012.328125 88.8125 1000.84375 115.0625 977.796875 133.03125 c 128 + 954.75 150.921875 922.09375 159.90625 879.828125 159.90625 c 1 + 856.15625 159.90625 832.484375 159.90625 808.8125 159.90625 c 1 + 808.8125 190.609375 808.8125 221.3125 808.8125 252.015625 c 1 + 831.520507812 252.015625 854.229492188 252.015625 876.9375 252.015625 c 1 +378.5 712.015625 m 0 + 322.25 712.015625 274.4375 722.25 235.0625 742.71875 c 128 + 195.6875 763.1875 161.9375 790.6875 133.8125 825.296875 c 1 + 158.760742188 848.65625 183.708007812 872.015625 208.65625 895.375 c 1 + 232.25 866.546875 258.34375 844.75 286.78125 830.0625 c 128 + 315.375 815.375 347.875 807.953125 384.28125 807.953125 c 0 + 427.25 807.953125 459.4375 817.5625 481.3125 836.78125 c 128 + 503.03125 856 513.96875 881.9375 513.96875 914.515625 c 0 + 513.96875 940.765625 506.15625 961.546875 490.84375 976.9375 c 128 + 475.53125 992.328125 448.34375 1003.8125 409.28125 1011.46875 c 1 + 389.4375 1015.01074219 369.59375 1018.55175781 349.75 1022.09375 c 1 + 284.4375 1034.203125 235.53125 1055.6875 202.875 1086.390625 c 128 + 170.21875 1117.09375 153.96875 1159.359375 153.96875 1213.109375 c 0 + 153.96875 1242.5625 159.4375 1269.28125 170.6875 1293.265625 c 128 + 181.9375 1317.25 197.5625 1337.40625 217.71875 1353.734375 c 128 + 237.875 1370.0625 262.40625 1382.71875 291.15625 1391.625 c 128 + 319.90625 1400.609375 352.25 1405.0625 388.1875 1405.0625 c 0 + 438.65625 1405.0625 482.5625 1396.3125 519.59375 1378.734375 c 128 + 556.78125 1361.078125 588.5 1335.6875 614.75 1302.40625 c 1 + 589.4375 1280.01074219 564.125 1257.61425781 538.8125 1235.21875 c 1 + 521.625 1257.5625 500.53125 1275.53125 475.53125 1288.96875 c 128 + 450.53125 1302.40625 419.4375 1309.125 382.40625 1309.125 c 0 + 343.96875 1309.125 314.28125 1301.390625 293.03125 1286.078125 c 128 + 271.9375 1270.6875 261.46875 1248.265625 261.46875 1218.890625 c 0 + 261.46875 1190.6875 270.0625 1169.75 287.40625 1156 c 128 + 304.59375 1142.25 331.46875 1131.78125 368.03125 1124.75 c 1 + 387.875 1120.609375 407.71875 1116.46875 427.5625 1112.328125 c 1 + 494.75 1099.515625 543.8125 1077.71875 574.90625 1047.015625 c 128 + 605.84375 1016.3125 621.46875 974.046875 621.46875 920.296875 c 0 + 621.46875 888.96875 616 860.453125 605.0625 834.828125 c 128 + 594.28125 809.28125 578.34375 787.328125 557.5625 769.125 c 128 + 536.78125 750.84375 511.3125 736.78125 481.3125 726.859375 c 128 + 451.15625 716.9375 416.9375 712.015625 378.5 712.015625 c 0 +709.125 723.5 m 1 + 709.125 752.926757812 709.125 782.354492188 709.125 811.78125 c 1 + 739.489257812 811.78125 769.854492188 811.78125 800.21875 811.78125 c 1 + 800.21875 976.286132812 800.21875 1140.79199219 800.21875 1305.296875 c 1 + 769.854492188 1305.296875 739.489257812 1305.296875 709.125 1305.296875 c 1 + 709.125 1334.72363281 709.125 1364.15136719 709.125 1393.578125 c 1 + 806.416992188 1393.578125 903.708007812 1393.578125 1001 1393.578125 c 1 + 1001 1364.15136719 1001 1334.72363281 1001 1305.296875 c 1 + 970.270507812 1305.296875 939.541992188 1305.296875 908.8125 1305.296875 c 1 + 908.8125 1140.79199219 908.8125 976.286132812 908.8125 811.78125 c 1 + 939.541992188 811.78125 970.270507812 811.78125 1001 811.78125 c 1 + 1001 782.354492188 1001 752.926757812 1001 723.5 c 1 + 903.708007812 723.5 806.416992188 723.5 709.125 723.5 c 1 +1137.875 1393.578125 m 1 + 1216.9375 1393.578125 1296 1393.578125 1375.0625 1393.578125 c 1 + 1417.875 1393.578125 1456.78125 1386.546875 1491.625 1372.484375 c 128 + 1526.46875 1358.34375 1556.3125 1337.40625 1581 1309.59375 c 128 + 1605.53125 1281.703125 1624.59375 1246.859375 1638.03125 1204.90625 c 128 + 1651.46875 1163.03125 1658.1875 1114.203125 1658.1875 1058.578125 c 256 + 1658.1875 1002.875 1651.46875 954.046875 1638.03125 912.171875 c 128 + 1624.59375 870.21875 1605.53125 835.375 1581 807.484375 c 128 + 1556.3125 779.671875 1526.46875 758.734375 1491.625 744.59375 c 128 + 1456.78125 730.53125 1417.875 723.5 1375.0625 723.5 c 1 + 1296 723.5 1216.9375 723.5 1137.875 723.5 c 1 + 1137.875 946.859375 1137.875 1170.21875 1137.875 1393.578125 c 1 +1375.0625 819.515625 m 1 + 1424.90625 819.515625 1465.21875 835.21875 1496 866.546875 c 128 + 1526.625 897.875 1542.09375 943.96875 1542.09375 1004.75 c 1 + 1542.09375 1040.609375 1542.09375 1076.46875 1542.09375 1112.328125 c 1 + 1542.09375 1173.109375 1526.625 1219.203125 1496 1250.53125 c 128 + 1465.21875 1281.9375 1424.90625 1297.5625 1375.0625 1297.5625 c 1 + 1332.14550781 1297.5625 1289.22949219 1297.5625 1246.3125 1297.5625 c 1 + 1246.3125 1138.21386719 1246.3125 978.864257812 1246.3125 819.515625 c 1 + 1289.22949219 819.515625 1332.14550781 819.515625 1375.0625 819.515625 c 1 +EndSplineSet +EndChar EndChars EndSplineFont diff --git a/res/icons.ttf b/res/icons.ttf index feaad8727..75c9a1a6f 100644 Binary files a/res/icons.ttf and b/res/icons.ttf differ diff --git a/src/engine/dispatch.h b/src/engine/dispatch.h index e0dd441c6..273c58957 100644 --- a/src/engine/dispatch.h +++ b/src/engine/dispatch.h @@ -283,6 +283,30 @@ enum DivDispatchCmds { DIV_CMD_MULTIPCM_PSEUDO_REVERB, // (value) DIV_CMD_MULTIPCM_LFO_RESET, // (value) DIV_CMD_MULTIPCM_LEVEL_DIRECT, // (value) + + DIV_CMD_SID3_SPECIAL_WAVE, + DIV_CMD_SID3_RING_MOD_SRC, + DIV_CMD_SID3_HARD_SYNC_SRC, + DIV_CMD_SID3_PHASE_MOD_SRC, + DIV_CMD_SID3_WAVE_MIX, + DIV_CMD_SID3_LFSR_FEEDBACK_BITS, + DIV_CMD_SID3_1_BIT_NOISE, + DIV_CMD_SID3_FILTER_DISTORTION, + DIV_CMD_SID3_FILTER_OUTPUT_VOLUME, + DIV_CMD_SID3_CHANNEL_INVERSION, + DIV_CMD_SID3_FILTER_CONNECTION, + DIV_CMD_SID3_FILTER_MATRIX, + DIV_CMD_SID3_FILTER_ENABLE, + + DIV_CMD_C64_PW_SLIDE, + DIV_CMD_C64_CUTOFF_SLIDE, + + DIV_CMD_SID3_PHASE_RESET, + DIV_CMD_SID3_NOISE_PHASE_RESET, + DIV_CMD_SID3_ENVELOPE_RESET, + + DIV_CMD_SID3_CUTOFF_SCALING, + DIV_CMD_SID3_RESONANCE_SCALING, DIV_CMD_MAX }; @@ -601,10 +625,10 @@ class DivDispatch { /** * get "paired" channels. - * @param chan the channel to query. - * @return a DivChannelPair. + * @param ch the channel to query. + * @param ret the DivChannelPair vector of pairs. */ - virtual DivChannelPair getPaired(int chan); + virtual void getPaired(int ch, std::vector& ret); /** * get channel mode hints. diff --git a/src/engine/dispatchContainer.cpp b/src/engine/dispatchContainer.cpp index 8c2784f2b..af472a268 100644 --- a/src/engine/dispatchContainer.cpp +++ b/src/engine/dispatchContainer.cpp @@ -92,6 +92,7 @@ #include "platform/nds.h" #include "platform/bifurcator.h" #include "platform/sid2.h" +#include "platform/sid3.h" #include "platform/dummy.h" #include "../ta-log.h" #include "song.h" @@ -768,6 +769,9 @@ void DivDispatchContainer::init(DivSystem sys, DivEngine* eng, int chanCount, do case DIV_SYSTEM_SID2: dispatch=new DivPlatformSID2; break; + case DIV_SYSTEM_SID3: + dispatch=new DivPlatformSID3; + break; case DIV_SYSTEM_OPL4: dispatch=new DivPlatformOPL; ((DivPlatformOPL*)dispatch)->setOPLType(4,false); diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index ea9ead3cd..fc6723502 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -1575,9 +1575,9 @@ void* DivEngine::getDispatchChanState(int ch) { return disCont[dispatchOfChan[ch]].dispatch->getChanState(dispatchChanOfChan[ch]); } -DivChannelPair DivEngine::getChanPaired(int ch) { - if (ch<0 || ch>=chans) return DivChannelPair(); - return disCont[dispatchOfChan[ch]].dispatch->getPaired(dispatchChanOfChan[ch]); +void DivEngine::getChanPaired(int ch, std::vector& ret) { + if (ch<0 || ch>=chans) return; + disCont[dispatchOfChan[ch]].dispatch->getPaired(dispatchChanOfChan[ch],ret); } DivChannelModeHints DivEngine::getChanModeHints(int ch) { diff --git a/src/engine/engine.h b/src/engine/engine.h index 8d83c272e..2b033be5d 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -54,8 +54,8 @@ class DivWorkPool; #define DIV_UNSTABLE -#define DIV_VERSION "dev221" -#define DIV_ENGINE_VERSION 221 +#define DIV_VERSION "dev222" +#define DIV_ENGINE_VERSION 222 // for imports #define DIV_VERSION_MOD 0xff01 #define DIV_VERSION_FC 0xff02 @@ -1151,7 +1151,7 @@ class DivEngine { void* getDispatchChanState(int chan); // get channel pairs - DivChannelPair getChanPaired(int chan); + void getChanPaired(int chan, std::vector& ret); // get channel mode hints DivChannelModeHints getChanModeHints(int chan); diff --git a/src/engine/instrument.cpp b/src/engine/instrument.cpp index 6774202f1..3bb00e9ac 100644 --- a/src/engine/instrument.cpp +++ b/src/engine/instrument.cpp @@ -106,6 +106,7 @@ bool DivInstrumentC64::operator==(const DivInstrumentC64& other) { _C(dutyIsAbs) && _C(filterIsAbs) && _C(noTest) && + _C(resetDuty) && _C(res) && _C(cut) && _C(hp) && @@ -258,6 +259,65 @@ bool DivInstrumentESFM::Operator::operator==(const DivInstrumentESFM::Operator& ); } +bool DivInstrumentSID3::operator==(const DivInstrumentSID3& other) { + return ( + _C(triOn) && + _C(sawOn) && + _C(pulseOn) && + _C(noiseOn) && + _C(a) && + _C(d) && + _C(s) && + _C(r) && + _C(sr) && + _C(duty) && + _C(ringMod) && + _C(oscSync) && + _C(phase_mod) && + _C(phase_mod_source) && + _C(ring_mod_source) && + _C(sync_source) && + _C(specialWaveOn) && + _C(oneBitNoise) && + _C(separateNoisePitch) && + _C(special_wave) && + _C(doWavetable) && + _C(dutyIsAbs) && + _C(resetDuty) && + _C(phaseInv) && + _C(feedback) && + _C(mixMode) && + _C(filt[0]) && + _C(filt[1]) && + _C(filt[2]) && + _C(filt[3]) + ); +} + +bool DivInstrumentSID3::Filter::operator==(const DivInstrumentSID3::Filter& other) { + return ( + _C(cutoff) && + _C(resonance) && + _C(output_volume) && + _C(distortion_level) && + _C(mode) && + _C(enabled) && + _C(init) && + _C(filter_matrix) && + _C(absoluteCutoff) && + _C(bindCutoffToNote) && + _C(bindCutoffToNoteStrength) && + _C(bindCutoffToNoteCenter) && + _C(bindCutoffToNoteDir) && + _C(bindCutoffOnNote) && + _C(bindResonanceToNote) && + _C(bindResonanceToNoteStrength) && + _C(bindResonanceToNoteCenter) && + _C(bindResonanceToNoteDir) && + _C(bindResonanceOnNote) + ); +} + bool DivInstrumentPowerNoise::operator==(const DivInstrumentPowerNoise& other) { return _C(octave); } @@ -622,7 +682,7 @@ void DivInstrument::writeFeature64(SafeWriter* w) { w->writeS(c64.duty); w->writeS((unsigned short)((c64.cut&4095)|((c64.res&15)<<12))); - w->writeC((c64.res>>4)&15); + w->writeC(((c64.res>>4)&15)|(c64.resetDuty?0x10:0)); FEATURE_END; } @@ -995,6 +1055,80 @@ void DivInstrument::writeFeatureS2(SafeWriter* w) { FEATURE_END; } +void DivInstrument::writeFeatureS3(SafeWriter* w) { + FEATURE_BEGIN("S3"); + + w->writeC( + (sid3.dutyIsAbs?0x80:0)| + (sid3.noiseOn?8:0)| + (sid3.pulseOn?4:0)| + (sid3.sawOn?2:0)| + (sid3.triOn?1:0) + ); + + w->writeC(sid3.a); + w->writeC(sid3.d); + w->writeC(sid3.s); + w->writeC(sid3.sr); + w->writeC(sid3.r); + + w->writeC(sid3.mixMode); + + w->writeS(sid3.duty); + + w->writeC( + (sid3.phase_mod?0x80:0)| + (sid3.specialWaveOn?0x40:0)| + (sid3.oneBitNoise?0x20:0)| + (sid3.separateNoisePitch?0x10:0)| + (sid3.doWavetable?8:0)| + (sid3.resetDuty?4:0)| + (sid3.oscSync?2:0)| + (sid3.ringMod?1:0) + ); + + w->writeC(sid3.phase_mod_source); + w->writeC(sid3.ring_mod_source); + w->writeC(sid3.sync_source); + w->writeC(sid3.special_wave); + w->writeC(sid3.phaseInv); + w->writeC(sid3.feedback); + + w->writeC(4); // number of filters + + for (int i=0; i<4; i++) { + w->writeC( + (sid3.filt[i].enabled?0x80:0)| + (sid3.filt[i].init?0x40:0)| + (sid3.filt[i].absoluteCutoff?0x20:0)| + (sid3.filt[i].bindCutoffToNote?0x10:0)| + (sid3.filt[i].bindCutoffToNoteDir?8:0)| + (sid3.filt[i].bindCutoffOnNote?4:0)| + (sid3.filt[i].bindResonanceToNote?2:0)| + (sid3.filt[i].bindResonanceToNoteDir?1:0) + ); + + w->writeC( + (sid3.filt[i].bindResonanceOnNote?0x80:0) + ); + + w->writeS(sid3.filt[i].cutoff); + + w->writeC(sid3.filt[i].resonance); + w->writeC(sid3.filt[i].output_volume); + w->writeC(sid3.filt[i].distortion_level); + w->writeC(sid3.filt[i].mode); + w->writeC(sid3.filt[i].filter_matrix); + + w->writeC(sid3.filt[i].bindCutoffToNoteStrength); + w->writeC(sid3.filt[i].bindCutoffToNoteCenter); + w->writeC(sid3.filt[i].bindResonanceToNoteStrength); + w->writeC(sid3.filt[i].bindResonanceToNoteCenter); + } + + FEATURE_END; +} + void DivInstrument::putInsData2(SafeWriter* w, bool fui, const DivSong* song, bool insName) { size_t blockStartSeek=0; size_t blockEndSeek=0; @@ -1041,6 +1175,7 @@ void DivInstrument::putInsData2(SafeWriter* w, bool fui, const DivSong* song, bo bool featureEF=false; bool featurePN=false; bool featureS2=false; + bool featureS3=false; bool checkForWL=false; @@ -1284,6 +1419,11 @@ void DivInstrument::putInsData2(SafeWriter* w, bool fui, const DivSong* song, bo feature64=true; featureS2=true; break; + case DIV_INS_SID3: + feature64=true; + featureS2=true; + featureS3=true; + break; case DIV_INS_SUPERVISION: featureSM=true; if (amiga.useSample) featureSL=true; @@ -1346,6 +1486,9 @@ void DivInstrument::putInsData2(SafeWriter* w, bool fui, const DivSong* song, bo if (sid2!=defaultIns.sid2) { featureS2=true; } + if (sid3!=defaultIns.sid3) { + featureS3=true; + } } // check ins name @@ -1497,6 +1640,9 @@ void DivInstrument::putInsData2(SafeWriter* w, bool fui, const DivSong* song, bo if (featureS2) { writeFeatureS2(w); } + if (featureS3) { + writeFeatureS3(w); + } if (fui && (featureSL || featureWL)) { w->write("EN",2); @@ -1812,7 +1958,12 @@ void DivInstrument::readFeature64(SafeReader& reader, bool& volIsCutoff, short v c64.res=cr>>12; if (version>=199) { - c64.res|=((unsigned char)reader.readC())<<4; + next=(unsigned char)reader.readC(); + c64.res|=(next&15)<<4; + + if (version>=222) { + c64.resetDuty=next&0x10; + } } READ_FEAT_END; @@ -2345,6 +2496,82 @@ void DivInstrument::readFeatureS2(SafeReader& reader, short version) { READ_FEAT_END; } +void DivInstrument::readFeatureS3(SafeReader& reader, short version) { + READ_FEAT_BEGIN; + + unsigned char next=reader.readC(); + + sid3.dutyIsAbs=next&0x80; + sid3.noiseOn=next&8; + sid3.pulseOn=next&4; + sid3.sawOn=next&2; + sid3.triOn=next&1; + + sid3.a=reader.readC(); + sid3.d=reader.readC(); + sid3.s=reader.readC(); + sid3.sr=reader.readC(); + sid3.r=reader.readC(); + + sid3.mixMode=reader.readC(); + + sid3.duty=reader.readS(); + + next=reader.readC(); + + sid3.phase_mod=next&0x80; + sid3.specialWaveOn=next&0x40; + sid3.oneBitNoise=next&0x20; + sid3.separateNoisePitch=next&0x10; + sid3.doWavetable=next&8; + sid3.resetDuty=next&4; + sid3.oscSync=next&2; + sid3.ringMod=next&1; + + sid3.phase_mod_source=reader.readC(); + sid3.ring_mod_source=reader.readC(); + sid3.sync_source=reader.readC(); + sid3.special_wave=reader.readC(); + sid3.phaseInv=reader.readC(); + sid3.feedback=reader.readC(); + + unsigned char numFilters=reader.readC(); + + for (int i=0; i=4) break; + + next=reader.readC(); + + sid3.filt[i].enabled=next&0x80; + sid3.filt[i].init=next&0x40; + sid3.filt[i].absoluteCutoff=next&0x20; + sid3.filt[i].bindCutoffToNote=next&0x10; + sid3.filt[i].bindCutoffToNoteDir=next&8; + sid3.filt[i].bindCutoffOnNote=next&4; + sid3.filt[i].bindResonanceToNote=next&2; + sid3.filt[i].bindResonanceToNoteDir=next&1; + + next=reader.readC(); + + sid3.filt[i].bindResonanceOnNote=next&0x80; + + sid3.filt[i].cutoff=reader.readS(); + + sid3.filt[i].resonance=reader.readC(); + sid3.filt[i].output_volume=reader.readC(); + sid3.filt[i].distortion_level=reader.readC(); + sid3.filt[i].mode=reader.readC(); + sid3.filt[i].filter_matrix=reader.readC(); + + sid3.filt[i].bindCutoffToNoteStrength=reader.readC(); + sid3.filt[i].bindCutoffToNoteCenter=reader.readC(); + sid3.filt[i].bindResonanceToNoteStrength=reader.readC(); + sid3.filt[i].bindResonanceToNoteCenter=reader.readC(); + } + + READ_FEAT_END; +} + DivDataErrors DivInstrument::readInsDataNew(SafeReader& reader, short version, bool fui, DivSong* song) { unsigned char featCode[2]; bool volIsCutoff=false; @@ -2419,6 +2646,8 @@ DivDataErrors DivInstrument::readInsDataNew(SafeReader& reader, short version, b readFeaturePN(reader,version); } else if (memcmp(featCode,"S2",2)==0) { // SID2 readFeatureS2(reader,version); + } else if (memcmp(featCode,"S3",2)==0) { // SID3 + readFeatureS3(reader,version); } else { if (song==NULL && (memcmp(featCode,"SL",2)==0 || (memcmp(featCode,"WL",2)==0))) { // nothing diff --git a/src/engine/instrument.h b/src/engine/instrument.h index 8115d81ab..a1aec2cae 100644 --- a/src/engine/instrument.h +++ b/src/engine/instrument.h @@ -98,6 +98,7 @@ enum DivInstrumentType: unsigned short { DIV_INS_SID2=63, // coincidence! DIV_INS_SUPERVISION=64, DIV_INS_UPD1771C=65, + DIV_INS_SID3=66, DIV_INS_MAX, DIV_INS_NULL }; @@ -429,7 +430,7 @@ struct DivInstrumentC64 { unsigned char a, d, s, r; unsigned short duty; unsigned char ringMod, oscSync; - bool toFilter, initFilter, dutyIsAbs, filterIsAbs, noTest; + bool toFilter, initFilter, dutyIsAbs, filterIsAbs, noTest, resetDuty; unsigned char res; unsigned short cut; bool hp, lp, bp, ch3off; @@ -456,6 +457,7 @@ struct DivInstrumentC64 { dutyIsAbs(false), filterIsAbs(false), noTest(false), + resetDuty(true), res(0), cut(0), hp(false), @@ -869,6 +871,111 @@ struct DivInstrumentSID2 { noiseMode(0) {} }; +struct DivInstrumentSID3 { + bool triOn, sawOn, pulseOn, noiseOn; + unsigned char a, d, s, r; + unsigned char sr; + unsigned short duty; + unsigned char ringMod, oscSync; + bool phase_mod; + unsigned char phase_mod_source, ring_mod_source, sync_source; + bool specialWaveOn; + bool oneBitNoise; + bool separateNoisePitch; + unsigned char special_wave; + bool doWavetable; + bool dutyIsAbs; + bool resetDuty; + unsigned char phaseInv; + unsigned char feedback; + unsigned char mixMode; + + struct Filter { + unsigned short cutoff; + unsigned char resonance; + unsigned char output_volume; + unsigned char distortion_level; + unsigned char mode; + bool enabled; + bool init; + unsigned char filter_matrix; + + // this is done purely in software + bool absoluteCutoff; + bool bindCutoffToNote; + unsigned char bindCutoffToNoteStrength; // how much cutoff changes over e.g. 1 semitone + unsigned char bindCutoffToNoteCenter; // central note of the cutoff change + bool bindCutoffToNoteDir; // if we decrease or increase cutoff if e.g. we go upper in note space + bool bindCutoffOnNote; // only do cutoff scaling once, on new note + + bool bindResonanceToNote; + unsigned char bindResonanceToNoteStrength; // how much resonance changes over e.g. 1 semitone + unsigned char bindResonanceToNoteCenter; // central note of the resonance change + bool bindResonanceToNoteDir; // if we decrease or increase resonance if e.g. we go upper in note space + bool bindResonanceOnNote; // only do resonance scaling once, on new note + + bool operator==(const Filter& other); + bool operator!=(const Filter& other) { + return !(*this==other); + } + Filter(): + cutoff(0), + resonance(0), + output_volume(0), + distortion_level(0), + mode(0), + enabled(false), + init(false), + filter_matrix(0), + absoluteCutoff(false), + bindCutoffToNote(false), + bindCutoffToNoteStrength(0), + bindCutoffToNoteCenter(0), + bindCutoffToNoteDir(false), + bindCutoffOnNote(false), + bindResonanceToNote(false), + bindResonanceToNoteStrength(0), + bindResonanceToNoteCenter(0), + bindResonanceToNoteDir(false), + bindResonanceOnNote(false) {} + } filt[4]; + + bool operator==(const DivInstrumentSID3& other); + bool operator!=(const DivInstrumentSID3& other) { + return !(*this==other); + } + DivInstrumentSID3(): + triOn(false), + sawOn(true), + pulseOn(false), + noiseOn(false), + a(0), + d(64), + s(0), + r(0), + sr(0), + duty(32768), + ringMod(0), + oscSync(0), + phase_mod(false), + phase_mod_source(0), + ring_mod_source(0), + sync_source(0), + specialWaveOn(false), + oneBitNoise(false), + separateNoisePitch(false), + special_wave(0), + doWavetable(false), + dutyIsAbs(true), + resetDuty(false), + phaseInv(0), + feedback(0), + mixMode(0) { + filt[0].mode=16|32; // default settings so filter just works, connect to input and channel output + filt[0].output_volume=0xff; + } +}; + struct DivInstrumentPOD { DivInstrumentType type; DivInstrumentFM fm; @@ -887,6 +994,7 @@ struct DivInstrumentPOD { DivInstrumentESFM esfm; DivInstrumentPowerNoise powernoise; DivInstrumentSID2 sid2; + DivInstrumentSID3 sid3; DivInstrumentPOD() : type(DIV_INS_FM) { @@ -985,6 +1093,7 @@ struct DivInstrument : DivInstrumentPOD { void writeFeatureEF(SafeWriter* w); void writeFeaturePN(SafeWriter* w); void writeFeatureS2(SafeWriter* w); + void writeFeatureS3(SafeWriter* w); void readFeatureNA(SafeReader& reader, short version); void readFeatureFM(SafeReader& reader, short version); @@ -1008,6 +1117,7 @@ struct DivInstrument : DivInstrumentPOD { void readFeatureEF(SafeReader& reader, short version); void readFeaturePN(SafeReader& reader, short version); void readFeatureS2(SafeReader& reader, short version); + void readFeatureS3(SafeReader& reader, short version); DivDataErrors readInsDataOld(SafeReader& reader, short version); DivDataErrors readInsDataNew(SafeReader& reader, short version, bool fui, DivSong* song); diff --git a/src/engine/platform/abstract.cpp b/src/engine/platform/abstract.cpp index 441ec1bff..2bf00580f 100644 --- a/src/engine/platform/abstract.cpp +++ b/src/engine/platform/abstract.cpp @@ -37,8 +37,7 @@ unsigned short DivDispatch::getPan(int chan) { return 0; } -DivChannelPair DivDispatch::getPaired(int chan) { - return DivChannelPair(); +void DivDispatch::getPaired(int ch, std::vector& ret) { } DivChannelModeHints DivDispatch::getModeHints(int chan) { diff --git a/src/engine/platform/c140.cpp b/src/engine/platform/c140.cpp index bde3e1fe7..24ffc6f14 100644 --- a/src/engine/platform/c140.cpp +++ b/src/engine/platform/c140.cpp @@ -561,12 +561,11 @@ float DivPlatformC140::getPostAmp() { return 3.0f; } -DivChannelPair DivPlatformC140::getPaired(int ch) { - if (!is219) return DivChannelPair(); +void DivPlatformC140::getPaired(int ch, std::vector& ret) { + if (!is219) return; if ((ch&3)==0) { - return DivChannelPair(bankLabel[ch>>2],ch+1,ch+2,ch+3,-1,-1,-1,-1,-1); + ret.push_back(DivChannelPair(bankLabel[ch>>2],ch+1,ch+2,ch+3,-1,-1,-1,-1,-1)); } - return DivChannelPair(); } const void* DivPlatformC140::getSampleMem(int index) { diff --git a/src/engine/platform/c140.h b/src/engine/platform/c140.h index fb385c5eb..3d055d629 100644 --- a/src/engine/platform/c140.h +++ b/src/engine/platform/c140.h @@ -89,7 +89,7 @@ class DivPlatformC140: public DivDispatch { void* getChanState(int chan); DivMacroInt* getChanMacroInt(int ch); unsigned short getPan(int chan); - DivChannelPair getPaired(int chan); + void getPaired(int ch, std::vector& ret); DivDispatchOscBuffer* getOscBuffer(int chan); unsigned char* getRegisterPool(); int getRegisterPoolSize(); diff --git a/src/engine/platform/c64.cpp b/src/engine/platform/c64.cpp index 52d87225f..221d7942d 100644 --- a/src/engine/platform/c64.cpp +++ b/src/engine/platform/c64.cpp @@ -158,6 +158,21 @@ void DivPlatformC64::tick(bool sysTick) { int i=chanOrder[_i]; chan[i].std.next(); + + if (sysTick) { + if (chan[i].pw_slide!=0) { + chan[i].duty-=chan[i].pw_slide; + chan[i].duty=CLAMP(chan[i].duty,0,0xfff); + rWrite(i*7+2,chan[i].duty&0xff); + rWrite(i*7+3,(chan[i].duty>>8)|(chan[i].outVol<<4)); + } + if (cutoff_slide!=0) { + filtCut+=cutoff_slide; + filtCut=CLAMP(filtCut,0,0x7ff); + updateFilter(); + } + } + if (chan[i].std.vol.had) { vol=MIN(15,chan[i].std.vol.val); willUpdateFilter=true; @@ -305,7 +320,7 @@ int DivPlatformC64::dispatch(DivCommand c) { chan[c.chan].active=true; chan[c.chan].keyOn=true; chan[c.chan].test=false; - if (chan[c.chan].insChanged || chan[c.chan].resetDuty || ins->std.waveMacro.len>0) { + if (((chan[c.chan].insChanged || chan[c.chan].resetDuty || ins->std.waveMacro.len>0) && ins->c64.resetDuty) || chan[c.chan].resetDuty) { chan[c.chan].duty=ins->c64.duty; rWrite(c.chan*7+2,chan[c.chan].duty&0xff); rWrite(c.chan*7+3,chan[c.chan].duty>>8); @@ -535,6 +550,12 @@ int DivPlatformC64::dispatch(DivCommand c) { chan[c.chan].release=c.value&15; rWrite(c.chan*7+6,(chan[c.chan].sustain<<4)|(chan[c.chan].release)); break; + case DIV_CMD_C64_PW_SLIDE: + chan[c.chan].pw_slide=c.value*c.value2; + break; + case DIV_CMD_C64_CUTOFF_SLIDE: + cutoff_slide=c.value*c.value2; + break; case DIV_CMD_MACRO_OFF: chan[c.chan].std.mask(c.value,true); break; @@ -600,6 +621,23 @@ DivMacroInt* DivPlatformC64::getChanMacroInt(int ch) { return &chan[ch].std; } +void DivPlatformC64::getPaired(int ch, std::vector& ret) { + if (chan[ch].ring) { + if (ch==0){ + ret.push_back(DivChannelPair(_("ring"),2)); + } else { + ret.push_back(DivChannelPair(_("ring"),(ch-1)%3)); + } + } + if (chan[ch].sync) { + if (ch==0) { + ret.push_back(DivChannelPair(_("sync"),2)); + } else { + ret.push_back(DivChannelPair(_("sync"),(ch-1)%3)); + } + } +} + DivChannelModeHints DivPlatformC64::getModeHints(int ch) { DivChannelModeHints ret; ret.count=1; @@ -653,8 +691,11 @@ void DivPlatformC64::reset() { chan[i].std.setEngine(parent); fakeLow[i]=0; fakeBand[i]=0; + chan[i].pw_slide=0; } + cutoff_slide=0; + if (sidCore==2) { dSID_init(sid_d,chipClock,rate,sidIs6581?6581:8580,needInitTables); dSID_setMuteMask( diff --git a/src/engine/platform/c64.h b/src/engine/platform/c64.h index bd2e9d65e..1fa5abd1b 100644 --- a/src/engine/platform/c64.h +++ b/src/engine/platform/c64.h @@ -37,6 +37,7 @@ class DivPlatformC64: public DivDispatch { short duty; bool sweepChanged, filter; bool resetMask, resetFilter, resetDuty, gate, ring, sync, test; + short pw_slide; Channel(): SharedChannel(15), prevFreq(65535), @@ -56,7 +57,8 @@ class DivPlatformC64: public DivDispatch { gate(true), ring(false), sync(false), - test(false) {} + test(false), + pw_slide(0) {} }; Channel chan[3]; DivDispatchOscBuffer* oscBuf[3]; @@ -76,6 +78,7 @@ class DivPlatformC64: public DivDispatch { unsigned char writeOscBuf; unsigned char sidCore; int filtCut, resetTime, initResetTime; + short cutoff_slide; bool keyPriority, sidIs6581, needInitTables, no1EUpdate, multiplyRel, macroRace; unsigned char chanOrder[3]; @@ -114,6 +117,7 @@ class DivPlatformC64: public DivDispatch { bool isVolGlobal(); float getPostAmp(); DivMacroInt* getChanMacroInt(int ch); + void getPaired(int ch, std::vector& ret); DivChannelModeHints getModeHints(int chan); void notifyInsDeletion(void* ins); void poke(unsigned int addr, unsigned short val); diff --git a/src/engine/platform/dave.cpp b/src/engine/platform/dave.cpp index 0d5868611..385bad81d 100644 --- a/src/engine/platform/dave.cpp +++ b/src/engine/platform/dave.cpp @@ -524,12 +524,16 @@ unsigned short DivPlatformDave::getPan(int ch) { return (chan[ch].panL<<8)|chan[ch].panR; } -// TODO: the rest -DivChannelPair DivPlatformDave::getPaired(int ch) { +void DivPlatformDave::getPaired(int ch, std::vector& ret) { if (chan[ch].highPass) { - DivChannelPair("high",(ch+1)&3); + ret.push_back(DivChannelPair(_("high"),(ch+1)&3)); + } + if (chan[ch].ringMod) { + ret.push_back(DivChannelPair(_("ring"),(ch+2)&3)); + } + if (chan[ch].lowPass && ch==3) { + ret.push_back(DivChannelPair(_("low"),2)); } - return DivChannelPair(); } DivChannelModeHints DivPlatformDave::getModeHints(int ch) { diff --git a/src/engine/platform/dave.h b/src/engine/platform/dave.h index b232218be..e6d7e3497 100644 --- a/src/engine/platform/dave.h +++ b/src/engine/platform/dave.h @@ -76,7 +76,7 @@ class DivPlatformDave: public DivDispatch { void* getChanState(int chan); DivMacroInt* getChanMacroInt(int ch); unsigned short getPan(int chan); - DivChannelPair getPaired(int chan); + void getPaired(int ch, std::vector& ret); DivChannelModeHints getModeHints(int chan); DivSamplePos getSamplePos(int ch); DivDispatchOscBuffer* getOscBuffer(int chan); diff --git a/src/engine/platform/gbaminmod.cpp b/src/engine/platform/gbaminmod.cpp index 65342be43..1d889e498 100644 --- a/src/engine/platform/gbaminmod.cpp +++ b/src/engine/platform/gbaminmod.cpp @@ -771,6 +771,8 @@ int DivPlatformGBAMinMod::init(DivEngine* p, int channels, int sugRate, const Di setFlags(flags); reset(); + maxCPU=0.0; // initialize! + return 16; } diff --git a/src/engine/platform/opl.cpp b/src/engine/platform/opl.cpp index 3477c4119..b1f847459 100644 --- a/src/engine/platform/opl.cpp +++ b/src/engine/platform/opl.cpp @@ -2646,13 +2646,12 @@ unsigned short DivPlatformOPL::getPan(int ch) { return ((chan[ch].pan&1)<<8)|((chan[ch].pan&2)>>1); } -DivChannelPair DivPlatformOPL::getPaired(int ch) { +void DivPlatformOPL::getPaired(int ch, std::vector& ret) { if (oplType==3 && ch<12 && !(ch&1)) { if (chan[ch].fourOp) { - return DivChannelPair("4OP",ch+1); + ret.push_back(DivChannelPair(_("4OP"),ch+1)); } } - return DivChannelPair(); } DivDispatchOscBuffer* DivPlatformOPL::getOscBuffer(int ch) { diff --git a/src/engine/platform/opl.h b/src/engine/platform/opl.h index 449cb2948..7a6826c5a 100644 --- a/src/engine/platform/opl.h +++ b/src/engine/platform/opl.h @@ -191,7 +191,7 @@ class DivPlatformOPL: public DivDispatch { void* getChanState(int chan); DivMacroInt* getChanMacroInt(int ch); unsigned short getPan(int chan); - DivChannelPair getPaired(int chan); + void getPaired(int ch, std::vector& ret); DivDispatchOscBuffer* getOscBuffer(int chan); int mapVelocity(int ch, float vel); float getGain(int ch, int vol); diff --git a/src/engine/platform/pce.cpp b/src/engine/platform/pce.cpp index d65271a3b..c077e5866 100644 --- a/src/engine/platform/pce.cpp +++ b/src/engine/platform/pce.cpp @@ -538,11 +538,10 @@ unsigned short DivPlatformPCE::getPan(int ch) { return ((chan[ch].pan&0xf0)<<4)|(chan[ch].pan&15); } -DivChannelPair DivPlatformPCE::getPaired(int ch) { +void DivPlatformPCE::getPaired(int ch, std::vector& ret) { if (ch==1 && lfoMode>0) { - return DivChannelPair("mod",0); + ret.push_back(DivChannelPair(_("mod"),0)); } - return DivChannelPair(); } DivChannelModeHints DivPlatformPCE::getModeHints(int ch) { diff --git a/src/engine/platform/pce.h b/src/engine/platform/pce.h index 725d1c232..f780c7a3e 100644 --- a/src/engine/platform/pce.h +++ b/src/engine/platform/pce.h @@ -85,7 +85,7 @@ class DivPlatformPCE: public DivDispatch { void* getChanState(int chan); DivMacroInt* getChanMacroInt(int ch); unsigned short getPan(int chan); - DivChannelPair getPaired(int chan); + void getPaired(int ch, std::vector& ret); DivChannelModeHints getModeHints(int chan); DivSamplePos getSamplePos(int ch); DivDispatchOscBuffer* getOscBuffer(int chan); diff --git a/src/engine/platform/pokey.cpp b/src/engine/platform/pokey.cpp index 6f524210e..9182b065e 100644 --- a/src/engine/platform/pokey.cpp +++ b/src/engine/platform/pokey.cpp @@ -407,22 +407,21 @@ DivMacroInt* DivPlatformPOKEY::getChanMacroInt(int ch) { return &chan[ch].std; } -DivChannelPair DivPlatformPOKEY::getPaired(int ch) { +void DivPlatformPOKEY::getPaired(int ch, std::vector& ret) { switch (ch) { case 0: - if (audctl&4) return DivChannelPair("filter",2); + if (audctl&4) ret.push_back(DivChannelPair(_("filter"),2)); break; case 1: - if (audctl&16) return DivChannelPair("16-bit",0); + if (audctl&16) ret.push_back(DivChannelPair(_("16-bit"),0)); break; case 2: - if (audctl&8) return DivChannelPair("16-bit",3); + if (audctl&8) ret.push_back(DivChannelPair(_("16-bit"),3)); break; case 3: - if (audctl&2) return DivChannelPair("filter",1); + if (audctl&2) ret.push_back(DivChannelPair(_("filter"),1)); break; } - return DivChannelPair(); } DivDispatchOscBuffer* DivPlatformPOKEY::getOscBuffer(int ch) { diff --git a/src/engine/platform/pokey.h b/src/engine/platform/pokey.h index 6407c0778..4a973e5e9 100644 --- a/src/engine/platform/pokey.h +++ b/src/engine/platform/pokey.h @@ -65,7 +65,7 @@ class DivPlatformPOKEY: public DivDispatch { int dispatch(DivCommand c); void* getChanState(int chan); DivMacroInt* getChanMacroInt(int ch); - DivChannelPair getPaired(int chan); + void getPaired(int ch, std::vector& ret); DivDispatchOscBuffer* getOscBuffer(int chan); unsigned char* getRegisterPool(); int getRegisterPoolSize(); diff --git a/src/engine/platform/sid2.cpp b/src/engine/platform/sid2.cpp index cc0a13f5c..4215e27f9 100644 --- a/src/engine/platform/sid2.cpp +++ b/src/engine/platform/sid2.cpp @@ -113,6 +113,21 @@ void DivPlatformSID2::tick(bool sysTick) { bool willUpdateFilter = false; chan[i].std.next(); + + if (sysTick) { + if (chan[i].pw_slide!=0) { + chan[i].duty-=chan[i].pw_slide; + chan[i].duty=CLAMP(chan[i].duty,0,0xfff); + rWrite(i*7+2,chan[i].duty&0xff); + rWrite(i*7+3,(chan[i].duty>>8)|(chan[i].outVol<<4)); + } + if (chan[i].cutoff_slide!=0) { + chan[i].filtCut+=chan[i].cutoff_slide; + chan[i].filtCut=CLAMP(chan[i].filtCut,0,0xfff); + updateFilter(i); + } + } + if (chan[i].std.vol.had) { chan[i].outVol=VOL_SCALE_LINEAR(chan[i].vol&15,MIN(15,chan[i].std.vol.val),15); rWrite(i*7+3,(chan[i].duty>>8) | (chan[i].outVol << 4)); @@ -297,7 +312,7 @@ int DivPlatformSID2::dispatch(DivCommand c) { chan[c.chan].keyOn=true; chan[c.chan].test=false; - if (chan[c.chan].insChanged || chan[c.chan].resetDuty || ins->std.waveMacro.len>0) { + if (((chan[c.chan].insChanged || chan[c.chan].resetDuty || ins->std.waveMacro.len>0) && ins->c64.resetDuty) || chan[c.chan].resetDuty) { chan[c.chan].duty=ins->c64.duty; rWrite(c.chan*7+2,chan[c.chan].duty&0xff); rWrite(c.chan*7+3,(chan[c.chan].duty>>8) | (chan[c.chan].outVol << 4)); @@ -521,6 +536,12 @@ int DivPlatformSID2::dispatch(DivCommand c) { break; } break; + case DIV_CMD_C64_PW_SLIDE: + chan[c.chan].pw_slide=c.value*c.value2; + break; + case DIV_CMD_C64_CUTOFF_SLIDE: + chan[c.chan].cutoff_slide=c.value*c.value2; + break; case DIV_CMD_MACRO_OFF: chan[c.chan].std.mask(c.value,true); break; @@ -574,15 +595,31 @@ DivMacroInt* DivPlatformSID2::getChanMacroInt(int ch) { return &chan[ch].std; } +void DivPlatformSID2::getPaired(int ch, std::vector& ret) { + if (chan[ch].ring) { + if (ch==0) { + ret.push_back(DivChannelPair(_("ring"),2)); + } else { + ret.push_back(DivChannelPair(_("ring"),(ch-1)%3)); + } + } + if (chan[ch].sync) { + if (ch==0) { + ret.push_back(DivChannelPair(_("sync"),2)); + } else { + ret.push_back(DivChannelPair(_("sync"),(ch-1)%3)); + } + } +} + DivChannelModeHints DivPlatformSID2::getModeHints(int ch) { DivChannelModeHints ret; ret.count=1; ret.hint[0]=ICON_FA_BELL_SLASH_O; ret.type[0]=0; - if (ch == 2 && (chan[ch].filtControl & 8)) { - ret.type[0] = 7; - } - else if (!chan[ch].gate) { + if (ch==2 && (chan[ch].filtControl & 8)) { + ret.type[0]=7; + } else if (!chan[ch].gate) { ret.type[0]=4; } @@ -633,6 +670,9 @@ void DivPlatformSID2::reset() { chan[i].noise_mode = 0; rWrite(0x3 + 7 * i,0xf0); + + chan[i].cutoff_slide = 0; + chan[i].pw_slide = 0; } sid2->reset(); diff --git a/src/engine/platform/sid2.h b/src/engine/platform/sid2.h index f1dc71f3f..124f3a505 100644 --- a/src/engine/platform/sid2.h +++ b/src/engine/platform/sid2.h @@ -36,7 +36,8 @@ class DivPlatformSID2: public DivDispatch { unsigned char noise_mode; unsigned char mix_mode; int filtCut; - bool do_pw_sweep_writes, do_cutoff_sweep_writes; + short cutoff_slide; + short pw_slide; Channel(): SharedChannel(15), prevFreq(0x1ffff), @@ -60,8 +61,8 @@ class DivPlatformSID2: public DivDispatch { noise_mode(0), mix_mode(0), filtCut(0), - do_pw_sweep_writes(false), - do_cutoff_sweep_writes(false) {} + cutoff_slide(0), + pw_slide(0) {} }; Channel chan[3]; DivDispatchOscBuffer* oscBuf[3]; @@ -108,6 +109,7 @@ class DivPlatformSID2: public DivDispatch { bool isVolGlobal(); float getPostAmp(); DivMacroInt* getChanMacroInt(int ch); + void getPaired(int ch, std::vector& ret); DivChannelModeHints getModeHints(int chan); void notifyInsDeletion(void* ins); void poke(unsigned int addr, unsigned short val); diff --git a/src/engine/platform/sid3.cpp b/src/engine/platform/sid3.cpp new file mode 100644 index 000000000..9f0bffb5b --- /dev/null +++ b/src/engine/platform/sid3.cpp @@ -0,0 +1,1411 @@ +/** + * Furnace Tracker - multi-system chiptune tracker + * Copyright (C) 2021-2024 tildearrow and contributors + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "sid3.h" +#include "../engine.h" +#include "IconsFontAwesome4.h" +#include +#include "../../ta-log.h" + +#define rWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} } + +#define CHIP_FREQBASE 524288*64 +#define CHIP_DIVIDER 1 + +#define CURRENT_FREQ_IN_HZ() ((double)chipClock / pow(2.0, (double)SID3_ACC_BITS) * (double)chan[i].freq) +#define c_5_FREQ() (parent->song.tuning / pow(2, (12.0 * 9.0 + 9.0) / 12.0)) +#define FREQ_FOR_NOTE(note) (c_5_FREQ() * pow(2, (double)note / 12.0)) + +const char* regCheatSheetSID3[]={ + "FreqL0", "00", + "FreqH0", "01", + "PWL0", "02", + "PWH0Vol", "03", + "Control0", "04", + "AtkDcy0", "05", + "StnRis0", "06", + "FreqL1", "07", + "FreqH1", "08", + "PWL1", "09", + "PWH1Vol", "0A", + "Control1", "0B", + "AtkDcy1", "0C", + "StnRis1", "0D", + "FreqL2", "0E", + "FreqH2", "0F", + "PWL2", "10", + "PWH2Vol", "11", + "Control2", "12", + "AtkDcy2", "13", + "StnRis2", "14", + + "FCL0Ctrl", "15", + "FCH0", "16", + "FilterRes0", "17", + + "FCL1Ctrl", "18", + "FCH1", "19", + "FilterRes1", "1A", + + "FCL2Ctrl", "1B", + "FCH2", "1C", + "FilterRes2", "1D", + + "NoiModeFrMSB01", "1E", + "WaveMixModeFrMSB2", "1F", + NULL +}; + +typedef struct +{ + uint32_t LFSRmask; + float freqScaling; +} noiseFreqData; + +const noiseFreqData noiseInterestingWavesData[] = +{ + {524288, 523.0f / 1675.0f}, //wave very close to SID2 noise mode 1 wave + {541065280U, 523.0f / 104.0f / 2.0f}, //smth like vocals + {2068, 1.0f}, //wave very close to SID2 noise mode 3 wave + {66, 523.0f / 540.0f / 2.0f}, //wave very close to SID2 noise mode 2 wave + + {0, 0.0f}, //end marker +}; + +const char** DivPlatformSID3::getRegisterSheet() { + return regCheatSheetSID3; +} + +void DivPlatformSID3::acquire(short** buf, size_t len) +{ + for (size_t i=0; irate) + { + DivSample* s=parent->getSample(chan[SID3_NUM_CHANNELS - 1].dacSample); + if (s->samples<=0 || chan[SID3_NUM_CHANNELS - 1].dacPos>=s->samples) + { + chan[SID3_NUM_CHANNELS - 1].dacSample=-1; + continue; + } + + int dacData=s->data16[chan[SID3_NUM_CHANNELS - 1].dacPos] + 32767; + chan[SID3_NUM_CHANNELS - 1].dacOut=CLAMP(dacData,0,65535); + updateSample = true; + + if (sampleTick > 2) + { + sampleTick = 0; + } + + chan[SID3_NUM_CHANNELS - 1].dacPos++; + if (s->isLoopable() && chan[SID3_NUM_CHANNELS - 1].dacPos>=(unsigned int)s->loopEnd) + { + chan[SID3_NUM_CHANNELS - 1].dacPos=s->loopStart; + } + else if (chan[SID3_NUM_CHANNELS - 1].dacPos>=s->samples) + { + chan[SID3_NUM_CHANNELS - 1].dacSample=-1; + } + chan[SID3_NUM_CHANNELS - 1].dacPeriod-=rate; + } + while (chan[SID3_NUM_CHANNELS - 1].dacPeriod > rate) + { + chan[SID3_NUM_CHANNELS - 1].dacPeriod -= rate; + } + } + + sampleTick++; + + if(chan[SID3_NUM_CHANNELS - 1].pcm) + { + if(sampleTick == 2 && updateSample) + { + if (!isMuted[SID3_NUM_CHANNELS - 1]) + { + sid3_write(sid3, SID3_REGISTER_STREAMED_SAMPLE_HIGH + (SID3_NUM_CHANNELS - 1) * SID3_REGISTERS_PER_CHANNEL, chan[SID3_NUM_CHANNELS - 1].dacOut >> 8); + regPool[SID3_REGISTER_STREAMED_SAMPLE_HIGH + (SID3_NUM_CHANNELS - 1) * SID3_REGISTERS_PER_CHANNEL]=chan[SID3_NUM_CHANNELS - 1].dacOut >> 8; + } + else + { + sid3_write(sid3, SID3_REGISTER_STREAMED_SAMPLE_HIGH + (SID3_NUM_CHANNELS - 1) * SID3_REGISTERS_PER_CHANNEL, 32768 >> 8); + regPool[SID3_REGISTER_STREAMED_SAMPLE_HIGH + (SID3_NUM_CHANNELS - 1) * SID3_REGISTERS_PER_CHANNEL]=32768 >> 8; + } + } + else if(sampleTick == 3 && updateSample) + { + if (!isMuted[SID3_NUM_CHANNELS - 1]) + { + sid3_write(sid3, SID3_REGISTER_STREAMED_SAMPLE_LOW + (SID3_NUM_CHANNELS - 1) * SID3_REGISTERS_PER_CHANNEL, chan[SID3_NUM_CHANNELS - 1].dacOut & 0xff); + regPool[SID3_REGISTER_STREAMED_SAMPLE_LOW + (SID3_NUM_CHANNELS - 1) * SID3_REGISTERS_PER_CHANNEL]=chan[SID3_NUM_CHANNELS - 1].dacOut & 0xff; + } + else + { + sid3_write(sid3, SID3_REGISTER_STREAMED_SAMPLE_LOW + (SID3_NUM_CHANNELS - 1) * SID3_REGISTERS_PER_CHANNEL, 32768 & 0xff); + regPool[SID3_REGISTER_STREAMED_SAMPLE_LOW + (SID3_NUM_CHANNELS - 1) * SID3_REGISTERS_PER_CHANNEL]=32768 & 0xff; + } + + sampleTick = 0; + updateSample = false; + } + else + { + if (!writes.empty()) + { + QueuedWrite w=writes.front(); + sid3_write(sid3, w.addr, w.val); + regPool[w.addr % SID3_NUM_REGISTERS]=w.val; + writes.pop(); + } + } + } + else + { + if (!writes.empty()) + { + QueuedWrite w=writes.front(); + sid3_write(sid3, w.addr, w.val); + regPool[w.addr % SID3_NUM_REGISTERS]=w.val; + writes.pop(); + } + } + + sid3_clock(sid3); + + buf[0][i]=sid3->output_l; + buf[1][i]=sid3->output_r; + + if (++writeOscBuf>=8) + { + writeOscBuf=0; + + for(int j = 0; j < SID3_NUM_CHANNELS - 1; j++) + { + oscBuf[j]->data[oscBuf[j]->needle++] = sid3->muted[j] ? 0 : (sid3->channel_output[j] / 4); + } + + oscBuf[SID3_NUM_CHANNELS - 1]->data[oscBuf[SID3_NUM_CHANNELS - 1]->needle++] = sid3->muted[SID3_NUM_CHANNELS - 1] ? 0 : (sid3->wave_channel_output / 4); + } + } +} + +void DivPlatformSID3::updateFlags(int channel, bool gate) +{ + rWrite(SID3_REGISTER_FLAGS + channel * SID3_REGISTERS_PER_CHANNEL, (gate ? 1 : 0) | + (chan[channel].ring ? SID3_CHAN_ENABLE_RING_MOD : 0) | + (chan[channel].sync ? SID3_CHAN_ENABLE_HARD_SYNC : 0) | + (chan[channel].phase ? SID3_CHAN_ENABLE_PHASE_MOD : 0) | + (chan[channel].phaseReset ? SID3_CHAN_PHASE_RESET : 0) | + (chan[channel].envReset ? SID3_CHAN_ENV_RESET : 0) | + (chan[channel].phaseResetNoise ? SID3_CHAN_NOISE_PHASE_RESET : 0) | + (chan[channel].oneBitNoise ? SID3_CHAN_1_BIT_NOISE : 0)); +} + +void DivPlatformSID3::updateFilter(int channel, int filter) +{ + rWrite(SID3_REGISTER_FILT_MODE + filter * SID3_REGISTERS_PER_FILTER + channel*SID3_REGISTERS_PER_CHANNEL, + chan[channel].filt[filter].mode | (chan[channel].filt[filter].enabled ? SID3_FILTER_ENABLE : 0)); + + rWrite(SID3_REGISTER_FILT_CUTOFF_HIGH + filter * SID3_REGISTERS_PER_FILTER + channel*SID3_REGISTERS_PER_CHANNEL, + chan[channel].filt[filter].cutoff >> 8); + rWrite(SID3_REGISTER_FILT_CUTOFF_LOW + filter * SID3_REGISTERS_PER_FILTER + channel*SID3_REGISTERS_PER_CHANNEL, + chan[channel].filt[filter].cutoff & 0xff); + + rWrite(SID3_REGISTER_FILT_RESONANCE + filter * SID3_REGISTERS_PER_FILTER + channel*SID3_REGISTERS_PER_CHANNEL, + chan[channel].filt[filter].resonance); + + rWrite(SID3_REGISTER_FILT_DISTORTION + filter * SID3_REGISTERS_PER_FILTER + channel*SID3_REGISTERS_PER_CHANNEL, + chan[channel].filt[filter].distortion_level); + + rWrite(SID3_REGISTER_FILT_CONNECTION + filter * SID3_REGISTERS_PER_FILTER + channel*SID3_REGISTERS_PER_CHANNEL, + chan[channel].filt[filter].filter_matrix); + + rWrite(SID3_REGISTER_FILT_OUTPUT_VOLUME + filter * SID3_REGISTERS_PER_FILTER + channel*SID3_REGISTERS_PER_CHANNEL, + chan[channel].filt[filter].output_volume); +} + +void DivPlatformSID3::updateFreq(int channel) +{ + rWrite(SID3_REGISTER_FREQ_HIGH + channel*SID3_REGISTERS_PER_CHANNEL,(chan[channel].freq >> 16) & 0xff); + rWrite(SID3_REGISTER_FREQ_MID + channel*SID3_REGISTERS_PER_CHANNEL,(chan[channel].freq >> 8) & 0xff); + rWrite(SID3_REGISTER_FREQ_LOW + channel*SID3_REGISTERS_PER_CHANNEL,chan[channel].freq & 0xff); +} + +void DivPlatformSID3::updateNoiseFreq(int channel) +{ + rWrite(SID3_REGISTER_NOISE_FREQ_HIGH + channel*SID3_REGISTERS_PER_CHANNEL,(chan[channel].noiseFreq >> 16) & 0xff); + rWrite(SID3_REGISTER_NOISE_FREQ_MID + channel*SID3_REGISTERS_PER_CHANNEL,(chan[channel].noiseFreq >> 8) & 0xff); + rWrite(SID3_REGISTER_NOISE_FREQ_LOW + channel*SID3_REGISTERS_PER_CHANNEL,chan[channel].noiseFreq & 0xff); +} + +void DivPlatformSID3::updateNoiseLFSRMask(int channel) +{ + rWrite(SID3_REGISTER_NOISE_LFSR_HIGHEST + channel*SID3_REGISTERS_PER_CHANNEL,(chan[channel].noiseLFSRMask >> 24) & 0xff); + rWrite(SID3_REGISTER_NOISE_LFSR_HIGH + channel*SID3_REGISTERS_PER_CHANNEL,(chan[channel].noiseLFSRMask >> 16) & 0xff); + rWrite(SID3_REGISTER_NOISE_LFSR_MID + channel*SID3_REGISTERS_PER_CHANNEL,(chan[channel].noiseLFSRMask >> 8) & 0xff); + rWrite(SID3_REGISTER_NOISE_LFSR_LOW + channel*SID3_REGISTERS_PER_CHANNEL,chan[channel].noiseLFSRMask & 0xff); +} + +void DivPlatformSID3::updateDuty(int channel) +{ + rWrite(SID3_REGISTER_PW_HIGH + channel*SID3_REGISTERS_PER_CHANNEL,(chan[channel].duty >> 8) & 0xff); + rWrite(SID3_REGISTER_PW_LOW + channel*SID3_REGISTERS_PER_CHANNEL,chan[channel].duty & 0xff); +} + +void DivPlatformSID3::updateEnvelope(int channel) +{ + rWrite(SID3_REGISTER_ADSR_A + channel * SID3_REGISTERS_PER_CHANNEL, chan[channel].attack); //attack + rWrite(SID3_REGISTER_ADSR_D + channel * SID3_REGISTERS_PER_CHANNEL, chan[channel].decay); //decay + rWrite(SID3_REGISTER_ADSR_S + channel * SID3_REGISTERS_PER_CHANNEL, chan[channel].sustain); //sustain + rWrite(SID3_REGISTER_ADSR_SR + channel * SID3_REGISTERS_PER_CHANNEL, chan[channel].sr); //sr + rWrite(SID3_REGISTER_ADSR_R + channel * SID3_REGISTERS_PER_CHANNEL, chan[channel].release); //release +} + +void DivPlatformSID3::updatePanning(int channel) +{ + rWrite(SID3_REGISTER_PAN_LEFT + channel*SID3_REGISTERS_PER_CHANNEL,chan[channel].panLeft); + rWrite(SID3_REGISTER_PAN_RIGHT + channel*SID3_REGISTERS_PER_CHANNEL,chan[channel].panRight); +} + +void DivPlatformSID3::updateWave() +{ + int channel = SID3_NUM_CHANNELS - 1; + + for(int i = 0; i < 256; i++) + { + uint8_t val = ws.output[i & 255]; + rWrite(SID3_REGISTER_PW_HIGH + channel*SID3_REGISTERS_PER_CHANNEL,i); + rWrite(SID3_REGISTER_PW_LOW + channel*SID3_REGISTERS_PER_CHANNEL,val); + } +} + +void DivPlatformSID3::tick(bool sysTick) +{ + bool doUpdateWave = false; + + for (int i=0; igetIns(chan[i].ins,DIV_INS_SID3); + + bool panChanged = false; + bool flagsChanged = false; + bool envChanged = false; + + if(sysTick) + { + if(chan[i].pw_slide != 0) + { + chan[i].duty -= chan[i].pw_slide; + chan[i].duty = CLAMP(chan[i].duty, 0, 0xffff); + updateDuty(i); + } + for(int j = 0; j < SID3_NUM_FILTERS; j++) //filters' slides + { + if(chan[i].filt[j].cutoff_slide != 0) + { + chan[i].filt[j].cutoff += chan[i].filt[j].cutoff_slide; + chan[i].filt[j].cutoff = CLAMP(chan[i].filt[j].cutoff, 0, 0xffff); + updateFilter(i, j); + } + } + + if(chan[i].phase_reset_counter >= 0) + { + if(chan[i].phase_reset_counter == 0) + { + chan[i].phaseReset = true; + flagsChanged = true; + } + chan[i].phase_reset_counter--; + } + if(chan[i].noise_phase_reset_counter >= 0) + { + if(chan[i].noise_phase_reset_counter == 0) + { + chan[i].phaseResetNoise = true; + flagsChanged = true; + } + chan[i].noise_phase_reset_counter--; + } + if(chan[i].envelope_reset_counter >= 0) + { + if(chan[i].envelope_reset_counter == 0) + { + chan[i].envReset = true; + flagsChanged = true; + } + chan[i].envelope_reset_counter--; + } + } + + if (chan[i].std.vol.had) + { + chan[i].outVol=VOL_SCALE_LINEAR(chan[i].vol&255,MIN(255,chan[i].std.vol.val),255); + rWrite(13 + i * SID3_REGISTERS_PER_CHANNEL, chan[i].outVol); + } + if (NEW_ARP_STRAT) { + chan[i].handleArp(); + } else if (chan[i].std.arp.had) { + if (!chan[i].inPorta) { + chan[i].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val)); + } + chan[i].freqChanged=true; + } + if (chan[i].std.pitch.had) { + if (chan[i].std.pitch.mode) { + chan[i].pitch2+=chan[i].std.pitch.val; + CLAMP_VAR(chan[i].pitch2,-65535,65535); + } else { + chan[i].pitch2=chan[i].std.pitch.val; + } + chan[i].freqChanged=true; + } + if (chan[i].std.duty.had) { + DivInstrument* ins=parent->getIns(chan[i].ins,DIV_INS_SID3); + if (ins->sid3.dutyIsAbs) { + chan[i].duty=chan[i].std.duty.val; + } else { + chan[i].duty-=chan[i].std.duty.val; + } + chan[i].duty&=65535; + updateDuty(i); + } + if (chan[i].std.wave.had) { + DivInstrument* ins=parent->getIns(chan[i].ins,DIV_INS_SID3); + + if(i == SID3_NUM_CHANNELS - 1 && ins->sid3.doWavetable) + { + chan[i].wavetable = chan[i].std.wave.val & 0xff; + ws.changeWave1(chan[i].wavetable, true); + doUpdateWave = true; + } + else + { + chan[i].wave = chan[i].std.wave.val & 0xff; + rWrite(SID3_REGISTER_WAVEFORM + i * SID3_REGISTERS_PER_CHANNEL, chan[i].wave); + } + } + if (chan[i].std.alg.had) { //special wave + chan[i].special_wave = chan[i].std.alg.val & 0xff; + rWrite(SID3_REGISTER_SPECIAL_WAVE + i * SID3_REGISTERS_PER_CHANNEL, chan[i].special_wave); + } + if (chan[i].std.op[3].am.had) { //noise arpeggio + //chan[i].handleArpNoise(0); + chan[i].noiseFreqChanged = true; + } + chan[i].handleArpNoise(0); + chan[i].handlePitchNoise(); + if (chan[i].std.op[0].ar.had) { //noise pitch + //chan[i].handlePitchNoise(); + chan[i].noiseFreqChanged = true; + } + if (chan[i].std.panL.had) { + panChanged = true; + chan[i].panLeft = chan[i].std.panL.val & 0xff; + } + if (chan[i].std.panR.had) { + panChanged = true; + chan[i].panRight = chan[i].std.panR.val & 0xff; + } + if (chan[i].std.op[2].ar.had) { //channel signal inversion + chan[i].phaseInv = chan[i].std.op[2].ar.val & 3; + rWrite(SID3_REGISTER_PHASE_INVERSION + i * SID3_REGISTERS_PER_CHANNEL, chan[i].phaseInv); + } + if (chan[i].std.op[0].am.had) { //key on/off + chan[i].gate = chan[i].std.op[0].am.val & 1; + flagsChanged = true; + } + if (chan[i].std.ex1.had) { //ring mod, hard sync, phase mod + chan[i].phase = chan[i].std.ex1.val & 1; + chan[i].sync = chan[i].std.ex1.val & 2; + chan[i].ring = chan[i].std.ex1.val & 4; + flagsChanged = true; + } + if (chan[i].std.ams.had) { //hard sync source + chan[i].syncSrc = chan[i].std.ams.val & 0xff; + rWrite(SID3_REGISTER_SYNC_SRC + i * SID3_REGISTERS_PER_CHANNEL, chan[i].syncSrc); + } + if (chan[i].std.fms.had) { //ring mod source + chan[i].ringSrc = chan[i].std.fms.val & 0xff; + rWrite(SID3_REGISTER_RING_MOD_SRC + i * SID3_REGISTERS_PER_CHANNEL, chan[i].ringSrc); + } + if (chan[i].std.fb.had) { //phase mod source + chan[i].phaseSrc = chan[i].std.fb.val & 0xff; + rWrite(SID3_REGISTER_PHASE_MOD_SRC + i * SID3_REGISTERS_PER_CHANNEL, chan[i].phaseSrc); + } + if (chan[i].std.op[3].ar.had) { //feedback + chan[i].feedback = chan[i].std.op[3].ar.val & 0xff; + rWrite(SID3_REGISTER_FEEDBACK + i * SID3_REGISTERS_PER_CHANNEL, chan[i].feedback); + } + if (chan[i].std.phaseReset.had) { + chan[i].phaseReset = chan[i].std.phaseReset.val & 1; + + if(chan[i].phaseReset) + { + flagsChanged = true; + } + + if (chan[i].pcm) + { + if (chan[i].active && chan[i].dacSample>=0 && chan[i].dacSamplesong.sampleLen) + { + chan[i].dacPos=0; + chan[i].dacPeriod=0; + } + } + } + if (chan[i].std.op[1].am.had) { //noise phase reset + chan[i].phaseResetNoise = chan[i].std.op[1].am.val & 1; + + if(chan[i].phaseResetNoise) + { + flagsChanged = true; + } + } + if (chan[i].std.op[2].am.had) { //envelope reset + chan[i].envReset = chan[i].std.op[2].am.val & 1; + + if(chan[i].envReset) + { + flagsChanged = true; + } + } + if (chan[i].std.ex2.had) { //attack + chan[i].attack = chan[i].std.ex2.val & 0xff; + envChanged = true; + } + if (chan[i].std.ex3.had) { //decay + chan[i].decay = chan[i].std.ex3.val & 0xff; + envChanged = true; + } + if (chan[i].std.ex4.had) { //sustain + chan[i].sustain = chan[i].std.ex4.val & 0xff; + envChanged = true; + } + if (chan[i].std.ex5.had) { //sustain rate + chan[i].sr = chan[i].std.ex5.val & 0xff; + envChanged = true; + } + if (chan[i].std.ex6.had) { //release + chan[i].release = chan[i].std.ex6.val & 0xff; + envChanged = true; + } + if (chan[i].std.ex7.had) { //noise LFSR feedback bits + chan[i].noiseLFSRMask = chan[i].std.ex7.val & 0x3fffffff; + updateNoiseLFSRMask(i); + chan[i].noiseFreqChanged = true; + } + if (chan[i].std.op[1].ar.had) { //1-bit noise / PCM mode for wavetable chan + if(i == SID3_NUM_CHANNELS - 1) //wave chan + { + rWrite(SID3_REGISTER_WAVEFORM + i * SID3_REGISTERS_PER_CHANNEL, chan[i].std.op[1].ar.val & 1); + } + else + { + if((uint32_t)chan[i].oneBitNoise != (chan[i].std.op[1].ar.val & 1)) + { + chan[i].oneBitNoise = chan[i].std.op[1].ar.val & 1; + flagsChanged = true; + } + } + } + if (chan[i].std.ex8.had) { //wave mix mode + chan[i].mix_mode = chan[i].std.ex8.val & 0xff; + rWrite(SID3_REGISTER_MIXMODE + i * SID3_REGISTERS_PER_CHANNEL, chan[i].mix_mode); //mixmode + } + + for(int j = 0; j < SID3_NUM_FILTERS; j++) //filter macros + { + DivMacroInt::IntOp* op = &chan[i].std.op[j]; + DivPlatformSID3::Channel::Filter* ch_filt = &chan[i].filt[j]; + DivInstrumentSID3::Filter* ins_filt = &ins->sid3.filt[j]; + + bool doUpdateFilter = false; + + if (op->d2r.had) { //cutoff + if (ins_filt->absoluteCutoff) { + ch_filt->cutoff=op->d2r.val; + } else { + ch_filt->cutoff+=op->d2r.val; + } + ch_filt->cutoff&=65535; + doUpdateFilter = true; + } + if (op->dam.had) { //resonance + ch_filt->resonance=op->dam.val & 0xff; + doUpdateFilter = true; + } + if (op->dr.had) { //filter toggle + ch_filt->enabled=op->dr.val & 1; + doUpdateFilter = true; + } + if (op->dt2.had) { //distortion level + ch_filt->distortion_level=op->dt2.val & 0xff; + doUpdateFilter = true; + } + if (op->dt.had) { //output volume + ch_filt->output_volume=op->dt.val & 0xff; + doUpdateFilter = true; + } + if (op->dvb.had) { //connect to channel input + ch_filt->mode &= ~SID3_FILTER_CHANNEL_INPUT; + ch_filt->mode |= (op->dvb.val & 1) ? SID3_FILTER_CHANNEL_INPUT : 0; + doUpdateFilter = true; + } + if (op->egt.had) { //connect to channel output + ch_filt->mode &= ~SID3_FILTER_OUTPUT; + ch_filt->mode |= (op->egt.val & 1) ? SID3_FILTER_OUTPUT : 0; + doUpdateFilter = true; + } + if (op->ksl.had) { //connection matrix row + ch_filt->filter_matrix=op->ksl.val & 0xf; + doUpdateFilter = true; + } + if (op->ksr.had) { //filter mode + ch_filt->mode &= ~(SID3_FILTER_LP | SID3_FILTER_HP | SID3_FILTER_BP); + if(op->ksr.val & 1) ch_filt->mode |= SID3_FILTER_LP; + if(op->ksr.val & 2) ch_filt->mode |= SID3_FILTER_BP; + if(op->ksr.val & 4) ch_filt->mode |= SID3_FILTER_HP; + doUpdateFilter = true; + } + + if(doUpdateFilter) + { + updateFilter(i, j); + } + } + + if(panChanged) + { + updatePanning(i); + } + if(flagsChanged) + { + updateFlags(i, chan[i].gate); + + chan[i].phaseReset = false; + chan[i].phaseResetNoise = false; + chan[i].envReset = false; + } + if(envChanged) + { + updateEnvelope(i); + } + + if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) + { + chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,2,chan[i].pitch2,chipClock,CHIP_FREQBASE); + + if (chan[i].keyOn) + { + DivInstrument* ins=parent->getIns(chan[i].ins,DIV_INS_SID3); + if(i == SID3_NUM_CHANNELS - 1) + { + if(ins->sid3.doWavetable && !ins->amiga.useSample) + { + rWrite(SID3_REGISTER_WAVEFORM + i * SID3_REGISTERS_PER_CHANNEL, 0); //wave channel mode + } + else + { + rWrite(SID3_REGISTER_WAVEFORM + i * SID3_REGISTERS_PER_CHANNEL, 1); //wave channel mode + } + } + else + { + rWrite(SID3_REGISTER_WAVEFORM + i * SID3_REGISTERS_PER_CHANNEL, chan[i].wave); + } + + rWrite(SID3_REGISTER_SPECIAL_WAVE + i * SID3_REGISTERS_PER_CHANNEL, chan[i].special_wave); //special wave + + rWrite(SID3_REGISTER_ADSR_VOL + i * SID3_REGISTERS_PER_CHANNEL, chan[i].outVol); //set volume + rWrite(SID3_REGISTER_MIXMODE + i * SID3_REGISTERS_PER_CHANNEL, chan[i].mix_mode); //mixmode + + rWrite(SID3_REGISTER_RING_MOD_SRC + i * SID3_REGISTERS_PER_CHANNEL, chan[i].ringSrc); //ring mod source + rWrite(SID3_REGISTER_SYNC_SRC + i * SID3_REGISTERS_PER_CHANNEL, chan[i].syncSrc); //hard sync source + rWrite(SID3_REGISTER_PHASE_MOD_SRC + i * SID3_REGISTERS_PER_CHANNEL, chan[i].phaseSrc); //phase mod source + + rWrite(SID3_REGISTER_PHASE_INVERSION + i * SID3_REGISTERS_PER_CHANNEL, chan[i].phaseInv); //signal inversion + rWrite(SID3_REGISTER_FEEDBACK + i * SID3_REGISTERS_PER_CHANNEL, chan[i].feedback); //feedback + + updateEnvelope(i); + + updateFlags(i, false); //gate off TODO: make it properly? + updateFlags(i, true); //gate on + chan[i].gate = true; + } + if (chan[i].keyOff) + { + updateFlags(i, false); //gate off + chan[i].gate = false; + } + + if (chan[i].freq<0) chan[i].freq=0; + if (chan[i].freq>0xffffff) chan[i].freq=0xffffff; + + updateFreq(i); + + for(int j = 0; j < SID3_NUM_FILTERS; j++) + { + bool doUpdateFilter = false; + + if(chan[i].filt[j].bindCutoffToNote && (!ins->sid3.filt[j].bindCutoffOnNote || chan[i].keyOn)) + { + double scaling = CURRENT_FREQ_IN_HZ() / FREQ_FOR_NOTE(chan[i].filt[j].bindCutoffToNoteCenter) - 1.0; + if (chan[i].filt[j].bindCutoffToNoteDir) + { + scaling *= -1.0; + } + + int cutoff = ins->sid3.filt[j].cutoff + (int)(scaling * (double)chan[i].filt[j].bindCutoffToNoteStrength * 80.0); + + if(cutoff > 0xffff) cutoff = 0xffff; + if(cutoff < 0) cutoff = 0; + + chan[i].filt[j].cutoff = cutoff; + doUpdateFilter = true; + } + + if(chan[i].filt[j].bindResonanceToNote && (!ins->sid3.filt[j].bindResonanceOnNote || chan[i].keyOn)) + { + double scaling = CURRENT_FREQ_IN_HZ() / FREQ_FOR_NOTE(chan[i].filt[j].bindResonanceToNoteCenter) - 1.0; + if (chan[i].filt[j].bindResonanceToNoteDir) + { + scaling *= -1.0; + } + + int res = ins->sid3.filt[j].resonance + (int)(scaling * (double)chan[i].filt[j].bindResonanceToNoteStrength * 80.0 / 256.0); + + if(res > 0xff) res = 0xff; + if(res < 0) res = 0; + + chan[i].filt[j].resonance = res; + doUpdateFilter = true; + } + + if(doUpdateFilter) + { + updateFilter(i, j); + } + } + + if (chan[i].pcm && i == SID3_NUM_CHANNELS - 1) { + double off=1.0; + if (chan[i].dacSample>=0 && chan[i].dacSamplesong.sampleLen) { + DivSample* s=parent->getSample(chan[i].dacSample); + if (s->centerRate<1) { + off=1.0; + } else { + off=(double)s->centerRate/8363.0; + } + } + chan[i].dacRate=chan[i].freq*(off / 32.0)*(double)chipClock/1000000.0; + } + + chan[i].noiseFreqChanged = true; + + if(chan[i].independentNoiseFreq) + { + chan[i].noise_pitch2 = chan[i].pitch2; + } + + if (chan[i].keyOn) chan[i].keyOn=false; + if (chan[i].keyOff) chan[i].keyOff=false; + chan[i].freqChanged=false; + } + + if(chan[i].noiseFreqChanged) + { + if(chan[i].independentNoiseFreq) + { + chan[i].noiseFreq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].noise_fixedArp?chan[i].noise_baseNoteOverride:chan[i].noise_arpOff,chan[i].noise_fixedArp,false,2,chan[i].noise_pitch2,chipClock,CHIP_FREQBASE); + } + else + { + chan[i].noiseFreq = chan[i].freq; + } + + bool found = false; + int index = 0; + while(noiseInterestingWavesData[index].LFSRmask != 0 && !found) + { + if(noiseInterestingWavesData[index].LFSRmask == chan[i].noiseLFSRMask) + { + chan[i].noiseFreq *= noiseInterestingWavesData[index].freqScaling; + found = true; + } + index++; + } + + if (chan[i].noiseFreq<0) chan[i].noiseFreq=0; + if (chan[i].noiseFreq>0xffffff) chan[i].noiseFreq=0xffffff; + + updateNoiseFreq(i); + + chan[i].noiseFreqChanged = false; + } + } + + if (chan[SID3_NUM_CHANNELS - 1].active && !chan[SID3_NUM_CHANNELS - 1].pcm) + { + if (ws.tick()) + { + doUpdateWave = true; + } + } + + if(doUpdateWave) + { + updateWave(); + doUpdateWave = false; + } +} + +int DivPlatformSID3::dispatch(DivCommand c) { + if (c.chan>SID3_NUM_CHANNELS - 1) return 0; + + bool updEnv = false; + DivInstrument* ins=parent->getIns(chan[c.chan].ins,DIV_INS_SID3); + int filter = 0; + + switch (c.cmd) { + case DIV_CMD_NOTE_ON: { + DivInstrument* ins=parent->getIns(chan[c.chan].ins,DIV_INS_SID3); + if (c.value!=DIV_NOTE_NULL) { + chan[c.chan].baseFreq=NOTE_FREQUENCY(c.value); + chan[c.chan].freqChanged=true; + chan[c.chan].note=c.value; + } + chan[c.chan].active=true; + chan[c.chan].keyOn=true; + + if (ins->amiga.useSample) + { + chan[c.chan].pcm=true; + } + else + { + chan[c.chan].pcm=false; + } + + if (chan[c.chan].pcm && c.chan == SID3_NUM_CHANNELS - 1) + { + if (ins->amiga.useSample) + { + if (skipRegisterWrites) break; + if (c.value!=DIV_NOTE_NULL) { + chan[c.chan].dacSample=ins->amiga.getSample(c.value); + chan[c.chan].sampleNote=c.value; + c.value=ins->amiga.getFreq(c.value); + chan[c.chan].sampleNoteDelta=c.value-chan[c.chan].sampleNote; + } else if (chan[c.chan].sampleNote!=DIV_NOTE_NULL) { + chan[c.chan].dacSample=ins->amiga.getSample(chan[c.chan].sampleNote); + c.value=ins->amiga.getFreq(chan[c.chan].sampleNote); + } + if (chan[c.chan].dacSample<0 || chan[c.chan].dacSample>=parent->song.sampleLen) + { + chan[c.chan].dacSample=-1; + break; + } + chan[c.chan].dacPos=0; + chan[c.chan].dacPeriod=0; + if (c.value!=DIV_NOTE_NULL) + { + chan[c.chan].baseFreq=NOTE_PERIODIC(c.value); + chan[c.chan].freqChanged=true; + chan[c.chan].note=c.value; + } + chan[c.chan].active=true; + chan[c.chan].macroInit(ins); + if (!parent->song.brokenOutVol && !chan[c.chan].std.vol.will) { + chan[c.chan].outVol=chan[c.chan].vol; + } + //chan[c.chan].keyOn=true; + } + } + + if (chan[c.chan].insChanged) + { + chan[c.chan].wave = (ins->sid3.triOn ? SID3_WAVE_TRIANGLE : 0) | (ins->sid3.sawOn ? SID3_WAVE_SAW : 0) | + (ins->sid3.pulseOn ? SID3_WAVE_PULSE : 0) | (ins->sid3.noiseOn ? SID3_WAVE_NOISE : 0) | (ins->sid3.specialWaveOn ? SID3_WAVE_SPECIAL : 0); //waveform + chan[c.chan].special_wave = ins->sid3.special_wave; //special wave + + chan[c.chan].attack=ins->sid3.a; + chan[c.chan].decay=ins->sid3.d; + chan[c.chan].sustain=ins->sid3.s; + chan[c.chan].sr=ins->sid3.sr; + chan[c.chan].release=ins->sid3.r; + + chan[c.chan].sync = ins->sid3.oscSync; + chan[c.chan].ring = ins->sid3.ringMod; + chan[c.chan].phase = ins->sid3.phase_mod; + chan[c.chan].oneBitNoise = ins->sid3.oneBitNoise; + + chan[c.chan].mix_mode = ins->sid3.mixMode; + + chan[c.chan].ringSrc = ins->sid3.ring_mod_source; + chan[c.chan].syncSrc = ins->sid3.sync_source; + chan[c.chan].phaseSrc = ins->sid3.phase_mod_source; + + chan[c.chan].independentNoiseFreq = ins->sid3.separateNoisePitch; + + chan[c.chan].phaseInv = ins->sid3.phaseInv; + chan[c.chan].feedback = ins->sid3.feedback; + + for(int j = 0; j < SID3_NUM_FILTERS; j++) + { + if(ins->sid3.filt[j].init) + { + chan[c.chan].filt[j].cutoff = ins->sid3.filt[j].cutoff; + chan[c.chan].filt[j].resonance = ins->sid3.filt[j].resonance; + chan[c.chan].filt[j].distortion_level = ins->sid3.filt[j].distortion_level; + chan[c.chan].filt[j].enabled = ins->sid3.filt[j].enabled; + chan[c.chan].filt[j].filter_matrix = ins->sid3.filt[j].filter_matrix; + chan[c.chan].filt[j].mode = ins->sid3.filt[j].mode; + chan[c.chan].filt[j].output_volume = ins->sid3.filt[j].output_volume; + + chan[c.chan].filt[j].bindCutoffToNote = ins->sid3.filt[j].bindCutoffToNote; + chan[c.chan].filt[j].bindCutoffToNoteStrength = ins->sid3.filt[j].bindCutoffToNoteStrength; + chan[c.chan].filt[j].bindCutoffToNoteCenter = ins->sid3.filt[j].bindCutoffToNoteCenter; + chan[c.chan].filt[j].bindCutoffToNoteDir = ins->sid3.filt[j].bindCutoffToNoteDir; + + chan[c.chan].filt[j].bindResonanceToNote = ins->sid3.filt[j].bindResonanceToNote; + chan[c.chan].filt[j].bindResonanceToNoteStrength = ins->sid3.filt[j].bindResonanceToNoteStrength; + chan[c.chan].filt[j].bindResonanceToNoteCenter = ins->sid3.filt[j].bindResonanceToNoteCenter; + chan[c.chan].filt[j].bindResonanceToNoteDir = ins->sid3.filt[j].bindResonanceToNoteDir; + + updateFilter(c.chan, j); + } + } + + if(c.chan == SID3_NUM_CHANNELS - 1) + { + if(!chan[c.chan].pcm) + { + ws.changeWave1(chan[c.chan].wavetable, false); + ws.init(ins,256,255,chan[c.chan].insChanged); + } + } + } + if(ins->sid3.resetDuty||chan[c.chan].insChanged) + { + chan[c.chan].duty=ins->sid3.duty; + updateDuty(c.chan); + } + if (chan[c.chan].insChanged) { + chan[c.chan].insChanged=false; + } + chan[c.chan].macroInit(ins); + break; + } + case DIV_CMD_NOTE_OFF: + chan[c.chan].active=false; + chan[c.chan].keyOff=true; + chan[c.chan].keyOn=false; + //chan[c.chan].macroInit(NULL); + break; + case DIV_CMD_NOTE_OFF_ENV: + chan[c.chan].active=false; + chan[c.chan].keyOff=true; + chan[c.chan].keyOn=false; + chan[c.chan].std.release(); + break; + case DIV_CMD_ENV_RELEASE: + chan[c.chan].std.release(); + break; + case DIV_CMD_INSTRUMENT: + if (chan[c.chan].ins!=c.value || c.value2==1) { + chan[c.chan].insChanged=true; + chan[c.chan].ins=c.value; + } + break; + case DIV_CMD_VOLUME: + if (chan[c.chan].vol!=c.value) { + chan[c.chan].vol=c.value; + if (!chan[c.chan].std.vol.has) { + chan[c.chan].outVol=c.value; + chan[c.chan].vol=chan[c.chan].outVol; + rWrite(SID3_REGISTER_ADSR_VOL + c.chan * SID3_REGISTERS_PER_CHANNEL, chan[c.chan].vol); + } + } + break; + case DIV_CMD_GET_VOLUME: + if (chan[c.chan].std.vol.has) { + return chan[c.chan].vol; + } + return chan[c.chan].outVol; + break; + case DIV_CMD_PITCH: + chan[c.chan].pitch=c.value; + chan[c.chan].freqChanged=true; + break; + case DIV_CMD_NOTE_PORTA: { + int destFreq=NOTE_FREQUENCY(c.value2); + bool return2=false; + if (destFreq>chan[c.chan].baseFreq) { + chan[c.chan].baseFreq+=c.value; + if (chan[c.chan].baseFreq>=destFreq) { + chan[c.chan].baseFreq=destFreq; + return2=true; + } + } else { + chan[c.chan].baseFreq-=c.value; + if (chan[c.chan].baseFreq<=destFreq) { + chan[c.chan].baseFreq=destFreq; + return2=true; + } + } + chan[c.chan].freqChanged=true; + if (return2) { + chan[c.chan].inPorta=false; + return 2; + } + break; + } + case DIV_CMD_LEGATO: + chan[c.chan].baseFreq=NOTE_FREQUENCY(c.value+((HACKY_LEGATO_MESS)?(chan[c.chan].std.arp.val):(0))); + chan[c.chan].freqChanged=true; + chan[c.chan].note=c.value; + break; + case DIV_CMD_PRE_PORTA: + if (chan[c.chan].active && c.value2) { + if (parent->song.resetMacroOnPorta || parent->song.preNoteNoEffect) { + chan[c.chan].macroInit(parent->getIns(chan[c.chan].ins,DIV_INS_SID3)); + chan[c.chan].keyOn=true; + } + } + if (!chan[c.chan].inPorta && c.value && !parent->song.brokenPortaArp && chan[c.chan].std.arp.will && !NEW_ARP_STRAT) chan[c.chan].baseFreq=NOTE_FREQUENCY(chan[c.chan].note); + chan[c.chan].inPorta=c.value; + break; + case DIV_CMD_PANNING: { + bool updPan = false; + if (!chan[c.chan].std.panL.has) + { + chan[c.chan].panLeft = c.value; + updPan = true; + } + if (!chan[c.chan].std.panR.has) + { + chan[c.chan].panRight = c.value2; + updPan = true; + } + if(updPan) + { + updatePanning(c.chan); + } + break; + } + case DIV_CMD_GET_VOLMAX: + return SID3_MAX_VOL; + break; + case DIV_CMD_WAVE: + if(c.chan == SID3_NUM_CHANNELS - 1 && ins->sid3.doWavetable) + { + chan[c.chan].wavetable = c.value & 0xff; + ws.changeWave1(chan[c.chan].wave); + } + else + { + chan[c.chan].wave = c.value & 0xff; + rWrite(SID3_REGISTER_WAVEFORM + c.chan * SID3_REGISTERS_PER_CHANNEL, chan[c.chan].wave); + } + break; + case DIV_CMD_SID3_SPECIAL_WAVE: + chan[c.chan].special_wave = c.value % SID3_NUM_SPECIAL_WAVES; + rWrite(SID3_REGISTER_SPECIAL_WAVE + c.chan * SID3_REGISTERS_PER_CHANNEL, chan[c.chan].special_wave); + break; + case DIV_CMD_C64_EXTENDED: + chan[c.chan].ring = c.value & 1; + chan[c.chan].sync = c.value & 2; + chan[c.chan].phase = c.value & 4; + updateFlags(c.chan, chan[c.chan].gate); + break; + case DIV_CMD_C64_DUTY_RESET: + if (c.value&15) { + DivInstrument* ins=parent->getIns(chan[c.chan].ins,DIV_INS_SID3); + chan[c.chan].duty=ins->sid3.duty; + updateDuty(c.chan); + } + chan[c.chan].resetDuty=c.value>>4; + break; + case DIV_CMD_SID3_RING_MOD_SRC: + chan[c.chan].ringSrc = c.value % (SID3_NUM_CHANNELS + 1); + rWrite(SID3_REGISTER_RING_MOD_SRC + c.chan * SID3_REGISTERS_PER_CHANNEL, chan[c.chan].ringSrc); + break; + case DIV_CMD_SID3_HARD_SYNC_SRC: + chan[c.chan].syncSrc = c.value % SID3_NUM_CHANNELS; + rWrite(SID3_REGISTER_SYNC_SRC + c.chan * SID3_REGISTERS_PER_CHANNEL, chan[c.chan].syncSrc); + break; + case DIV_CMD_SID3_PHASE_MOD_SRC: + chan[c.chan].phaseSrc = c.value % SID3_NUM_CHANNELS; + rWrite(SID3_REGISTER_PHASE_MOD_SRC + c.chan * SID3_REGISTERS_PER_CHANNEL, chan[c.chan].phaseSrc); + break; + case DIV_CMD_FM_AR: + chan[c.chan].attack = c.value & 0xff; + updEnv = true; + break; + case DIV_CMD_FM_DR: + chan[c.chan].decay = c.value & 0xff; + updEnv = true; + break; + case DIV_CMD_FM_SL: + chan[c.chan].sustain = c.value & 0xff; + updEnv = true; + break; + case DIV_CMD_FM_D2R: + chan[c.chan].sr = c.value & 0xff; + updEnv = true; + break; + case DIV_CMD_FM_RR: + chan[c.chan].release = c.value & 0xff; + updEnv = true; + break; + case DIV_CMD_SID3_WAVE_MIX: + chan[c.chan].mix_mode = c.value % 5; + rWrite(SID3_REGISTER_MIXMODE + c.chan * SID3_REGISTERS_PER_CHANNEL, chan[c.chan].mix_mode); + break; + case DIV_CMD_SID3_LFSR_FEEDBACK_BITS: + chan[c.chan].noiseLFSRMask &= ~(0xffU << (8 * c.value2)); + chan[c.chan].noiseLFSRMask |= ((c.value & (c.value2 == 3 ? 0x3f : 0xff)) << (8 * c.value2)); + updateNoiseLFSRMask(c.chan); + chan[c.chan].noiseFreqChanged = true; + break; + case DIV_CMD_SID3_1_BIT_NOISE: + if(c.chan == SID3_NUM_CHANNELS - 1) //wave chan + { + rWrite(SID3_REGISTER_WAVEFORM + c.chan * SID3_REGISTERS_PER_CHANNEL, c.value & 1); //PCM mode + } + else + { + if((uint32_t)chan[c.chan].oneBitNoise != (c.value & 1)) + { + chan[c.chan].oneBitNoise = c.value & 1; + updateFlags(c.chan, chan[c.chan].gate); + } + } + break; + case DIV_CMD_C64_FINE_DUTY: + chan[c.chan].duty = (c.value & 0xfff) << 4; + updateDuty(c.chan); + break; + case DIV_CMD_FM_FB: + chan[c.chan].feedback = c.value & 0xff; + rWrite(SID3_REGISTER_FEEDBACK + c.chan * SID3_REGISTERS_PER_CHANNEL, chan[c.chan].feedback); + break; + case DIV_CMD_SID3_CHANNEL_INVERSION: + chan[c.chan].phaseInv = c.value & 3; + rWrite(SID3_REGISTER_PHASE_INVERSION + c.chan * SID3_REGISTERS_PER_CHANNEL, chan[c.chan].phaseInv); + break; + case DIV_CMD_C64_FINE_CUTOFF: + chan[c.chan].filt[c.value2].cutoff = (c.value & 0xfff) << 4; + updateFilter(c.chan, c.value2); + break; + case DIV_CMD_C64_RESONANCE: + chan[c.chan].filt[c.value2].resonance = c.value & 0xff; + updateFilter(c.chan, c.value2); + break; + case DIV_CMD_SID3_FILTER_OUTPUT_VOLUME: + chan[c.chan].filt[c.value2].output_volume = c.value & 0xff; + updateFilter(c.chan, c.value2); + break; + case DIV_CMD_SID3_FILTER_DISTORTION: + chan[c.chan].filt[c.value2].distortion_level = c.value & 0xff; + updateFilter(c.chan, c.value2); + break; + case DIV_CMD_C64_FILTER_MODE: + chan[c.chan].filt[(c.value >> 4) & 3].mode &= ~(SID3_FILTER_LP | SID3_FILTER_HP | SID3_FILTER_BP); + if(c.value & 1) chan[c.chan].filt[(c.value >> 4) & 3].mode |= SID3_FILTER_LP; + if(c.value & 2) chan[c.chan].filt[(c.value >> 4) & 3].mode |= SID3_FILTER_BP; + if(c.value & 4) chan[c.chan].filt[(c.value >> 4) & 3].mode |= SID3_FILTER_HP; + updateFilter(c.chan, (c.value >> 4) & 3); + break; + case DIV_CMD_SID3_FILTER_CONNECTION: + chan[c.chan].filt[(c.value >> 4) & 3].mode &= ~(SID3_FILTER_CHANNEL_INPUT | SID3_FILTER_OUTPUT); + if(c.value & 1) chan[c.chan].filt[(c.value >> 4) & 3].mode |= SID3_FILTER_CHANNEL_INPUT; + if(c.value & 2) chan[c.chan].filt[(c.value >> 4) & 3].mode |= SID3_FILTER_OUTPUT; + updateFilter(c.chan, (c.value >> 4) & 3); + break; + case DIV_CMD_SID3_FILTER_MATRIX: + chan[c.chan].filt[(c.value >> 4) & 3].filter_matrix = c.value & 0xf; + updateFilter(c.chan, (c.value >> 4) & 3); + break; + case DIV_CMD_SID3_FILTER_ENABLE: + chan[c.chan].filt[(c.value >> 4) & 3].enabled = c.value & 1; + updateFilter(c.chan, (c.value >> 4) & 3); + break; + case DIV_CMD_C64_PW_SLIDE: + chan[c.chan].pw_slide = c.value * c.value2 * 16; + break; + case DIV_CMD_C64_CUTOFF_SLIDE: + filter = abs(c.value2) - 1; + chan[c.chan].filt[filter].cutoff_slide = c.value * (c.value2 > 0 ? 1 : -1) * 16; + break; + case DIV_CMD_SID3_PHASE_RESET: + chan[c.chan].phase_reset_counter = c.value; + break; + case DIV_CMD_SID3_NOISE_PHASE_RESET: + chan[c.chan].noise_phase_reset_counter = c.value; + break; + case DIV_CMD_SID3_ENVELOPE_RESET: + chan[c.chan].envelope_reset_counter = c.value; + break; + case DIV_CMD_SID3_CUTOFF_SCALING: + chan[c.chan].filt[(c.value >> 4) & 3].bindCutoffToNote = c.value & 1; + chan[c.chan].filt[(c.value >> 4) & 3].bindCutoffToNoteDir = c.value & 2; + chan[c.chan].freqChanged = true; + break; + case DIV_CMD_SID3_RESONANCE_SCALING: + chan[c.chan].filt[(c.value >> 4) & 3].bindResonanceToNote = c.value & 1; + chan[c.chan].filt[(c.value >> 4) & 3].bindResonanceToNoteDir = c.value & 2; + chan[c.chan].freqChanged = true; + break; + case DIV_CMD_SAMPLE_POS: + chan[c.chan].dacPos=c.value; + break; + case DIV_CMD_MACRO_OFF: + chan[c.chan].std.mask(c.value,true); + break; + case DIV_CMD_MACRO_ON: + chan[c.chan].std.mask(c.value,false); + break; + case DIV_CMD_MACRO_RESTART: + chan[c.chan].std.restart(c.value); + break; + default: + break; + } + + if(updEnv) + { + updateEnvelope(c.chan); + } + return 1; +} + +void DivPlatformSID3::muteChannel(int ch, bool mute) { + isMuted[ch]=mute; + sid3_set_is_muted(sid3,ch,mute); +} + +void DivPlatformSID3::forceIns() { + for (int i=0; i& wlist) { + for (DivRegWrite& i: wlist) rWrite(i.addr,i.val); +} + +void DivPlatformSID3::setFlags(const DivConfig& flags) { + chipClock=1000000; + CHECK_CUSTOM_CLOCK; + + quarterClock=flags.getBool("quarterClock",false); + + if(quarterClock && chipClock >= 1000000 && !parent->isExporting()) + { + chipClock /= 4; + } + + rate=chipClock; + sid3_set_clock_rate(sid3, chipClock); + for (int i=0; irate=rate/8; + } +} + +void DivPlatformSID3::getPaired(int ch, std::vector& ret) +{ + if(chan[ch].phase) + { + ret.push_back(DivChannelPair(_("phase"), chan[ch].phaseSrc)); + } + if(chan[ch].ring) + { + if(chan[ch].ringSrc == SID3_NUM_CHANNELS) + { + ret.push_back(DivChannelPair(_("ring"), ch)); + } + else + { + ret.push_back(DivChannelPair(_("ring"), chan[ch].ringSrc)); + } + } + if(chan[ch].sync) + { + ret.push_back(DivChannelPair(_("sync"), chan[ch].syncSrc)); + } +} + +int DivPlatformSID3::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) { + parent=p; + dumpWrites=false; + skipRegisterWrites=false; + writeOscBuf=0; + + for (int i=0; i { + int prevFreq; + unsigned char wave, special_wave, attack, decay, sustain, sr, release; + int duty; + bool resetMask, resetFilter, resetDuty, gate, ring, sync, phase, oneBitNoise; + bool phaseReset, envReset, phaseResetNoise; + bool noiseFreqChanged; + unsigned char vol; + unsigned char noise_mode; + unsigned char mix_mode; + unsigned char ringSrc, syncSrc, phaseSrc; + unsigned char panLeft, panRight; + int noiseFreq; + bool independentNoiseFreq; + unsigned int noiseLFSRMask; + + struct Filter + { + int cutoff; + unsigned char resonance; + unsigned char output_volume; + unsigned char distortion_level; + unsigned char mode; + bool enabled; + unsigned char filter_matrix; + + short cutoff_slide; + + bool bindCutoffToNote; //cutoff scaling + unsigned char bindCutoffToNoteStrength; //how much cutoff changes over e.g. 1 semitone + unsigned char bindCutoffToNoteCenter; //central note of the cutoff change + bool bindCutoffToNoteDir; //if we decrease or increase cutoff if e.g. we go upper in note space + + bool bindResonanceToNote; + unsigned char bindResonanceToNoteStrength; //how much resonance changes over e.g. 1 semitone + unsigned char bindResonanceToNoteCenter; //central note of the resonance change + bool bindResonanceToNoteDir; //if we decrease or increase resonance if e.g. we go upper in note space + + Filter(): + cutoff(0), + resonance(0), + output_volume(0), + distortion_level(0), + mode(0), + enabled(false), + filter_matrix(0), + cutoff_slide(0), + bindCutoffToNote(false), + bindCutoffToNoteStrength(0), + bindCutoffToNoteCenter(0), + bindCutoffToNoteDir(false), + bindResonanceToNote(false), + bindResonanceToNoteStrength(0), + bindResonanceToNoteCenter(0), + bindResonanceToNoteDir(false) {} + } filt[SID3_NUM_FILTERS]; + + int noise_baseNoteOverride; + bool noise_fixedArp; + int noise_arpOff; + int noise_pitch2; + bool noise_hasArp; + bool noise_hasPitch; + + bool pcm; + int wavetable; + + long long dacPeriod, dacRate, dacOut; + unsigned long long dacPos; + int dacSample; + + unsigned char phaseInv; + unsigned char feedback; + + short pw_slide; + + short phase_reset_counter; + short noise_phase_reset_counter; + short envelope_reset_counter; + + void handleArpNoise(int offset=0) + { + DivMacroStruct& m = this->std.op[3].am; + + if (m.had) { + noise_hasArp=true; + + if (m.val<0) { + if (!(m.val&0x40000000)) { + noise_baseNoteOverride=(m.val|0x40000000)+offset; + noise_fixedArp=true; + } else { + noise_arpOff=m.val; + noise_fixedArp=false; + } + } else { + if (m.val&0x40000000) { + noise_baseNoteOverride=(m.val&(~0x40000000))+offset; + noise_fixedArp=true; + } else { + noise_arpOff=m.val; + noise_fixedArp=false; + } + } + noiseFreqChanged=true; + } + + else + { + noise_hasArp=false; + } + } + + void handlePitchNoise() + { + DivMacroStruct& m = this->std.op[0].ar; + + if (m.had) { + noise_hasPitch=true; + + if (m.mode) { + noise_pitch2+=m.val; + CLAMP_VAR(noise_pitch2,-131071,131071); + } else { + noise_pitch2=m.val; + } + noiseFreqChanged=true; + } + + else + { + noise_hasPitch=false; + } + } + + Channel(): + SharedChannel(SID3_MAX_VOL), + prevFreq(0xffffff), + wave(0), + special_wave(0), + attack(0), + decay(0), + sustain(0), + sr(0), + release(0), + duty(0), + resetMask(false), + resetFilter(false), + resetDuty(false), + gate(true), + ring(false), + sync(false), + phase(false), + oneBitNoise(false), + phaseReset(false), + envReset(false), + phaseResetNoise(false), + noiseFreqChanged(false), + vol(SID3_MAX_VOL), + noise_mode(0), + mix_mode(0), + ringSrc(0), + syncSrc(0), + phaseSrc(0), + panLeft(0xff), + panRight(0xff), + noiseFreq(0), + independentNoiseFreq(false), + noiseLFSRMask((1 << 29) | (1 << 5) | (1 << 3) | 1), //https://docs.amd.com/v/u/en-US/xapp052 for 30 bits: 30, 6, 4, 1 + pcm(false), + wavetable(-1), + dacPeriod(0), + dacRate(0), + dacOut(0), + dacPos(0), + dacSample(-1), + phaseInv(0), + feedback(0), + pw_slide(0), + phase_reset_counter(-1), + noise_phase_reset_counter(-1), + envelope_reset_counter(-1) {} + }; + Channel chan[SID3_NUM_CHANNELS]; + DivDispatchOscBuffer* oscBuf[SID3_NUM_CHANNELS]; + struct QueuedWrite { + unsigned short addr; + unsigned char val; + QueuedWrite(): addr(0), val(0) {} + QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v) {} + }; + FixedQueue writes; + DivWaveSynth ws; + + unsigned char writeOscBuf; + + SID3* sid3; + unsigned char regPool[SID3_NUM_REGISTERS]; + + bool isMuted[SID3_NUM_CHANNELS]; + + unsigned char sampleTick; //used to update streamed sample and not clash with other reg writes at high rate samples + bool updateSample; + bool quarterClock; + + friend void putDispatchChip(void*,int); + friend void putDispatchChan(void*,int,int); + + void updateFlags(int channel, bool gate); + void updateFilter(int channel, int filter); + void updateFreq(int channel); + void updateNoiseFreq(int channel); + void updateNoiseLFSRMask(int channel); + void updateDuty(int channel); + void updateEnvelope(int channel); + void updatePanning(int channel); + void updateWave(); + + public: + void acquire(short** buf, size_t len); + int dispatch(DivCommand c); + void* getChanState(int chan); + DivDispatchOscBuffer* getOscBuffer(int chan); + unsigned char* getRegisterPool(); + int getRegisterPoolSize(); + void reset(); + void forceIns(); + void tick(bool sysTick=true); + void muteChannel(int ch, bool mute); + void setFlags(const DivConfig& flags); + void notifyInsChange(int ins); + void notifyWaveChange(int wave); + float getPostAmp(); + bool getDCOffRequired(); + DivMacroInt* getChanMacroInt(int ch); + DivChannelModeHints getModeHints(int chan); + void notifyInsDeletion(void* ins); + void poke(unsigned int addr, unsigned short val); + void poke(std::vector& wlist); + const char** getRegisterSheet(); + int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags); + int getOutputCount(); + void getPaired(int ch, std::vector& ret); + void quit(); + ~DivPlatformSID3(); +}; + +#endif diff --git a/src/engine/platform/snes.cpp b/src/engine/platform/snes.cpp index dd0571099..31f04ca26 100644 --- a/src/engine/platform/snes.cpp +++ b/src/engine/platform/snes.cpp @@ -723,11 +723,10 @@ unsigned short DivPlatformSNES::getPan(int ch) { return (chan[ch].panL<<8)|chan[ch].panR; } -DivChannelPair DivPlatformSNES::getPaired(int ch) { +void DivPlatformSNES::getPaired(int ch, std::vector& ret) { if (chan[ch].pitchMod) { - return DivChannelPair("mod",(ch-1)&7); + ret.push_back(DivChannelPair(_("mod"),(ch-1)&7)); } - return DivChannelPair(); } DivChannelModeHints DivPlatformSNES::getModeHints(int ch) { diff --git a/src/engine/platform/snes.h b/src/engine/platform/snes.h index 6426cf395..e813b6abf 100644 --- a/src/engine/platform/snes.h +++ b/src/engine/platform/snes.h @@ -106,7 +106,7 @@ class DivPlatformSNES: public DivDispatch { void* getChanState(int chan); DivMacroInt* getChanMacroInt(int ch); unsigned short getPan(int chan); - DivChannelPair getPaired(int chan); + void getPaired(int ch, std::vector& ret); DivChannelModeHints getModeHints(int chan); DivSamplePos getSamplePos(int ch); DivDispatchOscBuffer* getOscBuffer(int chan); diff --git a/src/engine/platform/sound/sid3.c b/src/engine/platform/sound/sid3.c new file mode 100644 index 000000000..9f0d89675 --- /dev/null +++ b/src/engine/platform/sound/sid3.c @@ -0,0 +1,3856 @@ +#include "sid3.h" + +#include + +#define SAFETY_HEADER if(sid3 == NULL) return; + +enum State { ATTACK, DECAY, SUSTAIN, RELEASE }; //for envelope + +#ifndef M_PI +# define M_PI 3.14159265358979323846 +#endif + +#define envspd_factor_a_sr 10 +#define envspd_factor_dr 15 + +#define envspd_a(rate) ((uint64_t)0xff0000 / ((rate == 0 ? 1 : (rate * envspd_factor_a_sr)) * (rate == 0 ? 1 : (rate * envspd_factor_a_sr * ((float)sid3->clock_rate / 1000000.0))))) +#define envspd_dr(rate) ((uint64_t)0xff0000 / ((rate == 0 ? 1 : (rate * envspd_factor_dr)) * (rate == 0 ? 1 : (rate * envspd_factor_dr * ((float)sid3->clock_rate / 1000000.0))))) +#define envspd_sr(rate) (rate == 0 ? 0 : ((uint64_t)0xff0000 / ((256 - rate) * (256 - rate) * envspd_factor_a_sr * envspd_factor_a_sr * ((float)sid3->clock_rate / 1000000.0)))) + +//these 4 ones are util only +double square(double x) { + return fmod(x, (2 * M_PI)) >= M_PI ? -1 : 1; +} +double triangle(double x) { + return asin(sin(x)) / (M_PI / 2); +} +double saw(double x) { + return atan(tan(x / 2)) / (M_PI / 2); +} +double rectSquare(double x) { + return square(x) > 0 ? square(x) : 0; +} +//=========================== + +double sinus(double x) { //taken from waveEdit.cpp of Furnace tracker + return sin(x); +} +double rectSin(double x) { + return sin(x) > 0 ? sin(x) : 0; +} +double absSin(double x) { + return fabs(sin(x)); +} + +double quartSin(double x) { + return absSin(x) * rectSquare(2 * x); +} +double squiSin(double x) { + return sin(x) >= 0 ? sin(2 * x) : 0; +} +double squiAbsSin(double x) { + return fabs(squiSin(x)); +} + +double rectSaw(double x) { + return saw(x) > 0 ? saw(x) : 0; +} +double absSaw(double x) { + return saw(x) < 0 ? saw(x) + 1 : saw(x); +} + + +double cubSaw(double x) { + return pow(saw(x), 3); +} +double rectCubSaw(double x) { + return pow(rectSaw(x), 3); +} +double absCubSaw(double x) { + return pow(absSaw(x), 3); +} + +double cubSine(double x) { + return pow(sin(x), 3); +} +double rectCubSin(double x) { + return pow(rectSin(x), 3); +} +double absCubSin(double x) { + return pow(absSin(x), 3); +} +double quartCubSin(double x) { + return pow(quartSin(x), 3); +} +double squishCubSin(double x) { + return pow(squiSin(x), 3); +} +double squishAbsCubSin(double x) { + return pow(squiAbsSin(x), 3); +} + +double rectTri(double x) { + return triangle(x) > 0 ? triangle(x) : 0; +} +double absTri(double x) { + return fabs(triangle(x)); +} +double quartTri(double x) { + return absTri(x) * rectSquare(2 * x); +} +double squiTri(double x) { + return sin(x) >= 0 ? triangle(2 * x) : 0; +} +double absSquiTri(double x) { + return fabs(squiTri(x)); +} + +double cubTriangle(double x) { + return pow(triangle(x), 3); +} +double cubRectTri(double x) { + return pow(rectTri(x), 3); +} +double cubAbsTri(double x) { + return pow(absTri(x), 3); +} +double cubQuartTri(double x) { + return pow(quartTri(x), 3); +} +double cubSquiTri(double x) { + return pow(squiTri(x), 3); +} +double absCubSquiTri(double x) { + return fabs(cubSquiTri(x)); +} + +typedef double (*WaveFunc) (double a); + +WaveFunc waveFuncsSID3[]={ + sinus, + rectSin, + absSin, + quartSin, + squiSin, + squiAbsSin, + + rectSaw, + absSaw, + + cubSaw, + rectCubSaw, + absCubSaw, + + cubSine, + rectCubSin, + absCubSin, + quartCubSin, + squishCubSin, + squishAbsCubSin, + + rectTri, + absTri, + quartTri, + squiTri, + absSquiTri, + + cubTriangle, + cubRectTri, + cubAbsTri, + cubQuartTri, + cubSquiTri, + absCubSquiTri +}; + +uint8_t wave8580__ST[] = +{ +/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x018: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x020: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x028: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x030: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x038: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x040: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x048: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x050: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x058: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x060: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x068: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x070: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x078: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x080: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x088: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x090: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x098: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0x100: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x108: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x110: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x118: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x120: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x128: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x130: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x138: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x140: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x148: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x150: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x158: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x160: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x168: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x170: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x178: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x180: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x188: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x190: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x198: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f8: */ 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x0f, +/* 0x200: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x208: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x210: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x218: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x220: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x228: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x230: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x238: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x240: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x248: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x250: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x258: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x260: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x268: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x270: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x278: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x280: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x288: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x290: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x298: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0x300: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x308: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x310: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x318: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x320: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x328: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x330: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x338: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x340: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x348: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x350: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x358: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x360: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x368: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x370: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x378: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x380: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x388: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x390: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x398: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x3c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3f0: */ 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, +/* 0x3f8: */ 0x1e, 0x1e, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, +/* 0x400: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x408: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x410: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x418: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x420: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x428: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x430: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x438: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x440: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x448: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x450: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x458: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x460: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x468: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x470: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x478: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x480: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x488: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x490: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x498: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0x500: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x508: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x510: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x518: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x520: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x528: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x530: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x538: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x540: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x548: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x550: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x558: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x560: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x568: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x570: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x578: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x580: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x588: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x590: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x598: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5f8: */ 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x1f, +/* 0x600: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x608: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x610: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x618: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x620: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x628: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x630: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x638: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x640: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x648: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x650: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x658: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x660: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x668: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x670: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x678: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x680: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x688: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x690: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x698: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0x700: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x708: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x710: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x718: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x720: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x728: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x730: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x738: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x740: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x748: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x750: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x758: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x760: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x768: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x770: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x778: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x780: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x788: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x790: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x798: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x7c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7e0: */ 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, +/* 0x7e8: */ 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, +/* 0x7f0: */ 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3e, +/* 0x7f8: */ 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, +/* 0x800: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x808: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x810: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x818: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x820: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x828: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x830: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x838: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x840: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x848: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x850: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x858: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x860: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x868: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x870: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x878: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x880: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x888: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x890: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x898: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8f8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0x900: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x908: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x910: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x918: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x920: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x928: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x930: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x938: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x940: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x948: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x950: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x958: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x960: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x968: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x970: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x978: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0x980: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x988: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x990: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x998: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9f8: */ 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x0f, +/* 0xa00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0xa80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xab0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xab8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xac0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xac8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xad0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xad8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xae0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xae8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaf8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0xb00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0xb80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xba0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xba8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0xbc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbf0: */ 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, +/* 0xbf8: */ 0x1e, 0x1e, 0x1f, 0x1f, 0x1f, 0x1f, 0x3f, 0x3f, +/* 0xc00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0xc80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xca0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xca8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xce0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xce8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcf8: */ 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, +/* 0xd00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, +/* 0xd80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xda0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xda8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0xdc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xde0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xde8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdf8: */ 0x0e, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x1f, 0x1f, +/* 0xe00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe78: */ 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x83, 0x83, +/* 0xe80: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xe88: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xe90: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xe98: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xea0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xea8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xeb0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xeb8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xec0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xec8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xed0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xed8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xee0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xee8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xef0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xef8: */ 0x80, 0x80, 0x80, 0x80, 0x87, 0x87, 0x87, 0x8f, +/* 0xf00: */ 0xc0, 0xe0, 0xe0, 0xc0, 0xc0, 0xe0, 0xe0, 0xe0, +/* 0xf08: */ 0xe0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xf10: */ 0xc0, 0xe0, 0xe0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xf18: */ 0xe0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xf20: */ 0xc0, 0xe0, 0xe0, 0xc0, 0xc0, 0xe0, 0xe0, 0xe0, +/* 0xf28: */ 0xe0, 0xe0, 0xe0, 0xc0, 0xe0, 0xc0, 0xe0, 0xe0, +/* 0xf30: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf38: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf40: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf48: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf50: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf58: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf60: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf68: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf70: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf78: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe3, 0xe3, +/* 0xf80: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0xf88: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0xf90: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0xf98: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0xfa0: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0xfa8: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0xfb0: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0xfb8: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf1, +/* 0xfc0: */ 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, +/* 0xfc8: */ 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, +/* 0xfd0: */ 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, +/* 0xfd8: */ 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, +/* 0xfe0: */ 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, +/* 0xfe8: */ 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, +/* 0xff0: */ 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, +/* 0xff8: */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +}; + +uint8_t wave8580_P_T[] = +{ +/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x018: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x020: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x028: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x030: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x038: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x040: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x048: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x050: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x058: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x060: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x068: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x070: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x078: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x080: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x088: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x090: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x098: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, +/* 0x100: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x108: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x110: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x118: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x120: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x128: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x130: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x138: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x140: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x148: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x150: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x158: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x160: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x168: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x170: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x178: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x180: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x188: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x190: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x198: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f8: */ 0x00, 0x00, 0x00, 0x1c, 0x00, 0x3c, 0x3f, 0x3f, +/* 0x200: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x208: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x210: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x218: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x220: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x228: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x230: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x238: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x240: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x248: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x250: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x258: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x260: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x268: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x270: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x278: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x280: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x288: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x290: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x298: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x5e, 0x5f, +/* 0x300: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x308: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x310: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x318: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x320: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x328: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x330: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x338: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x340: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x348: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x350: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x358: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x360: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x368: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x370: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0x378: */ 0x00, 0x00, 0x00, 0x40, 0x40, 0x60, 0x60, 0x6f, +/* 0x380: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x388: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x390: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x398: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0x3a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, +/* 0x3b0: */ 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x60, +/* 0x3b8: */ 0x40, 0x40, 0x60, 0x60, 0x60, 0x60, 0x70, 0x77, +/* 0x3c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, +/* 0x3c8: */ 0x40, 0x40, 0x40, 0x40, 0x40, 0x60, 0x60, 0x60, +/* 0x3d0: */ 0x40, 0x40, 0x40, 0x60, 0x60, 0x60, 0x60, 0x70, +/* 0x3d8: */ 0x60, 0x60, 0x60, 0x70, 0x70, 0x70, 0x78, 0x7b, +/* 0x3e0: */ 0x60, 0x60, 0x60, 0x70, 0x60, 0x70, 0x70, 0x70, +/* 0x3e8: */ 0x70, 0x70, 0x70, 0x78, 0x78, 0x78, 0x78, 0x7c, +/* 0x3f0: */ 0x78, 0x78, 0x78, 0x7c, 0x78, 0x7c, 0x7c, 0x7e, +/* 0x3f8: */ 0x7c, 0x7e, 0x7e, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, +/* 0x400: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x408: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x410: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x418: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x420: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x428: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x430: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x438: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x440: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x448: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x450: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x458: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x460: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x468: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x470: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x478: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x480: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x488: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x490: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x498: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, +/* 0x4c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x4d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x4d8: */ 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x4e0: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x4e8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x4f0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x4f8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x8e, 0x9f, +/* 0x500: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x508: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x510: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x518: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x520: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x528: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x80, +/* 0x530: */ 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x538: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x540: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x80, +/* 0x548: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x550: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x558: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x560: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x568: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x570: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x578: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xaf, +/* 0x580: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x588: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x590: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x598: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x5a0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x5a8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x5b0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x5b8: */ 0x80, 0x80, 0x80, 0xa0, 0xa0, 0xa0, 0xa0, 0xb7, +/* 0x5c0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x5c8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xa0, +/* 0x5d0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xa0, 0xa0, +/* 0x5d8: */ 0xa0, 0xa0, 0xa0, 0xb0, 0xa0, 0xb0, 0xb0, 0xbb, +/* 0x5e0: */ 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xb0, 0xb0, +/* 0x5e8: */ 0xa0, 0xb0, 0xb0, 0xb8, 0xb0, 0xb8, 0xb8, 0xbc, +/* 0x5f0: */ 0xb0, 0xb8, 0xb8, 0xb8, 0xb8, 0xbc, 0xbc, 0xbe, +/* 0x5f8: */ 0xbc, 0xbc, 0xbe, 0xbf, 0xbe, 0xbf, 0xbf, 0xbf, +/* 0x600: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x608: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x610: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x618: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x620: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x628: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x630: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x638: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, +/* 0x640: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x648: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x650: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, +/* 0x658: */ 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x660: */ 0x80, 0x80, 0x80, 0xc0, 0x80, 0xc0, 0xc0, 0xc0, +/* 0x668: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x670: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x678: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xcf, +/* 0x680: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, +/* 0x688: */ 0xc0, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x690: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x698: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x6a0: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x6a8: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x6b0: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x6b8: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xd7, +/* 0x6c0: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x6c8: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x6d0: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x6d8: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xd0, 0xd0, 0xd9, +/* 0x6e0: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xd0, +/* 0x6e8: */ 0xc0, 0xd0, 0xd0, 0xd0, 0xd0, 0xd8, 0xd8, 0xdc, +/* 0x6f0: */ 0xd0, 0xd0, 0xd8, 0xd8, 0xd8, 0xdc, 0xdc, 0xde, +/* 0x6f8: */ 0xdc, 0xdc, 0xde, 0xdf, 0xde, 0xdf, 0xdf, 0xdf, +/* 0x700: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x708: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x710: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x718: */ 0xc0, 0xc0, 0xc0, 0xe0, 0xc0, 0xe0, 0xe0, 0xe0, +/* 0x720: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xe0, +/* 0x728: */ 0xc0, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0x730: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0x738: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe7, +/* 0x740: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0x748: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0x750: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0x758: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe8, +/* 0x760: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0x768: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe8, 0xec, +/* 0x770: */ 0xe0, 0xe0, 0xe0, 0xe8, 0xe8, 0xe8, 0xec, 0xee, +/* 0x778: */ 0xec, 0xec, 0xec, 0xee, 0xee, 0xef, 0xef, 0xef, +/* 0x780: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0x788: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, +/* 0x790: */ 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0x798: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0x7a0: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0x7a8: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf4, +/* 0x7b0: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf4, +/* 0x7b8: */ 0xf0, 0xf4, 0xf4, 0xf6, 0xf6, 0xf7, 0xf7, 0xf7, +/* 0x7c0: */ 0xf0, 0xf0, 0xf0, 0xf8, 0xf0, 0xf8, 0xf8, 0xf8, +/* 0x7c8: */ 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, +/* 0x7d0: */ 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, +/* 0x7d8: */ 0xf8, 0xf8, 0xf8, 0xfa, 0xfa, 0xfb, 0xfb, 0xfb, +/* 0x7e0: */ 0xf8, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, +/* 0x7e8: */ 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfd, 0xfd, 0xfd, +/* 0x7f0: */ 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, +/* 0x7f8: */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* 0x800: */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* 0x808: */ 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfc, +/* 0x810: */ 0xfd, 0xfd, 0xfd, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, +/* 0x818: */ 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xf8, +/* 0x820: */ 0xfb, 0xfb, 0xfb, 0xfa, 0xfa, 0xf8, 0xf8, 0xf8, +/* 0x828: */ 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, +/* 0x830: */ 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, +/* 0x838: */ 0xf8, 0xf8, 0xf8, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0x840: */ 0xf7, 0xf7, 0xf7, 0xf6, 0xf6, 0xf4, 0xf4, 0xf0, +/* 0x848: */ 0xf4, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0x850: */ 0xf4, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0x858: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0x860: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0x868: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xe0, 0xe0, +/* 0x870: */ 0xf0, 0xf0, 0xf0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0x878: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0x880: */ 0xef, 0xef, 0xef, 0xee, 0xee, 0xec, 0xec, 0xe8, +/* 0x888: */ 0xee, 0xec, 0xe8, 0xe8, 0xe8, 0xe0, 0xe0, 0xe0, +/* 0x890: */ 0xec, 0xe8, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0x898: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0x8a0: */ 0xe8, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0x8a8: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0x8b0: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0x8b8: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0x8c0: */ 0xe7, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0x8c8: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0x8d0: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0xc0, +/* 0x8d8: */ 0xe0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x8e0: */ 0xe0, 0xe0, 0xe0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x8e8: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x8f0: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x8f8: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x900: */ 0xdf, 0xdf, 0xdf, 0xde, 0xdf, 0xde, 0xdc, 0xdc, +/* 0x908: */ 0xde, 0xdc, 0xdc, 0xd8, 0xd8, 0xd8, 0xd0, 0xd0, +/* 0x910: */ 0xdc, 0xd8, 0xd8, 0xd0, 0xd0, 0xd0, 0xd0, 0xc0, +/* 0x918: */ 0xd0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x920: */ 0xd9, 0xd0, 0xd0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x928: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x930: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x938: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x940: */ 0xd7, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x948: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x950: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x958: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x960: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x968: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x970: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, +/* 0x978: */ 0xc0, 0xc0, 0xc0, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x980: */ 0xcf, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x988: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x990: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0x998: */ 0xc0, 0xc0, 0xc0, 0x80, 0xc0, 0x80, 0x80, 0x80, +/* 0x9a0: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, 0x80, +/* 0x9a8: */ 0xc0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x9b0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x9b8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x9c0: */ 0xc0, 0xc0, 0xc0, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x9c8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x9d0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x9d8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x9e0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x9e8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x9f0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0x9f8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa00: */ 0xbf, 0xbf, 0xbf, 0xbe, 0xbf, 0xbe, 0xbc, 0xbc, +/* 0xa08: */ 0xbe, 0xbc, 0xbc, 0xb8, 0xb8, 0xb8, 0xb8, 0xb0, +/* 0xa10: */ 0xbc, 0xb8, 0xb8, 0xb0, 0xb8, 0xb0, 0xb0, 0xb0, +/* 0xa18: */ 0xb0, 0xb0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, +/* 0xa20: */ 0xbb, 0xb0, 0xb0, 0xa0, 0xb0, 0xa0, 0xa0, 0xa0, +/* 0xa28: */ 0xa0, 0xa0, 0xa0, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa30: */ 0xa0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa38: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa40: */ 0xb7, 0xb0, 0xa0, 0xa0, 0xa0, 0x80, 0x80, 0x80, +/* 0xa48: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa50: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa58: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa60: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa68: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa70: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa78: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa80: */ 0xaf, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa88: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa90: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xa98: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xaa0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xaa8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xab0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xab8: */ 0x80, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, +/* 0xac0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xac8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, +/* 0xad0: */ 0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, +/* 0xad8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xae0: */ 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xae8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb00: */ 0x9f, 0x9e, 0x88, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb08: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb10: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb18: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, +/* 0xb20: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, +/* 0xb28: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb30: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb40: */ 0x80, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, +/* 0xb48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb80: */ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xba0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xba8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc00: */ 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7e, 0x7e, 0x7c, +/* 0xc08: */ 0x7e, 0x7c, 0x7c, 0x78, 0x7c, 0x78, 0x78, 0x78, +/* 0xc10: */ 0x7c, 0x78, 0x78, 0x78, 0x78, 0x70, 0x70, 0x70, +/* 0xc18: */ 0x78, 0x70, 0x70, 0x60, 0x70, 0x60, 0x60, 0x60, +/* 0xc20: */ 0x7b, 0x78, 0x70, 0x70, 0x70, 0x60, 0x60, 0x60, +/* 0xc28: */ 0x70, 0x60, 0x60, 0x60, 0x60, 0x40, 0x40, 0x40, +/* 0xc30: */ 0x60, 0x60, 0x60, 0x40, 0x40, 0x40, 0x40, 0x40, +/* 0xc38: */ 0x40, 0x40, 0x40, 0x00, 0x40, 0x00, 0x00, 0x00, +/* 0xc40: */ 0x77, 0x70, 0x60, 0x60, 0x60, 0x60, 0x40, 0x40, +/* 0xc48: */ 0x60, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, +/* 0xc50: */ 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc60: */ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc80: */ 0x6f, 0x64, 0x60, 0x40, 0x40, 0x00, 0x00, 0x00, +/* 0xc88: */ 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xca0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xca8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xce0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xce8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd00: */ 0x5f, 0x5e, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xda0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xda8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xde0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xde8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe00: */ 0x3f, 0x3f, 0x3e, 0x00, 0x1c, 0x00, 0x00, 0x00, +/* 0xe08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xea0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xea8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xeb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xeb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xec0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xec8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xed0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xed8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xee0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xee8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xef0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xef8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf00: */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xf98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xfe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xff0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xff8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +uint8_t wave8580_PS_[] = +{ +/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x018: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x020: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x028: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x030: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x038: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x040: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x048: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x050: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x058: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x060: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x068: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x070: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x078: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +/* 0x080: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x088: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x090: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x098: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x0c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, +/* 0x100: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x108: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x110: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x118: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x120: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x128: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x130: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x138: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x140: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x148: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x150: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x158: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x160: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x168: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x170: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x178: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, +/* 0x180: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x188: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x190: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x198: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +/* 0x1c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x1e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x1f, +/* 0x200: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x208: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x210: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x218: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x220: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x228: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x230: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x238: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x240: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x248: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x250: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x258: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x260: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x268: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x270: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x278: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +/* 0x280: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x288: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x290: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x298: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +/* 0x2c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x2e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0f, +/* 0x300: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x308: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x310: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x318: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x320: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x328: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x330: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x338: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x340: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x348: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x350: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x358: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x360: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x368: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x370: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x378: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, +/* 0x380: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x388: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x390: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x398: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, +/* 0x3c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3d, +/* 0x3e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, +/* 0x3f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, +/* 0x3f8: */ 0x00, 0x0c, 0x1c, 0x3f, 0x1e, 0x3f, 0x3f, 0x3f, +/* 0x400: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x408: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x410: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x418: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x420: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x428: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x430: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x438: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x440: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x448: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x450: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x458: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x460: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x468: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x470: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x478: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +/* 0x480: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x488: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x490: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x498: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x4c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, +/* 0x500: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x508: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x510: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x518: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x520: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x528: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x530: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x538: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x540: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x548: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x550: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x558: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x560: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x568: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x570: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x578: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, +/* 0x580: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x588: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x590: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x598: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, +/* 0x5c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, +/* 0x5e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5e, +/* 0x5f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, +/* 0x5f8: */ 0x00, 0x00, 0x00, 0x5f, 0x0c, 0x5f, 0x5f, 0x5f, +/* 0x600: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x608: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x610: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x618: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x620: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x628: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x630: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x638: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x640: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x648: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x650: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x658: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x660: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x668: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x670: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x678: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, +/* 0x680: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x688: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x690: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x698: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, +/* 0x6c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, +/* 0x6e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, +/* 0x6f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6f, +/* 0x6f8: */ 0x00, 0x40, 0x40, 0x6f, 0x40, 0x6f, 0x6f, 0x6f, +/* 0x700: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x708: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x710: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x718: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x720: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x728: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x730: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x738: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, +/* 0x740: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x748: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x750: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x758: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x61, +/* 0x760: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0x768: */ 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x40, 0x70, +/* 0x770: */ 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x70, +/* 0x778: */ 0x40, 0x60, 0x60, 0x77, 0x60, 0x77, 0x77, 0x77, +/* 0x780: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x788: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +/* 0x790: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, +/* 0x798: */ 0x00, 0x40, 0x40, 0x60, 0x40, 0x60, 0x60, 0x79, +/* 0x7a0: */ 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x60, +/* 0x7a8: */ 0x40, 0x40, 0x40, 0x60, 0x60, 0x60, 0x60, 0x78, +/* 0x7b0: */ 0x40, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x78, +/* 0x7b8: */ 0x60, 0x70, 0x70, 0x78, 0x70, 0x79, 0x7b, 0x7b, +/* 0x7c0: */ 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x70, +/* 0x7c8: */ 0x60, 0x60, 0x60, 0x70, 0x60, 0x70, 0x70, 0x7c, +/* 0x7d0: */ 0x60, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x7c, +/* 0x7d8: */ 0x70, 0x78, 0x78, 0x7c, 0x78, 0x7c, 0x7c, 0x7d, +/* 0x7e0: */ 0x70, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x7c, +/* 0x7e8: */ 0x78, 0x7c, 0x7c, 0x7e, 0x7c, 0x7e, 0x7e, 0x7e, +/* 0x7f0: */ 0x7c, 0x7c, 0x7c, 0x7e, 0x7e, 0x7f, 0x7f, 0x7f, +/* 0x7f8: */ 0x7e, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0xff, +/* 0x800: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x808: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x810: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x818: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x820: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x828: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x830: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x838: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x840: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x848: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x850: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x858: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x860: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x868: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x870: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x878: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +/* 0x880: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x888: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x890: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x898: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x8c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f, +/* 0x900: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x908: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x910: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x918: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x920: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x928: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x930: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x938: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0x940: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x948: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x950: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x958: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x960: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x968: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x970: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x978: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, +/* 0x980: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x988: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x990: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x998: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, +/* 0x9c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x8d, +/* 0x9e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0x9e8: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x8e, +/* 0x9f0: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x8f, +/* 0x9f8: */ 0x80, 0x80, 0x80, 0x9f, 0x80, 0x9f, 0x9f, 0x9f, +/* 0xa00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +/* 0xa40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0xa70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0xa78: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x87, +/* 0xa80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0xaa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0xab0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0xab8: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x83, +/* 0xac0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xac8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0xad0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, +/* 0xad8: */ 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, +/* 0xae0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xae8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x84, +/* 0xaf0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x87, +/* 0xaf8: */ 0x80, 0x80, 0x80, 0x87, 0x80, 0x8f, 0xaf, 0xaf, +/* 0xb00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0xb10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0xb18: */ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb20: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x80, +/* 0xb28: */ 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb30: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb38: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x83, +/* 0xb40: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb48: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb50: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb58: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, +/* 0xb60: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb68: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xa0, +/* 0xb70: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xa0, +/* 0xb78: */ 0x80, 0x80, 0x80, 0xa0, 0x80, 0xa3, 0xb7, 0xb7, +/* 0xb80: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb88: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb90: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xb98: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xb1, +/* 0xba0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xba8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xb0, +/* 0xbb0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xb0, +/* 0xbb8: */ 0x80, 0xa0, 0xa0, 0xb0, 0xa0, 0xb8, 0xb9, 0xbb, +/* 0xbc0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xa0, +/* 0xbc8: */ 0x80, 0x80, 0x80, 0xa0, 0x80, 0xa0, 0xa0, 0xb8, +/* 0xbd0: */ 0x80, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xb8, +/* 0xbd8: */ 0xa0, 0xb0, 0xb0, 0xb8, 0xb0, 0xbc, 0xbc, 0xbd, +/* 0xbe0: */ 0xa0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb8, 0xb8, 0xbc, +/* 0xbe8: */ 0xb0, 0xb8, 0xb8, 0xbc, 0xb8, 0xbc, 0xbe, 0xbe, +/* 0xbf0: */ 0xb8, 0xbc, 0xbc, 0xbe, 0xbc, 0xbe, 0xbe, 0xbf, +/* 0xbf8: */ 0xbe, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, +/* 0xc00: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, +/* 0xc08: */ 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, +/* 0xc10: */ 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc18: */ 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc20: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc28: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc30: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc38: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, +/* 0xc40: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc48: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc50: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc58: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc60: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc68: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc70: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc78: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc7, +/* 0xc80: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc88: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc90: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xc98: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xca0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xca8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xcb0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xcb8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc3, +/* 0xcc0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xcc8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, +/* 0xcd0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, +/* 0xcd8: */ 0x80, 0x80, 0x80, 0xc0, 0x80, 0xc0, 0xc0, 0xc1, +/* 0xce0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, +/* 0xce8: */ 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xcf0: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc7, +/* 0xcf8: */ 0xc0, 0xc0, 0xc0, 0xc7, 0xc0, 0xcf, 0xcf, 0xcf, +/* 0xd00: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xd08: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xd10: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xd18: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, +/* 0xd20: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xd28: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, +/* 0xd30: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, +/* 0xd38: */ 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc3, +/* 0xd40: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, +/* 0xd48: */ 0x80, 0x80, 0x80, 0xc0, 0x80, 0xc0, 0xc0, 0xc0, +/* 0xd50: */ 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xd58: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc1, +/* 0xd60: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xd68: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xd70: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xd78: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc1, 0xc7, 0xd7, +/* 0xd80: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xd88: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xd90: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xd98: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xda0: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xda8: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xd0, +/* 0xdb0: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xd0, +/* 0xdb8: */ 0xc0, 0xc0, 0xc0, 0xd0, 0xc0, 0xd0, 0xd8, 0xdb, +/* 0xdc0: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xdc8: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xd8, +/* 0xdd0: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xd8, +/* 0xdd8: */ 0xc0, 0xc0, 0xc0, 0xd8, 0xd0, 0xd8, 0xd8, 0xdd, +/* 0xde0: */ 0xc0, 0xc0, 0xc0, 0xd0, 0xc0, 0xd0, 0xd0, 0xdc, +/* 0xde8: */ 0xd0, 0xd8, 0xd8, 0xdc, 0xd8, 0xdc, 0xdc, 0xde, +/* 0xdf0: */ 0xd8, 0xdc, 0xdc, 0xde, 0xdc, 0xde, 0xde, 0xdf, +/* 0xdf8: */ 0xde, 0xdf, 0xdf, 0xdf, 0xdf, 0xdf, 0xdf, 0xdf, +/* 0xe00: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xe08: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xe10: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xe18: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xe20: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xe28: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xe30: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xe38: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xe3, +/* 0xe40: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xe48: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xe50: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xe0, +/* 0xe58: */ 0xc0, 0xc0, 0xc0, 0xe0, 0xc0, 0xe0, 0xe0, 0xe1, +/* 0xe60: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xe0, +/* 0xe68: */ 0xc0, 0xc0, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xe70: */ 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xe78: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe1, 0xe3, 0xe7, +/* 0xe80: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xe0, +/* 0xe88: */ 0xc0, 0xc0, 0xc0, 0xe0, 0xc0, 0xe0, 0xe0, 0xe0, +/* 0xe90: */ 0xc0, 0xc0, 0xc0, 0xe0, 0xc0, 0xe0, 0xe0, 0xe0, +/* 0xe98: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xea0: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xea8: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xeb0: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xeb8: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xeb, +/* 0xec0: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xec8: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xed0: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xed8: */ 0xe0, 0xe0, 0xe0, 0xe8, 0xe0, 0xe8, 0xe8, 0xed, +/* 0xee0: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xec, +/* 0xee8: */ 0xe0, 0xe0, 0xe0, 0xec, 0xe8, 0xec, 0xec, 0xee, +/* 0xef0: */ 0xe8, 0xe8, 0xe8, 0xec, 0xec, 0xee, 0xee, 0xef, +/* 0xef8: */ 0xec, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, +/* 0xf00: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf08: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf10: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf18: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xf0, +/* 0xf20: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xf0, +/* 0xf28: */ 0xe0, 0xe0, 0xe0, 0xf0, 0xe0, 0xf0, 0xf0, 0xf0, +/* 0xf30: */ 0xe0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0xf38: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf3, +/* 0xf40: */ 0xe0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0xf48: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0xf50: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0xf58: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf5, +/* 0xf60: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0xf68: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf4, 0xf4, 0xf6, +/* 0xf70: */ 0xf0, 0xf0, 0xf0, 0xf4, 0xf0, 0xf4, 0xf6, 0xf7, +/* 0xf78: */ 0xf4, 0xf6, 0xf6, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, +/* 0xf80: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf8, +/* 0xf88: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf8, 0xf8, 0xf8, +/* 0xf90: */ 0xf0, 0xf0, 0xf0, 0xf8, 0xf0, 0xf8, 0xf8, 0xf8, +/* 0xf98: */ 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf9, +/* 0xfa0: */ 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, +/* 0xfa8: */ 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xfa, +/* 0xfb0: */ 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xfb, +/* 0xfb8: */ 0xf8, 0xfa, 0xfa, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, +/* 0xfc0: */ 0xf8, 0xf8, 0xf8, 0xfc, 0xf8, 0xfc, 0xfc, 0xfc, +/* 0xfc8: */ 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, +/* 0xfd0: */ 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfd, +/* 0xfd8: */ 0xfc, 0xfc, 0xfc, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, +/* 0xfe0: */ 0xfc, 0xfc, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, +/* 0xfe8: */ 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, +/* 0xff0: */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +/* 0xff8: */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +}; + +uint8_t wave8580_PST[] = +{ +/* 0x000: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x008: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x010: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x018: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x020: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x028: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x030: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x038: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x040: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x048: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x050: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x058: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x060: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x068: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x070: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x078: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x080: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x088: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x090: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x098: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x0f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x100: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x108: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x110: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x118: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x120: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x128: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x130: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x138: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x140: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x148: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x150: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x158: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x160: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x168: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x170: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x178: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x180: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x188: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x190: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x198: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x1f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x200: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x208: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x210: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x218: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x220: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x228: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x230: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x238: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x240: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x248: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x250: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x258: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x260: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x268: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x270: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x278: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x280: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x288: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x290: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x298: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x2f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x300: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x308: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x310: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x318: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x320: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x328: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x330: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x338: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x340: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x348: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x350: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x358: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x360: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x368: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x370: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x378: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x380: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x388: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x390: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x398: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x3f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, +/* 0x400: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x408: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x410: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x418: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x420: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x428: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x430: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x438: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x440: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x448: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x450: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x458: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x460: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x468: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x470: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x478: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x480: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x488: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x490: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x498: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x4f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x500: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x508: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x510: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x518: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x520: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x528: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x530: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x538: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x540: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x548: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x550: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x558: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x560: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x568: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x570: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x578: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x580: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x588: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x590: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x598: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x5f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x600: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x608: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x610: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x618: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x620: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x628: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x630: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x638: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x640: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x648: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x650: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x658: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x660: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x668: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x670: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x678: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x680: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x688: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x690: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x698: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x6f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x700: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x708: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x710: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x718: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x720: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x728: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x730: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x738: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x740: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x748: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x750: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x758: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x760: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x768: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x770: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x778: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x780: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x788: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x790: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x798: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x7e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x70, +/* 0x7f0: */ 0x60, 0x20, 0x70, 0x70, 0x70, 0x70, 0x70, 0x78, +/* 0x7f8: */ 0x78, 0x78, 0x7c, 0x7c, 0x7e, 0x7e, 0x7f, 0x7f, +/* 0x800: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x808: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x810: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x818: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x820: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x828: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x830: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x838: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x840: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x848: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x850: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x858: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x860: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x868: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x870: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x878: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x880: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x888: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x890: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x898: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x8f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x900: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x908: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x910: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x918: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x920: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x928: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x930: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x938: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x940: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x948: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x950: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x958: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x960: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x968: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x970: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x978: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x980: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x988: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x990: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x998: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9a0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9a8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9b0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9b8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9c0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9c8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9d0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9d8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9e0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9e8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9f0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0x9f8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xa98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaa0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaa8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xab0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xab8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xac0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xac8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xad0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xad8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xae0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xae8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xaf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xb98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xba0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xba8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbe0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbe8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xbf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x1e, 0x3f, +/* 0xc00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xc98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xca0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xca8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xce0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xce8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xcf8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd68: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd70: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd78: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd80: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd88: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd90: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xd98: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xda0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xda8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdb0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdb8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdc0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdc8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdd0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdd8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xde0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xde8: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xdf0: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, +/* 0xdf8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x8c, 0x9f, +/* 0xe00: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe08: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe10: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe18: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe20: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe28: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe30: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe38: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, +/* 0xe40: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe48: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe50: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0xe58: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, +/* 0xe60: */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, +/* 0xe68: */ 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xe70: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xe78: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xe80: */ 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x80, 0x80, +/* 0xe88: */ 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xe90: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xe98: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xea0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xea8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xeb0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xeb8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xec0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xec8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xed0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xed8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xee0: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +/* 0xee8: */ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, +/* 0xef0: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xef8: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xcf, +/* 0xf00: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xf08: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xf10: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xf18: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xf20: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xf28: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xf30: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xf38: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xf40: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xf48: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xf50: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xf58: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xf60: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, +/* 0xf68: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xe0, +/* 0xf70: */ 0xc0, 0xc0, 0xc0, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf78: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe3, +/* 0xf80: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf88: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf90: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xf98: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xfa0: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xfa8: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, +/* 0xfb0: */ 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xf0, 0xf0, +/* 0xfb8: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0xfc0: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0xfc8: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0xfd0: */ 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, +/* 0xfd8: */ 0xf0, 0xf0, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, +/* 0xfe0: */ 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, +/* 0xfe8: */ 0xf8, 0xf8, 0xf8, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, +/* 0xff0: */ 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfe, 0xfe, 0xfe, +/* 0xff8: */ 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +}; + +uint16_t sid3_pulse(uint32_t acc, uint16_t pw) // 0-FFFF pulse width range +{ + return (((acc >> ((SID3_ACC_BITS - 16))) >= ((pw == 0xffff ? pw + 1 : pw)) ? (0xffff) : 0)); +} + +uint16_t sid3_saw(uint32_t acc) +{ + return (acc >> (SID3_ACC_BITS - 16)) & (0xffff); +} + +uint16_t sid3_triangle(uint32_t acc) +{ + return (((acc > (1 << (SID3_ACC_BITS - 1))) ? ~acc : acc) >> (SID3_ACC_BITS - 17)); +} + +void sid3_clock_lfsr(sid3_channel* ch) +{ + uint32_t feedback = ch->lfsr & 1; + ch->lfsr >>= 1; + + if (feedback) + { + ch->lfsr ^= ch->lfsr_taps; + } +} + +uint16_t sid3_noise(uint32_t lfsr, bool one_bit) +{ + return one_bit ? ((lfsr & 1) ? 0xffff : 0) : + + ((((lfsr & 1) << 7) | + ((lfsr & 4) << 4) | + ((lfsr & 0x40) >> 1) | + ((lfsr & 0x200) >> 5) | + ((lfsr & 0x800) >> 8) | + ((lfsr & 0x8000) >> 13) | + ((lfsr & 0x40000) >> 17) | + ((lfsr & 0x100000) >> 20)) << 8); //bits like in SID +} + +uint16_t sid3_special_wave(SID3* sid3, uint32_t acc, uint8_t wave) +{ + return sid3->special_waves[wave][acc >> (SID3_ACC_BITS - 14)]; +} + +#define fill_gap(i, how_far) \ +if(i > (how_far - 1)) \ +{ \ + if(sid3->exponential_output_to_envelope_counter[(i) - (how_far)] != 0) \ + { \ + sid3->exponential_output_to_envelope_counter[(i)] = sid3->exponential_output_to_envelope_counter[i - (how_far)]; \ + goto next; \ + } \ +} + +SID3* sid3_create() +{ + SID3* sid3 = (SID3*)malloc(sizeof(SID3)); + + memset(sid3, 0, sizeof(SID3)); + + for(int32_t i = 0; i < SID3_NUM_UNIQUE_SPECIAL_WAVES; i++) + { + for(int32_t j = 0; j < SID3_SPECIAL_WAVE_LENGTH; j++) + { + sid3->special_waves[i][j] = (uint16_t)(waveFuncsSID3[i]((double)j * 2.0 * M_PI / (double)SID3_SPECIAL_WAVE_LENGTH) * (double)0x7fff + (double)0x7fff); + + int32_t clipped = ((int32_t)sid3->special_waves[i][j] - 0x7fff) * 2; + if (clipped < -0x7fff) clipped = -0x7fff; + if (clipped > 0x7fff) clipped = 0x7fff; + sid3->special_waves[i + SID3_NUM_UNIQUE_SPECIAL_WAVES][j] = clipped + 0x7fff; + } + } + + for (int32_t j = 0; j < SID3_SPECIAL_WAVE_LENGTH; j++) + { + int32_t clipped = (int32_t)(triangle((double)j * 2.0 * M_PI / (double)SID3_SPECIAL_WAVE_LENGTH) * (double)0x7fff) * 2; + + if (clipped < -0x7fff) clipped = -0x7fff; + if (clipped > 0x7fff) clipped = 0x7fff; + sid3->special_waves[SID3_NUM_UNIQUE_SPECIAL_WAVES * 2][j] = clipped + 0x7fff; + + clipped = (int32_t)(saw((double)j * 2.0 * M_PI / (double)SID3_SPECIAL_WAVE_LENGTH) * (double)0x7fff) * 2; + + if (clipped < -0x7fff) clipped = -0x7fff; + if (clipped > 0x7fff) clipped = 0x7fff; + sid3->special_waves[SID3_NUM_UNIQUE_SPECIAL_WAVES * 2 + 1][j] = clipped + 0x7fff; + } + + double min_val = exp(-2.0); + double max_val = exp(2.0); + + double scale_factor = (double)0xffff / (max_val - min_val); + + for(uint32_t i = 0; i < SID3_EXPONENTIAL_LUT_LENGTH; i++) + { + sid3->env_counter_to_exponential_output[i] = (exp(-2.0 + (double)i * 4.0 / (double)SID3_EXPONENTIAL_LUT_LENGTH) - min_val) * scale_factor; + } + + sid3->env_counter_to_exponential_output[0] = 0; //just in case + + for(uint32_t i = 0; i < SID3_EXPONENTIAL_LUT_LENGTH; i++) + { + sid3->exponential_output_to_envelope_counter[(uint64_t)sid3->env_counter_to_exponential_output[i] * (uint64_t)SID3_EXPONENTIAL_LUT_LENGTH / (uint64_t)0xffff] = i << 8; + } + for(uint32_t i = 0; i < SID3_EXPONENTIAL_LUT_LENGTH; i++) //fill the gaps... + { + if(sid3->exponential_output_to_envelope_counter[i] > 0xff0000) + { + sid3->exponential_output_to_envelope_counter[i] = 0xff0000; + } + + if(sid3->exponential_output_to_envelope_counter[i] == 0) + { + fill_gap(i, 1) + fill_gap(i, 2) + fill_gap(i, 3) + fill_gap(i, 4) + fill_gap(i, 5) + fill_gap(i, 6) + } + + next:; + } + + return sid3; +} + +void sid3_reset(SID3* sid3) +{ + SAFETY_HEADER + + for(int32_t i = 0; i < SID3_NUM_CHANNELS - 1; i++) + { + memset(&sid3->chan[i], 0, sizeof(sid3_channel)); + sid3->chan[i].adsr.hold_zero = true; + sid3->chan[i].lfsr = 0x3fffffff; + sid3->chan[i].lfsr_taps = 1 | (1 << 23) | (1 << 25) | (1 << 29); //https://docs.amd.com/v/u/en-US/xapp052 for 30 bits: 30, 6, 4, 1; but inverted since our LFSR is moving in different direction + + for(int j = 0; j < SID3_NUM_FILTERS; j++) + { + sid3->chan[i].filt.filt[j].Vlp = 0; + sid3->chan[i].filt.filt[j].Vbp = 0; + sid3->chan[i].filt.filt[j].Vhp = 0; + } + } + + memset(&sid3->wave_chan, 0, sizeof(sid3_wavetable_chan)); + sid3->wave_chan.adsr.hold_zero = true; + + for(int j = 0; j < SID3_NUM_FILTERS; j++) + { + sid3->wave_chan.filt.filt[j].Vlp = 0; + sid3->wave_chan.filt.filt[j].Vbp = 0; + sid3->wave_chan.filt.filt[j].Vhp = 0; + } +} + +void sid3_gate_bit(SID3* sid3, uint8_t gate, sid3_channel_adsr* adsr) +{ + // The rate counter is never reset, thus there will be a delay before the + // envelope counter starts counting up (attack) or down (release). + + // Gate bit on: Start attack, decay, sustain. + if (gate) + { + if(adsr->state != ATTACK) + { + adsr->envelope_counter = (uint32_t)sid3->env_counter_to_exponential_output[adsr->envelope_counter >> 8] << 8; + } + + adsr->state = ATTACK; + adsr->envelope_speed = envspd_a(adsr->a); //todo: make it properly + //adsr->envelope_counter = 0; + + // Switching to attack state unlocks the zero freeze. + adsr->hold_zero = false; + } + // Gate bit off: Start release. + else + { + if(adsr->state == ATTACK && !adsr->hold_zero) + { + adsr->envelope_counter = sid3->exponential_output_to_envelope_counter[adsr->envelope_counter >> 8]; + } + + adsr->state = RELEASE; + adsr->envelope_speed = envspd_dr(adsr->r); //todo: make it properly + } + + if(adsr->envelope_counter > 0xff0000) adsr->envelope_counter = 0xff0000; +} + +void sid3_adsr_clock(SID3* sid3, sid3_channel_adsr* adsr) +{ + // Check whether the envelope counter is frozen at zero. + if (adsr->hold_zero) + { + return; + } + + switch (adsr->state) + { + case ATTACK: + { + adsr->envelope_counter += adsr->envelope_speed; + + if (adsr->envelope_counter >= 0xff0000) + { + adsr->state = DECAY; + adsr->envelope_speed = envspd_dr(adsr->d); + } + + return; //do not do exponential approximation of attack + } + break; + case DECAY: + { + adsr->envelope_counter -= adsr->envelope_speed; + + if(adsr->envelope_counter > 0xff0000) adsr->envelope_counter = 0xff0000; + + if(adsr->envelope_counter <= ((uint32_t)adsr->s << 16)) + { + adsr->state = SUSTAIN; + adsr->envelope_counter = (uint32_t)adsr->s << 16; + adsr->envelope_speed = envspd_sr(adsr->sr); + } + + if(adsr->envelope_counter <= adsr->envelope_speed || adsr->envelope_counter > 0xfff0000) + { + adsr->envelope_counter = 0; + adsr->hold_zero = true; + } + } + break; + case SUSTAIN: + case RELEASE: + { + adsr->envelope_counter -= adsr->envelope_speed; + + if(adsr->envelope_counter > 0xff0000) adsr->envelope_counter = 0xff0000; + + if(adsr->envelope_counter <= adsr->envelope_speed) + { + adsr->envelope_counter = 0; + adsr->hold_zero = true; + } + } + break; + } +} + +int32_t sid3_adsr_output(SID3* sid3, sid3_channel_adsr* adsr, int32_t input) +{ + if(adsr->hold_zero) return 0; + + if(adsr->state == ATTACK) + { + return (int32_t)((int64_t)input * (int64_t)adsr->envelope_counter / (int64_t)0xff0000 * (int64_t)adsr->vol / (int64_t)SID3_MAX_VOL); + } + else + { + return (int32_t)((int64_t)input * (int64_t)sid3->env_counter_to_exponential_output[adsr->envelope_counter >> 8] / (int64_t)0xffff * (int64_t)adsr->vol / (int64_t)SID3_MAX_VOL); + } +} + +void sid3_set_filter_settings(SID3* sid3, sid3_filter* filt) +{ + const double pi = 3.1415926535897932385; + + // Multiply with 1.048576 to facilitate division by 1 000 000 by right- + // shifting 20 times (2 ^ 20 = 1048576). + filt->w0 = (2.0*pi*(float)filt->cutoff) / ((double)sid3->clock_rate / 2.0) / 5.0; // "/ 5.0" bc we have 16 bit cutoff instead of 12-bit + + // Limit f0 to 16kHz to keep 1 cycle filter stable. + const float w0_max_1 = (2.0*pi*20000.0) / ((double)sid3->clock_rate / 2.0); + filt->w0_ceil_1 = filt->w0 <= w0_max_1 ? filt->w0 : w0_max_1; + + filt->_1024_div_Q = (1.0/(0.707 + 4.0*(float)filt->resonance/(float)0x0ff)); + + filt->distortion_multiplier = (double)filt->distortion_level / 16.0; + filt->tanh_distortion_multiplier = tanh(filt->distortion_multiplier); +} + +int32_t sid3_get_waveform(SID3* sid3, sid3_channel* ch) +{ + if(ch->waveform == 0) return 0; + + int32_t wave = 0; + + switch(ch->mix_mode) + { + case SID3_MIX_8580: + { + switch(ch->waveform) + { + case SID3_WAVE_TRIANGLE: + { + wave = sid3_triangle(ch->accumulator); + break; + } + case SID3_WAVE_SAW: + { + wave = sid3_saw(ch->accumulator); + break; + } + case SID3_WAVE_SAW | SID3_WAVE_TRIANGLE: + { + wave = wave8580__ST[ch->accumulator >> (SID3_ACC_BITS - 12)] << 8; + break; + } + case SID3_WAVE_PULSE: + { + wave = sid3_pulse(ch->accumulator, ch->pw); + break; + } + case SID3_WAVE_PULSE | SID3_WAVE_TRIANGLE: + { + wave = (wave8580_P_T[ch->accumulator >> (SID3_ACC_BITS - 12)] << 8) & sid3_pulse(ch->accumulator, ch->pw); + break; + } + case SID3_WAVE_PULSE | SID3_WAVE_SAW: + { + wave = (wave8580_PS_[ch->accumulator >> (SID3_ACC_BITS - 12)] << 8) & sid3_pulse(ch->accumulator, ch->pw); + break; + } + case SID3_WAVE_PULSE | SID3_WAVE_SAW | SID3_WAVE_TRIANGLE: + { + wave = (wave8580_PST[ch->accumulator >> (SID3_ACC_BITS - 12)] << 8) & sid3_pulse(ch->accumulator, ch->pw); + break; + } + case SID3_WAVE_NOISE: + { + wave = sid3_noise(ch->lfsr, ch->flags & SID3_CHAN_1_BIT_NOISE); + break; + } + case SID3_WAVE_NOISE | SID3_WAVE_TRIANGLE: + { + wave = sid3_noise(ch->lfsr, ch->flags & SID3_CHAN_1_BIT_NOISE) & sid3_triangle(ch->accumulator); + break; + } + case SID3_WAVE_NOISE | SID3_WAVE_SAW: + { + wave = sid3_noise(ch->lfsr, ch->flags & SID3_CHAN_1_BIT_NOISE) & sid3_saw(ch->accumulator); + break; + } + case SID3_WAVE_NOISE | SID3_WAVE_SAW | SID3_WAVE_TRIANGLE: + { + wave = (wave8580__ST[ch->accumulator >> (SID3_ACC_BITS - 12)] << 8) & sid3_noise(ch->lfsr, ch->flags & SID3_CHAN_1_BIT_NOISE); + break; + } + case SID3_WAVE_NOISE | SID3_WAVE_PULSE: + { + wave = sid3_noise(ch->lfsr, ch->flags & SID3_CHAN_1_BIT_NOISE) & sid3_pulse(ch->accumulator, ch->pw); + break; + } + case SID3_WAVE_NOISE | SID3_WAVE_PULSE | SID3_WAVE_TRIANGLE: + { + wave = (wave8580_P_T[ch->accumulator >> (SID3_ACC_BITS - 12)] << 8) & sid3_noise(ch->lfsr, ch->flags & SID3_CHAN_1_BIT_NOISE); + break; + } + case SID3_WAVE_NOISE | SID3_WAVE_PULSE | SID3_WAVE_SAW: + { + wave = (wave8580_PS_[ch->accumulator >> (SID3_ACC_BITS - 12)] << 8) & sid3_noise(ch->lfsr, ch->flags & SID3_CHAN_1_BIT_NOISE); + break; + } + case SID3_WAVE_NOISE | SID3_WAVE_PULSE | SID3_WAVE_SAW | SID3_WAVE_TRIANGLE: + { + wave = (wave8580_PST[ch->accumulator >> (SID3_ACC_BITS - 12)] << 8) & sid3_noise(ch->lfsr, ch->flags & SID3_CHAN_1_BIT_NOISE); + break; + } + case SID3_WAVE_SPECIAL: + { + wave = sid3_special_wave(sid3, ch->accumulator, ch->special_wave); + break; + } + case SID3_WAVE_SPECIAL | SID3_WAVE_TRIANGLE: + { + wave = sid3_special_wave(sid3, ch->accumulator, ch->special_wave) & sid3_triangle(ch->accumulator); + break; + } + case SID3_WAVE_SPECIAL | SID3_WAVE_SAW: + { + wave = sid3_special_wave(sid3, ch->accumulator, ch->special_wave) & sid3_saw(ch->accumulator); + break; + } + case SID3_WAVE_SPECIAL | SID3_WAVE_SAW | SID3_WAVE_TRIANGLE: + { + wave = sid3_special_wave(sid3, ch->accumulator, ch->special_wave) & wave8580__ST[ch->accumulator >> (SID3_ACC_BITS - 12)] << 8; + break; + } + case SID3_WAVE_SPECIAL | SID3_WAVE_PULSE: + { + wave = sid3_special_wave(sid3, ch->accumulator, ch->special_wave) & sid3_pulse(ch->accumulator, ch->pw); + break; + } + case SID3_WAVE_SPECIAL | SID3_WAVE_PULSE | SID3_WAVE_TRIANGLE: + { + wave = sid3_special_wave(sid3, ch->accumulator, ch->special_wave) & (wave8580_P_T[ch->accumulator >> (SID3_ACC_BITS - 12)] << 8) & sid3_pulse(ch->accumulator, ch->pw); + break; + } + case SID3_WAVE_SPECIAL | SID3_WAVE_PULSE | SID3_WAVE_SAW: + { + wave = sid3_special_wave(sid3, ch->accumulator, ch->special_wave) & (wave8580_PS_[ch->accumulator >> (SID3_ACC_BITS - 12)] << 8) & sid3_pulse(ch->accumulator, ch->pw); + break; + } + case SID3_WAVE_SPECIAL | SID3_WAVE_PULSE | SID3_WAVE_SAW | SID3_WAVE_TRIANGLE: + { + wave = sid3_special_wave(sid3, ch->accumulator, ch->special_wave) & (wave8580_PST[ch->accumulator >> (SID3_ACC_BITS - 12)] << 8) & sid3_pulse(ch->accumulator, ch->pw); + break; + } + case SID3_WAVE_SPECIAL | SID3_WAVE_NOISE: + { + wave = sid3_special_wave(sid3, ch->accumulator, ch->special_wave) & sid3_noise(ch->lfsr, ch->flags & SID3_CHAN_1_BIT_NOISE); + break; + } + case SID3_WAVE_SPECIAL | SID3_WAVE_NOISE | SID3_WAVE_TRIANGLE: + { + wave = sid3_special_wave(sid3, ch->accumulator, ch->special_wave) & sid3_noise(ch->lfsr, ch->flags & SID3_CHAN_1_BIT_NOISE) & sid3_triangle(ch->accumulator); + break; + } + case SID3_WAVE_SPECIAL | SID3_WAVE_NOISE | SID3_WAVE_SAW: + { + wave = sid3_special_wave(sid3, ch->accumulator, ch->special_wave) & sid3_noise(ch->lfsr, ch->flags & SID3_CHAN_1_BIT_NOISE) & sid3_saw(ch->accumulator); + break; + } + case SID3_WAVE_SPECIAL | SID3_WAVE_NOISE | SID3_WAVE_SAW | SID3_WAVE_TRIANGLE: + { + wave = sid3_special_wave(sid3, ch->accumulator, ch->special_wave) & (wave8580__ST[ch->accumulator >> (SID3_ACC_BITS - 12)] << 8) & sid3_noise(ch->lfsr, ch->flags & SID3_CHAN_1_BIT_NOISE); + break; + } + case SID3_WAVE_SPECIAL | SID3_WAVE_NOISE | SID3_WAVE_PULSE: + { + wave = sid3_special_wave(sid3, ch->accumulator, ch->special_wave) & sid3_noise(ch->lfsr, ch->flags & SID3_CHAN_1_BIT_NOISE) & sid3_pulse(ch->accumulator, ch->pw); + break; + } + case SID3_WAVE_SPECIAL | SID3_WAVE_NOISE | SID3_WAVE_PULSE | SID3_WAVE_TRIANGLE: + { + wave = sid3_special_wave(sid3, ch->accumulator, ch->special_wave) & (wave8580_P_T[ch->accumulator >> (SID3_ACC_BITS - 12)] << 8) & sid3_noise(ch->lfsr, ch->flags & SID3_CHAN_1_BIT_NOISE); + break; + } + case SID3_WAVE_SPECIAL | SID3_WAVE_NOISE | SID3_WAVE_PULSE | SID3_WAVE_SAW: + { + wave = sid3_special_wave(sid3, ch->accumulator, ch->special_wave) & (wave8580_PS_[ch->accumulator >> (SID3_ACC_BITS - 12)] << 8) & sid3_noise(ch->lfsr, ch->flags & SID3_CHAN_1_BIT_NOISE); + break; + } + case SID3_WAVE_SPECIAL | SID3_WAVE_NOISE | SID3_WAVE_PULSE | SID3_WAVE_SAW | SID3_WAVE_TRIANGLE: + { + wave = sid3_special_wave(sid3, ch->accumulator, ch->special_wave) & (wave8580_PST[ch->accumulator >> (SID3_ACC_BITS - 12)] << 8) & sid3_noise(ch->lfsr, ch->flags & SID3_CHAN_1_BIT_NOISE); + break; + } + default: break; + } + + wave -= 0x8000; + break; + } + case SID3_MIX_AND: + { + wave = 0xffff; + + if(ch->waveform & SID3_WAVE_TRIANGLE) + { + wave &= sid3_triangle(ch->accumulator); + } + if(ch->waveform & SID3_WAVE_SAW) + { + wave &= sid3_saw(ch->accumulator); + } + if(ch->waveform & SID3_WAVE_PULSE) + { + wave &= sid3_pulse(ch->accumulator, ch->pw); + } + if(ch->waveform & SID3_WAVE_NOISE) + { + wave &= sid3_noise(ch->lfsr, ch->flags & SID3_CHAN_1_BIT_NOISE); + } + if(ch->waveform & SID3_WAVE_SPECIAL) + { + wave &= sid3_special_wave(sid3, ch->accumulator, ch->special_wave); + } + + wave -= 0x8000; + break; + } + case SID3_MIX_OR: + { + uint16_t wave_16 = 0; + + if(ch->waveform & SID3_WAVE_TRIANGLE) + { + wave_16 |= sid3_triangle(ch->accumulator); + } + if(ch->waveform & SID3_WAVE_SAW) + { + wave_16 |= sid3_saw(ch->accumulator); + } + if(ch->waveform & SID3_WAVE_PULSE) + { + wave_16 |= sid3_pulse(ch->accumulator, ch->pw); + } + if(ch->waveform & SID3_WAVE_NOISE) + { + wave_16 |= sid3_noise(ch->lfsr, ch->flags & SID3_CHAN_1_BIT_NOISE); + } + if(ch->waveform & SID3_WAVE_SPECIAL) + { + wave_16 |= sid3_special_wave(sid3, ch->accumulator, ch->special_wave); + } + + wave = wave_16 - 0x8000; + break; + } + case SID3_MIX_XOR: + { + uint16_t wave_16 = 0; + + if(ch->waveform & SID3_WAVE_TRIANGLE) + { + wave_16 ^= sid3_triangle(ch->accumulator); + } + if(ch->waveform & SID3_WAVE_SAW) + { + wave_16 ^= sid3_saw(ch->accumulator); + } + if(ch->waveform & SID3_WAVE_PULSE) + { + wave_16 ^= sid3_pulse(ch->accumulator, ch->pw); + } + if(ch->waveform & SID3_WAVE_NOISE) + { + wave_16 ^= sid3_noise(ch->lfsr, ch->flags & SID3_CHAN_1_BIT_NOISE); + } + if(ch->waveform & SID3_WAVE_SPECIAL) + { + wave_16 ^= sid3_special_wave(sid3, ch->accumulator, ch->special_wave); + } + + wave = wave_16 - 0x8000; + break; + } + case SID3_MIX_SUM: + { + if(ch->waveform & SID3_WAVE_TRIANGLE) + { + wave += (int32_t)sid3_triangle(ch->accumulator) - 0x8000; + } + if(ch->waveform & SID3_WAVE_SAW) + { + wave += (int32_t)sid3_saw(ch->accumulator) - 0x8000; + } + if(ch->waveform & SID3_WAVE_PULSE) + { + wave += (int32_t)sid3_pulse(ch->accumulator, ch->pw) - 0x8000; + } + if(ch->waveform & SID3_WAVE_NOISE) + { + wave += (int32_t)sid3_noise(ch->lfsr, ch->flags & SID3_CHAN_1_BIT_NOISE) - 0x8000; + } + if(ch->waveform & SID3_WAVE_SPECIAL) + { + wave += (int32_t)sid3_special_wave(sid3, ch->accumulator, ch->special_wave) - 0x8000; + } + break; + } + default: break; + } + + return wave; +} + +int32_t sid3_process_filters_block(sid3_channel* ch) +{ + int32_t output = 0; + + ch->clock_filter++; + + if(ch->clock_filter & 1) + { + for(uint8_t i = 0; i < SID3_NUM_FILTERS; i++) + { + if(ch->filt.filt[i].mode & SID3_FILTER_OUTPUT) + { + output += ch->filt.filt[i].output; + } + } + + return output; + } + + for(uint8_t i = 0; i < SID3_NUM_FILTERS; i++) + { + ch->filt.filt[i].input = 0; + } + + for(uint8_t i = 0; i < SID3_NUM_FILTERS; i++) + { + if(ch->filt.filt[i].mode & SID3_FILTER_CHANNEL_INPUT) + { + ch->filt.filt[i].input += ch->output_before_filter; + } + + for(uint8_t j = 0; j < SID3_NUM_FILTERS; j++) + { + if(ch->filt.connection_matrix[i] & (1 << j)) + { + ch->filt.filt[i].input += ch->filt.filt[j].output; + } + } + } + + for(uint8_t i = 0; i < SID3_NUM_FILTERS; i++) + { + if(ch->filt.filt[i].mode & SID3_FILTER_ENABLE) + { + float Vi = ch->filt.filt[i].input; + + float dVbp = (ch->filt.filt[i].w0_ceil_1 * ch->filt.filt[i].Vhp); + float dVlp = (ch->filt.filt[i].w0_ceil_1 * ch->filt.filt[i].Vbp); + ch->filt.filt[i].Vbp += dVbp; + ch->filt.filt[i].Vlp += dVlp; + ch->filt.filt[i].Vhp = Vi - ch->filt.filt[i].Vlp - (ch->filt.filt[i].Vbp * ch->filt.filt[i]._1024_div_Q); + + float Vo; + + switch(ch->filt.filt[i].mode & SID3_FILTER_MODES_MASK) + { + case 0x0: + default: + Vo = 0; + break; + case SID3_FILTER_LP: + Vo = ch->filt.filt[i].Vlp; + break; + case SID3_FILTER_HP: + Vo = ch->filt.filt[i].Vhp; + break; + case SID3_FILTER_LP | SID3_FILTER_HP: + Vo = ch->filt.filt[i].Vlp + ch->filt.filt[i].Vhp; + break; + case SID3_FILTER_BP: + Vo = ch->filt.filt[i].Vbp; + break; + case SID3_FILTER_BP | SID3_FILTER_LP: + Vo = ch->filt.filt[i].Vlp + ch->filt.filt[i].Vbp; + break; + case SID3_FILTER_BP | SID3_FILTER_HP: + Vo = ch->filt.filt[i].Vhp + ch->filt.filt[i].Vbp; + break; + case SID3_FILTER_BP | SID3_FILTER_HP | SID3_FILTER_LP: + Vo = ch->filt.filt[i].Vlp + ch->filt.filt[i].Vbp + ch->filt.filt[i].Vhp; + break; + } + + if(ch->filt.filt[i].distortion_level > 0) + { + if(Vo > 0.0) + { + Vo = (tanh((Vo / 39767.0) * ch->filt.filt[i].distortion_multiplier) / ch->filt.filt[i].tanh_distortion_multiplier) * 39767.0; + } + else + { + double ahh = (Vo / 39767.0) * ch->filt.filt[i].distortion_multiplier; + Vo = ((exp(ahh) - 1.0) / ch->filt.filt[i].tanh_distortion_multiplier) * 39767.0; + } + } + + ch->filt.filt[i].output = Vo * ch->filt.filt[i].output_volume / 0xff; + } + else + { + ch->filt.filt[i].output = 0; + } + + if(ch->filt.filt[i].mode & SID3_FILTER_OUTPUT) + { + output += ch->filt.filt[i].output; + } + } + + return output; +} + +int32_t sid3_process_wave_channel_filters_block(sid3_wavetable_chan* ch) +{ + int32_t output = 0; + + ch->clock_filter++; + + if(ch->clock_filter & 1) + { + for(uint8_t i = 0; i < SID3_NUM_FILTERS; i++) + { + if(ch->filt.filt[i].mode & SID3_FILTER_OUTPUT) + { + output += ch->filt.filt[i].output; + } + } + + return output; + } + + for(uint8_t i = 0; i < SID3_NUM_FILTERS; i++) + { + ch->filt.filt[i].input = 0; + } + + for(uint8_t i = 0; i < SID3_NUM_FILTERS; i++) + { + if(ch->filt.filt[i].mode & SID3_FILTER_CHANNEL_INPUT) + { + ch->filt.filt[i].input += ch->output_before_filter; + } + + for(uint8_t j = 0; j < SID3_NUM_FILTERS; j++) + { + if(ch->filt.connection_matrix[i] & (1 << j)) + { + ch->filt.filt[i].input += ch->filt.filt[j].output; + } + } + } + + for(uint8_t i = 0; i < SID3_NUM_FILTERS; i++) + { + if(ch->filt.filt[i].mode & SID3_FILTER_ENABLE) + { + float Vi = ch->filt.filt[i].input; + + float dVbp = (ch->filt.filt[i].w0_ceil_1 * ch->filt.filt[i].Vhp); + float dVlp = (ch->filt.filt[i].w0_ceil_1 * ch->filt.filt[i].Vbp); + ch->filt.filt[i].Vbp += dVbp; + ch->filt.filt[i].Vlp += dVlp; + ch->filt.filt[i].Vhp = Vi - ch->filt.filt[i].Vlp - (ch->filt.filt[i].Vbp * ch->filt.filt[i]._1024_div_Q); + + float Vo; + + switch(ch->filt.filt[i].mode & SID3_FILTER_MODES_MASK) + { + case 0x0: + default: + Vo = 0; + break; + case SID3_FILTER_LP: + Vo = ch->filt.filt[i].Vlp; + break; + case SID3_FILTER_HP: + Vo = ch->filt.filt[i].Vhp; + break; + case SID3_FILTER_LP | SID3_FILTER_HP: + Vo = ch->filt.filt[i].Vlp + ch->filt.filt[i].Vhp; + break; + case SID3_FILTER_BP: + Vo = ch->filt.filt[i].Vbp; + break; + case SID3_FILTER_BP | SID3_FILTER_LP: + Vo = ch->filt.filt[i].Vlp + ch->filt.filt[i].Vbp; + break; + case SID3_FILTER_BP | SID3_FILTER_HP: + Vo = ch->filt.filt[i].Vhp + ch->filt.filt[i].Vbp; + break; + case SID3_FILTER_BP | SID3_FILTER_HP | SID3_FILTER_LP: + Vo = ch->filt.filt[i].Vlp + ch->filt.filt[i].Vbp + ch->filt.filt[i].Vhp; + break; + } + + if(ch->filt.filt[i].distortion_level > 0) + { + if(Vo > 0.0) + { + Vo = (tanh((Vo / 39767.0) * ch->filt.filt[i].distortion_multiplier) / ch->filt.filt[i].tanh_distortion_multiplier) * 39767.0; + } + else + { + double ahh = (Vo / 39767.0) * ch->filt.filt[i].distortion_multiplier; + Vo = ((exp(ahh) - 1.0) / ch->filt.filt[i].tanh_distortion_multiplier) * 39767.0; + } + } + + ch->filt.filt[i].output = Vo * ch->filt.filt[i].output_volume / 0xff; + } + else + { + ch->filt.filt[i].output = 0; + } + + if(ch->filt.filt[i].mode & SID3_FILTER_OUTPUT) + { + output += ch->filt.filt[i].output; + } + } + + return output; +} + +void sid3_clock(SID3* sid3) +{ + //SAFETY_HEADER + + sid3->output_l = sid3->output_r = 0; + + for(int32_t i = 0; i < SID3_NUM_CHANNELS - 1; i++) + { + sid3_channel* ch = &sid3->chan[i]; + + uint32_t prev_acc = ch->accumulator; + uint32_t prev_noise_acc = ch->noise_accumulator; + + ch->accumulator += ch->frequency; + ch->noise_accumulator += ch->noise_frequency; + + ch->sync_bit = 0; + + if(ch->accumulator & (1 << SID3_ACC_BITS)) + { + ch->sync_bit = 1; + } + + if(ch->flags & SID3_CHAN_ENABLE_HARD_SYNC) + { + if(ch->hard_sync_src == SID3_NUM_CHANNELS - 1) //wave chan + { + if(sid3->wave_chan.sync_bit) + { + ch->accumulator = 0; + ch->noise_accumulator = 0; + ch->lfsr = 0x3fffffff; + } + } + else + { + if(sid3->chan[ch->hard_sync_src].sync_bit) + { + ch->accumulator = 0; + ch->noise_accumulator = 0; + ch->lfsr = 0x3fffffff; + } + } + } + + int32_t waveform = 0; + + if(!ch->adsr.hold_zero) + { + uint32_t acc_state = ch->accumulator; + uint32_t noise_acc_state = ch->noise_accumulator; + + if(ch->flags & SID3_CHAN_ENABLE_PHASE_MOD) + { + ch->accumulator += ch->phase_mod_source == SID3_NUM_CHANNELS - 1 ? ((uint64_t)sid3->wave_channel_output << 18) : ((uint64_t)sid3->channel_output[ch->phase_mod_source] << 18); + ch->noise_accumulator += ch->phase_mod_source == SID3_NUM_CHANNELS - 1 ? ((uint64_t)sid3->wave_channel_output << 18) : ((uint64_t)sid3->channel_output[ch->phase_mod_source] << 18); + } + + if(ch->feedback) + { + ch->accumulator += (ch->prev_output + ch->prev_output2) * ch->feedback; + } + + ch->accumulator &= SID3_ACC_MASK; + ch->noise_accumulator &= SID3_ACC_MASK; + + if((prev_noise_acc & ((uint32_t)1 << (SID3_ACC_BITS - 6))) != (ch->noise_accumulator & ((uint32_t)1 << (SID3_ACC_BITS - 6)))) + { + sid3_clock_lfsr(ch); + } + + waveform = sid3_get_waveform(sid3, ch); + + ch->accumulator = acc_state & SID3_ACC_MASK; + ch->noise_accumulator = noise_acc_state & SID3_ACC_MASK; + + sid3->channel_signals_before_ADSR[i] = waveform; + + if(ch->flags & SID3_CHAN_ENABLE_RING_MOD) + { + uint8_t ring_mod_src = ch->ring_mod_src == SID3_NUM_CHANNELS ? i : ch->ring_mod_src; //SID3_NUM_CHANNELS = self-mod + + waveform = waveform * (ch->ring_mod_src == (SID3_NUM_CHANNELS - 1) ? sid3->wave_channel_signal_before_ADSR : sid3->channel_signals_before_ADSR[ring_mod_src]) / (int32_t)0xffff; //ring modulation is just multiplication of two signals! + } + } + else + { + ch->accumulator &= SID3_ACC_MASK; + ch->noise_accumulator &= SID3_ACC_MASK; + } + + sid3_adsr_clock(sid3, &ch->adsr); + + int32_t output = 0; + + if(!ch->adsr.hold_zero) + { + ch->output_before_filter = sid3_adsr_output(sid3, &ch->adsr, waveform); + + if((ch->filt.filt[0].mode & SID3_FILTER_ENABLE) || (ch->filt.filt[1].mode & SID3_FILTER_ENABLE) || + (ch->filt.filt[2].mode & SID3_FILTER_ENABLE) || (ch->filt.filt[3].mode & SID3_FILTER_ENABLE)) + { + output = sid3_process_filters_block(ch); + } + else + { + output = ch->output_before_filter; + } + + if(ch->feedback) + { + ch->prev_output2 = ch->prev_output; + ch->prev_output = output + 0xffff; + } + + if(!sid3->muted[i]) + { + sid3->output_l += output * ch->panning_left / 0x8f0 * ((ch->phase_inv & SID3_INV_SIGNAL_LEFT) ? -1 : 1); + sid3->output_r += output * ch->panning_right / 0x8f0 * ((ch->phase_inv & SID3_INV_SIGNAL_RIGHT) ? -1 : 1); + } + } + else + { + ch->output_before_filter = 0; + + for(int j = 0; j < SID3_NUM_FILTERS; j++) + { + if(ch->filt.filt[j].mode & SID3_FILTER_ENABLE) + { + if(ch->filt.filt[j].output > 0) + { + ch->filt.filt[j].output--; + } + if(ch->filt.filt[j].output < 0) + { + ch->filt.filt[j].output++; + } + } + } + } + + sid3->channel_output[i] = output; + } + + //wavetable/streamed PCM sample channel: + + sid3_wavetable_chan* ch = &sid3->wave_chan; + + uint32_t prev_acc = ch->accumulator; + + ch->accumulator += ch->frequency; + + ch->sync_bit = 0; + + if(ch->accumulator & (1 << SID3_ACC_BITS)) + { + ch->sync_bit = 1; + } + + if(ch->flags & SID3_CHAN_ENABLE_HARD_SYNC) + { + if(ch->hard_sync_src == SID3_NUM_CHANNELS - 1) //wave chan + { + if(sid3->wave_chan.sync_bit) + { + ch->accumulator = 0; + } + } + else + { + if(sid3->chan[ch->hard_sync_src].sync_bit) + { + ch->accumulator = 0; + } + } + } + + int32_t waveform = 0; + + if(!ch->adsr.hold_zero) + { + uint32_t acc_state = ch->accumulator; + + if(ch->flags & SID3_CHAN_ENABLE_PHASE_MOD) + { + ch->accumulator += ch->phase_mod_source == SID3_NUM_CHANNELS - 1 ? ((uint64_t)sid3->wave_channel_output << 18) : ((uint64_t)sid3->channel_output[ch->phase_mod_source] << 18); + } + + ch->accumulator &= SID3_ACC_MASK; + + if(ch->mode) + { + waveform = (int32_t)ch->streamed_sample - 0x7fff; + } + else + { + waveform = ((int32_t)ch->wavetable[(ch->accumulator & SID3_ACC_MASK) >> (SID3_ACC_BITS - 8)] << 8) - 0x7fff; + } + + ch->accumulator = acc_state & SID3_ACC_MASK; + + sid3->wave_channel_signal_before_ADSR = waveform; + + if(ch->flags & SID3_CHAN_ENABLE_RING_MOD) + { + uint8_t ring_mod_src = ch->ring_mod_src == SID3_NUM_CHANNELS ? 0xff : ch->ring_mod_src; //SID3_NUM_CHANNELS = self-mod + + waveform = waveform * (ch->ring_mod_src == 0xff ? sid3->wave_channel_signal_before_ADSR : sid3->channel_signals_before_ADSR[ring_mod_src]) / (int32_t)0xffff; //ring modulation is just multiplication of two signals! + } + } + else + { + ch->accumulator &= SID3_ACC_MASK; + } + + sid3_adsr_clock(sid3, &ch->adsr); + + int32_t output = 0; + + if(!ch->adsr.hold_zero) + { + ch->output_before_filter = sid3_adsr_output(sid3, &ch->adsr, waveform); + + if((ch->filt.filt[0].mode & SID3_FILTER_ENABLE) || (ch->filt.filt[1].mode & SID3_FILTER_ENABLE) || + (ch->filt.filt[2].mode & SID3_FILTER_ENABLE) || (ch->filt.filt[3].mode & SID3_FILTER_ENABLE)) + { + output = sid3_process_wave_channel_filters_block(ch); + } + else + { + output = ch->output_before_filter; + } + + if(!sid3->muted[SID3_NUM_CHANNELS - 1]) + { + sid3->output_l += output * ch->panning_left / 0x8f0 * ((ch->phase_inv & SID3_INV_SIGNAL_LEFT) ? -1 : 1); + sid3->output_r += output * ch->panning_right / 0x8f0 * ((ch->phase_inv & SID3_INV_SIGNAL_RIGHT) ? -1 : 1); + } + } + else + { + ch->output_before_filter = 0; + + for(int j = 0; j < SID3_NUM_FILTERS; j++) + { + if(ch->filt.filt[j].mode & SID3_FILTER_ENABLE) + { + if(ch->filt.filt[j].output > 0) + { + ch->filt.filt[j].output--; + } + if(ch->filt.filt[j].output < 0) + { + ch->filt.filt[j].output++; + } + } + } + } + + sid3->wave_channel_output = output; +} + +void sid3_write(SID3* sid3, uint16_t address, uint8_t data) +{ + SAFETY_HEADER + + uint8_t channel = address / SID3_REGISTERS_PER_CHANNEL; + + if(channel >= SID3_NUM_CHANNELS) return; + + switch(address % SID3_REGISTERS_PER_CHANNEL) //NB: only works if registers for each channel are the same and their addresses + //are x + y*n, where x is address of channel 0 register, y is number of current channel and n is how many registers you have + //for each channel + { + case SID3_REGISTER_FLAGS: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + uint8_t prev_flags = sid3->chan[channel].flags; + sid3->chan[channel].flags = data; + + if((prev_flags & SID3_CHAN_ENABLE_GATE) != (sid3->chan[channel].flags & SID3_CHAN_ENABLE_GATE)) + { + sid3_gate_bit(sid3, sid3->chan[channel].flags & SID3_CHAN_ENABLE_GATE, &sid3->chan[channel].adsr); + } + + if(sid3->chan[channel].flags & SID3_CHAN_ENV_RESET) + { + sid3->chan[channel].adsr.envelope_counter = 0; + sid3->chan[channel].adsr.state = ATTACK; + sid3->chan[channel].adsr.envelope_speed = envspd_a(sid3->chan[channel].adsr.a); + sid3->chan[channel].adsr.hold_zero = false; + } + + if(sid3->chan[channel].flags & SID3_CHAN_PHASE_RESET) + { + sid3->chan[channel].accumulator = 0; + } + + if(sid3->chan[channel].flags & SID3_CHAN_NOISE_PHASE_RESET) + { + sid3->chan[channel].noise_accumulator = 0; + sid3->chan[channel].lfsr = 0x3fffffff; + } + + sid3->chan[channel].flags &= ~(SID3_CHAN_ENV_RESET | SID3_CHAN_NOISE_PHASE_RESET | SID3_CHAN_PHASE_RESET); + } + else + { + uint8_t prev_flags = sid3->wave_chan.flags; + sid3->wave_chan.flags = data; + + if((prev_flags & SID3_CHAN_ENABLE_GATE) != (sid3->wave_chan.flags & SID3_CHAN_ENABLE_GATE)) + { + sid3_gate_bit(sid3, sid3->wave_chan.flags & SID3_CHAN_ENABLE_GATE, &sid3->wave_chan.adsr); + } + + if(sid3->wave_chan.flags & SID3_CHAN_ENV_RESET) + { + sid3->wave_chan.adsr.envelope_counter = 0; + sid3->wave_chan.adsr.state = ATTACK; + sid3->wave_chan.adsr.envelope_speed = envspd_a(sid3->wave_chan.adsr.a); + sid3->wave_chan.adsr.hold_zero = false; + } + + if(sid3->wave_chan.flags & SID3_CHAN_PHASE_RESET) + { + sid3->wave_chan.accumulator = 0; + } + + sid3->wave_chan.flags &= ~(SID3_CHAN_ENV_RESET | SID3_CHAN_NOISE_PHASE_RESET | SID3_CHAN_PHASE_RESET); + } + break; + } + case SID3_REGISTER_ADSR_A: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].adsr.a = data; + + if(sid3->chan[channel].adsr.state == ATTACK) sid3->chan[channel].adsr.envelope_speed = envspd_a(sid3->chan[channel].adsr.a); + } + else + { + sid3->wave_chan.adsr.a = data; + + if(sid3->wave_chan.adsr.state == ATTACK) sid3->wave_chan.adsr.envelope_speed = envspd_a(sid3->wave_chan.adsr.a); + } + break; + } + case SID3_REGISTER_ADSR_D: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].adsr.d = data; + + if(sid3->chan[channel].adsr.state == DECAY) sid3->chan[channel].adsr.envelope_speed = envspd_dr(sid3->chan[channel].adsr.d); + } + else + { + sid3->wave_chan.adsr.d = data; + + if(sid3->wave_chan.adsr.state == DECAY) sid3->wave_chan.adsr.envelope_speed = envspd_dr(sid3->wave_chan.adsr.d); + } + break; + } + case SID3_REGISTER_ADSR_S: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].adsr.s = data; + + if(sid3->chan[channel].adsr.state == SUSTAIN) sid3->chan[channel].adsr.envelope_counter = sid3->chan[channel].adsr.s << 16; + } + else + { + sid3->wave_chan.adsr.s = data; + + if(sid3->wave_chan.adsr.state == SUSTAIN) sid3->wave_chan.adsr.envelope_counter = sid3->wave_chan.adsr.s << 16; + } + break; + } + case SID3_REGISTER_ADSR_SR: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].adsr.sr = data; + + if(sid3->chan[channel].adsr.state == SUSTAIN) sid3->chan[channel].adsr.envelope_speed = envspd_sr(sid3->chan[channel].adsr.sr); + } + else + { + sid3->wave_chan.adsr.sr = data; + + if(sid3->wave_chan.adsr.state == SUSTAIN) sid3->wave_chan.adsr.envelope_speed = envspd_sr(sid3->wave_chan.adsr.sr); + } + break; + } + case SID3_REGISTER_ADSR_R: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].adsr.r = data; + + if(sid3->chan[channel].adsr.state == RELEASE) sid3->chan[channel].adsr.envelope_speed = envspd_dr(sid3->chan[channel].adsr.r); + } + else + { + sid3->wave_chan.adsr.r = data; + + if(sid3->wave_chan.adsr.state == RELEASE) sid3->wave_chan.adsr.envelope_speed = envspd_dr(sid3->wave_chan.adsr.r); + } + break; + } + case SID3_REGISTER_WAVEFORM: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].waveform = data; + } + else + { + sid3->wave_chan.mode = data; + } + break; + } + case SID3_REGISTER_PW_HIGH: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].pw &= 0x00ff; + sid3->chan[channel].pw |= data << 8; + } + else + { + sid3->wave_chan.wave_address = data; + } + break; + } + case SID3_REGISTER_PW_LOW: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].pw &= 0xff00; + sid3->chan[channel].pw |= data; + } + else + { + sid3->wave_chan.wavetable[sid3->wave_chan.wave_address] = data; + } + break; + } + case SID3_REGISTER_SPECIAL_WAVE: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].special_wave = data; + } + break; + } + case SID3_REGISTER_FREQ_HIGH: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].frequency &= 0x00ffff; + sid3->chan[channel].frequency |= data << 16; + } + else + { + sid3->wave_chan.frequency &= 0x00ffff; + sid3->wave_chan.frequency |= data << 16; + } + break; + } + case SID3_REGISTER_FREQ_MID: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].frequency &= 0xff00ff; + sid3->chan[channel].frequency |= data << 8; + } + else + { + sid3->wave_chan.frequency &= 0xff00ff; + sid3->wave_chan.frequency |= data << 8; + } + break; + } + case SID3_REGISTER_FREQ_LOW: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].frequency &= 0xffff00; + sid3->chan[channel].frequency |= data; + } + else + { + sid3->wave_chan.frequency &= 0xffff00; + sid3->wave_chan.frequency |= data; + } + break; + } + case SID3_REGISTER_ADSR_VOL: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].adsr.vol = data; + } + else + { + sid3->wave_chan.adsr.vol = data; + } + break; + } + case SID3_REGISTER_MIXMODE: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].mix_mode = data; + } + break; + } + case SID3_REGISTER_RING_MOD_SRC: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].ring_mod_src = data; + } + else + { + sid3->wave_chan.ring_mod_src = data; + } + break; + } + case SID3_REGISTER_SYNC_SRC: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].hard_sync_src = data; + } + else + { + sid3->wave_chan.hard_sync_src = data; + } + break; + } + case SID3_REGISTER_FILT_MODE: + case SID3_REGISTER_FILT_MODE + 1 * SID3_REGISTERS_PER_FILTER: + case SID3_REGISTER_FILT_MODE + 2 * SID3_REGISTERS_PER_FILTER: + case SID3_REGISTER_FILT_MODE + 3 * SID3_REGISTERS_PER_FILTER: + { + uint8_t filter = ((address % SID3_REGISTERS_PER_CHANNEL) - SID3_REGISTER_FILT_MODE) / SID3_REGISTERS_PER_FILTER; + + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].filt.filt[filter].mode = data; + } + else + { + sid3->wave_chan.filt.filt[filter].mode = data; + } + break; + } + case SID3_REGISTER_FILT_CUTOFF_HIGH: + case SID3_REGISTER_FILT_CUTOFF_HIGH + 1 * SID3_REGISTERS_PER_FILTER: + case SID3_REGISTER_FILT_CUTOFF_HIGH + 2 * SID3_REGISTERS_PER_FILTER: + case SID3_REGISTER_FILT_CUTOFF_HIGH + 3 * SID3_REGISTERS_PER_FILTER: + { + uint8_t filter = ((address % SID3_REGISTERS_PER_CHANNEL) - SID3_REGISTER_FILT_MODE) / SID3_REGISTERS_PER_FILTER; + + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].filt.filt[filter].cutoff &= 0x00ff; + sid3->chan[channel].filt.filt[filter].cutoff |= data << 8; + sid3_set_filter_settings(sid3, &sid3->chan[channel].filt.filt[filter]); + } + else + { + sid3->wave_chan.filt.filt[filter].cutoff &= 0x00ff; + sid3->wave_chan.filt.filt[filter].cutoff |= data << 8; + sid3_set_filter_settings(sid3, &sid3->wave_chan.filt.filt[filter]); + } + break; + } + case SID3_REGISTER_FILT_CUTOFF_LOW: + case SID3_REGISTER_FILT_CUTOFF_LOW + 1 * SID3_REGISTERS_PER_FILTER: + case SID3_REGISTER_FILT_CUTOFF_LOW + 2 * SID3_REGISTERS_PER_FILTER: + case SID3_REGISTER_FILT_CUTOFF_LOW + 3 * SID3_REGISTERS_PER_FILTER: + { + uint8_t filter = ((address % SID3_REGISTERS_PER_CHANNEL) - SID3_REGISTER_FILT_MODE) / SID3_REGISTERS_PER_FILTER; + + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].filt.filt[filter].cutoff &= 0xff00; + sid3->chan[channel].filt.filt[filter].cutoff |= data; + sid3_set_filter_settings(sid3, &sid3->chan[channel].filt.filt[filter]); + } + else + { + sid3->wave_chan.filt.filt[filter].cutoff &= 0xff00; + sid3->wave_chan.filt.filt[filter].cutoff |= data; + sid3_set_filter_settings(sid3, &sid3->wave_chan.filt.filt[filter]); + } + break; + } + case SID3_REGISTER_FILT_RESONANCE: + case SID3_REGISTER_FILT_RESONANCE + 1 * SID3_REGISTERS_PER_FILTER: + case SID3_REGISTER_FILT_RESONANCE + 2 * SID3_REGISTERS_PER_FILTER: + case SID3_REGISTER_FILT_RESONANCE + 3 * SID3_REGISTERS_PER_FILTER: + { + uint8_t filter = ((address % SID3_REGISTERS_PER_CHANNEL) - SID3_REGISTER_FILT_MODE) / SID3_REGISTERS_PER_FILTER; + + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].filt.filt[filter].resonance = data; + sid3_set_filter_settings(sid3, &sid3->chan[channel].filt.filt[filter]); + } + else + { + sid3->wave_chan.filt.filt[filter].resonance = data; + sid3_set_filter_settings(sid3, &sid3->wave_chan.filt.filt[filter]); + } + break; + } + case SID3_REGISTER_FILT_DISTORTION: + case SID3_REGISTER_FILT_DISTORTION + 1 * SID3_REGISTERS_PER_FILTER: + case SID3_REGISTER_FILT_DISTORTION + 2 * SID3_REGISTERS_PER_FILTER: + case SID3_REGISTER_FILT_DISTORTION + 3 * SID3_REGISTERS_PER_FILTER: + { + uint8_t filter = ((address % SID3_REGISTERS_PER_CHANNEL) - SID3_REGISTER_FILT_MODE) / SID3_REGISTERS_PER_FILTER; + + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].filt.filt[filter].distortion_level = data; + sid3_set_filter_settings(sid3, &sid3->chan[channel].filt.filt[filter]); + } + else + { + sid3->wave_chan.filt.filt[filter].distortion_level = data; + sid3_set_filter_settings(sid3, &sid3->wave_chan.filt.filt[filter]); + } + break; + } + case SID3_REGISTER_FILT_CONNECTION: + case SID3_REGISTER_FILT_CONNECTION + 1 * SID3_REGISTERS_PER_FILTER: + case SID3_REGISTER_FILT_CONNECTION + 2 * SID3_REGISTERS_PER_FILTER: + case SID3_REGISTER_FILT_CONNECTION + 3 * SID3_REGISTERS_PER_FILTER: + { + uint8_t filter = ((address % SID3_REGISTERS_PER_CHANNEL) - SID3_REGISTER_FILT_MODE) / SID3_REGISTERS_PER_FILTER; + + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].filt.connection_matrix[filter] = data; + } + else + { + sid3->wave_chan.filt.connection_matrix[filter] = data; + } + break; + } + case SID3_REGISTER_FILT_OUTPUT_VOLUME: + case SID3_REGISTER_FILT_OUTPUT_VOLUME + 1 * SID3_REGISTERS_PER_FILTER: + case SID3_REGISTER_FILT_OUTPUT_VOLUME + 2 * SID3_REGISTERS_PER_FILTER: + case SID3_REGISTER_FILT_OUTPUT_VOLUME + 3 * SID3_REGISTERS_PER_FILTER: + { + uint8_t filter = ((address % SID3_REGISTERS_PER_CHANNEL) - SID3_REGISTER_FILT_MODE) / SID3_REGISTERS_PER_FILTER; + + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].filt.filt[filter].output_volume = data; + } + else + { + sid3->wave_chan.filt.filt[filter].output_volume = data; + } + break; + } + case SID3_REGISTER_PAN_LEFT: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].panning_left = data; + } + else + { + sid3->wave_chan.panning_left = data; + } + break; + } + case SID3_REGISTER_PAN_RIGHT: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].panning_right = data; + } + else + { + sid3->wave_chan.panning_right = data; + } + break; + } + case SID3_REGISTER_NOISE_FREQ_HIGH: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].noise_frequency &= 0x00ffff; + sid3->chan[channel].noise_frequency |= data << 16; + } + break; + } + case SID3_REGISTER_NOISE_FREQ_MID: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].noise_frequency &= 0xff00ff; + sid3->chan[channel].noise_frequency |= data << 8; + } + break; + } + case SID3_REGISTER_NOISE_FREQ_LOW: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].noise_frequency &= 0xffff00; + sid3->chan[channel].noise_frequency |= data; + } + break; + } + case SID3_REGISTER_NOISE_LFSR_HIGHEST: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].lfsr_taps &= 0x00ffffff; + sid3->chan[channel].lfsr_taps |= (uint32_t)data << 24; + + sid3->chan[channel].lfsr_taps &= 0x3fffffff; //30 bits limit + } + break; + } + case SID3_REGISTER_NOISE_LFSR_HIGH: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].lfsr_taps &= 0xff00ffff; + sid3->chan[channel].lfsr_taps |= data << 16; + + sid3->chan[channel].lfsr_taps &= 0x3fffffff; + } + break; + } + case SID3_REGISTER_NOISE_LFSR_MID: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].lfsr_taps &= 0xffff00ff; + sid3->chan[channel].lfsr_taps |= data << 8; + + sid3->chan[channel].lfsr_taps &= 0x3fffffff; + } + break; + } + case SID3_REGISTER_NOISE_LFSR_LOW: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].lfsr_taps &= 0xffffff00; + sid3->chan[channel].lfsr_taps |= data; + + sid3->chan[channel].lfsr_taps &= 0x3fffffff; + } + break; + } + case SID3_REGISTER_STREAMED_SAMPLE_HIGH: + { + if(channel == SID3_NUM_CHANNELS - 1) + { + sid3->wave_chan.streamed_sample &= 0x00ff; + sid3->wave_chan.streamed_sample |= data << 8; + } + break; + } + case SID3_REGISTER_STREAMED_SAMPLE_LOW: + { + if(channel == SID3_NUM_CHANNELS - 1) + { + sid3->wave_chan.streamed_sample &= 0xff00; + sid3->wave_chan.streamed_sample |= data; + } + break; + } + case SID3_REGISTER_PHASE_INVERSION: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].phase_inv = data; + } + else + { + sid3->wave_chan.phase_inv = data; + } + break; + } + case SID3_REGISTER_FEEDBACK: + { + if(channel != SID3_NUM_CHANNELS - 1) + { + sid3->chan[channel].feedback = (uint32_t)data * (uint32_t)data; + } + break; + } + default: break; + } +} + +void sid3_set_is_muted(SID3* sid3, uint8_t ch, bool mute) +{ + SAFETY_HEADER + + sid3->muted[ch] = mute; +} + +void sid3_set_clock_rate(SID3* sid3, uint32_t clock) +{ + sid3->clock_rate = clock; +} + +void sid3_free(SID3* sid3) +{ + SAFETY_HEADER + + free(sid3); +} \ No newline at end of file diff --git a/src/engine/platform/sound/sid3.h b/src/engine/platform/sound/sid3.h new file mode 100644 index 000000000..65ca86661 --- /dev/null +++ b/src/engine/platform/sound/sid3.h @@ -0,0 +1,285 @@ +#ifndef SID3_H +#define SID3_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include + +#define SID3_NUM_CHANNELS 7 +#define SID3_NUM_FILTERS 4 +#define SID3_REGISTERS_PER_CHANNEL 64 +#define SID3_REGISTERS_PER_FILTER 8 +#define SID3_NUM_REGISTERS (SID3_NUM_CHANNELS * SID3_REGISTERS_PER_CHANNEL) +#define SID3_MAX_VOL 255 + +#define SID3_WAVETABLE_LENGTH 256 + +#define SID3_NUM_WAVEFORM_BITS 5 + +#define SID3_NUM_UNIQUE_SPECIAL_WAVES 28 +#define SID3_NUM_SPECIAL_WAVES (SID3_NUM_UNIQUE_SPECIAL_WAVES * 2 + 2) /* usual and 2x vol clipped + 2x vol clipped tri and saw... */ +#define SID3_SPECIAL_WAVE_LENGTH 16384 + +#define SID3_EXPONENTIAL_LUT_LENGTH ((0xff0000 >> 8) + 1) + +#define SID3_ACC_BITS 30 +#define SID3_ACC_MASK ((1UL << SID3_ACC_BITS) - 1) + +enum Flags +{ + SID3_CHAN_ENABLE_GATE = 1, + SID3_CHAN_ENABLE_RING_MOD = 2, + SID3_CHAN_ENABLE_HARD_SYNC = 4, + SID3_CHAN_ENABLE_PHASE_MOD = 8, + SID3_CHAN_PHASE_RESET = 16, + SID3_CHAN_ENV_RESET = 32, + SID3_CHAN_NOISE_PHASE_RESET = 64, + SID3_CHAN_1_BIT_NOISE = 128, +}; + +enum PhaseInversion +{ + SID3_INV_SIGNAL_RIGHT = 1, + SID3_INV_SIGNAL_LEFT = 2, +}; + +enum Waveforms +{ + SID3_WAVE_TRIANGLE = 1, + SID3_WAVE_SAW = 2, + SID3_WAVE_PULSE = 4, + SID3_WAVE_NOISE = 8, + SID3_WAVE_SPECIAL = 16, +}; + +enum Mixmodes +{ + SID3_MIX_8580 = 0, + SID3_MIX_AND = 1, + SID3_MIX_OR = 2, + SID3_MIX_XOR = 3, + SID3_MIX_SUM = 4, +}; + +enum Filter_modes +{ + SID3_FILTER_LP = 1, + SID3_FILTER_HP = 2, + SID3_FILTER_BP = 4, + + SID3_FILTER_MODES_MASK = 7, + + SID3_FILTER_ENABLE = 8, + SID3_FILTER_CHANNEL_INPUT = 16, //add channel input to filter input + SID3_FILTER_OUTPUT = 32, //output sound from this filter to channel output +}; + +enum Registers +{ + SID3_REGISTER_FLAGS = 0, + + SID3_REGISTER_ADSR_A = 1, + SID3_REGISTER_ADSR_D = 2, + SID3_REGISTER_ADSR_S = 3, + SID3_REGISTER_ADSR_SR = 4, + SID3_REGISTER_ADSR_R = 5, + + SID3_REGISTER_WAVEFORM = 6, + + SID3_REGISTER_PW_HIGH = 7, + SID3_REGISTER_PW_LOW = 8, + + SID3_REGISTER_SPECIAL_WAVE = 9, + + SID3_REGISTER_FREQ_HIGH = 10, + SID3_REGISTER_FREQ_MID = 11, + SID3_REGISTER_FREQ_LOW = 12, + + SID3_REGISTER_ADSR_VOL = 13, + + SID3_REGISTER_MIXMODE = 14, + + SID3_REGISTER_RING_MOD_SRC = 15, + SID3_REGISTER_SYNC_SRC = 16, + + SID3_REGISTER_FILT_BASE = 17, + SID3_REGISTER_FILT_MODE = 17, + SID3_REGISTER_FILT_CUTOFF_HIGH = 18, + SID3_REGISTER_FILT_CUTOFF_LOW = 19, + SID3_REGISTER_FILT_RESONANCE = 20, + SID3_REGISTER_FILT_DISTORTION = 21, + SID3_REGISTER_FILT_CONNECTION = 22, + SID3_REGISTER_FILT_OUTPUT_VOLUME = 23, + + SID3_REGISTER_AFTER_FILT_1ST_REG = SID3_REGISTER_FILT_BASE + SID3_REGISTERS_PER_FILTER * SID3_NUM_FILTERS, + SID3_REGISTER_PHASE_MOD_SRC = SID3_REGISTER_AFTER_FILT_1ST_REG, + + SID3_REGISTER_PAN_LEFT = SID3_REGISTER_AFTER_FILT_1ST_REG + 1, + SID3_REGISTER_PAN_RIGHT = SID3_REGISTER_AFTER_FILT_1ST_REG + 2, + + SID3_REGISTER_NOISE_FREQ_HIGH = SID3_REGISTER_AFTER_FILT_1ST_REG + 3, + SID3_REGISTER_NOISE_FREQ_MID = SID3_REGISTER_AFTER_FILT_1ST_REG + 4, + SID3_REGISTER_NOISE_FREQ_LOW = SID3_REGISTER_AFTER_FILT_1ST_REG + 5, + + SID3_REGISTER_NOISE_LFSR_HIGHEST = SID3_REGISTER_AFTER_FILT_1ST_REG + 6, + SID3_REGISTER_NOISE_LFSR_HIGH = SID3_REGISTER_AFTER_FILT_1ST_REG + 7, + SID3_REGISTER_NOISE_LFSR_MID = SID3_REGISTER_AFTER_FILT_1ST_REG + 8, + SID3_REGISTER_NOISE_LFSR_LOW = SID3_REGISTER_AFTER_FILT_1ST_REG + 9, + + SID3_REGISTER_STREAMED_SAMPLE_HIGH = SID3_REGISTER_AFTER_FILT_1ST_REG + 10, + SID3_REGISTER_STREAMED_SAMPLE_LOW = SID3_REGISTER_AFTER_FILT_1ST_REG + 11, + + SID3_REGISTER_PHASE_INVERSION = SID3_REGISTER_AFTER_FILT_1ST_REG + 12, + + SID3_REGISTER_FEEDBACK = SID3_REGISTER_AFTER_FILT_1ST_REG + 13, +}; + +typedef struct +{ + int32_t input; + int32_t output; + + // State of filter. + float Vhp; // highpass + float Vbp; // bandpass + float Vlp; // lowpass + + // Cutoff frequency, resonance. + float w0, w0_ceil_1; + float _1024_div_Q; + + double distortion_multiplier; //pre-calculated distortion multiplier for tanh() simple distortion + double tanh_distortion_multiplier; //pre-calculated tanh(distortion multiplier) + + uint16_t cutoff; + uint8_t resonance; + uint8_t distortion_level; + + uint8_t mode; + + uint8_t output_volume; +} sid3_filter; + +typedef struct +{ + sid3_filter filt[SID3_NUM_FILTERS]; + uint8_t connection_matrix[SID3_NUM_FILTERS]; +} sid3_filters_block; + +typedef struct +{ + uint8_t a, d, s, sr, r, vol, state; + + uint32_t envelope_counter; + uint32_t envelope_speed; + bool hold_zero; +} sid3_channel_adsr; + +typedef struct +{ + uint32_t accumulator; + uint8_t sync_bit; + uint32_t frequency; + + uint32_t noise_accumulator; + uint32_t noise_frequency; + + uint32_t lfsr, lfsr_taps; + + uint8_t waveform; + uint8_t special_wave; + + uint16_t pw; + + uint8_t mix_mode; + + sid3_channel_adsr adsr; + + uint8_t flags; + + uint8_t ring_mod_src; + uint8_t hard_sync_src; + uint8_t phase_mod_source; + + sid3_filters_block filt; + uint8_t clock_filter; + + uint8_t panning_left, panning_right; + + int32_t output_before_filter; + + uint8_t phase_inv; + uint32_t feedback; + + int32_t prev_output, prev_output2; +} sid3_channel; + +typedef struct +{ + uint32_t accumulator; + uint8_t sync_bit; + uint32_t frequency; + + uint16_t streamed_sample; + uint8_t wavetable[SID3_WAVETABLE_LENGTH]; + + uint8_t wave_address; + + sid3_channel_adsr adsr; + + uint8_t flags; + uint8_t mode; + + uint8_t ring_mod_src; + uint8_t hard_sync_src; + uint8_t phase_mod_source; + + sid3_filters_block filt; + uint8_t clock_filter; + + uint8_t panning_left, panning_right; + + int32_t output_before_filter; + + uint8_t phase_inv; +} sid3_wavetable_chan; + +typedef struct +{ + uint16_t special_waves[SID3_NUM_SPECIAL_WAVES][SID3_SPECIAL_WAVE_LENGTH]; //sine wave and OPL3-ish waves + OPZ and YMF825 waves! + + uint16_t env_counter_to_exponential_output[SID3_EXPONENTIAL_LUT_LENGTH]; + uint32_t exponential_output_to_envelope_counter[SID3_EXPONENTIAL_LUT_LENGTH]; + + sid3_channel chan[SID3_NUM_CHANNELS - 1]; + sid3_wavetable_chan wave_chan; + + int32_t output_l, output_r; + + int32_t channel_signals_before_ADSR[SID3_NUM_CHANNELS]; + int32_t channel_output[SID3_NUM_CHANNELS]; + int32_t wave_channel_signal_before_ADSR; + int32_t wave_channel_output; + + //emulation-only helpers + bool muted[SID3_NUM_CHANNELS]; + uint32_t clock_rate; //in Hz. 1 MHz default +} SID3; + +SID3* sid3_create(); +void sid3_reset(SID3* sid3); +void sid3_write(SID3* sid3, uint16_t address, uint8_t data); +void sid3_clock(SID3* sid3); +void sid3_set_is_muted(SID3* sid3, uint8_t ch, bool mute); +void sid3_set_clock_rate(SID3* sid3, uint32_t clock); +void sid3_free(SID3* sid3); + +#ifdef __cplusplus +}; +#endif +#endif diff --git a/src/engine/platform/su.cpp b/src/engine/platform/su.cpp index 9425f8787..af0e253ae 100644 --- a/src/engine/platform/su.cpp +++ b/src/engine/platform/su.cpp @@ -67,6 +67,22 @@ void DivPlatformSoundUnit::writeControlUpper(int ch) { void DivPlatformSoundUnit::tick(bool sysTick) { for (int i=0; i<8; i++) { chan[i].std.next(); + if (sysTick) { + if (chan[i].pw_slide!=0) { + chan[i].virtual_duty-=chan[i].pw_slide; + chan[i].virtual_duty=CLAMP(chan[i].virtual_duty,0,0xfff); + chan[i].duty=chan[i].virtual_duty>>5; + + chWrite(i,0x08,chan[i].duty); + } + if (chan[i].cutoff_slide!=0) { + chan[i].cutoff+=chan[i].cutoff_slide*4; + chan[i].cutoff=CLAMP(chan[i].cutoff,0,0x3fff); + + chWrite(i,0x06,chan[i].cutoff&0xff); + chWrite(i,0x07,chan[i].cutoff>>8); + } + } if (chan[i].std.vol.had) { DivInstrument* ins=parent->getIns(chan[i].ins,DIV_INS_SU); if (ins->type==DIV_INS_AMIGA) { @@ -86,6 +102,7 @@ void DivPlatformSoundUnit::tick(bool sysTick) { } if (chan[i].std.duty.had) { chan[i].duty=chan[i].std.duty.val; + chan[i].virtual_duty=(unsigned short)chan[i].duty<<5; chWrite(i,0x08,chan[i].duty); } if (chan[i].std.wave.had) { @@ -351,6 +368,7 @@ int DivPlatformSoundUnit::dispatch(DivCommand c) { break; case DIV_CMD_STD_NOISE_MODE: chan[c.chan].duty=c.value&127; + chan[c.chan].virtual_duty=(unsigned short)chan[c.chan].duty << 5; chWrite(c.chan,0x08,chan[c.chan].duty); break; case DIV_CMD_C64_RESONANCE: @@ -498,6 +516,12 @@ int DivPlatformSoundUnit::dispatch(DivCommand c) { if (!chan[c.chan].inPorta && c.value && !parent->song.brokenPortaArp && chan[c.chan].std.arp.will && !NEW_ARP_STRAT) chan[c.chan].baseFreq=NOTE_SU(c.chan,chan[c.chan].note); chan[c.chan].inPorta=c.value; break; + case DIV_CMD_C64_PW_SLIDE: + chan[c.chan].pw_slide=c.value*c.value2; + break; + case DIV_CMD_C64_CUTOFF_SLIDE: + chan[c.chan].cutoff_slide=c.value*c.value2; + break; case DIV_CMD_GET_VOLMAX: return 127; break; @@ -564,6 +588,11 @@ void DivPlatformSoundUnit::reset() { for (int i=0; i<8; i++) { chan[i]=DivPlatformSoundUnit::Channel(); chan[i].std.setEngine(parent); + + chan[i].cutoff_slide=0; + chan[i].pw_slide=0; + + chan[i].virtual_duty=0x800; // for some reason duty by default is 50% } if (dumpWrites) { addWrite(0xffffffff,0); diff --git a/src/engine/platform/su.h b/src/engine/platform/su.h index 0456f42f7..7f6eef16f 100644 --- a/src/engine/platform/su.h +++ b/src/engine/platform/su.h @@ -38,6 +38,9 @@ class DivPlatformSoundUnit: public DivDispatch { signed short wave; unsigned short hwSeqPos; short hwSeqDelay; + short cutoff_slide; + short pw_slide; + short virtual_duty; Channel(): SharedChannel(127), cutoff(16383), @@ -71,7 +74,10 @@ class DivPlatformSoundUnit: public DivDispatch { syncTimer(0), wave(0), hwSeqPos(0), - hwSeqDelay(0) {} + hwSeqDelay(0), + cutoff_slide(0), + pw_slide(0), + virtual_duty(0) {} }; Channel chan[8]; DivDispatchOscBuffer* oscBuf[8]; diff --git a/src/engine/playback.cpp b/src/engine/playback.cpp index 77c4c47c0..89207ce54 100644 --- a/src/engine/playback.cpp +++ b/src/engine/playback.cpp @@ -265,7 +265,7 @@ const char* cmdName[]={ "BIFURCATOR_PARAMETER", "FDS_MOD_AUTO", - + "FM_OPMASK", "MULTIPCM_MIX_FM", @@ -282,7 +282,30 @@ const char* cmdName[]={ "MULTIPCM_DAMP", "MULTIPCM_PSEUDO_REVERB", "MULTIPCM_LFO_RESET", - "MULTIPCM_LEVEL_DIRECT" + "MULTIPCM_LEVEL_DIRECT", + + "SID3_SPECIAL_WAVE", + "SID3_RING_MOD_SRC", + "SID3_HARD_SYNC_SRC", + "SID3_PHASE_MOD_SRC", + "SID3_WAVE_MIX", + "SID3_LFSR_FEEDBACK_BITS", + "SID3_1_BIT_NOISE", + "SID3_FILTER_DISTORTION", + "SID3_FILTER_OUTPUT_VOLUME", + "SID3_CHANNEL_INVERSION", + "SID3_FILTER_CONNECTION", + "SID3_FILTER_MATRIX", + "SID3_FILTER_ENABLE", + + "C64_PW_SLIDE", + "C64_CUTOFF_SLIDE", + + "SID3_PHASE_RESET", + "SID3_NOISE_PHASE_RESET", + "SID3_ENVELOPE_RESET", + "SID3_CUTOFF_SCALING", + "SID3_RESONANCE_SCALING" }; static_assert((sizeof(cmdName)/sizeof(void*))==DIV_CMD_MAX,"update cmdName!"); diff --git a/src/engine/song.h b/src/engine/song.h index 32f6fb5ef..ef745d0cd 100644 --- a/src/engine/song.h +++ b/src/engine/song.h @@ -143,6 +143,7 @@ enum DivSystem { DIV_SYSTEM_SID2, DIV_SYSTEM_SUPERVISION, DIV_SYSTEM_UPD1771C, + DIV_SYSTEM_SID3, DIV_SYSTEM_MAX }; diff --git a/src/engine/sysDef.cpp b/src/engine/sysDef.cpp index ec113fa65..09e68819d 100644 --- a/src/engine/sysDef.cpp +++ b/src/engine/sysDef.cpp @@ -634,6 +634,12 @@ void DivEngine::registerSystems() { {0x1e, {DIV_CMD_C64_EXTENDED, _("1Exy: Change other parameters (LEGACY)")}}, {0x20, {DIV_CMD_C64_AD, _("20xy: Set attack/decay (x: attack; y: decay)")}}, {0x21, {DIV_CMD_C64_SR, _("21xy: Set sustain/release (x: sustain; y: release)")}}, + + {0x22, {DIV_CMD_C64_PW_SLIDE, _("22xx: Pulse width slide up"), effectVal, constVal<1>}}, + {0x23, {DIV_CMD_C64_PW_SLIDE, _("23xx: Pulse width slide down"), effectVal, constVal<-1>}}, + + {0x24, {DIV_CMD_C64_CUTOFF_SLIDE, _("24xx: Filter cutoff slide up"), effectVal, constVal<1>}}, + {0x25, {DIV_CMD_C64_CUTOFF_SLIDE, _("25xx: Filter cutoff slide down"), effectVal, constVal<-1>}}, }; const EffectHandler c64FineDutyHandler(DIV_CMD_C64_FINE_DUTY, _("3xxx: Set pulse width (0 to FFF)"), effectValLong<12>); const EffectHandler c64FineCutoffHandler(DIV_CMD_C64_FINE_CUTOFF, _("4xxx: Set cutoff (0 to 7FF)"), effectValLong<11>); @@ -706,12 +712,97 @@ void DivEngine::registerSystems() { {0x14, {DIV_CMD_C64_FILTER_RESET, _("14xy: Reset cutoff (x: on new note; y: now)")}}, {0x15, {DIV_CMD_C64_DUTY_RESET, _("15xy: Reset pulse width (x: on new note; y: now)")}}, {0x16, {DIV_CMD_C64_EXTENDED, _("16xy: Change other parameters")}}, + + {0x17, {DIV_CMD_C64_PW_SLIDE, _("17xx: Pulse width slide up"), effectVal, constVal<1>}}, + {0x18, {DIV_CMD_C64_PW_SLIDE, _("18xx: Pulse width slide down"), effectVal, constVal<-1>}}, + + {0x19, {DIV_CMD_C64_CUTOFF_SLIDE, _("19xx: Filter cutoff slide up"), effectVal, constVal<1>}}, + {0x1A, {DIV_CMD_C64_CUTOFF_SLIDE, _("1Axx: Filter cutoff slide down"), effectVal, constVal<-1>}}, }; const EffectHandler SID2FineDutyHandler(DIV_CMD_C64_FINE_DUTY, _("3xxx: Set pulse width (0 to FFF)"), effectValLong<12>); const EffectHandler SID2FineCutoffHandler(DIV_CMD_C64_FINE_CUTOFF, _("4xxx: Set cutoff (0 to FFF)"), effectValLong<11>); for (int i=0; i<16; i++) SID2PostEffectHandlerMap.emplace(0x30+i,SID2FineDutyHandler); for (int i=0; i<16; i++) SID2PostEffectHandlerMap.emplace(0x40+i,SID2FineCutoffHandler); + EffectHandlerMap SID3PostEffectHandlerMap={ + {0x60, {DIV_CMD_WAVE, _("60xx: Set waveform (bit 0: triangle; bit 1: saw; bit 2: pulse; bit 3: noise; bit 4: special wave)")}}, + {0x61, {DIV_CMD_SID3_SPECIAL_WAVE, _("61xx: Set special wave (00-39)")}}, + {0x62, {DIV_CMD_C64_EXTENDED, _("62xx: Modulation control (bit 0: ring mod; bit 1: osc. sync; bit 2: phase mod)")}}, + {0x63, {DIV_CMD_C64_DUTY_RESET, _("63xy: Reset pulse width (x: on new note; y: now)")}}, + + {0x64, {DIV_CMD_SID3_RING_MOD_SRC, _("64xx: Set ring modulation source channel (0-7)")}}, + {0x65, {DIV_CMD_SID3_HARD_SYNC_SRC, _("65xx: Set hard sync source channel (0-6)")}}, + {0x66, {DIV_CMD_SID3_PHASE_MOD_SRC, _("66xx: Set phase modulation source channel (0-6)")}}, + + {0x67, {DIV_CMD_FM_AR, _("67xx: Set attack")}}, + {0x68, {DIV_CMD_FM_DR, _("68xx: Set decay")}}, + {0x69, {DIV_CMD_FM_SL, _("69xx: Set sustain level")}}, + {0x6A, {DIV_CMD_FM_D2R, _("6Axx: Set sustain rate")}}, + {0x6B, {DIV_CMD_FM_RR, _("6Bxx: Set release")}}, + + {0x6C, {DIV_CMD_SID3_WAVE_MIX, _("6Cxx: Set wave mix mode (0-4)")}}, + + {0x6D, {DIV_CMD_SID3_LFSR_FEEDBACK_BITS, _("6Dxx: Set noise LFSR feedback bits (low byte)"), effectVal, constVal<0>}}, + {0x6E, {DIV_CMD_SID3_LFSR_FEEDBACK_BITS, _("6Exx: Set noise LFSR feedback bits (medium byte)"), effectVal, constVal<1>}}, + {0x6F, {DIV_CMD_SID3_LFSR_FEEDBACK_BITS, _("6Fxx: Set noise LFSR feedback bits (higher byte)"), effectVal, constVal<2>}}, + {0x70, {DIV_CMD_SID3_LFSR_FEEDBACK_BITS, _("70xx: Set noise LFSR feedback bits (highest bits, 0-3F)"), effectVal, constVal<3>}}, + + {0x71, {DIV_CMD_C64_RESONANCE, _("71xx: Set filter 1 resonance"), effectVal, constVal<0>}}, + {0x72, {DIV_CMD_C64_RESONANCE, _("72xx: Set filter 2 resonance"), effectVal, constVal<1>}}, + {0x73, {DIV_CMD_C64_RESONANCE, _("73xx: Set filter 3 resonance"), effectVal, constVal<2>}}, + {0x74, {DIV_CMD_C64_RESONANCE, _("74xx: Set filter 4 resonance"), effectVal, constVal<3>}}, + + {0x75, {DIV_CMD_SID3_1_BIT_NOISE, _("75xx: Set noise mode (0: usual noise, 1: 1-bit noise (PCM mode on wave channel))")}}, + + {0x76, {DIV_CMD_SID3_FILTER_OUTPUT_VOLUME, _("76xx: Set filter 1 output volume"), effectVal, constVal<0>}}, + {0x77, {DIV_CMD_SID3_FILTER_OUTPUT_VOLUME, _("77xx: Set filter 2 output volume"), effectVal, constVal<1>}}, + {0x78, {DIV_CMD_SID3_FILTER_OUTPUT_VOLUME, _("78xx: Set filter 3 output volume"), effectVal, constVal<2>}}, + {0x79, {DIV_CMD_SID3_FILTER_OUTPUT_VOLUME, _("79xx: Set filter 4 output volume"), effectVal, constVal<3>}}, + + {0x7A, {DIV_CMD_SID3_FILTER_DISTORTION, _("7Axx: Set filter 1 distortion"), effectVal, constVal<0>}}, + {0x7B, {DIV_CMD_SID3_FILTER_DISTORTION, _("7Bxx: Set filter 2 distortion"), effectVal, constVal<1>}}, + {0x7C, {DIV_CMD_SID3_FILTER_DISTORTION, _("7Cxx: Set filter 3 distortion"), effectVal, constVal<2>}}, + {0x7D, {DIV_CMD_SID3_FILTER_DISTORTION, _("7Dxx: Set filter 4 distortion"), effectVal, constVal<3>}}, + + {0x7E, {DIV_CMD_FM_FB, _("7Exx: Set feedback")}}, + {0x7F, {DIV_CMD_SID3_CHANNEL_INVERSION, _("7Fxx: Set channel signal inversion (bit 0: right channel, bit 1: left channel)")}}, + + {0xA0, {DIV_CMD_C64_FILTER_MODE, _("A0xy: Set filter mode (x: filter (0-3); y: bit 0: low pass; bit 1: band pass; bit 2: high pass)")}}, + {0xA1, {DIV_CMD_SID3_FILTER_CONNECTION, _("A1xy: Set filter connection (x: filter (0-3); y: bit 0: connect to channel input; bit 1: connect to channel output)")}}, + {0xA2, {DIV_CMD_SID3_FILTER_MATRIX, _("A2xy: Set filter connection matrix (x: filter (0-3); y: bits 0-3: add filter 1-4 output to filter's input)")}}, + {0xA3, {DIV_CMD_SID3_FILTER_ENABLE, _("A3xy: Enable filter (x: filter (0-3); y: enable)")}}, + + {0xA4, {DIV_CMD_C64_PW_SLIDE, _("A4xx: Pulse width slide up"), effectVal, constVal<1>}}, + {0xA5, {DIV_CMD_C64_PW_SLIDE, _("A5xx: Pulse width slide down"), effectVal, constVal<-1>}}, + + {0xA6, {DIV_CMD_C64_CUTOFF_SLIDE, _("A6xx: Filter 1 cutoff slide up"), effectVal, constVal<1>}}, + {0xA7, {DIV_CMD_C64_CUTOFF_SLIDE, _("A7xx: Filter 1 cutoff slide down"), effectVal, constVal<-1>}}, + {0xA8, {DIV_CMD_C64_CUTOFF_SLIDE, _("A8xx: Filter 2 cutoff slide up"), effectVal, constVal<2>}}, + {0xA9, {DIV_CMD_C64_CUTOFF_SLIDE, _("A9xx: Filter 2 cutoff slide down"), effectVal, constVal<-2>}}, + {0xAA, {DIV_CMD_C64_CUTOFF_SLIDE, _("AAxx: Filter 3 cutoff slide up"), effectVal, constVal<3>}}, + {0xAB, {DIV_CMD_C64_CUTOFF_SLIDE, _("ABxx: Filter 3 cutoff slide down"), effectVal, constVal<-3>}}, + {0xAC, {DIV_CMD_C64_CUTOFF_SLIDE, _("ACxx: Filter 4 cutoff slide up"), effectVal, constVal<4>}}, + {0xAD, {DIV_CMD_C64_CUTOFF_SLIDE, _("ADxx: Filter 4 cutoff slide down"), effectVal, constVal<-4>}}, + + {0xAE, {DIV_CMD_SID3_PHASE_RESET, _("AExx: Phase reset on tick xx")}}, + {0xAF, {DIV_CMD_SID3_NOISE_PHASE_RESET, _("AFxx: Noise phase reset on tick xx")}}, + {0xB0, {DIV_CMD_SID3_ENVELOPE_RESET, _("B0xx: Envelope reset on tick xx")}}, + + {0xB1, {DIV_CMD_SID3_CUTOFF_SCALING, _("B1xy: Cutoff scaling control (x: filter (0-3); y: bit 0: enable scaling; bit 1: invert scaling)")}}, + {0xB2, {DIV_CMD_SID3_RESONANCE_SCALING, _("B2xy: Resonance scaling control (x: filter (0-3); y: bit 0: enable scaling; bit 1: invert scaling)")}}, + }; + + const EffectHandler SID3FineDutyHandler(DIV_CMD_C64_FINE_DUTY, _("5xxx: Set pulse width (0 to FFF)"), effectValLong<12>); + const EffectHandler SID3FineCutoffHandler1(DIV_CMD_C64_FINE_CUTOFF, _("1xxx: Set cutoff of filter 1 (0 to FFF)"), effectValLong<12>, constVal<0>); + const EffectHandler SID3FineCutoffHandler2(DIV_CMD_C64_FINE_CUTOFF, _("2xxx: Set cutoff of filter 2 (0 to FFF)"), effectValLong<12>, constVal<1>); + const EffectHandler SID3FineCutoffHandler3(DIV_CMD_C64_FINE_CUTOFF, _("3xxx: Set cutoff of filter 3 (0 to FFF)"), effectValLong<12>, constVal<2>); + const EffectHandler SID3FineCutoffHandler4(DIV_CMD_C64_FINE_CUTOFF, _("4xxx: Set cutoff of filter 4 (0 to FFF)"), effectValLong<12>, constVal<3>); + for (int i=0; i<16; i++) SID3PostEffectHandlerMap.emplace(0x50+i,SID3FineDutyHandler); + for (int i=0; i<16; i++) SID3PostEffectHandlerMap.emplace(0x10+i,SID3FineCutoffHandler1); + for (int i=0; i<16; i++) SID3PostEffectHandlerMap.emplace(0x20+i,SID3FineCutoffHandler2); + for (int i=0; i<16; i++) SID3PostEffectHandlerMap.emplace(0x30+i,SID3FineCutoffHandler3); + for (int i=0; i<16; i++) SID3PostEffectHandlerMap.emplace(0x40+i,SID3FineCutoffHandler4); + // SysDefs // this chip uses YMZ ADPCM, but the emulator uses ADPCM-B because I got it wrong back then. @@ -1500,7 +1591,7 @@ void DivEngine::registerSystems() { sysDefs[DIV_SYSTEM_OPLL_DRUMS]=new DivSysDef( _("Yamaha YM2413 (OPLL) with drums"), NULL, 0xa7, 0, 11, true, false, 0x150, false, 0, 0, 0, - _("the OPLL chips but with drums mode turned on."), + _("the OPLL chip but with drums mode turned on."), {_("FM 1"), _("FM 2"), _("FM 3"), _("FM 4"), _("FM 5"), _("FM 6"), _("Kick"), _("Snare"), _("Tom"), _("Top"), _("HiHat")}, {"F1", "F2", "F3", "F4", "F5", "F6", "BD", "SD", "TM", "TP", "HH"}, {DIV_CH_FM, DIV_CH_FM, DIV_CH_FM, DIV_CH_FM, DIV_CH_FM, DIV_CH_FM, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE}, @@ -1756,6 +1847,12 @@ void DivEngine::registerSystems() { {0x20, {DIV_CMD_SU_SWEEP_ENABLE, _("20xx: Toggle frequency sweep (bit 0-6: speed; bit 7: direction is up)"), constVal<0>, effectVal}}, {0x21, {DIV_CMD_SU_SWEEP_ENABLE, _("21xx: Toggle volume sweep (bit 0-4: speed; bit 5: direction is up; bit 6: loop; bit 7: alternate)"), constVal<1>, effectVal}}, {0x22, {DIV_CMD_SU_SWEEP_ENABLE, _("22xx: Toggle cutoff sweep (bit 0-6: speed; bit 7: direction is up)"), constVal<2>, effectVal}}, + + {0x23, {DIV_CMD_C64_PW_SLIDE, _("23xx: Pulse width slide up"), effectVal, constVal<1>}}, + {0x24, {DIV_CMD_C64_PW_SLIDE, _("24xx: Pulse width slide down"), effectVal, constVal<-1>}}, + + {0x25, {DIV_CMD_C64_CUTOFF_SLIDE, _("25xx: Filter cutoff slide up"), effectVal, constVal<1>}}, + {0x26, {DIV_CMD_C64_CUTOFF_SLIDE, _("26xx: Filter cutoff slide down"), effectVal, constVal<-1>}}, }; const EffectHandler suCutoffHandler(DIV_CMD_C64_FINE_CUTOFF, _("4xxx: Set cutoff (0 to FFF)"), effectValLong<12>); for (int i=0; i<16; i++) { @@ -2198,6 +2295,18 @@ void DivEngine::registerSystems() { SID2PostEffectHandlerMap ); + sysDefs[DIV_SYSTEM_SID3]=new DivSysDef( + _("SID3"), NULL, 0xf5, 0, 7, false, true, 0, false, (1U< #include #include "plot_nolerp.h" +#include "util.h" extern "C" { #include "../../extern/Nuked-OPLL/opll.h" @@ -228,7 +231,7 @@ const char* esfmNoiseModeDescriptions[4]={ }; const char* sid2WaveMixModes[5]={ - _N("Normal"), + _N("8580 SID"), _N("Bitwise AND"), _N("Bitwise OR"), _N("Bitwise XOR"), @@ -242,6 +245,99 @@ const char* sid2ControlBits[4]={ NULL }; +const char* sid3ControlBits[4]={ + _N("phase"), + _N("sync"), + _N("ring"), + NULL +}; + +const char* sid3WaveMixModes[6]={ + _N("8580 SID"), + _N("Bitwise AND"), + _N("Bitwise OR"), + _N("Bitwise XOR"), + _N("Sum of the signals"), + NULL +}; + +const char* sid3SpecialWaveforms[]={ + _N("Sine"), + _N("Rect. Sine"), + _N("Abs. Sine"), + _N("Quart. Sine"), + _N("Squish. Sine"), + _N("Abs. Squish. Sine"), + + _N("Rect. Saw"), + _N("Abs. Saw"), + + _N("Cubed Saw"), + _N("Rect. Cubed Saw"), + _N("Abs. Cubed Saw"), + + _N("Cubed Sine"), + _N("Rect. Cubed Sine"), + _N("Abs. Cubed Sine"), + _N("Quart. Cubed Sine"), + _N("Squish. Cubed Sine"), + _N("Squish. Abs. Cub. Sine"), + + _N("Rect. Triangle"), + _N("Abs. Triangle"), + _N("Quart. Triangle"), + _N("Squish. Triangle"), + _N("Abs. Squish. Triangle"), + + _N("Cubed Triangle"), + _N("Rect. Cubed Triangle"), + _N("Abs. Cubed Triangle"), + _N("Quart. Cubed Triangle"), + _N("Squish. Cubed Triangle"), + _N("Squish. Abs. Cub. Triangle"), + + // clipped + + _N("Clipped Sine"), + _N("Clipped Rect. Sine"), + _N("Clipped Abs. Sine"), + _N("Clipped Quart. Sine"), + _N("Clipped Squish. Sine"), + _N("Clipped Abs. Squish. Sine"), + + _N("Clipped Rect. Saw"), + _N("Clipped Abs. Saw"), + + _N("Clipped Cubed Saw"), + _N("Clipped Rect. Cubed Saw"), + _N("Clipped Abs. Cubed Saw"), + + _N("Clipped Cubed Sine"), + _N("Clipped Rect. Cubed Sine"), + _N("Clipped Abs. Cubed Sine"), + _N("Clipped Quart. Cubed Sine"), + _N("Clipped Squish. Cubed Sine"), + _N("Clipped Squish. Abs. Cub. Sine"), + + _N("Clipped Rect. Triangle"), + _N("Clipped Abs. Triangle"), + _N("Clipped Quart. Triangle"), + _N("Clipped Squish. Triangle"), + _N("Clipped Abs. Squish. Triangle"), + + _N("Clipped Cubed Triangle"), + _N("Clipped Rect. Cubed Triangle"), + _N("Clipped Abs. Cubed Triangle"), + _N("Clipped Quart. Cubed Triangle"), + _N("Clipped Squish. Cubed Triangle"), + _N("Clipped Squish. Abs. Cub. Triangle"), + + // two clipped simple waves + + _N("Clipped Triangle"), + _N("Clipped Saw") +}; + const bool opIsOutput[8][4]={ {false,false,false,true}, {false,false,false,true}, @@ -346,6 +442,23 @@ const char* ayShapeBits[4]={ NULL }; +const char* sid3ShapeBits[6]={ + _N("triangle"), + _N("saw"), + _N("pulse"), + _N("noise"), + _N("special wave"), + NULL +}; + +const char* sid3FilterMatrixBits[5]={ + _N("From filter 1"), + _N("From filter 2"), + _N("From filter 3"), + _N("From filter 4"), + NULL +}; + const char* ayEnvBits[4]={ _N("hold"), _N("alternate"), @@ -406,7 +519,7 @@ const char* pokeyCtlBits[9]={ NULL }; -const char* mikeyFeedbackBits[11] = { +const char* mikeyFeedbackBits[11]={ "0", "1", "2", "3", "4", "5", "7", "10", "11", "int", NULL }; @@ -577,6 +690,10 @@ const int kslMap[4]={ 0, 2, 1, 3 }; +const int _SID3_SPECIAL_WAVES=SID3_NUM_SPECIAL_WAVES-1; +const int _SID3_NUM_CHANNELS=SID3_NUM_CHANNELS; +const int _SID3_NUM_CHANNELS_MINUS_ONE=SID3_NUM_CHANNELS-1; + // do not change these! // anything other than a checkbox will look ugly! // @@ -631,16 +748,16 @@ String macroHoverES5506FilterMode(int id, float val, void* u) { String mode="???"; switch (((int)val)&3) { case 0: - mode="HP/K2, HP/K2"; + mode=_("HP/K2, HP/K2"); break; case 1: - mode="HP/K2, LP/K1"; + mode=_("HP/K2, LP/K1"); break; case 2: - mode="LP/K2, LP/K2"; + mode=_("LP/K2, LP/K2"); break; case 3: - mode="LP/K2, LP/K1"; + mode=_("LP/K2, LP/K1"); break; default: break; @@ -664,6 +781,45 @@ String macroLFOWaves(int id, float val, void* u) { return "???"; } +String macroSID3SpecialWaves(int id, float val, void* u) { + if ((int)val<0 || (int)val>=SID3_NUM_SPECIAL_WAVES) return "???"; + + return _(sid3SpecialWaveforms[(int)val%SID3_NUM_SPECIAL_WAVES]); +} + +String macroSID3SourceChan(int id, float val, void* u) { + if ((int)val>SID3_NUM_CHANNELS) return "???"; + + if ((int)val==SID3_NUM_CHANNELS) { + return _("Self"); + } else if ((int)val==SID3_NUM_CHANNELS-1) { + return _("PCM/Wave channel"); + } else { + return fmt::sprintf(_("Channel %d"),(int)val+1); + } +} + +String macroSID3NoiseLFSR(int id, float val, void* u) { + return _( + "values close to SID2 noise modes:\n\n" + "Mode 1: 524288\n" + "Mode 2: 66\n" + "Mode 3: 541065280" + ); +} + +String macroSID2WaveMixMode(int id, float val, void* u) { + if ((int)val<0 || (int)val>3) return "???"; + + return _(sid2WaveMixModes[(int)val]); +} + +String macroSID3WaveMixMode(int id, float val, void* u) { + if ((int)val<0 || (int)val>4) return "???"; + + return _(sid3WaveMixModes[(int)val]); +} + void addAALine(ImDrawList* dl, const ImVec2& p1, const ImVec2& p2, const ImU32 color, float thickness=1.0f) { ImVec2 pt[2]; pt[0]=p1; @@ -924,6 +1080,114 @@ void FurnaceGUI::drawWaveform(unsigned char type, bool opz, const ImVec2& size) } } +typedef double (*WaveFunc) (double a); + +WaveFunc waveFuncsIns[]={ + sinus, + rectSin, + absSin, + quartSin, + squiSin, + squiAbsSin, + + rectSaw, + absSaw, + + cubSaw, + rectCubSaw, + absCubSaw, + + cubSine, + rectCubSin, + absCubSin, + quartCubSin, + squishCubSin, + squishAbsCubSin, + + rectTri, + absTri, + quartTri, + squiTri, + absSquiTri, + + cubTriangle, + cubRectTri, + cubAbsTri, + cubQuartTri, + cubSquiTri, + absCubSquiTri +}; + +void FurnaceGUI::drawWaveformSID3(unsigned char type, const ImVec2& size) { + ImDrawList* dl=ImGui::GetWindowDrawList(); + ImGuiWindow* window=ImGui::GetCurrentWindow(); + + ImVec2 waveform[65]; + const size_t waveformLen=64; + + ImVec2 minArea=window->DC.CursorPos; + ImVec2 maxArea=ImVec2( + minArea.x+size.x, + minArea.y+size.y + ); + ImRect rect=ImRect(minArea,maxArea); + ImGuiStyle& style=ImGui::GetStyle(); + ImU32 color=ImGui::GetColorU32(uiColors[GUI_COLOR_FM_WAVE]); + ImGui::ItemSize(size,style.FramePadding.y); + if (ImGui::ItemAdd(rect,ImGui::GetID("SID3wsDisplay"))) { + ImGui::RenderFrame(rect.Min,rect.Max,ImGui::GetColorU32(ImGuiCol_FrameBg),true,style.FrameRounding); + + if (type=SID3_NUM_UNIQUE_SPECIAL_WAVES && type1.0f) y=1.0f; + if (y<-1.0f) y=-1.0f; + + waveform[i]=ImLerp(rect.Min,rect.Max,ImVec2(x,0.5-y*0.48)); + } + } else { + if (type==SID3_NUM_UNIQUE_SPECIAL_WAVES*2) { + for (size_t i=0; i<=waveformLen; i++) { + float x=(float)i/(float)waveformLen; + float y=triangle(x*2.0*M_PI); + + y*=2.0f; // clipping + + if (y>1.0f) y=1.0f; + if (y<-1.0f) y=-1.0f; + + waveform[i]=ImLerp(rect.Min,rect.Max,ImVec2(x,0.5-y*0.4)); + } + } + if (type==SID3_NUM_UNIQUE_SPECIAL_WAVES*2+1) { + for (size_t i=0; i<=waveformLen; i++) { + float x=(float)i/(float)waveformLen; + float y=saw(x*2.0*M_PI); + + y*=2.0f; // clipping + + if (y>1.0f) y=1.0f; + if (y<-1.0f) y=-1.0f; + + waveform[i]=ImLerp(rect.Min,rect.Max,ImVec2(x,0.5-y*0.4)); + } + } + } + + dl->AddPolyline(waveform,waveformLen+1,color,ImDrawFlags_None,dpiScale); + } +} + void FurnaceGUI::drawAlgorithm(unsigned char alg, FurnaceGUIFMAlgs algType, const ImVec2& size) { ImDrawList* dl=ImGui::GetWindowDrawList(); ImGuiWindow* window=ImGui::GetCurrentWindow(); @@ -1523,6 +1787,80 @@ void FurnaceGUI::drawFMEnv(unsigned char tl, unsigned char ar, unsigned char dr, } } +void FurnaceGUI::drawSID3Env(unsigned char tl, unsigned char ar, unsigned char dr, unsigned char d2r, unsigned char rr, unsigned char sl, unsigned char sus, unsigned char egt, unsigned char algOrGlobalSus, float maxTl, float maxArDr, float maxRr, const ImVec2& size, unsigned short instType) { + ImDrawList* dl=ImGui::GetWindowDrawList(); + ImGuiWindow* window=ImGui::GetCurrentWindow(); + + ImVec2 minArea=window->DC.CursorPos; + ImVec2 maxArea=ImVec2( + minArea.x+size.x, + minArea.y+size.y + ); + ImRect rect=ImRect(minArea,maxArea); + ImGuiStyle& style=ImGui::GetStyle(); + ImU32 color=ImGui::GetColorU32(uiColors[GUI_COLOR_FM_ENVELOPE]); + ImU32 colorR=ImGui::GetColorU32(uiColors[GUI_COLOR_FM_ENVELOPE_RELEASE]); // Relsease triangle + ImU32 colorS=ImGui::GetColorU32(uiColors[GUI_COLOR_FM_ENVELOPE_SUS_GUIDE]); // Sustain horiz/vert line color + ImGui::ItemSize(size,style.FramePadding.y); + if (ImGui::ItemAdd(rect,ImGui::GetID("fmEnv"))) { + ImGui::RenderFrame(rect.Min,rect.Max,ImGui::GetColorU32(ImGuiCol_FrameBg),true,style.FrameRounding); + + // Adjust for OPLL global sustain setting + if (instType==DIV_INS_OPLL && algOrGlobalSus==1.0) { + rr=5.0; + } + // calculate x positions + float arPos=float(maxArDr-(float)ar)/maxArDr; // peak of AR, start of DR + float drPos=arPos+(((float)sl/255.0)*(float(maxArDr-(float)dr)/maxArDr)); // end of DR, start of D2R + float d2rPos=drPos+(((255.0-(float)sl)/255.0)*(float(255.0-(float)d2r)/255.0)); // End of D2R + float rrPos=(float(maxRr-(float)rr)/float(maxRr)); // end of RR + + // shrink all the x positions horizontally + arPos/=2.0; + drPos/=2.0; + d2rPos/=2.0; + rrPos/=1.0; + + ImVec2 pos1=ImLerp(rect.Min,rect.Max,ImVec2(0.0,1.0)); // the bottom corner + ImVec2 pos2=ImLerp(rect.Min,rect.Max,ImVec2(arPos,((float)tl/maxTl))); // peak of AR, start of DR + ImVec2 pos3=ImLerp(rect.Min,rect.Max,ImVec2(drPos,(float)(((float)tl/maxTl)+((float)sl/255.0)-(((float)tl/maxTl)*((float)sl/255.0))))); // end of DR, start of D2R + ImVec2 pos4=ImLerp(rect.Min,rect.Max,ImVec2(d2rPos,1.0)); // end of D2R + ImVec2 posRStart=ImLerp(rect.Min,rect.Max,ImVec2(0.0,((float)tl/maxTl))); // release start + ImVec2 posREnd=ImLerp(rect.Min,rect.Max,ImVec2(rrPos,1.0));// release end + ImVec2 posSLineHEnd=ImLerp(rect.Min,rect.Max,ImVec2(1.0,(float)(((float)tl/maxTl)+((float)sl/255.0)-(((float)tl/maxTl)*((float)sl/255.0))))); // sustain horizontal line end + ImVec2 posSLineVEnd=ImLerp(rect.Min,rect.Max,ImVec2(drPos,1.0)); // sustain vertical line end + ImVec2 posDecayRate0Pt=ImLerp(rect.Min,rect.Max,ImVec2(1.0,((float)tl/maxTl))); // Height of the peak of AR, forever + ImVec2 posDecay2Rate0Pt=ImLerp(rect.Min,rect.Max,ImVec2(1.0,(float)(((float)tl/maxTl)+((float)sl/255.0)-(((float)tl/maxTl)*((float)sl/255.0))))); // Height of the peak of SR, forever + + // dl->Flags=ImDrawListFlags_AntiAliasedLines|ImDrawListFlags_AntiAliasedLinesUseTex; + if ((float)ar==0.0) { // if AR = 0, the envelope never starts + dl->AddTriangleFilled(posRStart,posREnd,pos1,colorS); // draw release as shaded triangle behind everything + addAALine(dl,pos1,pos4,color); // draw line on ground + } else if ((float)dr==0.0 && (float)sl!=0.0) { // if DR = 0 and SL is not 0, then the envelope stays at max volume forever + dl->AddTriangleFilled(posRStart,posREnd,pos1,colorS); // draw release as shaded triangle behind everything + // addAALine(dl,pos3,posSLineHEnd,colorS); // draw horiz line through sustain level + // addAALine(dl,pos3,posSLineVEnd,colorS); // draw vert. line through sustain level + addAALine(dl,pos1,pos2,color); // A + addAALine(dl,pos2,posDecayRate0Pt,color); // Line from A to end of graph + } else if ((float)d2r==0.0 || ((instType==DIV_INS_OPL || instType==DIV_INS_SNES || instType == DIV_INS_ESFM) && sus==1.0) || (instType==DIV_INS_OPLL && egt!=0.0)) { // envelope stays at the sustain level forever + dl->AddTriangleFilled(posRStart,posREnd,pos1,colorS); // draw release as shaded triangle behind everything + addAALine(dl,pos3,posSLineHEnd,colorR); // draw horiz line through sustain level + addAALine(dl,pos3,posSLineVEnd,colorR); // draw vert. line through sustain level + addAALine(dl,pos1,pos2,color); // A + addAALine(dl,pos2,pos3,color); // D + addAALine(dl,pos3,posDecay2Rate0Pt,color); // Line from D to end of graph + } else { // draw graph normally + dl->AddTriangleFilled(posRStart,posREnd,pos1,colorS); // draw release as shaded triangle behind everything + addAALine(dl,pos3,posSLineHEnd,colorR); // draw horiz line through sustain level + addAALine(dl,pos3,posSLineVEnd,colorR); // draw vert. line through sustain level + addAALine(dl,pos1,pos2,color); // A + addAALine(dl,pos2,pos3,color); // D + addAALine(dl,pos3,pos4,color); // D2 + } + //dl->Flags^=ImDrawListFlags_AntiAliasedLines|ImDrawListFlags_AntiAliasedLinesUseTex; + } +} + void FurnaceGUI::drawGBEnv(unsigned char vol, unsigned char len, unsigned char sLen, bool dir, const ImVec2& size) { ImDrawList* dl=ImGui::GetWindowDrawList(); ImGuiWindow* window=ImGui::GetCurrentWindow(); @@ -1741,7 +2079,7 @@ void FurnaceGUI::drawMacroEdit(FurnaceGUIMacroDesc& i, int totalFit, float avail } if (i.isBitfield) { - PlotBitfield("##IMacro",asInt,totalFit,0,i.bitfieldBits,i.max,ImVec2(availableWidth,(i.macro->open&1)?(i.height*dpiScale):(32.0f*dpiScale)),sizeof(float),doHighlight,uiColors[GUI_COLOR_MACRO_HIGHLIGHT],i.color); + PlotBitfield("##IMacro",asInt,totalFit,0,i.bitfieldBits,i.max,ImVec2(availableWidth,(i.macro->open&1)?(i.height*dpiScale):(32.0f*dpiScale)),sizeof(float),doHighlight,uiColors[GUI_COLOR_MACRO_HIGHLIGHT],i.color,i.hoverFunc,i.hoverFuncUser); } else { PlotCustom("##IMacro",asFloat,totalFit,macroDragScroll,NULL,i.min+i.macro->vScroll,i.min+i.macro->vScroll+i.macro->vZoom,ImVec2(availableWidth,(i.macro->open&1)?(i.height*dpiScale):(32.0f*dpiScale)),sizeof(float),i.color,i.macro->len-macroDragScroll,i.hoverFunc,i.hoverFuncUser,i.blockMode,(i.macro->open&1)?genericGuide:NULL,doHighlight,uiColors[GUI_COLOR_MACRO_HIGHLIGHT]); } @@ -1878,7 +2216,7 @@ void FurnaceGUI::drawMacroEdit(FurnaceGUIMacroDesc& i, int totalFit, float avail ImGui::SetNextItemWidth(availableWidth); String& mmlStr=mmlString[index]; if (ImGui::InputText("##IMacroMML",&mmlStr)) { - decodeMMLStr(mmlStr,i.macro->val,i.macro->len,i.macro->loop,i.min,(i.isBitfield)?((1<<(i.isBitfield?i.max:0))-1):i.max,i.macro->rel,i.bit30); + decodeMMLStr(mmlStr,i.macro->val,i.macro->len,i.macro->loop,i.min,(i.isBitfield)?((1<<(i.isBitfield?(i.max):0))-1):i.max,i.macro->rel,i.bit30); } if (!ImGui::IsItemActive()) { encodeMMLStr(mmlStr,i.macro->val,i.macro->len,i.macro->loop,i.macro->rel,false,i.bit30); @@ -2658,6 +2996,273 @@ void FurnaceGUI::alterSampleMap(int column, int val) { ImGui::EndDragDropTarget(); \ } +void FurnaceGUI::insTabWavetable(DivInstrument* ins) +{ + if (ImGui::BeginTabItem(_("Wavetable"))) { + switch (ins->type) { + case DIV_INS_GB: + case DIV_INS_NAMCO: + case DIV_INS_SM8521: + case DIV_INS_SWAN: + wavePreviewLen=32; + wavePreviewHeight=15; + break; + case DIV_INS_PCE: + wavePreviewLen=32; + wavePreviewHeight=31; + break; + case DIV_INS_VBOY: + wavePreviewLen=32; + wavePreviewHeight=63; + break; + case DIV_INS_SCC: + wavePreviewLen=32; + wavePreviewHeight=255; + break; + case DIV_INS_FDS: + wavePreviewLen=64; + wavePreviewHeight=63; + break; + case DIV_INS_N163: + wavePreviewLen=ins->n163.waveLen; + wavePreviewHeight=15; + break; + case DIV_INS_X1_010: + wavePreviewLen=128; + wavePreviewHeight=255; + break; + case DIV_INS_AMIGA: + case DIV_INS_GBA_DMA: + wavePreviewLen=ins->amiga.waveLen+1; + wavePreviewHeight=255; + break; + case DIV_INS_SNES: + wavePreviewLen=ins->amiga.waveLen+1; + wavePreviewHeight=15; + break; + case DIV_INS_GBA_MINMOD: + wavePreviewLen=ins->amiga.waveLen+1; + wavePreviewHeight=255; + break; + case DIV_INS_SID3: + wavePreviewLen=256; + wavePreviewHeight=255; + break; + default: + wavePreviewLen=32; + wavePreviewHeight=31; + break; + } + if (ImGui::Checkbox(_("Enable synthesizer"),&ins->ws.enabled)) { + wavePreviewInit=true; + } + if (ins->ws.enabled) { + ImGui::SameLine(); + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); + if (ins->ws.effect&0x80) { + if ((ins->ws.effect&0x7f)>=DIV_WS_DUAL_MAX) { + ins->ws.effect=0; + wavePreviewInit=true; + } + } else { + if ((ins->ws.effect&0x7f)>=DIV_WS_SINGLE_MAX) { + ins->ws.effect=0; + wavePreviewInit=true; + } + } + if (ImGui::BeginCombo("##WSEffect",(ins->ws.effect&0x80)?dualWSEffects[ins->ws.effect&0x7f]:singleWSEffects[ins->ws.effect&0x7f])) { + ImGui::Text(_("Single-waveform")); + ImGui::Indent(); + for (int i=0; iws.effect=i; + wavePreviewInit=true; + } + } + ImGui::Unindent(); + ImGui::Text(_("Dual-waveform")); + ImGui::Indent(); + for (int i=129; iws.effect=i; + wavePreviewInit=true; + } + } + ImGui::Unindent(); + ImGui::EndCombo(); + } + const bool isSingleWaveFX=(ins->ws.effect>=128); + if (ImGui::BeginTable("WSPreview",isSingleWaveFX?3:2)) { + DivWavetable* wave1=e->getWave(ins->ws.wave1); + DivWavetable* wave2=e->getWave(ins->ws.wave2); + if (wavePreviewInit) { + wavePreview.init(ins,wavePreviewLen,wavePreviewHeight,true); + wavePreviewInit=false; + } + float wavePreview1[257]; + float wavePreview2[257]; + float wavePreview3[257]; + for (int i=0; ilen; i++) { + if (wave1->data[i]>wave1->max) { + wavePreview1[i]=wave1->max; + } else { + wavePreview1[i]=wave1->data[i]; + } + } + if (wave1->len>0) { + wavePreview1[wave1->len]=wave1->data[wave1->len-1]; + } + for (int i=0; ilen; i++) { + if (wave2->data[i]>wave2->max) { + wavePreview2[i]=wave2->max; + } else { + wavePreview2[i]=wave2->data[i]; + } + } + if (wave2->len>0) { + wavePreview2[wave2->len]=wave2->data[wave2->len-1]; + } + if (ins->ws.enabled && (!wavePreviewPaused || wavePreviewInit)) { + wavePreview.tick(true); + WAKE_UP; + } + for (int i=0; i0) { + wavePreview3[wavePreviewLen]=wavePreview3[wavePreviewLen-1]; + } + + float ySize=(isSingleWaveFX?96.0f:128.0f)*dpiScale; + + ImGui::TableNextRow(); + ImGui::TableNextColumn(); + ImVec2 size1=ImVec2(ImGui::GetContentRegionAvail().x,ySize); + PlotNoLerp("##WaveformP1",wavePreview1,wave1->len+1,0,"Wave 1",0,wave1->max,size1); + if (isSingleWaveFX) { + ImGui::TableNextColumn(); + ImVec2 size2=ImVec2(ImGui::GetContentRegionAvail().x,ySize); + PlotNoLerp("##WaveformP2",wavePreview2,wave2->len+1,0,"Wave 2",0,wave2->max,size2); + } + ImGui::TableNextColumn(); + ImVec2 size3=ImVec2(ImGui::GetContentRegionAvail().x,ySize); + PlotNoLerp("##WaveformP3",wavePreview3,wavePreviewLen+1,0,"Result",0,wavePreviewHeight,size3); + + ImGui::TableNextRow(); + ImGui::TableNextColumn(); + if (ins->std.waveMacro.len>0) { + ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_WARNING]); + ImGui::AlignTextToFramePadding(); + ImGui::Text(_("Wave 1")); + ImGui::SameLine(); + ImGui::Text(ICON_FA_EXCLAMATION_TRIANGLE); + ImGui::PopStyleColor(); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("waveform macro is controlling wave 1!\nthis value will be ineffective.")); + } + } else { + ImGui::AlignTextToFramePadding(); + ImGui::Text(_("Wave 1")); + } + ImGui::SameLine(); + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); + if (ImGui::InputInt("##SelWave1",&ins->ws.wave1,1,4)) { + if (ins->ws.wave1<0) ins->ws.wave1=0; + if (ins->ws.wave1>=(int)e->song.wave.size()) ins->ws.wave1=e->song.wave.size()-1; + wavePreviewInit=true; + } + if (ins->std.waveMacro.len>0) { + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("waveform macro is controlling wave 1!\nthis value will be ineffective.")); + } + } + if (isSingleWaveFX) { + ImGui::TableNextColumn(); + ImGui::AlignTextToFramePadding(); + ImGui::Text(_("Wave 2")); + ImGui::SameLine(); + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); + if (ImGui::InputInt("##SelWave2",&ins->ws.wave2,1,4)) { + if (ins->ws.wave2<0) ins->ws.wave2=0; + if (ins->ws.wave2>=(int)e->song.wave.size()) ins->ws.wave2=e->song.wave.size()-1; + wavePreviewInit=true; + } + } + ImGui::TableNextColumn(); + if (ImGui::Button(wavePreviewPaused?(ICON_FA_PLAY "##WSPause"):(ICON_FA_PAUSE "##WSPause"))) { + wavePreviewPaused=!wavePreviewPaused; + } + if (ImGui::IsItemHovered()) { + if (wavePreviewPaused) { + ImGui::SetTooltip(_("Resume preview")); + } else { + ImGui::SetTooltip(_("Pause preview")); + } + } + ImGui::SameLine(); + if (ImGui::Button(ICON_FA_REPEAT "##WSRestart")) { + wavePreviewInit=true; + } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("Restart preview")); + } + ImGui::SameLine(); + if (ImGui::Button(ICON_FA_UPLOAD "##WSCopy")) { + curWave=e->addWave(); + if (curWave==-1) { + showError(_("too many wavetables!")); + } else { + wantScrollListWave=true; + MARK_MODIFIED; + RESET_WAVE_MACRO_ZOOM; + nextWindow=GUI_WINDOW_WAVE_EDIT; + + DivWavetable* copyWave=e->song.wave[curWave]; + copyWave->len=wavePreviewLen; + copyWave->max=wavePreviewHeight; + memcpy(copyWave->data,wavePreview.output,256*sizeof(int)); + } + } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("Copy to new wavetable")); + } + ImGui::SameLine(); + ImGui::Text("(%d×%d)",wavePreviewLen,wavePreviewHeight+1); + ImGui::EndTable(); + } + + if (ImGui::InputScalar(_("Update Rate"),ImGuiDataType_U8,&ins->ws.rateDivider,&_ONE,&_EIGHT)) { + wavePreviewInit=true; + } + int speed=ins->ws.speed+1; + if (ImGui::InputInt(_("Speed"),&speed,1,8)) { + if (speed<1) speed=1; + if (speed>256) speed=256; + ins->ws.speed=speed-1; + wavePreviewInit=true; + } + + if (ImGui::InputScalar(_("Amount"),ImGuiDataType_U8,&ins->ws.param1,&_ONE,&_EIGHT)) { + wavePreviewInit=true; + } + + if (ins->ws.effect==DIV_WS_PHASE_MOD) { + if (ImGui::InputScalar(_("Power"),ImGuiDataType_U8,&ins->ws.param2,&_ONE,&_EIGHT)) { + wavePreviewInit=true; + } + } + + if (ImGui::Checkbox(_("Global"),&ins->ws.global)) { + wavePreviewInit=true; + } + } else { + ImGui::TextWrapped(_("wavetable synthesizer disabled.\nuse the Waveform macro to set the wave for this instrument.")); + } + + ImGui::EndTabItem(); + } +} + void FurnaceGUI::insTabSample(DivInstrument* ins) { const char* sampleTabName=_("Sample"); if (ins->type==DIV_INS_NES) sampleTabName=_("DPCM"); @@ -2687,8 +3292,9 @@ void FurnaceGUI::insTabSample(DivInstrument* ins) { ins->type==DIV_INS_AY8930 || ins->type==DIV_INS_VRC6 || ins->type==DIV_INS_SU || - ins->type==DIV_INS_NDS || - ins->type==DIV_INS_SUPERVISION) { + ins->type==DIV_INS_NDS || + ins->type==DIV_INS_SUPERVISION || + ins->type==DIV_INS_SID3) { P(ImGui::Checkbox(_("Use sample"),&ins->amiga.useSample)); if (ins->type==DIV_INS_X1_010) { if (ImGui::InputInt(_("Sample bank slot##BANKSLOT"),&ins->x1_010.bankSlot,1,4)) { PARAMETER @@ -5256,6 +5862,458 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) { } } +void FurnaceGUI::drawInsSID3(DivInstrument* ins) { + char buffer[100]; + char buffer2[100]; + + if (ImGui::BeginTabItem("SID3")) { + if (ImGui::BeginTable("sid3Waves",2,0)) { + ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthFixed,0.0f); + ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthFixed,0.0f); + + ImGui::TableNextRow(); + ImGui::TableNextColumn(); + + ImGui::AlignTextToFramePadding(); + ImGui::Text(_("Waveform")); + ImGui::SameLine(); + pushToggleColors(ins->sid3.triOn); + if (ImGui::Button(_("tri"))) { PARAMETER + ins->sid3.triOn=!ins->sid3.triOn; + } + popToggleColors(); + ImGui::SameLine(); + pushToggleColors(ins->sid3.sawOn); + if (ImGui::Button(_("saw"))) { PARAMETER + ins->sid3.sawOn=!ins->sid3.sawOn; + } + popToggleColors(); + ImGui::SameLine(); + pushToggleColors(ins->sid3.pulseOn); + if (ImGui::Button(_("pulse"))) { PARAMETER + ins->sid3.pulseOn=!ins->sid3.pulseOn; + } + popToggleColors(); + ImGui::SameLine(); + pushToggleColors(ins->sid3.noiseOn); + if (ImGui::Button(_("noise"))) { PARAMETER + ins->sid3.noiseOn=!ins->sid3.noiseOn; + } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("Like in SID2,specific noise LFSR feedback bits config can produce tonal waves.\n" + "Refer to the manual for LFSR bits macro configurations for which frequency calculation is altered\n" + "in a way that makes tonal noise stay in tune.")); + } + popToggleColors(); + ImGui::SameLine(); + + P(ImGui::Checkbox(_("1-bit noise"),&ins->sid3.oneBitNoise)); + ImGui::SameLine(); + + pushToggleColors(ins->sid3.specialWaveOn); + if (ImGui::Button(_("special"))) { PARAMETER + ins->sid3.specialWaveOn=!ins->sid3.specialWaveOn; + } + popToggleColors(); + + P(CWSliderScalar(_("Special wave"),ImGuiDataType_U8,&ins->sid3.special_wave,&_ZERO,&_SID3_SPECIAL_WAVES,_(sid3SpecialWaveforms[ins->sid3.special_wave%SID3_NUM_SPECIAL_WAVES]))); rightClickable + + if (ImGui::Checkbox(_("Wavetable channel"),&ins->sid3.doWavetable)) { + PARAMETER; + ins->std.waveMacro.vZoom=-1; + for (int i=0; i<256; i++) { + ins->std.waveMacro.val[i]=0; + } + } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("Forces waveform macro to control wavetable index.")); + } + + bool invLeft=ins->sid3.phaseInv&SID3_INV_SIGNAL_LEFT; + if (ImGui::Checkbox(_("Inv. left"),&invLeft)) { PARAMETER + ins->sid3.phaseInv^=SID3_INV_SIGNAL_LEFT; + } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("Invert left channel signal")); + } + ImGui::SameLine(); + bool invRight=ins->sid3.phaseInv&SID3_INV_SIGNAL_RIGHT; + if (ImGui::Checkbox(_("Inv. right"),&invRight)) { PARAMETER + ins->sid3.phaseInv^=SID3_INV_SIGNAL_RIGHT; + } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("Invert right channel signal")); + } + + ImGui::TableNextColumn(); + + CENTER_TEXT(_("Special wave preview")); + ImGui::TextUnformatted(_("Special wave preview")); + drawWaveformSID3(ins->sid3.special_wave,ImVec2(120.0f*dpiScale,70.0f*dpiScale)); + + ImGui::EndTable(); + } + + ImVec2 sliderSize=ImVec2(30.0f*dpiScale,256.0*dpiScale); + + if (ImGui::BeginTable("SID3EnvParams",6,ImGuiTableFlags_NoHostExtendX)) { + ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthFixed,sliderSize.x); + ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthFixed,sliderSize.x); + ImGui::TableSetupColumn("c2",ImGuiTableColumnFlags_WidthFixed,sliderSize.x); + ImGui::TableSetupColumn("c3",ImGuiTableColumnFlags_WidthFixed,sliderSize.x); + ImGui::TableSetupColumn("c4",ImGuiTableColumnFlags_WidthFixed,sliderSize.x); + ImGui::TableSetupColumn("c5",ImGuiTableColumnFlags_WidthStretch); + + ImGui::TableNextRow(); + ImGui::TableNextColumn(); + CENTER_TEXT(_("A")); + ImGui::TextUnformatted(_("A")); + ImGui::TableNextColumn(); + CENTER_TEXT(_("D")); + ImGui::TextUnformatted(_("D")); + ImGui::TableNextColumn(); + CENTER_TEXT(_("S")); + ImGui::TextUnformatted(_("S")); + ImGui::TableNextColumn(); + CENTER_TEXT(_("SR")); + ImGui::TextUnformatted(_("SR")); + ImGui::TableNextColumn(); + CENTER_TEXT(_("R")); + ImGui::TextUnformatted(_("R")); + ImGui::TableNextColumn(); + CENTER_TEXT(_("Envelope")); + ImGui::TextUnformatted(_("Envelope")); + + ImGui::TableNextRow(); + ImGui::TableNextColumn(); + P(CWVSliderScalar("##Attack",sliderSize,ImGuiDataType_U8,&ins->sid3.a,&_ZERO,&_TWO_HUNDRED_FIFTY_FIVE)); rightClickable + ImGui::TableNextColumn(); + P(CWVSliderScalar("##Decay",sliderSize,ImGuiDataType_U8,&ins->sid3.d,&_ZERO,&_TWO_HUNDRED_FIFTY_FIVE)); rightClickable + ImGui::TableNextColumn(); + P(CWVSliderScalar("##Sustain",sliderSize,ImGuiDataType_U8,&ins->sid3.s,&_ZERO,&_TWO_HUNDRED_FIFTY_FIVE)); rightClickable + ImGui::TableNextColumn(); + P(CWVSliderScalar("##SustainRate",sliderSize,ImGuiDataType_U8,&ins->sid3.sr,&_ZERO,&_TWO_HUNDRED_FIFTY_FIVE)); rightClickable + ImGui::TableNextColumn(); + P(CWVSliderScalar("##Release",sliderSize,ImGuiDataType_U8,&ins->sid3.r,&_ZERO,&_TWO_HUNDRED_FIFTY_FIVE)); rightClickable + ImGui::TableNextColumn(); + // the (ins->sid3.r==15?(ins->sid3.r-1):ins->sid3.r) is used so release part never becomes horizontal (which isn't the case with SID3 envelope) + drawSID3Env(0,(ins->sid3.a==0?(255):(256-ins->sid3.a)),(ins->sid3.d==0?(255):(256-ins->sid3.d)),ins->sid3.sr,255-(ins->sid3.r==255?(ins->sid3.r-1):ins->sid3.r),255-ins->sid3.s,0,0,0,255,256,255,ImVec2(ImGui::GetContentRegionAvail().x,sliderSize.y),ins->type); + + ImGui::EndTable(); + } + + if (!ins->sid3.doWavetable) { + strncpy(buffer,macroSID3WaveMixMode(0,(float)ins->sid3.mixMode,NULL).c_str(),40); + P(CWSliderScalar(_("Wave Mix Mode"),ImGuiDataType_U8,&ins->sid3.mixMode,&_ZERO,&_FOUR,buffer)); + P(CWSliderScalar(_("Duty"),ImGuiDataType_U16,&ins->sid3.duty,&_ZERO,&_SIXTY_FIVE_THOUSAND_FIVE_HUNDRED_THIRTY_FIVE)); rightClickable + P(CWSliderScalar(_("Feedback"),ImGuiDataType_U8,&ins->sid3.feedback,&_ZERO,&_TWO_HUNDRED_FIFTY_FIVE)); + bool resetDuty=ins->sid3.resetDuty; + if (ImGui::Checkbox(_("Reset duty on new note"),&resetDuty)) { PARAMETER + ins->sid3.resetDuty=resetDuty; + } + if (ImGui::Checkbox(_("Absolute Duty Macro"),&ins->sid3.dutyIsAbs)) { + ins->std.dutyMacro.vZoom=-1; + PARAMETER; + } + } + + bool ringMod=ins->sid3.ringMod; + if (ImGui::Checkbox(_("Ring Modulation"),&ringMod)) { PARAMETER + ins->sid3.ringMod=ringMod; + } + + ImGui::SameLine(); + + strncpy(buffer,macroSID3SourceChan(0,(float)ins->sid3.ring_mod_source,NULL).c_str(),40); + P(CWSliderScalar(_("Source channel##rmsrc"),ImGuiDataType_U8,&ins->sid3.ring_mod_source,&_ZERO,&_SID3_NUM_CHANNELS,buffer)); + + bool oscSync=ins->sid3.oscSync; + if (ImGui::Checkbox(_("Oscillator Sync"),&oscSync)) { PARAMETER + ins->sid3.oscSync=oscSync; + } + + ImGui::SameLine(); + + strncpy(buffer,macroSID3SourceChan(0,(float)ins->sid3.sync_source,NULL).c_str(),40); + P(CWSliderScalar(_("Source channel##hssrc"),ImGuiDataType_U8,&ins->sid3.sync_source,&_ZERO,&_SID3_NUM_CHANNELS_MINUS_ONE,buffer)); + + bool phaseMod=ins->sid3.phase_mod; + if (ImGui::Checkbox(_("Phase modulation"),&phaseMod)) { PARAMETER + ins->sid3.phase_mod=phaseMod; + } + + ImGui::SameLine(); + + strncpy(buffer,macroSID3SourceChan(0,(float)ins->sid3.phase_mod_source,NULL).c_str(),40); + P(CWSliderScalar(_("Source channel##pmsrc"),ImGuiDataType_U8,&ins->sid3.phase_mod_source,&_ZERO,&_SID3_NUM_CHANNELS_MINUS_ONE,buffer)); + + ImGui::Separator(); + + if (!ins->sid3.doWavetable) { + bool sepNoisePitch=ins->sid3.separateNoisePitch; + if (ImGui::Checkbox(_("Separate noise pitch"),&sepNoisePitch)) { PARAMETER + ins->sid3.separateNoisePitch=sepNoisePitch; + } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("Make noise pitch independent from other waves' pitch.\nNoise pitch will be controllable via macros.")); + } + } + + for (int i=0; isid3.filt[i]; + + if (filt->enabled) { + ImGui::Separator(); + } + + bool enable=filt->enabled; + snprintf(buffer,100,_("Enable filter %d"),i+1); + if (ImGui::Checkbox(buffer,&enable)) { PARAMETER + filt->enabled=enable; + } + + if (filt->enabled) { + bool init=filt->init; + snprintf(buffer,100,_("Initialize filter %d"),i+1); + if (ImGui::Checkbox(buffer,&init)) { PARAMETER + filt->init=init; + } + ImGui::SameLine(); + snprintf(buffer,100,_("Connect to channel input##contoinput%d"),i+1); + bool toInput=filt->mode&SID3_FILTER_CHANNEL_INPUT; + if (ImGui::Checkbox(buffer,&toInput)) { PARAMETER + filt->mode^=SID3_FILTER_CHANNEL_INPUT; + } + + snprintf(buffer,100,_("Cutoff##fcut%d"),i+1); + P(CWSliderScalar(buffer,ImGuiDataType_U16,&filt->cutoff,&_ZERO,&_SIXTY_FIVE_THOUSAND_FIVE_HUNDRED_THIRTY_FIVE)); rightClickable + snprintf(buffer,100,_("Resonance##fres%d"),i+1); + P(CWSliderScalar(buffer,ImGuiDataType_U8,&filt->resonance,&_ZERO,&_TWO_HUNDRED_FIFTY_FIVE)); rightClickable + snprintf(buffer,100,_("Output volume##foutvol%d"),i+1); + P(CWSliderScalar(buffer,ImGuiDataType_U8,&filt->output_volume,&_ZERO,&_TWO_HUNDRED_FIFTY_FIVE)); rightClickable + snprintf(buffer,100,_("Distortion level##fdist%d"),i+1); + P(CWSliderScalar(buffer,ImGuiDataType_U8,&filt->distortion_level,&_ZERO,&_TWO_HUNDRED_FIFTY_FIVE)); rightClickable + + ImGui::AlignTextToFramePadding(); + ImGui::Text(_("Filter Mode")); + ImGui::SameLine(); + + bool lp=filt->mode&SID3_FILTER_LP; + pushToggleColors(lp); + snprintf(buffer,100,_("low##flow%d"),i+1); + if (ImGui::Button(buffer)) { PARAMETER + filt->mode^=SID3_FILTER_LP; + } + popToggleColors(); + ImGui::SameLine(); + + bool bp=filt->mode&SID3_FILTER_BP; + pushToggleColors(bp); + snprintf(buffer,100,_("band##fband%d"),i+1); + if (ImGui::Button(buffer)) { PARAMETER + filt->mode^=SID3_FILTER_BP; + } + popToggleColors(); + ImGui::SameLine(); + + bool hp=filt->mode&SID3_FILTER_HP; + pushToggleColors(hp); + snprintf(buffer,100,_("high##fhigh%d"),i+1); + if (ImGui::Button(buffer)) { PARAMETER + filt->mode^=SID3_FILTER_HP; + } + popToggleColors(); + + + ImGui::SameLine(); + snprintf(buffer,100,_("Connect to channel output##contooutput%d"),i+1); + bool toOutput=filt->mode&SID3_FILTER_OUTPUT; + if (ImGui::Checkbox(buffer,&toOutput)) { PARAMETER + filt->mode^=SID3_FILTER_OUTPUT; + } + + snprintf(buffer,100,_("Absolute cutoff macro##abscutoff%d"),i+1); + bool absCutoff=filt->absoluteCutoff; + if (ImGui::Checkbox(buffer,&absCutoff)) { PARAMETER + filt->absoluteCutoff=!filt->absoluteCutoff; + ins->std.opMacros[i].d2rMacro.vZoom=-1; + } + + snprintf(buffer,100,_("Change cutoff with pitch##bindcutoff%d"),i+1); + P(ImGui::Checkbox(buffer,&filt->bindCutoffToNote)); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("Filter cutoff will change with frequency/pitch.\nSee settings below.")); + } + + if (filt->bindCutoffToNote) { + snprintf(buffer,100,_("Decrease cutoff when pitch increases##decreasecutoff%d"),i+1); + P(ImGui::Checkbox(buffer,&filt->bindCutoffToNoteDir)); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("If this is enabled,filter cutoff will decrease if you increase the pitch.\n" + "If this is disabled,filter cutoff will increase if you increase the pitch.")); + } + + snprintf(buffer2,100,_("%s"),noteNameNormal(filt->bindCutoffToNoteCenter%12,(short)(filt->bindCutoffToNoteCenter / 12)-5)); + snprintf(buffer,100,_("Cutoff change center note##bindcutcenternote%d"),i+1); + P(CWSliderScalar(buffer,ImGuiDataType_U8,&filt->bindCutoffToNoteCenter,&_ZERO,&_ONE_HUNDRED_SEVENTY_NINE,buffer2)); rightClickable + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("The center note for cutoff changes. At this note no cutoff change happens.\nAs pitch goes lower or higher,cutoff changes apply.")); + } + + snprintf(buffer,100,_("Cutoff change strength##bindcutstrength%d"),i+1); + P(CWSliderScalar(buffer,ImGuiDataType_U8,&filt->bindCutoffToNoteStrength,&_ZERO,&_TWO_HUNDRED_FIFTY_FIVE)); rightClickable + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("How much cutoff changes for given pitch change.")); + } + snprintf(buffer,100,_("Scale cutoff only once on new note##bindcutnn%d"),i+1); + P(ImGui::Checkbox(buffer,&filt->bindCutoffOnNote)); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("Filter cutoff will be changed only once on new note.\nIf this option is disabled,cutoff scaling will be applied\nevery time a pitch change happens.")); + } + } + + snprintf(buffer,100,_("Change resonance with pitch##bindres%d"),i+1); + P(ImGui::Checkbox(buffer,&filt->bindResonanceToNote)); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("Filter resonance will change with frequency/pitch.\nSee settings below.")); + } + + if (filt->bindResonanceToNote) { + snprintf(buffer,100,_("Decrease resonance when pitch increases##decreaseres%d"),i+1); + P(ImGui::Checkbox(buffer,&filt->bindResonanceToNoteDir)); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("If this is enabled,filter resonance will decrease if you increase the pitch.\n" + "If this is disabled,filter resonance will increase if you increase the pitch.")); + } + + snprintf(buffer2,100,_("%s"),noteNameNormal(filt->bindResonanceToNoteCenter%12,(short)(filt->bindResonanceToNoteCenter / 12)-5)); + snprintf(buffer,100,_("Resonance change center note##bindrescenternote%d"),i+1); + P(CWSliderScalar(buffer,ImGuiDataType_U8,&filt->bindResonanceToNoteCenter,&_ZERO,&_ONE_HUNDRED_SEVENTY_NINE,buffer2)); rightClickable + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("The center note for resonance changes. At this note no resonance change happens.\nAs pitch goes lower or higher,resonance changes apply.")); + } + + snprintf(buffer,100,_("Resonance change strength##bindresstrength%d"),i+1); + P(CWSliderScalar(buffer,ImGuiDataType_U8,&filt->bindResonanceToNoteStrength,&_ZERO,&_TWO_HUNDRED_FIFTY_FIVE)); rightClickable + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("How much resonance changes for given pitch change.")); + } + snprintf(buffer,100,_("Scale resonance only once on new note##bindresnn%d"),i+1); + P(ImGui::Checkbox(buffer,&filt->bindResonanceOnNote)); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("Filter resonance will be changed only once on new note.\nIf this option is disabled,resonance scaling will be applied\nevery time a pitch change happens.")); + } + } + } + } + + ImGui::Separator(); + + if (ImGui::BeginTable("SID3filtmatrix",1)) { + if (waveGenVisible) ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthFixed,250.0f*dpiScale); + ImGui::TableNextRow(); + ImGui::TableNextColumn(); + + CENTER_TEXT(_("Filters connection matrix")); + ImGui::Text(_("Filters connection matrix")); + + if (ImGui::BeginTable("SID3checkboxesmatrix",3+SID3_NUM_FILTERS)) { + ImGui::TableNextRow(); + ImGui::TableNextColumn(); + ImGui::Text(">>"); + ImGui::TableNextColumn(); + ImGui::Text(_("In")); + + for (int i=0; isid3.filt[i]; + + ImGui::TableNextRow(); + ImGui::TableNextColumn(); + ImGui::Text("%d",i+1); + + ImGui::TableNextColumn(); + + snprintf(buffer,40,"##filtmatrixin%d",i+1); + bool toInput=filt->mode&SID3_FILTER_CHANNEL_INPUT; + if (ImGui::Checkbox(buffer,&toInput)) { PARAMETER + filt->mode^=SID3_FILTER_CHANNEL_INPUT; + } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("Feed signal from channel to filter %d input"),i+1); + } + + for (int j=0; jfilter_matrix&(1<filter_matrix^=(1<mode&SID3_FILTER_OUTPUT; + if (ImGui::Checkbox(buffer,&toOutput)) { PARAMETER + filt->mode^=SID3_FILTER_OUTPUT; + } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("Feed signal from filter %d output to channel output"),i+1); + } + } + + ImGui::EndTable(); + } + + ImGui::EndTable(); + } + + ImGui::EndTabItem(); + } + + if (!ins->amiga.useSample) { + insTabWavetable(ins); + } + insTabSample(ins); + + std::vector macroList; + + for (int i=0; istd.opMacros[i].d2rMacro,ins->sid3.filt[i].absoluteCutoff?0:-65535,65535,160,uiColors[GUI_COLOR_MACRO_FILTER])); + macroList.push_back(FurnaceGUIMacroDesc(_("Resonance"),&ins->std.opMacros[i].damMacro,0,255,160,uiColors[GUI_COLOR_MACRO_FILTER])); + macroList.push_back(FurnaceGUIMacroDesc(_("Filter Toggle"),&ins->std.opMacros[i].drMacro,0,1,32,uiColors[GUI_COLOR_MACRO_FILTER],false,NULL,NULL,true)); + macroList.push_back(FurnaceGUIMacroDesc(_("Filter Mode"),&ins->std.opMacros[i].ksrMacro,0,3,48,uiColors[GUI_COLOR_MACRO_FILTER],false,NULL,NULL,true,filtModeBits)); + macroList.push_back(FurnaceGUIMacroDesc(_("Distortion Level"),&ins->std.opMacros[i].dt2Macro,0,255,160,uiColors[GUI_COLOR_MACRO_FILTER])); + macroList.push_back(FurnaceGUIMacroDesc(_("Output Volume"),&ins->std.opMacros[i].dtMacro,0,255,160,uiColors[GUI_COLOR_MACRO_FILTER])); + macroList.push_back(FurnaceGUIMacroDesc(_("Channel Input Connection"),&ins->std.opMacros[i].dvbMacro,0,1,32,uiColors[GUI_COLOR_MACRO_FILTER],false,NULL,NULL,true)); + macroList.push_back(FurnaceGUIMacroDesc(_("Channel Output Connection"),&ins->std.opMacros[i].egtMacro,0,1,32,uiColors[GUI_COLOR_MACRO_FILTER],false,NULL,NULL,true)); + macroList.push_back(FurnaceGUIMacroDesc(_("Connection Matrix Row"),&ins->std.opMacros[i].kslMacro,0,SID3_NUM_FILTERS,16*SID3_NUM_FILTERS,uiColors[GUI_COLOR_MACRO_FILTER],false,NULL,NULL,true,sid3FilterMatrixBits)); + + drawMacros(macroList,macroEditStateOP[i]); + + ImGui::EndTabItem(); + } + } +} + void FurnaceGUI::drawInsEdit() { if (nextWindow==GUI_WINDOW_INS_EDIT) { insEditOpen=true; @@ -5474,6 +6532,7 @@ void FurnaceGUI::drawInsEdit() { if (ImGui::BeginTabBar("insEditTab")) { std::vector macroList; + if (ins->type==DIV_INS_FM || ins->type==DIV_INS_OPL || ins->type==DIV_INS_OPLL || ins->type==DIV_INS_OPZ || ins->type==DIV_INS_OPL_DRUMS || ins->type==DIV_INS_OPM || ins->type==DIV_INS_ESFM) { char label[32]; int opCount=4; @@ -5951,6 +7010,11 @@ void FurnaceGUI::drawInsEdit() { P(CWSliderScalar(_("Duty"),ImGuiDataType_U16,&ins->c64.duty,&_ZERO,&_FOUR_THOUSAND_NINETY_FIVE)); rightClickable + bool resetDuty=ins->c64.resetDuty; + if (ImGui::Checkbox(_("Reset duty on new note"),&resetDuty)) { PARAMETER + ins->c64.resetDuty=resetDuty; + } + bool ringMod=ins->c64.ringMod; if (ImGui::Checkbox(_("Ring Modulation"),&ringMod)) { PARAMETER ins->c64.ringMod=ringMod; @@ -6255,6 +7319,9 @@ void FurnaceGUI::drawInsEdit() { ImGui::EndChild(); ImGui::EndTabItem(); } + if (ins->type==DIV_INS_SID3) { + drawInsSID3(ins); + } if (ins->type==DIV_INS_MSM6258 || ins->type==DIV_INS_MSM6295 || ins->type==DIV_INS_ADPCMA || @@ -6735,266 +7802,9 @@ void FurnaceGUI::drawInsEdit() { ins->type==DIV_INS_SNES || ins->type==DIV_INS_NAMCO || ins->type==DIV_INS_SM8521 || - (ins->type==DIV_INS_GBA_MINMOD && ins->amiga.useWave)) { - if (ImGui::BeginTabItem(_("Wavetable"))) { - switch (ins->type) { - case DIV_INS_GB: - case DIV_INS_NAMCO: - case DIV_INS_SM8521: - case DIV_INS_SWAN: - wavePreviewLen=32; - wavePreviewHeight=15; - break; - case DIV_INS_PCE: - wavePreviewLen=32; - wavePreviewHeight=31; - break; - case DIV_INS_VBOY: - wavePreviewLen=32; - wavePreviewHeight=63; - break; - case DIV_INS_SCC: - wavePreviewLen=32; - wavePreviewHeight=255; - break; - case DIV_INS_FDS: - wavePreviewLen=64; - wavePreviewHeight=63; - break; - case DIV_INS_N163: - wavePreviewLen=ins->n163.waveLen; - wavePreviewHeight=15; - break; - case DIV_INS_X1_010: - wavePreviewLen=128; - wavePreviewHeight=255; - break; - case DIV_INS_AMIGA: - case DIV_INS_GBA_DMA: - wavePreviewLen=ins->amiga.waveLen+1; - wavePreviewHeight=255; - break; - case DIV_INS_SNES: - wavePreviewLen=ins->amiga.waveLen+1; - wavePreviewHeight=15; - break; - case DIV_INS_GBA_MINMOD: - wavePreviewLen=ins->amiga.waveLen+1; - wavePreviewHeight=255; - break; - default: - wavePreviewLen=32; - wavePreviewHeight=31; - break; - } - if (ImGui::Checkbox(_("Enable synthesizer"),&ins->ws.enabled)) { - wavePreviewInit=true; - } - if (ins->ws.enabled) { - ImGui::SameLine(); - ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); - if (ins->ws.effect&0x80) { - if ((ins->ws.effect&0x7f)>=DIV_WS_DUAL_MAX) { - ins->ws.effect=0; - wavePreviewInit=true; - } - } else { - if ((ins->ws.effect&0x7f)>=DIV_WS_SINGLE_MAX) { - ins->ws.effect=0; - wavePreviewInit=true; - } - } - if (ImGui::BeginCombo("##WSEffect",(ins->ws.effect&0x80)?dualWSEffects[ins->ws.effect&0x7f]:singleWSEffects[ins->ws.effect&0x7f])) { - ImGui::Text(_("Single-waveform")); - ImGui::Indent(); - for (int i=0; iws.effect=i; - wavePreviewInit=true; - } - } - ImGui::Unindent(); - ImGui::Text(_("Dual-waveform")); - ImGui::Indent(); - for (int i=129; iws.effect=i; - wavePreviewInit=true; - } - } - ImGui::Unindent(); - ImGui::EndCombo(); - } - const bool isSingleWaveFX=(ins->ws.effect>=128); - if (ImGui::BeginTable("WSPreview",isSingleWaveFX?3:2)) { - DivWavetable* wave1=e->getWave(ins->ws.wave1); - DivWavetable* wave2=e->getWave(ins->ws.wave2); - if (wavePreviewInit) { - wavePreview.init(ins,wavePreviewLen,wavePreviewHeight,true); - wavePreviewInit=false; - } - float wavePreview1[257]; - float wavePreview2[257]; - float wavePreview3[257]; - for (int i=0; ilen; i++) { - if (wave1->data[i]>wave1->max) { - wavePreview1[i]=wave1->max; - } else { - wavePreview1[i]=wave1->data[i]; - } - } - if (wave1->len>0) { - wavePreview1[wave1->len]=wave1->data[wave1->len-1]; - } - for (int i=0; ilen; i++) { - if (wave2->data[i]>wave2->max) { - wavePreview2[i]=wave2->max; - } else { - wavePreview2[i]=wave2->data[i]; - } - } - if (wave2->len>0) { - wavePreview2[wave2->len]=wave2->data[wave2->len-1]; - } - if (ins->ws.enabled && (!wavePreviewPaused || wavePreviewInit)) { - wavePreview.tick(true); - WAKE_UP; - } - for (int i=0; i0) { - wavePreview3[wavePreviewLen]=wavePreview3[wavePreviewLen-1]; - } - - float ySize=(isSingleWaveFX?96.0f:128.0f)*dpiScale; - - ImGui::TableNextRow(); - ImGui::TableNextColumn(); - ImVec2 size1=ImVec2(ImGui::GetContentRegionAvail().x,ySize); - PlotNoLerp("##WaveformP1",wavePreview1,wave1->len+1,0,"Wave 1",0,wave1->max,size1); - if (isSingleWaveFX) { - ImGui::TableNextColumn(); - ImVec2 size2=ImVec2(ImGui::GetContentRegionAvail().x,ySize); - PlotNoLerp("##WaveformP2",wavePreview2,wave2->len+1,0,"Wave 2",0,wave2->max,size2); - } - ImGui::TableNextColumn(); - ImVec2 size3=ImVec2(ImGui::GetContentRegionAvail().x,ySize); - PlotNoLerp("##WaveformP3",wavePreview3,wavePreviewLen+1,0,"Result",0,wavePreviewHeight,size3); - - ImGui::TableNextRow(); - ImGui::TableNextColumn(); - if (ins->std.waveMacro.len>0) { - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_WARNING]); - ImGui::AlignTextToFramePadding(); - ImGui::Text(_("Wave 1")); - ImGui::SameLine(); - ImGui::Text(ICON_FA_EXCLAMATION_TRIANGLE); - ImGui::PopStyleColor(); - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip(_("waveform macro is controlling wave 1!\nthis value will be ineffective.")); - } - } else { - ImGui::AlignTextToFramePadding(); - ImGui::Text(_("Wave 1")); - } - ImGui::SameLine(); - ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); - if (ImGui::InputInt("##SelWave1",&ins->ws.wave1,1,4)) { - if (ins->ws.wave1<0) ins->ws.wave1=0; - if (ins->ws.wave1>=(int)e->song.wave.size()) ins->ws.wave1=e->song.wave.size()-1; - wavePreviewInit=true; - } - if (ins->std.waveMacro.len>0) { - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip(_("waveform macro is controlling wave 1!\nthis value will be ineffective.")); - } - } - if (isSingleWaveFX) { - ImGui::TableNextColumn(); - ImGui::AlignTextToFramePadding(); - ImGui::Text(_("Wave 2")); - ImGui::SameLine(); - ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); - if (ImGui::InputInt("##SelWave2",&ins->ws.wave2,1,4)) { - if (ins->ws.wave2<0) ins->ws.wave2=0; - if (ins->ws.wave2>=(int)e->song.wave.size()) ins->ws.wave2=e->song.wave.size()-1; - wavePreviewInit=true; - } - } - ImGui::TableNextColumn(); - if (ImGui::Button(wavePreviewPaused?(ICON_FA_PLAY "##WSPause"):(ICON_FA_PAUSE "##WSPause"))) { - wavePreviewPaused=!wavePreviewPaused; - } - if (ImGui::IsItemHovered()) { - if (wavePreviewPaused) { - ImGui::SetTooltip(_("Resume preview")); - } else { - ImGui::SetTooltip(_("Pause preview")); - } - } - ImGui::SameLine(); - if (ImGui::Button(ICON_FA_REPEAT "##WSRestart")) { - wavePreviewInit=true; - } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip(_("Restart preview")); - } - ImGui::SameLine(); - if (ImGui::Button(ICON_FA_UPLOAD "##WSCopy")) { - curWave=e->addWave(); - if (curWave==-1) { - showError(_("too many wavetables!")); - } else { - wantScrollListWave=true; - MARK_MODIFIED; - RESET_WAVE_MACRO_ZOOM; - nextWindow=GUI_WINDOW_WAVE_EDIT; - - DivWavetable* copyWave=e->song.wave[curWave]; - copyWave->len=wavePreviewLen; - copyWave->max=wavePreviewHeight; - memcpy(copyWave->data,wavePreview.output,256*sizeof(int)); - } - } - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip(_("Copy to new wavetable")); - } - ImGui::SameLine(); - ImGui::Text("(%d×%d)",wavePreviewLen,wavePreviewHeight+1); - ImGui::EndTable(); - } - - if (ImGui::InputScalar(_("Update Rate"),ImGuiDataType_U8,&ins->ws.rateDivider,&_ONE,&_EIGHT)) { - wavePreviewInit=true; - } - int speed=ins->ws.speed+1; - if (ImGui::InputInt(_("Speed"),&speed,1,8)) { - if (speed<1) speed=1; - if (speed>256) speed=256; - ins->ws.speed=speed-1; - wavePreviewInit=true; - } - - if (ImGui::InputScalar(_("Amount"),ImGuiDataType_U8,&ins->ws.param1,&_ONE,&_EIGHT)) { - wavePreviewInit=true; - } - - if (ins->ws.effect==DIV_WS_PHASE_MOD) { - if (ImGui::InputScalar(_("Power"),ImGuiDataType_U8,&ins->ws.param2,&_ONE,&_EIGHT)) { - wavePreviewInit=true; - } - } - - if (ImGui::Checkbox(_("Global"),&ins->ws.global)) { - wavePreviewInit=true; - } - } else { - ImGui::TextWrapped(_("wavetable synthesizer disabled.\nuse the Waveform macro to set the wave for this instrument.")); - } - - ImGui::EndTabItem(); - } + (ins->type==DIV_INS_GBA_MINMOD && ins->amiga.useWave)) + { + insTabWavetable(ins); } if (ins->typestd.arpMacro,-120,120,160,uiColors[GUI_COLOR_MACRO_PITCH],true,NULL,macroHoverNote,false,NULL,true,ins->std.arpMacro.val)); if (!ins->amiga.useSample) { macroList.push_back(FurnaceGUIMacroDesc(_("Noise Freq"),&ins->std.dutyMacro,0,31,160,uiColors[GUI_COLOR_MACRO_NOISE])); - macroList.push_back(FurnaceGUIMacroDesc(_("Waveform"),&ins->std.waveMacro,0,3,64,uiColors[GUI_COLOR_MACRO_WAVE],false,NULL,NULL,true,ayShapeBits)); + macroList.push_back(FurnaceGUIMacroDesc(_("Waveform"),&ins->std.waveMacro,0,3,48,uiColors[GUI_COLOR_MACRO_WAVE],false,NULL,NULL,true,ayShapeBits)); } macroList.push_back(FurnaceGUIMacroDesc(_("Pitch"),&ins->std.pitchMacro,-2048,2047,160,uiColors[GUI_COLOR_MACRO_PITCH],true,macroRelativeMode)); macroList.push_back(FurnaceGUIMacroDesc(_("Phase Reset"),&ins->std.phaseResetMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true)); @@ -7597,7 +8407,7 @@ void FurnaceGUI::drawInsEdit() { macroList.push_back(FurnaceGUIMacroDesc(_("Sustain"),&ins->std.ex7Macro,0,15,128,uiColors[GUI_COLOR_MACRO_ENVELOPE])); macroList.push_back(FurnaceGUIMacroDesc(_("Release"),&ins->std.ex8Macro,0,15,128,uiColors[GUI_COLOR_MACRO_ENVELOPE])); macroList.push_back(FurnaceGUIMacroDesc(_("Noise Mode"),&ins->std.fmsMacro,0,3,64,uiColors[GUI_COLOR_MACRO_NOISE])); - macroList.push_back(FurnaceGUIMacroDesc(_("Wave Mix"),&ins->std.amsMacro,0,3,64,uiColors[GUI_COLOR_MACRO_OTHER])); + macroList.push_back(FurnaceGUIMacroDesc(_("Wave Mix"),&ins->std.amsMacro,0,3,64,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,macroSID2WaveMixMode)); break; case DIV_INS_UPD1771C: macroList.push_back(FurnaceGUIMacroDesc(_("Volume"),&ins->std.volMacro,0,31,160,uiColors[GUI_COLOR_MACRO_VOLUME])); @@ -7607,6 +8417,64 @@ void FurnaceGUI::drawInsEdit() { macroList.push_back(FurnaceGUIMacroDesc(_("Duty/Mode"),&ins->std.dutyMacro,0,1,160,uiColors[GUI_COLOR_MACRO_NOISE])); macroList.push_back(FurnaceGUIMacroDesc(_("Pitch"),&ins->std.pitchMacro,-2048,2047,160,uiColors[GUI_COLOR_MACRO_PITCH],true,macroRelativeMode)); break; + case DIV_INS_SID3: + macroList.push_back(FurnaceGUIMacroDesc(_("Volume"),&ins->std.volMacro,0,255,160,uiColors[GUI_COLOR_MACRO_VOLUME])); + + macroList.push_back(FurnaceGUIMacroDesc(_("Arpeggio"),&ins->std.arpMacro,-120,120,160,uiColors[GUI_COLOR_MACRO_PITCH],true,NULL,macroHoverNote,false,NULL,true,ins->std.arpMacro.val)); + macroList.push_back(FurnaceGUIMacroDesc(_("Pitch"),&ins->std.pitchMacro,-2048,2047,160,uiColors[GUI_COLOR_MACRO_PITCH],true,macroRelativeMode)); + + if (ins->sid3.doWavetable) { + int waveCount=MAX(1,e->song.waveLen-1); + macroList.push_back(FurnaceGUIMacroDesc(_("Waveform"),&ins->std.waveMacro,0,waveCount,160,uiColors[GUI_COLOR_MACRO_WAVE],false,NULL,NULL,false,NULL)); + } else { + macroList.push_back(FurnaceGUIMacroDesc(_("Duty"),&ins->std.dutyMacro,ins->sid3.dutyIsAbs?0:-65535,65535,160,uiColors[GUI_COLOR_MACRO_OTHER])); + macroList.push_back(FurnaceGUIMacroDesc(_("Waveform"),&ins->std.waveMacro,0,5,16 * 5,uiColors[GUI_COLOR_MACRO_WAVE],false,NULL,NULL,true,sid3ShapeBits)); + macroList.push_back(FurnaceGUIMacroDesc(_("Special Wave"),&ins->std.algMacro,0,SID3_NUM_SPECIAL_WAVES - 1,160,uiColors[GUI_COLOR_MACRO_WAVE],false,NULL,macroSID3SpecialWaves)); + } + + if (ins->sid3.separateNoisePitch && !ins->sid3.doWavetable) { + macroList.push_back(FurnaceGUIMacroDesc(_("Noise Arpeggio"),&ins->std.opMacros[3].amMacro,-120,120,160,uiColors[GUI_COLOR_MACRO_PITCH],true,NULL,macroHoverNote,false,NULL,true,ins->std.opMacros[3].amMacro.val,true)); + macroList.push_back(FurnaceGUIMacroDesc(_("Noise Pitch"),&ins->std.opMacros[0].arMacro,-2048,2047,160,uiColors[GUI_COLOR_MACRO_PITCH],true,macroRelativeMode,NULL,false,NULL,false,NULL,false,true)); + } + + macroList.push_back(FurnaceGUIMacroDesc(_("Panning (left)"),&ins->std.panLMacro,0,255,160,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL)); + macroList.push_back(FurnaceGUIMacroDesc(_("Panning (right)"),&ins->std.panRMacro,0,255,160,uiColors[GUI_COLOR_MACRO_OTHER])); + + macroList.push_back(FurnaceGUIMacroDesc(_("Channel inversion"),&ins->std.opMacros[2].arMacro,0,2,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,minModModeBits)); + + macroList.push_back(FurnaceGUIMacroDesc(_("Key On/Off"),&ins->std.opMacros[0].amMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true)); + + macroList.push_back(FurnaceGUIMacroDesc(_("Special"),&ins->std.ex1Macro,0,3,48,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,sid3ControlBits)); + + macroList.push_back(FurnaceGUIMacroDesc(_("Ring Mod Source"),&ins->std.fmsMacro,0,SID3_NUM_CHANNELS,64,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,macroSID3SourceChan)); + macroList.push_back(FurnaceGUIMacroDesc(_("Hard Sync Source"),&ins->std.amsMacro,0,SID3_NUM_CHANNELS - 1,64,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,macroSID3SourceChan)); + macroList.push_back(FurnaceGUIMacroDesc(_("Phase Mod Source"),&ins->std.fbMacro,0,SID3_NUM_CHANNELS - 1,64,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,macroSID3SourceChan)); + + if (!ins->sid3.doWavetable) { + macroList.push_back(FurnaceGUIMacroDesc(_("Feedback"),&ins->std.opMacros[3].arMacro,0,255,160,uiColors[GUI_COLOR_MACRO_OTHER])); + } + + macroList.push_back(FurnaceGUIMacroDesc(_("Phase Reset"),&ins->std.phaseResetMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true)); + + if (!ins->sid3.doWavetable) { + macroList.push_back(FurnaceGUIMacroDesc(_("Noise Phase Reset"),&ins->std.opMacros[1].amMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true)); + } + macroList.push_back(FurnaceGUIMacroDesc(_("Envelope Reset"),&ins->std.opMacros[2].amMacro,0,1,32,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true)); + + macroList.push_back(FurnaceGUIMacroDesc(_("Attack"),&ins->std.ex2Macro,0,255,160,uiColors[GUI_COLOR_MACRO_ENVELOPE])); + macroList.push_back(FurnaceGUIMacroDesc(_("Decay"),&ins->std.ex3Macro,0,255,160,uiColors[GUI_COLOR_MACRO_ENVELOPE])); + macroList.push_back(FurnaceGUIMacroDesc(_("Sustain"),&ins->std.ex4Macro,0,255,160,uiColors[GUI_COLOR_MACRO_ENVELOPE])); + macroList.push_back(FurnaceGUIMacroDesc(_("Sustain Rate"),&ins->std.ex5Macro,0,255,160,uiColors[GUI_COLOR_MACRO_ENVELOPE])); + macroList.push_back(FurnaceGUIMacroDesc(_("Release"),&ins->std.ex6Macro,0,255,160,uiColors[GUI_COLOR_MACRO_ENVELOPE])); + + if (!ins->sid3.doWavetable) { + macroList.push_back(FurnaceGUIMacroDesc(_("Noise LFSR bits"),&ins->std.ex7Macro,0,30,16 * 30,uiColors[GUI_COLOR_MACRO_NOISE],false,NULL,macroSID3NoiseLFSR,true)); + macroList.push_back(FurnaceGUIMacroDesc(_("1-Bit Noise"),&ins->std.opMacros[1].arMacro,0,1,32,uiColors[GUI_COLOR_MACRO_NOISE],false,NULL,NULL,true)); + macroList.push_back(FurnaceGUIMacroDesc(_("Wave Mix"),&ins->std.ex8Macro,0,4,64,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,macroSID3WaveMixMode)); + } else { + macroList.push_back(FurnaceGUIMacroDesc(_("Sample Mode"),&ins->std.opMacros[1].arMacro,0,1,32,uiColors[GUI_COLOR_MACRO_NOISE],false,NULL,NULL,true)); + } + break; case DIV_INS_MAX: case DIV_INS_NULL: break; diff --git a/src/gui/intConst.cpp b/src/gui/intConst.cpp index dde39ea34..37ff6f7aa 100644 --- a/src/gui/intConst.cpp +++ b/src/gui/intConst.cpp @@ -33,6 +33,7 @@ const int _THIRTY_ONE=31; const int _SIXTY_FOUR=64; const int _ONE_HUNDRED=100; const int _ONE_HUNDRED_TWENTY_SEVEN=127; +const int _ONE_HUNDRED_SEVENTY_NINE=179; const int _TWO_HUNDRED_FIFTY_FIVE=255; const int _FIVE_HUNDRED_ELEVEN=511; const int _TWO_THOUSAND_FORTY_SEVEN=2047; diff --git a/src/gui/intConst.h b/src/gui/intConst.h index 26f3b9e8b..d62ef5f03 100644 --- a/src/gui/intConst.h +++ b/src/gui/intConst.h @@ -35,6 +35,7 @@ extern const int _THIRTY_ONE; extern const int _SIXTY_FOUR; extern const int _ONE_HUNDRED; extern const int _ONE_HUNDRED_TWENTY_SEVEN; +extern const int _ONE_HUNDRED_SEVENTY_NINE; extern const int _TWO_HUNDRED_FIFTY_FIVE; extern const int _FIVE_HUNDRED_ELEVEN; extern const int _TWO_THOUSAND_FORTY_SEVEN; diff --git a/src/gui/newSong.cpp b/src/gui/newSong.cpp index f03715be5..e974b02b5 100644 --- a/src/gui/newSong.cpp +++ b/src/gui/newSong.cpp @@ -37,7 +37,7 @@ void FurnaceGUI::drawSysDefs(std::vector& category, bool& acce ImGui::TableNextColumn(); if (!i.subDefs.empty()) { if (i.orig.empty()) { - sysDefID=fmt::sprintf("%s%s/%dS",i.name,sysDefIDLeader,index); + sysDefID=fmt::sprintf("%s%s/%dS",_(i.name.c_str()),sysDefIDLeader,index); } else { sysDefID=fmt::sprintf("%s/%dS",sysDefIDLeader,index); } @@ -45,7 +45,7 @@ void FurnaceGUI::drawSysDefs(std::vector& category, bool& acce ImGui::SameLine(); } if (!i.orig.empty()) { - sysDefID=fmt::sprintf("%s%s/%d",i.name,sysDefIDLeader,index); + sysDefID=fmt::sprintf("%s%s/%d",_(i.name.c_str()),sysDefIDLeader,index); if (ImGui::Selectable(sysDefID.c_str(),false,ImGuiSelectableFlags_DontClosePopups)) { nextDesc=i.definition; nextDescName=i.name; diff --git a/src/gui/pattern.cpp b/src/gui/pattern.cpp index c32171161..0a658a4e2 100644 --- a/src/gui/pattern.cpp +++ b/src/gui/pattern.cpp @@ -1282,116 +1282,120 @@ void FurnaceGUI::drawPattern() { memset(floors,0,4*4*sizeof(unsigned int)); for (int i=0; icurSubSong->chanShow[i]) { - continue; - } + std::vector pairs; + e->getChanPaired(i,pairs); - DivChannelPair pairs=e->getChanPaired(i); - for (int j=0; j<8; j++) { - if (pairs.pairs[j]==-1) continue; - int pairCh=e->dispatchFirstChan[i]+pairs.pairs[j]; - if (!e->curSubSong->chanShow[pairCh]) { + for (DivChannelPair pair: pairs) { + bool isPaired=false; + int numPairs=0; + unsigned int pairMin=i; + unsigned int pairMax=i; + unsigned char curFloor=0; + if (!e->curSubSong->chanShow[i]) { continue; } - isPaired=true; - if ((unsigned int)pairChpairMax) pairMax=pairCh; - } - if (!isPaired) continue; - - float posY=chanHeadBottom; - - // find a free floor - while (curFloor<4) { - bool free=true; - for (unsigned int j=pairMin; j<=pairMax; j++) { - const unsigned int j0=j>>5; - const unsigned int j1=1U<<(j&31); - if (floors[curFloor][j0]&j1) { - free=false; - break; + for (int j=0; j<8; j++) { + if (pair.pairs[j]==-1) continue; + int pairCh=e->dispatchFirstChan[i]+pair.pairs[j]; + if (!e->curSubSong->chanShow[pairCh]) { + continue; } - } - if (free) break; - curFloor++; - } - if (curFloor<4) { - // occupy floor - floors[curFloor][pairMin>>5]|=1U<<(pairMin&31); - floors[curFloor][pairMax>>5]|=1U<<(pairMax&31); - } - - pos=(patChanX[i+1]+patChanX[i])*0.5; - posCenter=pos; - posMin=pos; - posMax=pos; - numPairs++; - - if (pairs.label==NULL) { - textSize=ImGui::CalcTextSize("???"); - } else { - textSize=ImGui::CalcTextSize(pairs.label); - } - - posY+=(textSize.y+ImGui::GetStyle().ItemSpacing.y)*curFloor; - - tdl->AddLine( - ImVec2(pos,chanHeadBottom), - ImVec2(pos,posY+textSize.y), - ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]), - 2.0f*dpiScale - ); - - for (int j=0; j<8; j++) { - if (pairs.pairs[j]==-1) continue; - int pairCh=e->dispatchFirstChan[i]+pairs.pairs[j]; - if (!e->curSubSong->chanShow[pairCh]) { - continue; + isPaired=true; + if ((unsigned int)pairChpairMax) pairMax=pairCh; } - pos=(patChanX[pairCh+1]+patChanX[pairCh])*0.5; - posCenter+=pos; + if (!isPaired) continue; + + float posY=chanHeadBottom; + + // find a free floor + while (curFloor<4) { + bool free=true; + for (unsigned int j=pairMin; j<=pairMax; j++) { + const unsigned int j0=j>>5; + const unsigned int j1=1U<<(j&31); + if (floors[curFloor][j0]&j1) { + free=false; + break; + } + } + if (free) break; + curFloor++; + } + if (curFloor<4) { + // occupy floor + floors[curFloor][pairMin>>5]|=1U<<(pairMin&31); + floors[curFloor][pairMax>>5]|=1U<<(pairMax&31); + } + + pos=(patChanX[i+1]+patChanX[i])*0.5; + posCenter=pos; + posMin=pos; + posMax=pos; numPairs++; - if (posposMax) posMax=pos; + + if (pair.label==NULL) { + textSize=ImGui::CalcTextSize("???"); + } else { + textSize=ImGui::CalcTextSize(pair.label); + } + + posY+=(textSize.y+ImGui::GetStyle().ItemSpacing.y)*curFloor; + tdl->AddLine( ImVec2(pos,chanHeadBottom), ImVec2(pos,posY+textSize.y), ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]), 2.0f*dpiScale ); - } - posCenter/=numPairs; + for (int j=0; j<8; j++) { + if (pair.pairs[j]==-1) continue; + int pairCh=e->dispatchFirstChan[i]+pair.pairs[j]; + if (!e->curSubSong->chanShow[pairCh]) { + continue; + } - if (pairs.label==NULL) { - tdl->AddLine( - ImVec2(posMin,posY+textSize.y), - ImVec2(posMax,posY+textSize.y), - ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]), - 2.0f*dpiScale - ); - } else { - tdl->AddLine( - ImVec2(posMin,posY+textSize.y), - ImVec2(posCenter-textSize.x*0.5-6.0f*dpiScale,posY+textSize.y), - ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]), - 2.0f*dpiScale - ); - tdl->AddLine( - ImVec2(posCenter+textSize.x*0.5+6.0f*dpiScale,posY+textSize.y), - ImVec2(posMax,posY+textSize.y), - ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]), - 2.0f*dpiScale - ); + pos=(patChanX[pairCh+1]+patChanX[pairCh])*0.5; + posCenter+=pos; + numPairs++; + if (posposMax) posMax=pos; + tdl->AddLine( + ImVec2(pos,chanHeadBottom), + ImVec2(pos,posY+textSize.y), + ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]), + 2.0f*dpiScale + ); + } - delayedLabels.push_back(DelayedLabel(posCenter,posY,textSize,pairs.label)); + posCenter/=numPairs; + + if (pair.label==NULL) { + tdl->AddLine( + ImVec2(posMin,posY+textSize.y), + ImVec2(posMax,posY+textSize.y), + ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]), + 2.0f*dpiScale + ); + } else { + tdl->AddLine( + ImVec2(posMin,posY+textSize.y), + ImVec2(posCenter-textSize.x*0.5-6.0f*dpiScale,posY+textSize.y), + ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]), + 2.0f*dpiScale + ); + tdl->AddLine( + ImVec2(posCenter+textSize.x*0.5+6.0f*dpiScale,posY+textSize.y), + ImVec2(posMax,posY+textSize.y), + ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]), + 2.0f*dpiScale + ); + + delayedLabels.push_back(DelayedLabel(posCenter,posY,textSize,pair.label)); + } } } diff --git a/src/gui/plot_nolerp.cpp b/src/gui/plot_nolerp.cpp index aa57f0da7..b34fea008 100644 --- a/src/gui/plot_nolerp.cpp +++ b/src/gui/plot_nolerp.cpp @@ -185,7 +185,7 @@ void PlotNoLerp(const char* label, const float* values, int values_count, int va PlotNoLerpEx(ImGuiPlotType_Lines, label, &Plot_ArrayGetter, (void*)&data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size); } -int PlotBitfieldEx(const char* label, int (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char** overlay_text, int bits, ImVec2 frame_size, const bool* values_highlight, ImVec4 highlightColor, ImVec4 color) +int PlotBitfieldEx(const char* label, int (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char** overlay_text, int bits, ImVec2 frame_size, const bool* values_highlight, ImVec4 highlightColor, ImVec4 color, std::string (*hoverFunc)(int,float,void*), void* hoverFuncUser) { ImGuiContext& g = *GImGui; ImGuiWindow* window = ImGui::GetCurrentWindow(); @@ -225,8 +225,18 @@ int PlotBitfieldEx(const char* label, int (*values_getter)(void* data, int idx), const int v_idx = (int)(t * item_count); IM_ASSERT(v_idx >= 0 && v_idx < values_count); - //const float v0 = values_getter(data, (v_idx + values_offset) % values_count); + const float v0 = values_getter(data, (v_idx + values_offset) % values_count); //ImGui::SetTooltip("%d: %8.4g", v_idx, v0); + + if (hoverFunc) { + std::string hoverText=hoverFunc(v_idx,v0,hoverFuncUser); + if (!hoverText.empty()) { + ImGui::SetTooltip("%s",hoverText.c_str()); + } + } else { + ImGui::SetTooltip("%d: %d (%X)", v_idx, (int)v0, (int)v0); + } + idx_hovered = v_idx; } @@ -290,10 +300,10 @@ int PlotBitfieldEx(const char* label, int (*values_getter)(void* data, int idx), return idx_hovered; } -void PlotBitfield(const char* label, const int* values, int values_count, int values_offset, const char** overlay_text, int bits, ImVec2 graph_size, int stride, const bool* values_highlight, ImVec4 highlightColor, ImVec4 color) +void PlotBitfield(const char* label, const int* values, int values_count, int values_offset, const char** overlay_text, int bits, ImVec2 graph_size, int stride, const bool* values_highlight, ImVec4 highlightColor, ImVec4 color, std::string (*hoverFunc)(int,float,void*), void* hoverFuncUser) { FurnacePlotIntArrayGetterData data(values, stride); - PlotBitfieldEx(label, &Plot_IntArrayGetter, (void*)&data, values_count, values_offset, overlay_text, bits, graph_size, values_highlight, highlightColor, color); + PlotBitfieldEx(label, &Plot_IntArrayGetter, (void*)&data, values_count, values_offset, overlay_text, bits, graph_size, values_highlight, highlightColor, color, hoverFunc, hoverFuncUser); } int PlotCustomEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_display_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 frame_size, ImVec4 color, int highlight, std::string (*hoverFunc)(int,float,void*), void* hoverFuncUser, bool blockMode, std::string (*guideFunc)(float), const bool* values_highlight, ImVec4 highlightColor) diff --git a/src/gui/plot_nolerp.h b/src/gui/plot_nolerp.h index 89cfe8573..e6fdad41e 100644 --- a/src/gui/plot_nolerp.h +++ b/src/gui/plot_nolerp.h @@ -21,5 +21,5 @@ #include "../pch.h" void PlotNoLerp(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0), int stride = sizeof(float)); -void PlotBitfield(const char* label, const int* values, int values_count, int values_offset = 0, const char** overlay_text = NULL, int bits = 8, ImVec2 graph_size = ImVec2(0, 0), int stride = sizeof(float), const bool* values_highlight = NULL, ImVec4 highlightColor = ImVec4(1.0f,1.0f,1.0f,1.0f), ImVec4 color = ImVec4(1.0f,1.0f,1.0f,1.0f)); +void PlotBitfield(const char* label, const int* values, int values_count, int values_offset = 0, const char** overlay_text = NULL, int bits = 8, ImVec2 graph_size = ImVec2(0, 0), int stride = sizeof(float), const bool* values_highlight = NULL, ImVec4 highlightColor = ImVec4(1.0f,1.0f,1.0f,1.0f), ImVec4 color = ImVec4(1.0f,1.0f,1.0f,1.0f), std::string (*hoverFunc)(int,float,void*) = NULL, void* hoverFuncUser = NULL); void PlotCustom(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0), int stride = sizeof(float), ImVec4 fgColor = ImVec4(1.0f,1.0f,1.0f,1.0f), int highlight = 0, std::string (*hoverFunc)(int,float,void*) = NULL, void* hoverFuncUser=NULL, bool blockMode=false, std::string (*guideFunc)(float) = NULL, const bool* values_highlight = NULL, ImVec4 highlightColor = ImVec4(1.0f,1.0f,1.0f,1.0f)); diff --git a/src/gui/presets.cpp b/src/gui/presets.cpp index ae2ae7672..75e57c73f 100644 --- a/src/gui/presets.cpp +++ b/src/gui/presets.cpp @@ -52,39 +52,39 @@ void FurnaceGUI::initSystemPresets() { FurnaceGUISysCategory cat; - CATEGORY_BEGIN("Game consoles","let's play some chiptune making games!"); + CATEGORY_BEGIN(_("Game consoles"),_("let's play some chiptune making games!")); ENTRY( - "Sega Genesis", { + _("Sega Genesis"), { CH(DIV_SYSTEM_YM2612, 1.0f, 0, ""), CH(DIV_SYSTEM_SMS, 0.5f, 0, "") } ); SUB_ENTRY( - "Sega Genesis (extended channel 3)", { + _("Sega Genesis (extended channel 3)"), { CH(DIV_SYSTEM_YM2612_EXT, 1.0f, 0, ""), CH(DIV_SYSTEM_SMS, 0.5f, 0, "") } ); SUB_ENTRY( - "Sega Genesis (CSM)", { + _("Sega Genesis (CSM)"), { CH(DIV_SYSTEM_YM2612_CSM, 1.0f, 0, ""), CH(DIV_SYSTEM_SMS, 0.5f, 0, "") } ); SUB_ENTRY( - "Sega Genesis (DualPCM)", { + _("Sega Genesis (DualPCM)"), { CH(DIV_SYSTEM_YM2612_DUALPCM, 1.0f, 0, ""), CH(DIV_SYSTEM_SMS, 0.5f, 0, "") } ); SUB_ENTRY( - "Sega Genesis (DualPCM, extended channel 3)", { + _("Sega Genesis (DualPCM, extended channel 3)"), { CH(DIV_SYSTEM_YM2612_DUALPCM_EXT, 1.0f, 0, ""), CH(DIV_SYSTEM_SMS, 0.5f, 0, "") } ); SUB_ENTRY( - "Sega Genesis (with Sega CD)", { + _("Sega Genesis (with Sega CD)"), { CH(DIV_SYSTEM_YM2612, 1.0f, 0, ""), CH(DIV_SYSTEM_SMS, 0.5f, 0, ""), CH(DIV_SYSTEM_RF5C68, 1.0f, 0, @@ -94,7 +94,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Sega Genesis (extended channel 3 with Sega CD)", { + _("Sega Genesis (extended channel 3 with Sega CD)"), { CH(DIV_SYSTEM_YM2612_EXT, 1.0f, 0, ""), CH(DIV_SYSTEM_SMS, 0.5f, 0, ""), CH(DIV_SYSTEM_RF5C68, 1.0f, 0, @@ -104,7 +104,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Sega Genesis (CSM with Sega CD)", { + _("Sega Genesis (CSM with Sega CD)"), { CH(DIV_SYSTEM_YM2612_CSM, 1.0f, 0, ""), CH(DIV_SYSTEM_SMS, 0.5f, 0, ""), CH(DIV_SYSTEM_RF5C68, 1.0f, 0, @@ -114,49 +114,49 @@ void FurnaceGUI::initSystemPresets() { } ); ENTRY( - "Sega Master System", { + _("Sega Master System"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, "") } ); SUB_ENTRY( - "Sega Master System (with FM expansion)", { + _("Sega Master System (with FM expansion)"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, ""), CH(DIV_SYSTEM_OPLL, 1.0f, 0, "") } ); SUB_ENTRY( - "Sega Master System (with FM expansion in drums mode)", { + _("Sega Master System (with FM expansion in drums mode)"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, ""), CH(DIV_SYSTEM_OPLL_DRUMS, 1.0f, 0, "") } ); ENTRY( - "Sega Game Gear", { + _("Sega Game Gear"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, "chipType=3") } ); ENTRY( - "Game Boy", { + _("Game Boy"), { CH(DIV_SYSTEM_GB, 1.0f, 0, "") } ); ENTRY( - "Game Boy Advance", {} + _("Game Boy Advance"), {} ); SUB_ENTRY( - "Game Boy Advance (no software mixing)", { + _("Game Boy Advance (no software mixing)"), { CH(DIV_SYSTEM_GB, 1.0f, 0, "chipType=3"), CH(DIV_SYSTEM_GBA_DMA, 0.5f, 0, ""), } ); SUB_ENTRY( - "Game Boy Advance (with MinMod)", { + _("Game Boy Advance (with MinMod)"), { CH(DIV_SYSTEM_GB, 1.0f, 0, "chipType=3"), CH(DIV_SYSTEM_GBA_MINMOD, 0.5f, 0, ""), } ); ENTRY( - "Neo Geo Pocket", { + _("Neo Geo Pocket"), { CH(DIV_SYSTEM_T6W28, 1.0f, 0, ""), CH(DIV_SYSTEM_PCM_DAC, 1.0f, -1.0f, "rate=11025\n" @@ -169,130 +169,130 @@ void FurnaceGUI::initSystemPresets() { } ); ENTRY( - "NEC PC Engine/TurboGrafx-16", { + _("NEC PC Engine/TurboGrafx-16"), { CH(DIV_SYSTEM_PCE, 1.0f, 0, "") } ); ENTRY( - "NES", { + _("NES"), { CH(DIV_SYSTEM_NES, 1.0f, 0, "") } ); SUB_ENTRY( - "Famicom with Konami VRC6", { + _("Famicom with Konami VRC6"), { CH(DIV_SYSTEM_NES, 1.0f, 0, ""), CH(DIV_SYSTEM_VRC6, 1.0f, 0, "") } ); SUB_ENTRY( - "Famicom with Konami VRC7", { + _("Famicom with Konami VRC7"), { CH(DIV_SYSTEM_NES, 1.0f, 0, ""), CH(DIV_SYSTEM_VRC7, 1.0f, 0, "") } ); SUB_ENTRY( - "Famicom with MMC5", { + _("Famicom with MMC5"), { CH(DIV_SYSTEM_NES, 1.0f, 0, ""), CH(DIV_SYSTEM_MMC5, 1.0f, 0, "") } ); SUB_ENTRY( - "Famicom with Sunsoft 5B", { + _("Famicom with Sunsoft 5B"), { CH(DIV_SYSTEM_NES, 1.0f, 0, ""), CH(DIV_SYSTEM_AY8910, 1.0f, 0, "chipType=2") } ); SUB_ENTRY( - "Famicom with Namco 163", { + _("Famicom with Namco 163"), { CH(DIV_SYSTEM_NES, 1.0f, 0, ""), CH(DIV_SYSTEM_N163, 1.0f, 0, "channels=7") } ); SUB_ENTRY( - "Famicom Disk System", { + _("Famicom Disk System"), { CH(DIV_SYSTEM_NES, 1.0f, 0, ""), CH(DIV_SYSTEM_FDS, 1.0f, 0, "") } ); ENTRY( - "SNES", { + _("SNES"), { CH(DIV_SYSTEM_SNES, 1.0f, 0, "") } ); SUB_ENTRY( - "Super Game Boy", { + _("Super Game Boy"), { CH(DIV_SYSTEM_GB, 1.0f, 0, "customClock=4295455"), CH(DIV_SYSTEM_SNES, 1.0f, 0, "") }, "tickRate=61.44697015935724" ); SUB_ENTRY( - "Super Game Boy 2", { + _("Super Game Boy 2"), { CH(DIV_SYSTEM_GB, 1.0f, 0, ""), CH(DIV_SYSTEM_SNES, 1.0f, 0, "") } ); ENTRY( - "Mattel Intellivision", { + _("Mattel Intellivision"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "chipType=3") } ); ENTRY( - "Vectrex", { + _("Vectrex"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=4") } ); ENTRY( - "Neo Geo AES", { + _("Neo Geo AES"), { CH(DIV_SYSTEM_YM2610_FULL, 1.0f, 0, "clockSel=1") } ); SUB_ENTRY( - "Neo Geo AES (extended channel 2)", { + _("Neo Geo AES (extended channel 2)"), { CH(DIV_SYSTEM_YM2610_FULL_EXT, 1.0f, 0, "clockSel=1") } ); ENTRY( - "Atari 2600/7800", { + _("Atari 2600/7800"), { CH(DIV_SYSTEM_TIA, 1.0f, 0, "") } ); SUB_ENTRY( - "Atari 2600/7800 (with software pitch driver)", { + _("Atari 2600/7800 (with software pitch driver)"), { CH(DIV_SYSTEM_TIA, 1.0f, 0, "softwarePitch=1") } ); ENTRY( - "Atari 7800 + Ballblazer/Commando", { + _("Atari 7800 + Ballblazer/Commando"), { CH(DIV_SYSTEM_TIA, 1.0f, 0, ""), CH(DIV_SYSTEM_POKEY, 1.0f, 0, "") } ); SUB_ENTRY( - "Atari 7800 (with software pitch driver) + Ballblazer/Commando", { + _("Atari 7800 (with software pitch driver) + Ballblazer/Commando"), { CH(DIV_SYSTEM_TIA, 1.0f, 0, "softwarePitch=1"), CH(DIV_SYSTEM_POKEY, 1.0f, 0, "") } ); ENTRY( - "Atari Lynx", { + _("Atari Lynx"), { CH(DIV_SYSTEM_LYNX, 1.0f, 0, "") } ); ENTRY( - "WonderSwan", { + _("WonderSwan"), { CH(DIV_SYSTEM_SWAN, 1.0f, 0, "") }, "tickRate=75.47169811320754716981" ); ENTRY( - "Virtual Boy", { + _("Virtual Boy"), { CH(DIV_SYSTEM_VBOY, 1.0f, 0, "") }, "tickRate=50.2734877734878" ); ENTRY( - "Gamate", { + _("Gamate"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=9\n" "chipType=0\n" @@ -301,22 +301,22 @@ void FurnaceGUI::initSystemPresets() { } ); ENTRY( - "Pokémon Mini", { + _("Pokémon Mini"), { CH(DIV_SYSTEM_POKEMINI, 0.5f, 0, "") } ); ENTRY( - "Tiger Game.com", { + _("Tiger Game.com"), { CH(DIV_SYSTEM_SM8521, 1.0f, 0, "") } ); ENTRY( - "Casio PV-1000", { + _("Casio PV-1000"), { CH(DIV_SYSTEM_PV1000, 1.0f, 0, "") } ); ENTRY( - "Nintendo DS", { + _("Nintendo DS"), { CH(DIV_SYSTEM_NDS, 1.0f, 0, "") } ); @@ -327,138 +327,138 @@ void FurnaceGUI::initSystemPresets() { ); CATEGORY_END; - CATEGORY_BEGIN("Computers","let's get to work on chiptune today."); + CATEGORY_BEGIN(_("Computers"),_("let's get to work on chiptune today.")); ENTRY( - "Commodore PET", { + _("Commodore PET"), { CH(DIV_SYSTEM_PET, 1.0f, 0, "") }, "tickRate=50" ); ENTRY( - "Commodore VIC-20", { + _("Commodore VIC-20"), { CH(DIV_SYSTEM_VIC20, 1.0f, 0, "clockSel=1") }, "tickRate=50" ); ENTRY( - "Commodore Plus/4", { + _("Commodore Plus/4"), { CH(DIV_SYSTEM_TED, 1.0f, 0, "") } ); ENTRY( - "Commodore 64 (SID)", {} + _("Commodore 64 (SID)"), {} ); SUB_ENTRY( - "Commodore 64 (6581 SID)", { + _("Commodore 64 (6581 SID)"), { CH(DIV_SYSTEM_C64_6581, 1.0f, 0, "clockSel=1") }, "tickRate=50.1245421" ); SUB_SUB_ENTRY( - "Commodore 64 (6581 SID + Sound Expander)", { + _("Commodore 64 (6581 SID + Sound Expander)"), { CH(DIV_SYSTEM_C64_6581, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_OPL, 1.0f, 0, "") }, "tickRate=50.1245421" ); SUB_SUB_ENTRY( - "Commodore 64 (6581 SID + Sound Expander in drums mode)", { + _("Commodore 64 (6581 SID + Sound Expander in drums mode)"), { CH(DIV_SYSTEM_C64_6581, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_OPL_DRUMS, 1.0f, 0, "") }, "tickRate=50.1245421" ); SUB_SUB_ENTRY( - "Commodore 64 (6581 SID + FM-YAM)", { + _("Commodore 64 (6581 SID + FM-YAM)"), { CH(DIV_SYSTEM_C64_6581, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_OPL2, 1.0f, 0, "") }, "tickRate=50.1245421" ); SUB_SUB_ENTRY( - "Commodore 64 (6581 SID + FM-YAM in drums mode)", { + _("Commodore 64 (6581 SID + FM-YAM in drums mode)"), { CH(DIV_SYSTEM_C64_6581, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, "") }, "tickRate=50.1245421" ); SUB_ENTRY( - "Commodore 64 (8580 SID)", { + _("Commodore 64 (8580 SID)"), { CH(DIV_SYSTEM_C64_8580, 1.0f, 0, "clockSel=1") }, "tickRate=50.1245421" ); SUB_SUB_ENTRY( - "Commodore 64 (8580 SID + Sound Expander)", { + _("Commodore 64 (8580 SID + Sound Expander)"), { CH(DIV_SYSTEM_C64_8580, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_OPL, 1.0f, 0, "") }, "tickRate=50.1245421" ); SUB_SUB_ENTRY( - "Commodore 64 (8580 SID + Sound Expander in drums mode)", { + _("Commodore 64 (8580 SID + Sound Expander in drums mode)"), { CH(DIV_SYSTEM_C64_8580, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_OPL_DRUMS, 1.0f, 0, "") }, "tickRate=50.1245421" ); SUB_SUB_ENTRY( - "Commodore 64 (8580 SID + FM-YAM)", { + _("Commodore 64 (8580 SID + FM-YAM)"), { CH(DIV_SYSTEM_C64_8580, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_OPL2, 1.0f, 0, "") }, "tickRate=50.1245421" ); SUB_SUB_ENTRY( - "Commodore 64 (8580 SID + FM-YAM in drums mode)", { + _("Commodore 64 (8580 SID + FM-YAM in drums mode)"), { CH(DIV_SYSTEM_C64_8580, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, "") }, "tickRate=50.1245421" ); ENTRY( - "Amiga", { + _("Amiga"), { CH(DIV_SYSTEM_AMIGA, 1.0f, 0, "clockSel=1") }, "tickRate=50" ); ENTRY( - "MSX", { + _("MSX"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=0\nchipType=1") } ); SUB_ENTRY( - "MSX + SFG-01", { + _("MSX + SFG-01"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "chipType=1"), CH(DIV_SYSTEM_YM2151, 1.0f, 0, "") } ); SUB_ENTRY( - "MSX + MSX-AUDIO", { + _("MSX + MSX-AUDIO"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "chipType=1"), CH(DIV_SYSTEM_Y8950, 1.0f, 0, "") } ); SUB_ENTRY( - "MSX + MSX-AUDIO (drums mode)", { + _("MSX + MSX-AUDIO (drums mode)"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "chipType=1"), CH(DIV_SYSTEM_Y8950_DRUMS, 1.0f, 0, "") } ); SUB_ENTRY( - "MSX + MSX-MUSIC", { + _("MSX + MSX-MUSIC"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "chipType=1"), CH(DIV_SYSTEM_OPLL, 1.0f, 0, "") } ); SUB_ENTRY( - "MSX + MSX-MUSIC (drums mode)", { + _("MSX + MSX-MUSIC (drums mode)"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "chipType=1"), CH(DIV_SYSTEM_OPLL_DRUMS, 1.0f, 0, "") } ); SUB_ENTRY( - "MSX + Darky", { + _("MSX + Darky"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "chipType=1"), CH(DIV_SYSTEM_AY8930, 1.0f, 0, "clockSel=11\n" @@ -472,7 +472,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "MSX + Playsoniq", { + _("MSX + Playsoniq"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "chipType=1"), CH(DIV_SYSTEM_SMS, 1.0f, 0, ""), // Sega VDP CH(DIV_SYSTEM_C64_8580, 1.0f, 0, ""), @@ -480,43 +480,43 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "MSX + SCC", { + _("MSX + SCC"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "chipType=1"), CH(DIV_SYSTEM_SCC, 1.0f, 0, "") } ); SUB_ENTRY( - "MSX + SCC+", { + _("MSX + SCC+"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "chipType=1"), CH(DIV_SYSTEM_SCC_PLUS, 1.0f, 0, "") } ); SUB_ENTRY( - "MSX + Neotron", { + _("MSX + Neotron"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "chipType=1"), CH(DIV_SYSTEM_YM2610_FULL, 1.0f, 0, "") } ); SUB_ENTRY( - "MSX + Neotron (extended channel 2)", { + _("MSX + Neotron (extended channel 2)"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "chipType=1"), CH(DIV_SYSTEM_YM2610_FULL_EXT, 1.0f, 0, "") } ); SUB_ENTRY( - "MSX + Neotron (with YM2610B)", { + _("MSX + Neotron (with YM2610B)"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "chipType=1"), CH(DIV_SYSTEM_YM2610B, 1.0f, 0, "") } ); SUB_ENTRY( - "MSX + Neotron (with YM2610B; extended channel 3)", { + _("MSX + Neotron (with YM2610B; extended channel 3)"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "chipType=1"), CH(DIV_SYSTEM_YM2610B_EXT, 1.0f, 0, "") } ); SUB_ENTRY( - "MSX + SIMPL", { + _("MSX + SIMPL"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "chipType=1"), CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, "rate=55930\n" @@ -537,52 +537,52 @@ void FurnaceGUI::initSystemPresets() { } ); ENTRY( - "NEC PC-6001", { + _("NEC PC-6001"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "customClock=3993600") } ); ENTRY( - "NEC PC-88", {} + _("NEC PC-88"), {} ); SUB_ENTRY( - "NEC PC-88 (with PC-8801-10)", { + _("NEC PC-88 (with PC-8801-10)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=15"), // external CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=15") // "" } ); SUB_ENTRY( - "NEC PC-88 (with PC-8801-11)", { + _("NEC PC-88 (with PC-8801-11)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=4") // external } ); SUB_ENTRY( - "NEC PC-88 (with PC-8801-11; extended channel 3)", { + _("NEC PC-88 (with PC-8801-11; extended channel 3)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=4") // external } ); SUB_ENTRY( - "NEC PC-88 (with PC-8801-23)", { + _("NEC PC-88 (with PC-8801-23)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2608, 1.0f, 0, "clockSel=1") // external } ); SUB_ENTRY( - "NEC PC-88 (with PC-8801-23; extended channel 3)", { + _("NEC PC-88 (with PC-8801-23; extended channel 3)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2608_EXT, 1.0f, 0, "clockSel=1") // external } ); SUB_ENTRY( - "NEC PC-88 (with HMB-20 HIBIKI-8800)", { + _("NEC PC-88 (with HMB-20 HIBIKI-8800)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2151, 1.0f, 0, "clockSel=2") // external; 4.0000MHz } ); SUB_ENTRY( - "NEC PC-8801mk2SR (with PC-8801-10)", { + _("NEC PC-8801mk2SR (with PC-8801-10)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=4"), // internal CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=15"), // external @@ -590,7 +590,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "NEC PC-8801mk2SR (with PC-8801-10; extended channel 3)", { + _("NEC PC-8801mk2SR (with PC-8801-10; extended channel 3)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=4"), // internal CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=15"), // external @@ -598,77 +598,77 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "NEC PC-8801mk2SR (with PC-8801-11)", { + _("NEC PC-8801mk2SR (with PC-8801-11)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=4"), // internal CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=4") // external } ); SUB_ENTRY( - "NEC PC-8801mk2SR (with PC-8801-11; extended channel 3 on internal OPN)", { + _("NEC PC-8801mk2SR (with PC-8801-11; extended channel 3 on internal OPN)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=4"), // internal CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=4") // external } ); SUB_ENTRY( - "NEC PC-8801mk2SR (with PC-8801-11; extended channel 3 on external OPN)", { + _("NEC PC-8801mk2SR (with PC-8801-11; extended channel 3 on external OPN)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=4"), // internal CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=4") // external } ); SUB_ENTRY( - "NEC PC-8801mk2SR (with PC-8801-11; extended channel 3 on both OPNs)", { + _("NEC PC-8801mk2SR (with PC-8801-11; extended channel 3 on both OPNs)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=4"), // internal CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=4") // external } ); SUB_ENTRY( - "NEC PC-8801mk2SR (with PC-8801-23)", { + _("NEC PC-8801mk2SR (with PC-8801-23)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=4"), // internal CH(DIV_SYSTEM_YM2608, 1.0f, 0, "clockSel=1") // external } ); SUB_ENTRY( - "NEC PC-8801mk2SR (with PC-8801-23; extended channel 3 on internal OPN)", { + _("NEC PC-8801mk2SR (with PC-8801-23; extended channel 3 on internal OPN)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=4"), // internal CH(DIV_SYSTEM_YM2608, 1.0f, 0, "clockSel=1") // external } ); SUB_ENTRY( - "NEC PC-8801mk2SR (with PC-8801-23; extended channel 3 on external OPN)", { + _("NEC PC-8801mk2SR (with PC-8801-23; extended channel 3 on external OPN)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=4"), // internal CH(DIV_SYSTEM_YM2608_EXT, 1.0f, 0, "clockSel=1") // external } ); SUB_ENTRY( - "NEC PC-8801mk2SR (with PC-8801-23; extended channel 3 on both OPNs)", { + _("NEC PC-8801mk2SR (with PC-8801-23; extended channel 3 on both OPNs)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=4"), // internal CH(DIV_SYSTEM_YM2608_EXT, 1.0f, 0, "clockSel=1") // external } ); SUB_ENTRY( - "NEC PC-8801mk2SR (with HMB-20 HIBIKI-8800)", { + _("NEC PC-8801mk2SR (with HMB-20 HIBIKI-8800)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=4"), // internal CH(DIV_SYSTEM_YM2151, 1.0f, 0, "clockSel=2") // external; 4.0000MHz } ); SUB_ENTRY( - "NEC PC-8801mk2SR (with HMB-20 HIBIKI-8800; extended channel 3)", { + _("NEC PC-8801mk2SR (with HMB-20 HIBIKI-8800; extended channel 3)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=4"), // internal CH(DIV_SYSTEM_YM2151, 1.0f, 0, "clockSel=2") // external; 4.0000MHz } ); SUB_ENTRY( - "NEC PC-8801FA (with PC-8801-10)", { + _("NEC PC-8801FA (with PC-8801-10)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2608, 1.0f, 0, "clockSel=4"), // internal CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=15"), // external @@ -676,7 +676,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "NEC PC-8801FA (with PC-8801-10; extended channel 3)", { + _("NEC PC-8801FA (with PC-8801-10; extended channel 3)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2608_EXT, 1.0f, 0, "clockSel=4"), // internal CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=15"), // external @@ -684,148 +684,148 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "NEC PC-8801FA (with PC-8801-11)", { + _("NEC PC-8801FA (with PC-8801-11)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2608, 1.0f, 0, "clockSel=1"), // internal CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=4") // external } ); SUB_ENTRY( - "NEC PC-8801FA (with PC-8801-11; extended channel 3 on internal OPN)", { + _("NEC PC-8801FA (with PC-8801-11; extended channel 3 on internal OPN)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2608_EXT, 1.0f, 0, "clockSel=1"), // internal CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=4") // external } ); SUB_ENTRY( - "NEC PC-8801FA (with PC-8801-11; extended channel 3 on external OPN)", { + _("NEC PC-8801FA (with PC-8801-11; extended channel 3 on external OPN)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2608, 1.0f, 0, "clockSel=1"), // internal CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=4") // external } ); SUB_ENTRY( - "NEC PC-8801FA (with PC-8801-11; extended channel 3 on both OPNs)", { + _("NEC PC-8801FA (with PC-8801-11; extended channel 3 on both OPNs)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2608_EXT, 1.0f, 0, "clockSel=1"), // internal CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=4") // external } ); SUB_ENTRY( - "NEC PC-8801FA (with PC-8801-23)", { + _("NEC PC-8801FA (with PC-8801-23)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2608, 1.0f, 0, "clockSel=1"), // internal CH(DIV_SYSTEM_YM2608, 1.0f, 0, "clockSel=1") // external } ); SUB_ENTRY( - "NEC PC-8801FA (with PC-8801-23; extended channel 3 on internal OPN)", { + _("NEC PC-8801FA (with PC-8801-23; extended channel 3 on internal OPN)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2608_EXT, 1.0f, 0, "clockSel=1"), // internal CH(DIV_SYSTEM_YM2608, 1.0f, 0, "clockSel=1") // external } ); SUB_ENTRY( - "NEC PC-8801FA (with PC-8801-23; extended channel 3 on external OPN)", { + _("NEC PC-8801FA (with PC-8801-23; extended channel 3 on external OPN)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2608, 1.0f, 0, "clockSel=1"), // internal CH(DIV_SYSTEM_YM2608_EXT, 1.0f, 0, "clockSel=1") // external } ); SUB_ENTRY( - "NEC PC-8801FA (with PC-8801-23; extended channel 3 on both OPNs)", { + _("NEC PC-8801FA (with PC-8801-23; extended channel 3 on both OPNs)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2608_EXT, 1.0f, 0, "clockSel=1"), // internal CH(DIV_SYSTEM_YM2608_EXT, 1.0f, 0, "clockSel=1") // external } ); SUB_ENTRY( - "NEC PC-8801FA (with HMB-20 HIBIKI-8800)", { + _("NEC PC-8801FA (with HMB-20 HIBIKI-8800)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2608, 1.0f, 0, "clockSel=1"), // internal CH(DIV_SYSTEM_YM2151, 1.0f, 0, "clockSel=2") // external; 4.0000MHz } ); SUB_ENTRY( - "NEC PC-8801FA (with HMB-20 HIBIKI-8800; extended channel 3)", { + _("NEC PC-8801FA (with HMB-20 HIBIKI-8800; extended channel 3)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2608_EXT, 1.0f, 0, "clockSel=1"), // internal CH(DIV_SYSTEM_YM2151, 1.0f, 0, "clockSel=2") // external; 4.0000MHz } ); ENTRY( - "NEC PC-98", {} + _("NEC PC-98"), {} ); SUB_ENTRY( - "NEC PC-98 (with PC-9801-26/K)", { + _("NEC PC-98 (with PC-9801-26/K)"), { CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=4"), // 3.9936MHz but some compatible card has 4MHz CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1") } ); SUB_ENTRY( - "NEC PC-98 (with PC-9801-26/K; extended channel 3)", { + _("NEC PC-98 (with PC-9801-26/K; extended channel 3)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=4"), // 3.9936MHz but some compatible card has 4MHz CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1") } ); SUB_ENTRY( - "NEC PC-98 (with Sound Orchestra)", { + _("NEC PC-98 (with Sound Orchestra)"), { CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=4"), CH(DIV_SYSTEM_OPL2, 1.0f, 0, "clockSel=4"), CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1") } ); SUB_ENTRY( - "NEC PC-98 (with Sound Orchestra; extended channel 3)", { + _("NEC PC-98 (with Sound Orchestra; extended channel 3)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=4"), CH(DIV_SYSTEM_OPL2, 1.0f, 0, "clockSel=4"), CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1") } ); SUB_ENTRY( - "NEC PC-98 (with Sound Orchestra in drums mode)", { + _("NEC PC-98 (with Sound Orchestra in drums mode)"), { CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=4"), CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, "clockSel=4"), CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1") } ); SUB_ENTRY( - "NEC PC-98 (with Sound Orchestra in drums mode; extended channel 3)", { + _("NEC PC-98 (with Sound Orchestra in drums mode; extended channel 3)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=4"), CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, "clockSel=4"), CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1") } ); SUB_ENTRY( - "NEC PC-98 (with Sound Orchestra V)", { + _("NEC PC-98 (with Sound Orchestra V)"), { CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=4"), CH(DIV_SYSTEM_Y8950, 1.0f, 0, "clockSel=4"), CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1") } ); SUB_ENTRY( - "NEC PC-98 (with Sound Orchestra V; extended channel 3)", { + _("NEC PC-98 (with Sound Orchestra V; extended channel 3)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=4"), CH(DIV_SYSTEM_Y8950, 1.0f, 0, "clockSel=4"), CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1") } ); SUB_ENTRY( - "NEC PC-98 (with Sound Orchestra V in drums mode)", { + _("NEC PC-98 (with Sound Orchestra V in drums mode)"), { CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=4"), CH(DIV_SYSTEM_Y8950_DRUMS, 1.0f, 0, "clockSel=4"), CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1") } ); SUB_ENTRY( - "NEC PC-98 (with Sound Orchestra V in drums mode; extended channel 3)", { + _("NEC PC-98 (with Sound Orchestra V in drums mode; extended channel 3)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=4"), CH(DIV_SYSTEM_Y8950_DRUMS, 1.0f, 0, "clockSel=4"), CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1") } ); SUB_ENTRY( - "NEC PC-98 (with PC-9801-86)", { // -73 also has OPNA + _("NEC PC-98 (with PC-9801-86)"), { // -73 also has OPNA CH(DIV_SYSTEM_YM2608, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, // 2x 16-bit Burr Brown DAC "rate=44100\n" @@ -839,7 +839,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "NEC PC-98 (with PC-9801-86; extended channel 3)", { // -73 also has OPNA + _("NEC PC-98 (with PC-9801-86; extended channel 3)"), { // -73 also has OPNA CH(DIV_SYSTEM_YM2608_EXT, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, "rate=44100\n" @@ -853,7 +853,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "NEC PC-98 (with PC-9801-86) stereo", { // -73 also has OPNA + _("NEC PC-98 (with PC-9801-86) stereo"), { // -73 also has OPNA CH(DIV_SYSTEM_YM2608, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_PCM_DAC, 1.0f, -1.0f, // 2x 16-bit Burr Brown DAC "rate=44100\n" @@ -867,7 +867,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "NEC PC-98 (with PC-9801-86; extended channel 3) stereo", { // -73 also has OPNA + _("NEC PC-98 (with PC-9801-86; extended channel 3) stereo"), { // -73 also has OPNA CH(DIV_SYSTEM_YM2608_EXT, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_PCM_DAC, 1.0f, -1.0f, "rate=44100\n" @@ -881,19 +881,19 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "NEC PC-98 (with PC-9801-73)", { + _("NEC PC-98 (with PC-9801-73)"), { CH(DIV_SYSTEM_YM2608, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1") } ); SUB_ENTRY( - "NEC PC-98 (with PC-9801-73; extended channel 3)", { + _("NEC PC-98 (with PC-9801-73; extended channel 3)"), { CH(DIV_SYSTEM_YM2608_EXT, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "clockSel=1") } ); SUB_ENTRY( - "NEC PC-98 (with Sound Blaster 16 for PC-9800 w/PC-9801-26/K compatible)", { + _("NEC PC-98 (with Sound Blaster 16 for PC-9800 w/PC-9801-26/K compatible)"), { CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, "rate=44100\n" @@ -905,7 +905,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "NEC PC-98 (with Sound Blaster 16 for PC-9800 w/PC-9801-26/K compatible; extended channel 3)", { + _("NEC PC-98 (with Sound Blaster 16 for PC-9800 w/PC-9801-26/K compatible; extended channel 3)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, "rate=44100\n" @@ -917,7 +917,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "NEC PC-98 (with Sound Blaster 16 for PC-9800 w/PC-9801-26/K compatible in drums mode)", { + _("NEC PC-98 (with Sound Blaster 16 for PC-9800 w/PC-9801-26/K compatible in drums mode)"), { CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, "rate=44100\n" @@ -929,7 +929,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "NEC PC-98 (with Sound Blaster 16 for PC-9800 w/PC-9801-26/K compatible in drums mode; extended channel 3)", { + _("NEC PC-98 (with Sound Blaster 16 for PC-9800 w/PC-9801-26/K compatible in drums mode; extended channel 3)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, "rate=44100\n" @@ -941,78 +941,78 @@ void FurnaceGUI::initSystemPresets() { } ); ENTRY( - "ZX Spectrum (48K) beeper", {} + _("ZX Spectrum (48K) beeper"), {} ); SUB_ENTRY( - "ZX Spectrum (48K, SFX-like engine)", { + _("ZX Spectrum (48K, SFX-like engine)"), { CH(DIV_SYSTEM_SFX_BEEPER, 1.0f, 0, "") } ); SUB_ENTRY( - "ZX Spectrum (48K, QuadTone engine)", { + _("ZX Spectrum (48K, QuadTone engine)"), { CH(DIV_SYSTEM_SFX_BEEPER_QUADTONE, 1.0f, 0, "") } ); ENTRY( - "ZX Spectrum (128K)", { + _("ZX Spectrum (128K)"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=1") //beeper was also included } ); SUB_ENTRY( - "ZX Spectrum (128K) with TurboSound FM", { + _("ZX Spectrum (128K) with TurboSound FM"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=1") } ); SUB_SUB_ENTRY( - "ZX Spectrum (128K) with TurboSound FM (extended channel 3 on first OPN)", { + _("ZX Spectrum (128K) with TurboSound FM (extended channel 3 on first OPN)"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=1") } ); SUB_SUB_ENTRY( - "ZX Spectrum (128K) with TurboSound FM (extended channel 3 on second OPN)", { + _("ZX Spectrum (128K) with TurboSound FM (extended channel 3 on second OPN)"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=1") } ); SUB_SUB_ENTRY( - "ZX Spectrum (128K) with TurboSound FM (extended channel 3 on both OPNs)", { + _("ZX Spectrum (128K) with TurboSound FM (extended channel 3 on both OPNs)"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=1") } ); SUB_ENTRY( - "ZX Spectrum (128K) with TurboSound", { + _("ZX Spectrum (128K) with TurboSound"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=1"), // or YM2149 CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=1") // or YM2149 } ); ENTRY( - "Amstrad CPC", { + _("Amstrad CPC"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=5") } ); ENTRY( - "Atari 800", { + _("Atari 800"), { CH(DIV_SYSTEM_POKEY, 1.0f, 0, "clockSel=1") }, "tickRate=50" ); SUB_ENTRY( - "Atari 800 (stereo)", { + _("Atari 800 (stereo)"), { CH(DIV_SYSTEM_POKEY, 1.0f, -1.0f, "clockSel=1"), CH(DIV_SYSTEM_POKEY, 1.0f, 1.0f, "clockSel=1"), }, "tickRate=50" ); ENTRY( - "Atari ST", { + _("Atari ST"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=3\n" "chipType=1\n" @@ -1020,7 +1020,7 @@ void FurnaceGUI::initSystemPresets() { } ); ENTRY( - "Atari STE", { + _("Atari STE"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=3\n" "chipType=1\n" @@ -1036,18 +1036,18 @@ void FurnaceGUI::initSystemPresets() { } ); ENTRY( - "SAM Coupé", { + _("SAM Coupé"), { CH(DIV_SYSTEM_SAA1099, 1.0f, 0, "") } ); ENTRY( - "Enterprise 128", { + _("Enterprise 128"), { CH(DIV_SYSTEM_DAVE, 1.0f, 0, "") }, "tickRate=50" ); ENTRY( - "BBC Micro", { + _("BBC Micro"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, "clockSel=2\n" "chipType=4\n" // SN76489A 4MHz @@ -1055,58 +1055,58 @@ void FurnaceGUI::initSystemPresets() { } ); ENTRY( - "IBM PC", {} + _("IBM PC"), {} ); SUB_ENTRY( - "PC (barebones)", { + _("PC (barebones)"), { CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "") } ); SUB_ENTRY( - "IBM PCjr", { + _("IBM PCjr"), { // it can be enable sound output at once CH(DIV_SYSTEM_SMS, 1.0f, 0, "chipType=5") // SN76496 } ); SUB_ENTRY( - "Tandy 1000", { + _("Tandy 1000"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, "chipType=5"), // NCR 8496 or SN76496 or Tandy PSSJ (with 8 bit DAC) CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "") } ); SUB_ENTRY( - "PC + Covox Sound Master", { + _("PC + Covox Sound Master"), { CH(DIV_SYSTEM_AY8930, 1.0f, 0, "clockSel=3"), CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "") } ); SUB_ENTRY( - "PC + SSI 2001", { + _("PC + SSI 2001"), { CH(DIV_SYSTEM_C64_6581, 1.0f, 0, "clockSel=2"), CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "") } ); SUB_ENTRY( - "PC + Game Blaster", { + _("PC + Game Blaster"), { CH(DIV_SYSTEM_SAA1099, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_SAA1099, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "") } ); SUB_ENTRY( - "PC + AdLib", { + _("PC + AdLib"), { CH(DIV_SYSTEM_OPL2, 1.0f, 0, ""), CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "") } ); SUB_ENTRY( - "PC + AdLib (drums mode)", { + _("PC + AdLib (drums mode)"), { CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, ""), CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "") } ); SUB_ENTRY( - "PC + Sound Blaster", { + _("PC + Sound Blaster"), { CH(DIV_SYSTEM_OPL2, 1.0f, 0, ""), CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, ""), CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, @@ -1116,7 +1116,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "PC + Sound Blaster (drums mode)", { + _("PC + Sound Blaster (drums mode)"), { CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, ""), CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, ""), CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, @@ -1126,7 +1126,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "PC + Sound Blaster w/Game Blaster Compatible", { + _("PC + Sound Blaster w/Game Blaster Compatible"), { CH(DIV_SYSTEM_OPL2, 1.0f, 0, ""), CH(DIV_SYSTEM_SAA1099, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_SAA1099, 1.0f, 0, "clockSel=1"), @@ -1138,7 +1138,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "PC + Sound Blaster w/Game Blaster Compatible (drums mode)", { + _("PC + Sound Blaster w/Game Blaster Compatible (drums mode)"), { CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, ""), CH(DIV_SYSTEM_SAA1099, 1.0f, 0, "clockSel=1"), CH(DIV_SYSTEM_SAA1099, 1.0f, 0, "clockSel=1"), @@ -1150,7 +1150,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "PC + Sound Blaster Pro", { + _("PC + Sound Blaster Pro"), { CH(DIV_SYSTEM_OPL2, 1.0f, -1.0f, ""), CH(DIV_SYSTEM_OPL2, 1.0f, 1.0f, ""), CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, @@ -1162,7 +1162,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "PC + Sound Blaster Pro (drums mode)", { + _("PC + Sound Blaster Pro (drums mode)"), { CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, -1.0f, ""), CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 1.0f, ""), CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, @@ -1174,7 +1174,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "PC + Sound Blaster Pro 2", { + _("PC + Sound Blaster Pro 2"), { CH(DIV_SYSTEM_OPL3, 1.0f, 0, ""), CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, "rate=44100\n" @@ -1185,7 +1185,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "PC + Sound Blaster Pro 2 (drums mode)", { + _("PC + Sound Blaster Pro 2 (drums mode)"), { CH(DIV_SYSTEM_OPL3_DRUMS, 1.0f, 0, ""), CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, "rate=44100\n" @@ -1196,7 +1196,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "PC + ESS AudioDrive ES1488 (native ESFM mode)", { + _("PC + ESS AudioDrive ES1488 (native ESFM mode)"), { CH(DIV_SYSTEM_ESFM, 1.0f, 0, ""), CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, "rate=44100\n" @@ -1207,13 +1207,13 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "PC + PC-FXGA", { + _("PC + PC-FXGA"), { CH(DIV_SYSTEM_PCE, 1.0f, 0, ""), // HuC6230 (WSG from HuC6280 but with built in 2 OKI ADPCM playback engines) CH(DIV_SYSTEM_PCSPKR, 1.0f, 0, "") } ); SUB_ENTRY( - "PC + SAAYM", { + _("PC + SAAYM"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, ""), // 3.58MHz or 4MHz selectable via jumper CH(DIV_SYSTEM_SAA1099, 1.0f, 0, "clockSel=1"), // 7.16MHz or 8MHz selectable via jumper CH(DIV_SYSTEM_SAA1099, 1.0f, 0, "clockSel=1"), // "" @@ -1256,72 +1256,72 @@ void FurnaceGUI::initSystemPresets() { } ); ENTRY( - "Sharp X1", { + _("Sharp X1"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=3") } ); SUB_ENTRY( - "Sharp X1 + FM Addon", { + _("Sharp X1 + FM Addon"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=3"), CH(DIV_SYSTEM_YM2151, 1.0f, 0, "clockSel=2") } ); ENTRY( - "Sharp X68000", { + _("Sharp X68000"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, "clockSel=2"), CH(DIV_SYSTEM_MSM6258, 1.0f, 0, "clockSel=2") } ); ENTRY( - "FM-7", { + _("FM-7"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=12"), CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=5") } ); SUB_ENTRY( - "FM-7 (extended channel 3)", { + _("FM-7 (extended channel 3)"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=12"), CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=5") } ); ENTRY( - "FM Towns", { + _("FM Towns"), { CH(DIV_SYSTEM_YM2612, 1.0f, 0, "clockSel=2"), // YM3438 CH(DIV_SYSTEM_RF5C68, 1.0f, 0, "") } ); SUB_ENTRY( - "FM Towns (extended channel 3)", { + _("FM Towns (extended channel 3)"), { CH(DIV_SYSTEM_YM2612_EXT, 1.0f, 0, "clockSel=2"), // YM3438 CH(DIV_SYSTEM_RF5C68, 1.0f, 0, "") } ); SUB_ENTRY( - "FM Towns (CSM)", { + _("FM Towns (CSM)"), { CH(DIV_SYSTEM_YM2612_CSM, 1.0f, 0, "clockSel=2"), // YM3438 CH(DIV_SYSTEM_RF5C68, 1.0f, 0, "") } ); ENTRY( - "Commander X16", { + _("Commander X16"), { CH(DIV_SYSTEM_VERA, 1.0f, 0, ""), CH(DIV_SYSTEM_YM2151, 1.0f, 0, "") } ); SUB_ENTRY( - "Commander X16 (VERA only)", { + _("Commander X16 (VERA only)"), { CH(DIV_SYSTEM_VERA, 1.0f, 0, "") } ); SUB_ENTRY( - "Commander X16 (with Twin OPL3)", { + _("Commander X16 (with Twin OPL3)"), { CH(DIV_SYSTEM_VERA, 1.0f, 0, ""), CH(DIV_SYSTEM_OPL3, 1.0f, 0, ""), CH(DIV_SYSTEM_OPL3, 1.0f, 0, "") } ); ENTRY( - "TI-99/4A", { + _("TI-99/4A"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, "clockSel=6\n" "chipType=8\n" // SN94624 447KHz @@ -1329,7 +1329,7 @@ void FurnaceGUI::initSystemPresets() { } ); ENTRY( - "Sord M5", { + _("Sord M5"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, "customClock=1773447\n" "chipType=1\n" @@ -1343,13 +1343,13 @@ void FurnaceGUI::initSystemPresets() { ); CATEGORY_END; - CATEGORY_BEGIN("Arcade systems","INSERT COIN"); + CATEGORY_BEGIN(_("Arcade systems"),_("INSERT COIN")); // MANUFACTURERS ENTRY( - "Alpha Denshi", {} + _("Alpha Denshi"), {} ); SUB_ENTRY( - "Alpha Denshi Alpha-68K", { + _("Alpha Denshi Alpha-68K"), { CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=3"), // 3MHz CH(DIV_SYSTEM_OPLL, 1.0f, 0, "clockSel=0"), // 3.58MHz CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, @@ -1359,7 +1359,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Alpha Denshi Alpha-68K (extended channel 3)", { + _("Alpha Denshi Alpha-68K (extended channel 3)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=3"), // 3MHz CH(DIV_SYSTEM_OPLL, 1.0f, 0, "clockSel=0"), // 3.58MHz CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, @@ -1369,7 +1369,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Alpha Denshi Alpha-68K (drums mode)", { + _("Alpha Denshi Alpha-68K (drums mode)"), { CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=3"), // 3MHz CH(DIV_SYSTEM_OPLL_DRUMS, 1.0f, 0, "clockSel=0"), // 3.58MHz CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, @@ -1379,7 +1379,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Alpha Denshi Alpha-68K (extended channel 3; drums mode)", { + _("Alpha Denshi Alpha-68K (extended channel 3; drums mode)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=3"), // 3MHz CH(DIV_SYSTEM_OPLL_DRUMS, 1.0f, 0, "clockSel=0"), // 3.58MHz CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, @@ -1389,7 +1389,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Alpha Denshi Equites", { + _("Alpha Denshi Equites"), { CH(DIV_SYSTEM_MSM5232, 1.0f, 0, "customClock=6144000"), CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=14"), CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, @@ -1404,58 +1404,58 @@ void FurnaceGUI::initSystemPresets() { ); ENTRY( - "Atari", {} + _("Atari"), {} ); SUB_ENTRY( - "Pong", { + _("Pong"), { CH(DIV_SYSTEM_PONG, 1.0f, 0, "") } ); SUB_ENTRY( - "Atari Klax", { + _("Atari Klax"), { CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=7") // 0.895MHz (3.579545MHz / 4) } ); SUB_ENTRY( - "Atari Rampart", { + _("Atari Rampart"), { CH(DIV_SYSTEM_OPLL, 1.0f, 0, ""), // 3.579545MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=14") // 1.193MHz (3.579545MHz / 3) } ); SUB_ENTRY( - "Atari Rampart (drums mode)", { + _("Atari Rampart (drums mode)"), { CH(DIV_SYSTEM_OPLL_DRUMS, 1.0f, 0, ""), // 3.579545MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=14") // 1.193MHz (3.579545MHz / 3) } ); SUB_ENTRY( - "Atari JSA IIIs", { + _("Atari JSA IIIs"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, ""), // 3.579545MHz CH(DIV_SYSTEM_MSM6295, 1.0f, -1.0f, "clockSel=14"), // 1.193MHz (3.579545MHz / 3), Left output CH(DIV_SYSTEM_MSM6295, 1.0f, 1.0f, "clockSel=14") // 1.193MHz (3.579545MHz / 3), Right output } ); SUB_ENTRY( - "Atari Marble Madness", { + _("Atari Marble Madness"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, ""), CH(DIV_SYSTEM_POKEY, 1.0f, 0, "") } ); SUB_ENTRY( - "Atari Championship Sprint", { + _("Atari Championship Sprint"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, ""), CH(DIV_SYSTEM_POKEY, 1.0f, 0, ""), CH(DIV_SYSTEM_POKEY, 1.0f, 0, "") } ); SUB_ENTRY( - "Atari Tetris", { + _("Atari Tetris"), { CH(DIV_SYSTEM_POKEY, 1.0f, 0, ""), CH(DIV_SYSTEM_POKEY, 1.0f, 0, "") } ); SUB_ENTRY( - "Atari I, Robot", { + _("Atari I, Robot"), { CH(DIV_SYSTEM_POKEY, 1.0f, 0, "customClock=1512000"), CH(DIV_SYSTEM_POKEY, 1.0f, 0, "customClock=1512000"), CH(DIV_SYSTEM_POKEY, 1.0f, 0, "customClock=1512000"), @@ -1464,10 +1464,10 @@ void FurnaceGUI::initSystemPresets() { ); ENTRY( - "Capcom", {} + _("Capcom"), {} ); SUB_ENTRY( - "Capcom Exed Exes", { + _("Capcom Exed Exes"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=4"), // 1.5MHz CH(DIV_SYSTEM_SMS, 1.0f, 0, "clockSel=4\n" @@ -1480,112 +1480,112 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Capcom Arcade", { // 1943, Side arms, etc + _("Capcom Arcade"), { // 1943, Side arms, etc CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=5"), // 4 or 1.5MHz; various per games CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=5") } ); SUB_ENTRY( - "Capcom Arcade (extended channel 3 on first OPN)", { + _("Capcom Arcade (extended channel 3 on first OPN)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=5"), CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=5") } ); SUB_ENTRY( - "Capcom Arcade (extended channel 3 on second OPN)", { + _("Capcom Arcade (extended channel 3 on second OPN)"), { CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=5"), CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=5") } ); SUB_ENTRY( - "Capcom Arcade (extended channel 3 on both OPNs)", { + _("Capcom Arcade (extended channel 3 on both OPNs)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=5"), CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=5") } ); SUB_ENTRY( - "Capcom CPS-1", { + _("Capcom CPS-1"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, ""), // 3.58MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "") } ); SUB_ENTRY( - "Capcom CPS-2 (QSound)", { + _("Capcom CPS-2 (QSound)"), { CH(DIV_SYSTEM_QSOUND, 1.0f, 0, "") } ); ENTRY( - "Data East", {} + _("Data East"), {} ); SUB_ENTRY( - "Data East Karnov", { + _("Data East Karnov"), { CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=5"), // 1.5MHz CH(DIV_SYSTEM_OPL, 1.0f, 0, "clockSel=3") // 3MHz } ); SUB_ENTRY( - "Data East Karnov (extended channel 3)", { + _("Data East Karnov (extended channel 3)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=5"), // 1.5MHz CH(DIV_SYSTEM_OPL, 1.0f, 0, "clockSel=3") // 3MHz } ); SUB_ENTRY( - "Data East Karnov (drums mode)", { + _("Data East Karnov (drums mode)"), { CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=5"), // 1.5MHz CH(DIV_SYSTEM_OPL_DRUMS, 1.0f, 0, "clockSel=3") // 3MHz } ); SUB_ENTRY( - "Data East Karnov (extended channel 3; drums mode)", { + _("Data East Karnov (extended channel 3; drums mode)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=5"), // 1.5MHz CH(DIV_SYSTEM_OPL_DRUMS, 1.0f, 0, "clockSel=3") // 3MHz } ); SUB_ENTRY( - "Data East Arcade", { // Bad Dudes, RoboCop, etc + _("Data East Arcade"), { // Bad Dudes, RoboCop, etc CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=5"), // 1.5MHz CH(DIV_SYSTEM_OPL2, 1.0f, 0, "clockSel=3"), // 3MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "") // 1 to 1.056MHz; various per games or optional } ); SUB_ENTRY( - "Data East Arcade (extended channel 3)", { // Bad Dudes, RoboCop, etc + _("Data East Arcade (extended channel 3)"), { // Bad Dudes, RoboCop, etc CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=5"), // 1.5MHz CH(DIV_SYSTEM_OPL2, 1.0f, 0, "clockSel=3"), // 3MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "") // 1 to 1.056MHz; various per games or optional } ); SUB_ENTRY( - "Data East Arcade (drums mode)", { // Bad Dudes, RoboCop, etc + _("Data East Arcade (drums mode)"), { // Bad Dudes, RoboCop, etc CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=5"), // 1.5MHz CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, "clockSel=3"), // 3MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "") // 1 to 1.056MHz; various per games or optional } ); SUB_ENTRY( - "Data East Arcade (extended channel 3; drums mode)", { // Bad Dudes, RoboCop, etc + _("Data East Arcade (extended channel 3; drums mode)"), { // Bad Dudes, RoboCop, etc CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=5"), // 1.5MHz CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, "clockSel=3"), // 3MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "") // 1 to 1.056MHz; various per games or optional } ); SUB_ENTRY( - "Data East PCX", { + _("Data East PCX"), { CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=5"), // 1.5MHz CH(DIV_SYSTEM_PCE, 1.0f, 0, "") // software controlled MSM5205 } ); SUB_ENTRY( - "Data East PCX (extended channel 3)", { + _("Data East PCX (extended channel 3)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=5"), // 1.5MHz CH(DIV_SYSTEM_PCE, 1.0f, 0, "") // software controlled MSM5205 } ); SUB_ENTRY( - "Data East Dark Seal", { // Dark Seal, Crude Buster, Vapor Trail, etc + _("Data East Dark Seal"), { // Dark Seal, Crude Buster, Vapor Trail, etc CH(DIV_SYSTEM_YM2151, 1.0f, 0, ""), // 3.580MHz (32.22MHz / 9) CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=2"), // 4.0275MHz (32.22MHz / 8); optional CH(DIV_SYSTEM_MSM6295, 1.0f, 0, ""), // 1.007MHz (32.22MHz / 32) @@ -1594,7 +1594,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Data East Dark Seal (extended channel 3)", { // Dark Seal, Crude Buster, Vapor Trail, etc + _("Data East Dark Seal (extended channel 3)"), { // Dark Seal, Crude Buster, Vapor Trail, etc CH(DIV_SYSTEM_YM2151, 1.0f, 0, ""), // 3.580MHz (32.22MHz / 9) CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=2"), // 4.0275MHz (32.22MHz / 8); optional CH(DIV_SYSTEM_MSM6295, 1.0f, 0, ""), // 1.007MHz (32.22MHz / 32) @@ -1603,22 +1603,22 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Data East Deco 156", { + _("Data East Deco 156"), { CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=0"), // 1 or 1.007MHz (32.22MHz / 32); various per games CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=8") // 1 or 2 or 2.014MHz (32.22MHz / 16); various per games } ); SUB_ENTRY( - "Data East MLC", { + _("Data East MLC"), { CH(DIV_SYSTEM_YMZ280B, 1.0f, 0, "clockSel=5") // 14MHz } ); ENTRY( - "Irem", {} + _("Irem"), {} ); SUB_ENTRY( - "Irem M72", { + _("Irem M72"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, ""), CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, "rate=7812\n" @@ -1627,29 +1627,29 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Irem M92/M107", { + _("Irem M92/M107"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, ""), CH(DIV_SYSTEM_GA20, 1.0f, 0, "") } ); ENTRY( - "Jaleco", {} + _("Jaleco"), {} ); SUB_ENTRY( - "Jaleco Ginga NinkyouDen", { + _("Jaleco Ginga NinkyouDen"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "chipType=1"), // 1.79MHz CH(DIV_SYSTEM_Y8950, 1.0f, 0, "") // 3.58MHz } ); SUB_ENTRY( - "Jaleco Ginga NinkyouDen (drums mode)", { + _("Jaleco Ginga NinkyouDen (drums mode)"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "chipType=1"), // 1.79MHz CH(DIV_SYSTEM_Y8950_DRUMS, 1.0f, 0, "") // 3.58MHz } ); SUB_ENTRY( - "Jaleco Mega System 1", { + _("Jaleco Mega System 1"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, "clockSel=1"), // 3.5MHz (7MHz / 2) CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=2") // 4MHz @@ -1657,24 +1657,24 @@ void FurnaceGUI::initSystemPresets() { ); ENTRY( - "Kaneko", {} + _("Kaneko"), {} ); SUB_ENTRY( - "Kaneko DJ Boy", { + _("Kaneko DJ Boy"), { CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=3"), // 3MHz CH(DIV_SYSTEM_MSM6295, 1.0f, -1.0f, "clockSel=12"), // 1.5MHz, Left output CH(DIV_SYSTEM_MSM6295, 1.0f, 1.0f, "clockSel=12"), // 1.5MHz, Right output } ); SUB_ENTRY( - "Kaneko DJ Boy (extended channel 3)", { + _("Kaneko DJ Boy (extended channel 3)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=3"), // 3MHz CH(DIV_SYSTEM_MSM6295, 1.0f, -1.0f, "clockSel=12"), // 1.5MHz, Left output CH(DIV_SYSTEM_MSM6295, 1.0f, 1.0f, "clockSel=12") // 1.5MHz, Right output } ); SUB_ENTRY( - "Kaneko Air Buster", { + _("Kaneko Air Buster"), { CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=3"), // 3MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=13\n" @@ -1683,7 +1683,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Kaneko Air Buster (extended channel 3)", { + _("Kaneko Air Buster (extended channel 3)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=3"), // 3MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=13\n" @@ -1692,7 +1692,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Kaneko Toybox System", { + _("Kaneko Toybox System"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=3\n" "chipType=1\n" @@ -1705,21 +1705,21 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Kaneko Jackie Chan", { + _("Kaneko Jackie Chan"), { CH(DIV_SYSTEM_YMZ280B, 1.0f, 0, "clockSel=3") // 16MHz } ); SUB_ENTRY( - "Super Kaneko Nova System", { + _("Super Kaneko Nova System"), { CH(DIV_SYSTEM_YMZ280B, 1.0f, 0, "clockSel=4") // 16.67MHz (33.33MHz / 2) } ); ENTRY( - "Konami", {} + _("Konami"), {} ); SUB_ENTRY( - "Konami Gyruss", { + _("Konami Gyruss"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, ""), CH(DIV_SYSTEM_AY8910, 1.0f, 0, ""), CH(DIV_SYSTEM_AY8910, 1.0f, 0, ""), @@ -1729,7 +1729,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Konami Bubble System", { + _("Konami Bubble System"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, ""), CH(DIV_SYSTEM_AY8910, 1.0f, 0, ""), CH(DIV_SYSTEM_BUBSYS_WSG, 1.0f, 0, "") @@ -1737,152 +1737,152 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Konami MX5000", { + _("Konami MX5000"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, ""), // 3.58MHz CH(DIV_SYSTEM_K007232, 1.0f, 0, "") // "" } ); SUB_ENTRY( - "Konami Battlantis", { + _("Konami Battlantis"), { CH(DIV_SYSTEM_OPL2, 1.0f, 0, "clockSel=3"), // 3MHz CH(DIV_SYSTEM_OPL2, 1.0f, 0, "clockSel=3") // "" } ); SUB_ENTRY( - "Konami Battlantis (drums mode on first OPL2)", { + _("Konami Battlantis (drums mode on first OPL2)"), { CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, "clockSel=3"), // 3MHz CH(DIV_SYSTEM_OPL2, 1.0f, 0, "clockSel=3") // "" } ); SUB_ENTRY( - "Konami Battlantis (drums mode on second OPL2)", { + _("Konami Battlantis (drums mode on second OPL2)"), { CH(DIV_SYSTEM_OPL2, 1.0f, 0, "clockSel=3"), // 3MHz CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, "clockSel=3") // "" } ); SUB_ENTRY( - "Konami Battlantis (drums mode on both OPL2s)", { + _("Konami Battlantis (drums mode on both OPL2s)"), { CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, "clockSel=3"), // 3MHz CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, "clockSel=3") // "" } ); SUB_ENTRY( - "Konami Fast Lane", { + _("Konami Fast Lane"), { CH(DIV_SYSTEM_K007232, 1.0f, 0, ""), // 3.58MHz CH(DIV_SYSTEM_K007232, 1.0f, 0, "") // "" } ); SUB_ENTRY( - "Konami Chequered Flag", { + _("Konami Chequered Flag"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, ""), // 3.58MHz CH(DIV_SYSTEM_K007232, 1.0f, 0, "stereo=true"), // "" CH(DIV_SYSTEM_K007232, 1.0f, 0, "") // "" } ); SUB_ENTRY( - "Konami Haunted Castle", { + _("Konami Haunted Castle"), { CH(DIV_SYSTEM_OPL2, 1.0f, 0, ""), // 3.58MHz CH(DIV_SYSTEM_SCC, 1.0f, 0, ""), // "" CH(DIV_SYSTEM_K007232, 1.0f, 0, "") // "" } ); SUB_ENTRY( - "Konami Haunted Castle (drums mode)", { + _("Konami Haunted Castle (drums mode)"), { CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, ""), // 3.58MHz CH(DIV_SYSTEM_SCC, 1.0f, 0, ""), // "" CH(DIV_SYSTEM_K007232, 1.0f, 0, "") // "" } ); SUB_ENTRY( - "Konami Hot Chase", { + _("Konami Hot Chase"), { CH(DIV_SYSTEM_K007232, 1.0f, 0, "stereo=true"), // 3.58MHz CH(DIV_SYSTEM_K007232, 1.0f, 0, "stereo=true"), // "" CH(DIV_SYSTEM_K007232, 1.0f, 0, "stereo=true") // "" } ); SUB_ENTRY( - "Konami S.P.Y.", { + _("Konami S.P.Y."), { CH(DIV_SYSTEM_OPL2, 1.0f, 0, ""), // 3.58MHz CH(DIV_SYSTEM_K007232, 1.0f, 0, ""), // "" CH(DIV_SYSTEM_K007232, 1.0f, 0, "") // "" } ); SUB_ENTRY( - "Konami S.P.Y. (drums mode)", { + _("Konami S.P.Y. (drums mode)"), { CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, ""), // 3.58MHz CH(DIV_SYSTEM_K007232, 1.0f, 0, ""), // "" CH(DIV_SYSTEM_K007232, 1.0f, 0, "") // "" } ); SUB_ENTRY( - "Konami Rollergames", { + _("Konami Rollergames"), { CH(DIV_SYSTEM_OPL2, 1.0f, 0, ""), // 3.58MHz CH(DIV_SYSTEM_K053260, 1.0f, 0, ""), // "" } ); SUB_ENTRY( - "Konami Rollergames (drums mode)", { + _("Konami Rollergames (drums mode)"), { CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, ""), // 3.58MHz CH(DIV_SYSTEM_K053260, 1.0f, 0, ""), // "" } ); SUB_ENTRY( - "Konami Golfing Greats", { + _("Konami Golfing Greats"), { CH(DIV_SYSTEM_K053260, 1.0f, 0, ""), // 3.58MHz } ); SUB_ENTRY( - "Konami Lightning Fighters", { + _("Konami Lightning Fighters"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, ""), // 3.58MHz CH(DIV_SYSTEM_K053260, 1.0f, 0, ""), // "" } ); SUB_ENTRY( - "Konami Over Drive", { + _("Konami Over Drive"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, ""), // 3.58MHz CH(DIV_SYSTEM_K053260, 1.0f, 0, ""), // "" CH(DIV_SYSTEM_K053260, 1.0f, 0, ""), // "" } ); SUB_ENTRY( - "Konami Asterix", { + _("Konami Asterix"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_K053260, 1.0f, 0, "clockSel=1"), // "" } ); SUB_ENTRY( - "Konami Hexion", { + _("Konami Hexion"), { CH(DIV_SYSTEM_SCC, 1.0f, 0, "clockSel=2"), // 1.5MHz (3MHz input) CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=1") } ); ENTRY( - "Namco", {} + _("Namco"), {} ); SUB_ENTRY( - "Namco (3-channel WSG)", { // Pac-Man, Galaga, Xevious, etc + _("Namco (3-channel WSG)"), { // Pac-Man, Galaga, Xevious, etc CH(DIV_SYSTEM_NAMCO, 1.0f, 0, "") } ); SUB_ENTRY( - "Namco Mappy", { // Mappy, Super Pac-Man, Libble Rabble, etc + _("Namco Mappy"), { // Mappy, Super Pac-Man, Libble Rabble, etc CH(DIV_SYSTEM_NAMCO_15XX, 1.0f, 0, "") } ); SUB_ENTRY( - "Namco Pac-Land", { // Pac-Land, Baraduke, Sky kid, etc + _("Namco Pac-Land"), { // Pac-Land, Baraduke, Sky kid, etc CH(DIV_SYSTEM_NAMCO_CUS30, 1.0f, 0, "") } ); SUB_ENTRY( - "Namco System 86", { // without expansion board case; Hopping Mappy, etc + _("Namco System 86"), { // without expansion board case; Hopping Mappy, etc CH(DIV_SYSTEM_YM2151, 1.0f, 0, ""), CH(DIV_SYSTEM_NAMCO_CUS30, 1.0f, 0, "") } ); SUB_ENTRY( - "Namco Thunder Ceptor", { + _("Namco Thunder Ceptor"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, ""), CH(DIV_SYSTEM_NAMCO_CUS30, 1.0f, 0, ""), CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, @@ -1892,7 +1892,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Namco System 1", { + _("Namco System 1"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, ""), CH(DIV_SYSTEM_NAMCO_CUS30, 1.0f, 0, ""), CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, @@ -1906,52 +1906,52 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Namco System 2", { + _("Namco System 2"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, ""), CH(DIV_SYSTEM_C140, 1.0f, 0, "") } ); SUB_ENTRY( - "Namco NA-1/2", { + _("Namco NA-1/2"), { CH(DIV_SYSTEM_C219, 1.0f, 0, "") } ); ENTRY( - "Psikyo", {} + _("Psikyo"), {} ); SUB_ENTRY( - "Psikyo 68EC020 hardware with OPL4", { + _("Psikyo 68EC020 hardware with OPL4"), { CH(DIV_SYSTEM_OPL4, 1.0f, 0, "") } ); SUB_ENTRY( - "Psikyo 68EC020 hardware with OPL4 (drums mode)", { + _("Psikyo 68EC020 hardware with OPL4 (drums mode)"), { CH(DIV_SYSTEM_OPL4_DRUMS, 1.0f, 0, "") } ); SUB_ENTRY( - "Psikyo SH-2 hardware", { + _("Psikyo SH-2 hardware"), { CH(DIV_SYSTEM_OPL4, 1.0f, 0, "clockSel=1") } ); SUB_ENTRY( - "Psikyo SH-2 hardware (drums mode)", { + _("Psikyo SH-2 hardware (drums mode)"), { CH(DIV_SYSTEM_OPL4_DRUMS, 1.0f, 0, "clockSel=1") } ); ENTRY( - "Sega", {} + _("Sega"), {} ); SUB_ENTRY( - "Sega Kyugo", { + _("Sega Kyugo"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=14"), CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=14") } ); SUB_ENTRY( - "Sega System 1", { + _("Sega System 1"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, "clockSel=2\n" "chipType=4\n" @@ -1963,45 +1963,45 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Sega System E", { + _("Sega System E"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, ""), CH(DIV_SYSTEM_SMS, 1.0f, 0, "") } ); SUB_ENTRY( - "Sega System E (with FM expansion)", { + _("Sega System E (with FM expansion)"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, ""), CH(DIV_SYSTEM_SMS, 1.0f, 0, ""), CH(DIV_SYSTEM_OPLL, 1.0f, 0, "") } ); SUB_ENTRY( - "Sega System E (with FM expansion in drums mode)", { + _("Sega System E (with FM expansion in drums mode)"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, ""), CH(DIV_SYSTEM_SMS, 1.0f, 0, ""), CH(DIV_SYSTEM_OPLL_DRUMS, 1.0f, 0, "") } ); SUB_ENTRY( - "Sega Hang-On", { + _("Sega Hang-On"), { CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_SEGAPCM, 1.0f, 0, "") // discrete logics, 62.5KHz output rate } ); SUB_ENTRY( - "Sega Hang-On (extended channel 3)", { + _("Sega Hang-On (extended channel 3)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_SEGAPCM, 1.0f, 0, "") // discrete logics, 62.5KHz output rate } ); SUB_ENTRY( - "Sega OutRun/X Board", { + _("Sega OutRun/X Board"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_SEGAPCM, 1.0f, 0, "") // ASIC, 31.25KHz output rate } ); SUB_ENTRY( - "Sega System 24", { + _("Sega System 24"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, "rate=61500\n" @@ -2010,35 +2010,35 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Sega System 18", { + _("Sega System 18"), { CH(DIV_SYSTEM_YM2612, 1.0f, 0, "clockSel=2"), // discrete 8MHz YM3438 CH(DIV_SYSTEM_YM2612, 1.0f, 0, "clockSel=2"), // ^^ CH(DIV_SYSTEM_RF5C68, 1.0f, 0, "clockSel=1") // 10MHz } ); SUB_ENTRY( - "Sega System 18 (extended channel 3 on first OPN2C)", { + _("Sega System 18 (extended channel 3 on first OPN2C)"), { CH(DIV_SYSTEM_YM2612_EXT, 1.0f, 0, "clockSel=2"), // discrete 8MHz YM3438 CH(DIV_SYSTEM_YM2612, 1.0f, 0, "clockSel=2"), // ^^ CH(DIV_SYSTEM_RF5C68, 1.0f, 0, "clockSel=1") // 10MHz } ); SUB_ENTRY( - "Sega System 18 (extended channel 3 on second OPN2C)", { + _("Sega System 18 (extended channel 3 on second OPN2C)"), { CH(DIV_SYSTEM_YM2612, 1.0f, 0, "clockSel=2"), // discrete 8MHz YM3438 CH(DIV_SYSTEM_YM2612_EXT, 1.0f, 0, "clockSel=2"), // ^^ CH(DIV_SYSTEM_RF5C68, 1.0f, 0, "clockSel=1") // 10MHz } ); SUB_ENTRY( - "Sega System 18 (extended channel 3 on both OPN2Cs)", { + _("Sega System 18 (extended channel 3 on both OPN2Cs)"), { CH(DIV_SYSTEM_YM2612_EXT, 1.0f, 0, "clockSel=2"), // discrete 8MHz YM3438 CH(DIV_SYSTEM_YM2612_EXT, 1.0f, 0, "clockSel=2"), // ^^ CH(DIV_SYSTEM_RF5C68, 1.0f, 0, "clockSel=1") // 10MHz } ); SUB_ENTRY( - "Sega System 32", { + _("Sega System 32"), { CH(DIV_SYSTEM_YM2612, 1.0f, 0, "clockSel=4"), // discrete 8.05MHz YM3438 CH(DIV_SYSTEM_YM2612, 1.0f, 0, "clockSel=4"), // ^^ CH(DIV_SYSTEM_RF5C68, 1.0f, 0, @@ -2048,7 +2048,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Sega System 32 (extended channel 3 on first OPN2C)", { + _("Sega System 32 (extended channel 3 on first OPN2C)"), { CH(DIV_SYSTEM_YM2612_EXT, 1.0f, 0, "clockSel=4"), // discrete 8.05MHz YM3438 CH(DIV_SYSTEM_YM2612, 1.0f, 0, "clockSel=4"), // ^^ CH(DIV_SYSTEM_RF5C68, 1.0f, 0, @@ -2058,7 +2058,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Sega System 32 (extended channel 3 on second OPN2C)", { + _("Sega System 32 (extended channel 3 on second OPN2C)"), { CH(DIV_SYSTEM_YM2612, 1.0f, 0, "clockSel=4"), // discrete 8.05MHz YM3438 CH(DIV_SYSTEM_YM2612_EXT, 1.0f, 0, "clockSel=4"), // ^^ CH(DIV_SYSTEM_RF5C68, 1.0f, 0, @@ -2068,7 +2068,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Sega System 32 (extended channel 3 on both OPN2Cs)", { + _("Sega System 32 (extended channel 3 on both OPN2Cs)"), { CH(DIV_SYSTEM_YM2612_EXT, 1.0f, 0, "clockSel=4"), // discrete 8.05MHz YM3438 CH(DIV_SYSTEM_YM2612_EXT, 1.0f, 0, "clockSel=4"), // ^^ CH(DIV_SYSTEM_RF5C68, 1.0f, 0, @@ -2079,27 +2079,27 @@ void FurnaceGUI::initSystemPresets() { ); ENTRY( - "Seta", {} + _("Seta"), {} ); SUB_ENTRY( - "Seta 1", { + _("Seta 1"), { CH(DIV_SYSTEM_X1_010, 1.0f, 0, "") } ); SUB_ENTRY( - "Seta 1 + FM addon", { + _("Seta 1 + FM addon"), { CH(DIV_SYSTEM_X1_010, 1.0f, 0, ""), CH(DIV_SYSTEM_YM2612, 1.0f, 0, "clockSel=2") // Discrete YM3438 } ); SUB_ENTRY( - "Seta 1 + FM addon (extended channel 3)", { + _("Seta 1 + FM addon (extended channel 3)"), { CH(DIV_SYSTEM_X1_010, 1.0f, 0, ""), CH(DIV_SYSTEM_YM2612_EXT, 1.0f, 0, "clockSel=2") // Discrete YM3438 } ); SUB_ENTRY( - "Seta 2", { + _("Seta 2"), { CH(DIV_SYSTEM_X1_010, 1.0f, 0, "clockSel=1\n" "isBanked=true\n" @@ -2107,126 +2107,126 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Sammy/Seta/Visco SSV", { + _("Sammy/Seta/Visco SSV"), { CH(DIV_SYSTEM_ES5506, 1.0f, 0, "channels=31") } ); ENTRY( - "SNK", {} + _("SNK"), {} ); SUB_ENTRY( - "Neo Geo MVS", { + _("Neo Geo MVS"), { CH(DIV_SYSTEM_YM2610_FULL, 1.0f, 0, "") } ); SUB_ENTRY( - "Neo Geo MVS (extended channel 2)", { + _("Neo Geo MVS (extended channel 2)"), { CH(DIV_SYSTEM_YM2610_FULL_EXT, 1.0f, 0, "") } ); SUB_ENTRY( - "SNK Ikari Warriors", { + _("SNK Ikari Warriors"), { CH(DIV_SYSTEM_OPL, 1.0f, 0, "clockSel=2"), CH(DIV_SYSTEM_OPL, 1.0f, 0, "clockSel=2") } ); SUB_ENTRY( - "SNK Ikari Warriors (drums mode on first OPL)", { + _("SNK Ikari Warriors (drums mode on first OPL)"), { CH(DIV_SYSTEM_OPL_DRUMS, 1.0f, 0, "clockSel=2"), CH(DIV_SYSTEM_OPL, 1.0f, 0, "clockSel=2") } ); SUB_ENTRY( - "SNK Ikari Warriors (drums mode on second OPL)", { + _("SNK Ikari Warriors (drums mode on second OPL)"), { CH(DIV_SYSTEM_OPL, 1.0f, 0, "clockSel=2"), CH(DIV_SYSTEM_OPL_DRUMS, 1.0f, 0, "clockSel=2") } ); SUB_ENTRY( - "SNK Ikari Warriors (drums mode on both OPLs)", { + _("SNK Ikari Warriors (drums mode on both OPLs)"), { CH(DIV_SYSTEM_OPL_DRUMS, 1.0f, 0, "clockSel=2"), CH(DIV_SYSTEM_OPL_DRUMS, 1.0f, 0, "clockSel=2") } ); SUB_ENTRY( - "SNK Triple Z80", { + _("SNK Triple Z80"), { CH(DIV_SYSTEM_Y8950, 1.0f, 0, "clockSel=2"), CH(DIV_SYSTEM_OPL, 1.0f, 0, "clockSel=2") } ); SUB_ENTRY( - "SNK Triple Z80 (drums mode on Y8950)", { + _("SNK Triple Z80 (drums mode on Y8950)"), { CH(DIV_SYSTEM_Y8950_DRUMS, 1.0f, 0, "clockSel=2"), CH(DIV_SYSTEM_OPL, 1.0f, 0, "clockSel=2") } ); SUB_ENTRY( - "SNK Triple Z80 (drums mode on OPL)", { + _("SNK Triple Z80 (drums mode on OPL)"), { CH(DIV_SYSTEM_Y8950, 1.0f, 0, "clockSel=2"), CH(DIV_SYSTEM_OPL_DRUMS, 1.0f, 0, "clockSel=2") } ); SUB_ENTRY( - "SNK Triple Z80 (drums mode on Y8950 and OPL)", { + _("SNK Triple Z80 (drums mode on Y8950 and OPL)"), { CH(DIV_SYSTEM_Y8950_DRUMS, 1.0f, 0, "clockSel=2"), CH(DIV_SYSTEM_OPL_DRUMS, 1.0f, 0, "clockSel=2") } ); SUB_ENTRY( - "SNK Chopper I", { + _("SNK Chopper I"), { CH(DIV_SYSTEM_Y8950, 1.0f, 0, "clockSel=2"), CH(DIV_SYSTEM_OPL2, 1.0f, 0, "clockSel=2") } ); SUB_ENTRY( - "SNK Chopper I (drums mode on Y8950)", { + _("SNK Chopper I (drums mode on Y8950)"), { CH(DIV_SYSTEM_Y8950_DRUMS, 1.0f, 0, "clockSel=2"), CH(DIV_SYSTEM_OPL2, 1.0f, 0, "clockSel=2") } ); SUB_ENTRY( - "SNK Chopper I (drums mode on OPL2)", { + _("SNK Chopper I (drums mode on OPL2)"), { CH(DIV_SYSTEM_Y8950, 1.0f, 0, "clockSel=2"), CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, "clockSel=2") } ); SUB_ENTRY( - "SNK Chopper I (drums mode on Y8950 and OPL2)", { + _("SNK Chopper I (drums mode on Y8950 and OPL2)"), { CH(DIV_SYSTEM_Y8950_DRUMS, 1.0f, 0, "clockSel=2"), CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, "clockSel=2") } ); SUB_ENTRY( - "SNK Touchdown Fever", { + _("SNK Touchdown Fever"), { CH(DIV_SYSTEM_OPL, 1.0f, 0, "clockSel=2"), CH(DIV_SYSTEM_Y8950, 1.0f, 0, "clockSel=2") } ); SUB_ENTRY( - "SNK Touchdown Fever (drums mode on OPL)", { + _("SNK Touchdown Fever (drums mode on OPL)"), { CH(DIV_SYSTEM_OPL_DRUMS, 1.0f, 0, "clockSel=2"), CH(DIV_SYSTEM_Y8950, 1.0f, 0, "clockSel=2") } ); SUB_ENTRY( - "SNK Touchdown Fever (drums mode on Y8950)", { + _("SNK Touchdown Fever (drums mode on Y8950)"), { CH(DIV_SYSTEM_OPL, 1.0f, 0, "clockSel=2"), CH(DIV_SYSTEM_Y8950_DRUMS, 1.0f, 0, "clockSel=2") } ); SUB_ENTRY( - "SNK Touchdown Fever (drums mode on OPL and Y8950)", { + _("SNK Touchdown Fever (drums mode on OPL and Y8950)"), { CH(DIV_SYSTEM_OPL_DRUMS, 1.0f, 0, "clockSel=2"), CH(DIV_SYSTEM_Y8950_DRUMS, 1.0f, 0, "clockSel=2") } ); ENTRY( - "Sunsoft", {} + _("Sunsoft"), {} ); SUB_ENTRY( - "Sunsoft Shanghai 3", { + _("Sunsoft Shanghai 3"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=4\n" "chipType=1\n" @@ -2235,40 +2235,40 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Sunsoft Arcade", { + _("Sunsoft Arcade"), { CH(DIV_SYSTEM_YM2612, 1.0f, 0, "clockSel=2"), // discrete YM3438 8MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=1") // 1.056MHz } ); SUB_ENTRY( - "Sunsoft Arcade (extended channel 3)", { + _("Sunsoft Arcade (extended channel 3)"), { CH(DIV_SYSTEM_YM2612_EXT, 1.0f, 0, "clockSel=2"), // discrete YM3438 8MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=1") // 1.056MHz } ); ENTRY( - "Taito", {} + _("Taito"), {} ); SUB_ENTRY( - "Taito Arcade", { + _("Taito Arcade"), { CH(DIV_SYSTEM_YM2610B, 1.0f, 0, "") } ); SUB_ENTRY( - "Taito Arcade (extended channel 3)", { + _("Taito Arcade (extended channel 3)"), { CH(DIV_SYSTEM_YM2610B_EXT, 1.0f, 0, "") } ); SUB_ENTRY( - "Taito Metal Soldier Isaac II", { + _("Taito Metal Soldier Isaac II"), { CH(DIV_SYSTEM_MSM5232, 1.0f, 0, ""), CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=3"), CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=3") } ); SUB_ENTRY( - "Taito The Fairyland Story", { + _("Taito The Fairyland Story"), { CH(DIV_SYSTEM_MSM5232, 1.0f, 0, ""), CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=3\n" @@ -2281,7 +2281,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Taito Wyvern F-0", { + _("Taito Wyvern F-0"), { CH(DIV_SYSTEM_MSM5232, 1.0f, 0, ""), CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=3\n" @@ -2299,70 +2299,70 @@ void FurnaceGUI::initSystemPresets() { ); ENTRY( - "Tecmo", {} + _("Tecmo"), {} ); SUB_ENTRY( - "Tecmo Ninja Gaiden", { // Ninja Gaiden, Raiga, etc + _("Tecmo Ninja Gaiden"), { // Ninja Gaiden, Raiga, etc CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "") // 1MHz } ); SUB_ENTRY( - "Tecmo Ninja Gaiden (extended channel 3 on first OPN)", { // Ninja Gaiden, Raiga, etc + _("Tecmo Ninja Gaiden (extended channel 3 on first OPN)"), { // Ninja Gaiden, Raiga, etc CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "") // 1MHz } ); SUB_ENTRY( - "Tecmo Ninja Gaiden (extended channel 3 on second OPN)", { // Ninja Gaiden, Raiga, etc + _("Tecmo Ninja Gaiden (extended channel 3 on second OPN)"), { // Ninja Gaiden, Raiga, etc CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "") // 1MHz } ); SUB_ENTRY( - "Tecmo Ninja Gaiden (extended channel 3 on both OPNs)", { // Ninja Gaiden, Raiga, etc + _("Tecmo Ninja Gaiden (extended channel 3 on both OPNs)"), { // Ninja Gaiden, Raiga, etc CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "") // 1MHz } ); SUB_ENTRY( - "Tecmo System", { + _("Tecmo System"), { CH(DIV_SYSTEM_OPL3, 1.0f, 0, ""), CH(DIV_SYSTEM_YMZ280B, 1.0f, 0, ""), CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=8") // 2MHz } ); SUB_ENTRY( - "Tecmo System (drums mode)", { + _("Tecmo System (drums mode)"), { CH(DIV_SYSTEM_OPL3_DRUMS, 1.0f, 0, ""), CH(DIV_SYSTEM_YMZ280B, 1.0f, 0, ""), CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=8") // 2MHz } ); SUB_ENTRY( - "Seibu Kaihatsu Raiden", { // Raiden, Seibu Cup Soccer, Zero Team, etc + _("Seibu Kaihatsu Raiden"), { // Raiden, Seibu Cup Soccer, Zero Team, etc CH(DIV_SYSTEM_OPL2, 1.0f, 0, ""), // YM3812 3.58MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "") // 1 or 1.023MHz (28.636363MHz / 28); various per games } ); SUB_ENTRY( - "Seibu Kaihatsu Raiden (drums mode)", { // Raiden, Seibu Cup Soccer, Zero Team, etc + _("Seibu Kaihatsu Raiden (drums mode)"), { // Raiden, Seibu Cup Soccer, Zero Team, etc CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, ""), // YM3812 3.58MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "") // 1 or 1.023MHz (28.636363MHz / 28); various per games } ); ENTRY( - "Other", {} + _("Other"), {} ); // UNSORTED SUB_ENTRY( - "Bally Midway MCR", { + _("Bally Midway MCR"), { // SSIO sound board CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=3"), // 2MHz CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=3") // 2MHz @@ -2370,7 +2370,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Williams/Midway Y/T unit w/ADPCM sound board", { + _("Williams/Midway Y/T unit w/ADPCM sound board"), { // ADPCM sound board CH(DIV_SYSTEM_YM2151, 1.0f, 0, ""), CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, @@ -2381,7 +2381,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "NMK 16-bit Arcade", { + _("NMK 16-bit Arcade"), { CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=5"), // 1.5MHz; optional CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=2\n" @@ -2394,7 +2394,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "NMK 16-bit Arcade (extended channel 3)", { + _("NMK 16-bit Arcade (extended channel 3)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=5"), // 1.5MHz; optional CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=2\n" @@ -2407,7 +2407,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "NMK 16-bit Arcade (w/NMK112 bankswitching)", { + _("NMK 16-bit Arcade (w/NMK112 bankswitching)"), { CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=5"), // 1.5MHz; optional CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=2\n" @@ -2422,7 +2422,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "NMK 16-bit Arcade (w/NMK112 bankswitching, extended channel 3)", { + _("NMK 16-bit Arcade (w/NMK112 bankswitching, extended channel 3)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=5"), // 1.5MHz; optional CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=2\n" @@ -2437,7 +2437,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Atlus Power Instinct 2", { + _("Atlus Power Instinct 2"), { CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=13\n" @@ -2452,7 +2452,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Atlus Power Instinct 2 (extended channel 3)", { + _("Atlus Power Instinct 2 (extended channel 3)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=13\n" @@ -2467,7 +2467,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Raizing/Eighting Battle Garegga", { + _("Raizing/Eighting Battle Garegga"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=8\n" @@ -2476,7 +2476,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Raizing/Eighting Batrider", { + _("Raizing/Eighting Batrider"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, "clockSel=2"), // 4MHz CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=15\n" @@ -2490,31 +2490,31 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Nichibutsu Mag Max", { + _("Nichibutsu Mag Max"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=13"), CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=13"), CH(DIV_SYSTEM_AY8910, 1.0f, 0, "clockSel=13") } ); SUB_ENTRY( - "Cave 68000", { + _("Cave 68000"), { CH(DIV_SYSTEM_YMZ280B, 1.0f, 0, "") } ); SUB_ENTRY( - "Coreland Cyber Tank", { + _("Coreland Cyber Tank"), { CH(DIV_SYSTEM_Y8950, 1.0f, -1.0f, ""), // 3.58MHz, Left output CH(DIV_SYSTEM_Y8950, 1.0f, 1.0f, "") // 3.58MHz, Right output } ); SUB_ENTRY( - "Coreland Cyber Tank (drums mode)", { + _("Coreland Cyber Tank (drums mode)"), { CH(DIV_SYSTEM_Y8950_DRUMS, 1.0f, -1.0f, ""), // 3.58MHz, Left output CH(DIV_SYSTEM_Y8950_DRUMS, 1.0f, 1.0f, "") // 3.58MHz, Right output } ); SUB_ENTRY( - "ICE Skimaxx", { + _("ICE Skimaxx"), { CH(DIV_SYSTEM_MSM6295, 1.0f, -1.0f, "clockSel=2\n" "rateSel=true\n" @@ -2528,224 +2528,224 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Toaplan 1", { + _("Toaplan 1"), { CH(DIV_SYSTEM_OPL2, 1.0f, 0, "clockSel=5") // 3.5MHz } ); SUB_ENTRY( - "Toaplan 1 (drums mode)", { + _("Toaplan 1 (drums mode)"), { CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, "clockSel=5") // 3.5MHz } ); SUB_ENTRY( - "Dynax/Nakanihon 3rd generation hardware", { + _("Dynax/Nakanihon 3rd generation hardware"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, ""), // AY or YM, optional - 1.79MHz or 3.58MHz; various per game CH(DIV_SYSTEM_OPLL, 1.0f, 0, ""), CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=6") // 1.023MHz mostly } ); SUB_ENTRY( - "Dynax/Nakanihon 3rd generation hardware (drums mode)", { + _("Dynax/Nakanihon 3rd generation hardware (drums mode)"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, ""), // AY or YM, optional - 1.79MHz or 3.58MHz; various per game CH(DIV_SYSTEM_OPLL_DRUMS, 1.0f, 0, ""), CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "clockSel=6") // 1.023MHz mostly } ); SUB_ENTRY( - "Dynax/Nakanihon Real Break", { + _("Dynax/Nakanihon Real Break"), { CH(DIV_SYSTEM_OPLL, 1.0f, 0, ""), CH(DIV_SYSTEM_YMZ280B, 1.0f, 0, "") } ); SUB_ENTRY( - "Dynax/Nakanihon Real Break (drums mode)", { + _("Dynax/Nakanihon Real Break (drums mode)"), { CH(DIV_SYSTEM_OPLL_DRUMS, 1.0f, 0, ""), CH(DIV_SYSTEM_YMZ280B, 1.0f, 0, "") } ); CATEGORY_END; - CATEGORY_BEGIN("User","system presets that you have saved."); + CATEGORY_BEGIN(_("User"),_("system presets that you have saved.")); CATEGORY_END; - CATEGORY_BEGIN("FM","chips which use frequency modulation (FM) to generate sound.\nsome of these also pack more (like square and sample channels)."); + CATEGORY_BEGIN(_("FM"),_("chips which use frequency modulation (FM) to generate sound.\nsome of these also pack more (like square and sample channels).")); ENTRY( - "Yamaha YM2151 (OPM)", { + _("Yamaha YM2151 (OPM)"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, "") } ); ENTRY( - "Yamaha YM2203 (OPN)", { + _("Yamaha YM2203 (OPN)"), { CH(DIV_SYSTEM_YM2203, 1.0f, 0, "clockSel=3") } ); SUB_ENTRY( - "Yamaha YM2203 (extended channel 3)", { + _("Yamaha YM2203 (extended channel 3)"), { CH(DIV_SYSTEM_YM2203_EXT, 1.0f, 0, "clockSel=3") } ); ENTRY( - "Yamaha YM2608 (OPNA)", { + _("Yamaha YM2608 (OPNA)"), { CH(DIV_SYSTEM_YM2608, 1.0f, 0, "") } ); SUB_ENTRY( - "Yamaha YM2608 (extended channel 3)", { + _("Yamaha YM2608 (extended channel 3)"), { CH(DIV_SYSTEM_YM2608_EXT, 1.0f, 0, "") } ); ENTRY( - "Yamaha YM2610 (OPNB)", { + _("Yamaha YM2610 (OPNB)"), { CH(DIV_SYSTEM_YM2610_FULL, 1.0f, 0, "") } ); SUB_ENTRY( - "Yamaha YM2610 (extended channel 2)", { + _("Yamaha YM2610 (extended channel 2)"), { CH(DIV_SYSTEM_YM2610_FULL_EXT, 1.0f, 0, "") } ); ENTRY( - "Yamaha YM2610B (OPNB2)", { + _("Yamaha YM2610B (OPNB2)"), { CH(DIV_SYSTEM_YM2610B, 1.0f, 0, "") } ); SUB_ENTRY( - "Yamaha YM2610B (extended channel 3)", { + _("Yamaha YM2610B (extended channel 3)"), { CH(DIV_SYSTEM_YM2610B_EXT, 1.0f, 0, "") } ); ENTRY( - "Yamaha YM2612 (OPN2)", { + _("Yamaha YM2612 (OPN2)"), { CH(DIV_SYSTEM_YM2612, 1.0f, 0, "chipType=1") } ); SUB_ENTRY( - "Yamaha YM2612 (extended channel 3)", { + _("Yamaha YM2612 (extended channel 3)"), { CH(DIV_SYSTEM_YM2612_EXT, 1.0f, 0, "chipType=1") } ); SUB_ENTRY( - "Yamaha YM2612 (OPN2) CSM", { + _("Yamaha YM2612 (OPN2) CSM"), { CH(DIV_SYSTEM_YM2612_CSM, 1.0f, 0, "chipType=1") } ); SUB_ENTRY( - "Yamaha YM2612 (OPN2) with DualPCM", { + _("Yamaha YM2612 (OPN2) with DualPCM"), { CH(DIV_SYSTEM_YM2612_DUALPCM, 1.0f, 0, "chipType=1") } ); SUB_ENTRY( - "Yamaha YM2612 (extended channel 3) with DualPCM", { + _("Yamaha YM2612 (extended channel 3) with DualPCM"), { CH(DIV_SYSTEM_YM2612_DUALPCM_EXT, 1.0f, 0, "chipType=1") } ); ENTRY( - "Yamaha YMF276 (OPN2)", { + _("Yamaha YMF276 (OPN2)"), { CH(DIV_SYSTEM_YM2612, 1.0f, 0, "chipType=2") } ); SUB_ENTRY( - "Yamaha YMF276 (extended channel 3)", { + _("Yamaha YMF276 (extended channel 3)"), { CH(DIV_SYSTEM_YM2612_EXT, 1.0f, 0, "chipType=2") } ); SUB_ENTRY( - "Yamaha YMF276 (OPN2) CSM", { + _("Yamaha YMF276 (OPN2) CSM"), { CH(DIV_SYSTEM_YM2612_CSM, 1.0f, 0, "chipType=2") } ); SUB_ENTRY( - "Yamaha YMF276 (OPN2) with DualPCM", { + _("Yamaha YMF276 (OPN2) with DualPCM"), { CH(DIV_SYSTEM_YM2612_DUALPCM, 1.0f, 0, "chipType=2") } ); SUB_ENTRY( - "Yamaha YMF276 (extended channel 3) with DualPCM", { + _("Yamaha YMF276 (extended channel 3) with DualPCM"), { CH(DIV_SYSTEM_YM2612_DUALPCM_EXT, 1.0f, 0, "chipType=2") } ); ENTRY( - "Yamaha YM2413 (OPLL)", { + _("Yamaha YM2413 (OPLL)"), { CH(DIV_SYSTEM_OPLL, 1.0f, 0, "") } ); SUB_ENTRY( - "Yamaha YM2413 (drums mode)", { + _("Yamaha YM2413 (drums mode)"), { CH(DIV_SYSTEM_OPLL_DRUMS, 1.0f, 0, "") } ); ENTRY( - "Yamaha YM2414 (OPZ)", { + _("Yamaha YM2414 (OPZ)"), { CH(DIV_SYSTEM_OPZ, 1.0f, 0, "") } ); ENTRY( - "Yamaha YM3438 (OPN2C)", { + _("Yamaha YM3438 (OPN2C)"), { CH(DIV_SYSTEM_YM2612, 1.0f, 0, "") } ); SUB_ENTRY( - "Yamaha YM3438 (extended channel 3)", { + _("Yamaha YM3438 (extended channel 3)"), { CH(DIV_SYSTEM_YM2612_EXT, 1.0f, 0, "") } ); SUB_ENTRY( - "Yamaha YM3438 (OPN2C) CSM", { + _("Yamaha YM3438 (OPN2C) CSM"), { CH(DIV_SYSTEM_YM2612_CSM, 1.0f, 0, "") } ); SUB_ENTRY( - "Yamaha YM3438 (OPN2C) with DualPCM", { + _("Yamaha YM3438 (OPN2C) with DualPCM"), { CH(DIV_SYSTEM_YM2612_DUALPCM, 1.0f, 0, "") } ); SUB_ENTRY( - "Yamaha YM3438 (extended channel 3) with DualPCM", { + _("Yamaha YM3438 (extended channel 3) with DualPCM"), { CH(DIV_SYSTEM_YM2612_DUALPCM_EXT, 1.0f, 0, "") } ); ENTRY( - "Yamaha YM3526 (OPL)", { + _("Yamaha YM3526 (OPL)"), { CH(DIV_SYSTEM_OPL, 1.0f, 0, "") } ); SUB_ENTRY( - "Yamaha YM3526 (drums mode)", { + _("Yamaha YM3526 (drums mode)"), { CH(DIV_SYSTEM_OPL_DRUMS, 1.0f, 0, "") } ); ENTRY( - "Yamaha Y8950", { + _("Yamaha Y8950"), { CH(DIV_SYSTEM_Y8950, 1.0f, 0, "") } ); SUB_ENTRY( - "Yamaha Y8950 (drums mode)", { + _("Yamaha Y8950 (drums mode)"), { CH(DIV_SYSTEM_Y8950_DRUMS, 1.0f, 0, "") } ); ENTRY( - "Yamaha YM3812 (OPL2)", { + _("Yamaha YM3812 (OPL2)"), { CH(DIV_SYSTEM_OPL2, 1.0f, 0, "") } ); SUB_ENTRY( - "Yamaha YM3812 (drums mode)", { + _("Yamaha YM3812 (drums mode)"), { CH(DIV_SYSTEM_OPL2_DRUMS, 1.0f, 0, "") } ); ENTRY( - "Yamaha YMF262 (OPL3)", { + _("Yamaha YMF262 (OPL3)"), { CH(DIV_SYSTEM_OPL3, 1.0f, 0, "") } ); SUB_ENTRY( - "Yamaha YMF262 (drums mode)", { + _("Yamaha YMF262 (drums mode)"), { CH(DIV_SYSTEM_OPL3_DRUMS, 1.0f, 0, "") } ); ENTRY( - "Yamaha YMF289B (OPL3-L)", { + _("Yamaha YMF289B (OPL3-L)"), { CH(DIV_SYSTEM_OPL3, 1.0f, 0, "clockSel=5\n" "chipType=1\n" @@ -2753,7 +2753,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "Yamaha YMF289B (drums mode)", { + _("Yamaha YMF289B (drums mode)"), { CH(DIV_SYSTEM_OPL3_DRUMS, 1.0f, 0, "clockSel=5\n" "chipType=1\n" @@ -2761,7 +2761,7 @@ void FurnaceGUI::initSystemPresets() { } ); ENTRY( - "ESS ES1xxx series (ESFM)", { + _("ESS ES1xxx series (ESFM)"), { CH(DIV_SYSTEM_ESFM, 1.0f, 0, "") } ); @@ -2777,52 +2777,52 @@ void FurnaceGUI::initSystemPresets() { ); if (settings.hiddenSystems) { ENTRY( - "Yamaha YMU759 (MA-2)", { + _("Yamaha YMU759 (MA-2)"), { CH(DIV_SYSTEM_YMU759, 1.0f, 0, "") } ); } CATEGORY_END; - CATEGORY_BEGIN("Square","these chips generate square/pulse tones only (but may include noise)."); + CATEGORY_BEGIN(_("Square"),_("these chips generate square/pulse tones only (but may include noise).")); ENTRY( - "TI SN76489", { + _("TI SN76489"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, "chipType=1") } ); SUB_ENTRY( - "TI SN76489A", { + _("TI SN76489A"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, "chipType=4") } ); SUB_ENTRY( - "TI SN76496", { + _("TI SN76496"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, "chipType=5") } ); SUB_ENTRY( - "NCR 8496", { + _("NCR 8496"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, "chipType=6") } ); SUB_ENTRY( - "Tandy PSSJ 3-voice sound", { + _("Tandy PSSJ 3-voice sound"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, "chipType=7") // 8 bit DAC } ); SUB_ENTRY( - "Sega PSG (SN76489-like)", { + _("Sega PSG (SN76489-like)"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, ""), } ); SUB_ENTRY( - "Sega PSG (SN76489-like, Stereo)", { + _("Sega PSG (SN76489-like, Stereo)"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, "chipType=3") } ); SUB_ENTRY( - "TI SN94624", { + _("TI SN94624"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, "clockSel=6\n" "chipType=8\n" @@ -2830,7 +2830,7 @@ void FurnaceGUI::initSystemPresets() { } ); SUB_ENTRY( - "TI SN76494", { + _("TI SN76494"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, "clockSel=6\n" "chipType=9\n" @@ -2838,151 +2838,151 @@ void FurnaceGUI::initSystemPresets() { } ); ENTRY( - "Toshiba T6W28", { + _("Toshiba T6W28"), { CH(DIV_SYSTEM_T6W28, 1.0f, 0, "") } ); ENTRY( - "AY-3-8910", { + _("AY-3-8910"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "") } ); ENTRY( - "AY-3-8914", { + _("AY-3-8914"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "chipType=3") } ); ENTRY( - "Yamaha YM2149(F)", { + _("Yamaha YM2149(F)"), { CH(DIV_SYSTEM_AY8910, 1.0f, 0, "chipType=1") } ); ENTRY( - "Philips SAA1099", { + _("Philips SAA1099"), { CH(DIV_SYSTEM_SAA1099, 1.0f, 0, "") } ); ENTRY( - "PC Speaker", { + _("PC Speaker"), { CH(DIV_SYSTEM_PCSPKR, 0.5f, 0, "") } ); ENTRY( - "Pokémon Mini", { + _("Pokémon Mini"), { CH(DIV_SYSTEM_POKEMINI, 0.5f, 0, "") } ); ENTRY( - "Commodore VIC", { + _("Commodore VIC"), { CH(DIV_SYSTEM_VIC20, 1.0f, 0, "clockSel=1") } ); ENTRY( - "OKI MSM5232", { + _("OKI MSM5232"), { CH(DIV_SYSTEM_MSM5232, 1.0f, 0, "") } ); ENTRY( - "Pong", { + _("Pong"), { CH(DIV_SYSTEM_PONG, 1.0f, 0, "") } ); ENTRY( - "NEC D65010G031", { + _("NEC D65010G031"), { CH(DIV_SYSTEM_PV1000, 1.0f, 0, "") } ); ENTRY( - "MOS Technology TED", { + _("MOS Technology TED"), { CH(DIV_SYSTEM_TED, 1.0f, 0, "clockSel=1") } ); CATEGORY_END; - CATEGORY_BEGIN("Sample","chips/systems which use PCM or ADPCM samples for sound synthesis."); + CATEGORY_BEGIN(_("Sample"),_("chips/systems which use PCM or ADPCM samples for sound synthesis.")); ENTRY( - "Amiga", { + _("Amiga"), { CH(DIV_SYSTEM_AMIGA, 1.0f, 0, "clockSel=1") }, "tickRate=50" ); ENTRY( - "SegaPCM", { + _("SegaPCM"), { CH(DIV_SYSTEM_SEGAPCM, 1.0f, 0, "") } ); ENTRY( - "Capcom QSound", { + _("Capcom QSound"), { CH(DIV_SYSTEM_QSOUND, 1.0f, 0, "") } ); ENTRY( - "Seta/Allumer X1-010", { + _("Seta/Allumer X1-010"), { CH(DIV_SYSTEM_X1_010, 1.0f, 0, "") } ); ENTRY( - "Yamaha YMZ280B (PCMD8)", { + _("Yamaha YMZ280B (PCMD8)"), { CH(DIV_SYSTEM_YMZ280B, 1.0f, 0, "") } ); ENTRY( - "Ricoh RF5C68", { + _("Ricoh RF5C68"), { CH(DIV_SYSTEM_RF5C68, 1.0f, 0, "") } ); ENTRY( - "OKI MSM6258", { + _("OKI MSM6258"), { CH(DIV_SYSTEM_MSM6258, 1.0f, 0, "") } ); ENTRY( - "OKI MSM6295", { + _("OKI MSM6295"), { CH(DIV_SYSTEM_MSM6295, 1.0f, 0, "") } ); ENTRY( - "SNES", { + _("SNES"), { CH(DIV_SYSTEM_SNES, 1.0f, 0, "") } ); ENTRY( - "Konami K007232", { + _("Konami K007232"), { CH(DIV_SYSTEM_K007232, 1.0f, 0, "") } ); ENTRY( - "Irem GA20", { + _("Irem GA20"), { CH(DIV_SYSTEM_GA20, 1.0f, 0, "") } ); ENTRY( - "Generic PCM DAC", { + _("Generic PCM DAC"), { CH(DIV_SYSTEM_PCM_DAC, 1.0f, 0, "") } ); ENTRY( - "Ensoniq ES5506 (OTTO)", { + _("Ensoniq ES5506 (OTTO)"), { CH(DIV_SYSTEM_ES5506, 1.0f, 0, "channels=31") } ); ENTRY( - "Konami K053260", { + _("Konami K053260"), { CH(DIV_SYSTEM_K053260, 1.0f, 0, "") } ); ENTRY( - "Namco C140", { + _("Namco C140"), { CH(DIV_SYSTEM_C140, 1.0f, 0, "") } ); ENTRY( - "Namco C219", { + _("Namco C219"), { CH(DIV_SYSTEM_C219, 1.0f, 0, "") } ); ENTRY( - "Nintendo DS", { + _("Nintendo DS"), { CH(DIV_SYSTEM_NDS, 1.0f, 0, "") } ); @@ -2998,282 +2998,287 @@ void FurnaceGUI::initSystemPresets() { ); CATEGORY_END; - CATEGORY_BEGIN("Wavetable","chips which use user-specified waveforms to generate sound."); + CATEGORY_BEGIN(_("Wavetable"),_("chips which use user-specified waveforms to generate sound.")); ENTRY( - "PC Engine", { + _("PC Engine"), { CH(DIV_SYSTEM_PCE, 1.0f, 0, "") } ); ENTRY( - "Konami Bubble System WSG", { + _("Konami Bubble System WSG"), { CH(DIV_SYSTEM_BUBSYS_WSG, 1.0f, 0, "") } ); ENTRY( - "Konami SCC", { + _("Konami SCC"), { CH(DIV_SYSTEM_SCC, 1.0f, 0, "") } ); ENTRY( - "Konami SCC+", { + _("Konami SCC+"), { CH(DIV_SYSTEM_SCC_PLUS, 1.0f, 0, "") } ); ENTRY( - "Namco WSG", { + _("Namco WSG"), { CH(DIV_SYSTEM_NAMCO, 1.0f, 0, "") } ); ENTRY( - "Namco C15 (8-channel mono)", { + _("Namco C15 (8-channel mono)"), { CH(DIV_SYSTEM_NAMCO_15XX, 1.0f, 0, "") } ); ENTRY( - "Namco C30 (8-channel stereo)", { + _("Namco C30 (8-channel stereo)"), { CH(DIV_SYSTEM_NAMCO_CUS30, 1.0f, 0, "") } ); ENTRY( - "Namco 163", { + _("Namco 163"), { CH(DIV_SYSTEM_N163, 1.0f, 0, "") } ); ENTRY( - "Famicom Disk System (chip)", { + _("Famicom Disk System (chip)"), { CH(DIV_SYSTEM_FDS, 1.0f, 0, "") } ); ENTRY( - "WonderSwan", { + _("WonderSwan"), { CH(DIV_SYSTEM_SWAN, 1.0f, 0, "") }, "tickRate=75.47169811320754716981" ); ENTRY( - "Virtual Boy", { + _("Virtual Boy"), { CH(DIV_SYSTEM_VBOY, 1.0f, 0, "") }, "tickRate=50.2734877734878" ); ENTRY( - "Seta/Allumer X1-010", { + _("Seta/Allumer X1-010"), { CH(DIV_SYSTEM_X1_010, 1.0f, 0, "") } ); CATEGORY_END; - CATEGORY_BEGIN("Specialized","chips/systems with unique sound synthesis methods."); + CATEGORY_BEGIN(_("Specialized"),_("chips/systems with unique sound synthesis methods.")); ENTRY( - "MOS Technology SID (6581)", { + _("MOS Technology SID (6581)"), { CH(DIV_SYSTEM_C64_6581, 1.0f, 0, "clockSel=1") }, "tickRate=50.1245421" ); ENTRY( - "MOS Technology SID (8580)", { + _("MOS Technology SID (8580)"), { CH(DIV_SYSTEM_C64_8580, 1.0f, 0, "clockSel=1") }, "tickRate=50.1245421" ); ENTRY( - "Commodore PET (pseudo-wavetable)", { + _("Commodore PET (pseudo-wavetable)"), { CH(DIV_SYSTEM_PET, 1.0f, 0, "") }, "tickRate=50" ); ENTRY( - "Konami VRC6", { + _("Konami VRC6"), { CH(DIV_SYSTEM_VRC6, 1.0f, 0, "") } ); ENTRY( - "MMC5", { + _("MMC5"), { CH(DIV_SYSTEM_MMC5, 1.0f, 0, "") } ); ENTRY( - "Microchip AY8930", { + _("Microchip AY8930"), { CH(DIV_SYSTEM_AY8930, 1.0f, 0, "") } ); ENTRY( - "Game Boy", { + _("Game Boy"), { CH(DIV_SYSTEM_GB, 1.0f, 0, "") } ); ENTRY( - "Atari Lynx", { + _("Atari Lynx"), { CH(DIV_SYSTEM_LYNX, 1.0f, 0, "") } ); ENTRY( - "POKEY", { + _("POKEY"), { CH(DIV_SYSTEM_POKEY, 1.0f, 0, "clockSel=1") }, "tickRate=50" ); ENTRY( - "Atari TIA", { + _("Atari TIA"), { CH(DIV_SYSTEM_TIA, 1.0f, 0, "") } ); SUB_ENTRY( - "Atari TIA (with software pitch driver)", { + _("Atari TIA (with software pitch driver)"), { CH(DIV_SYSTEM_TIA, 1.0f, 0, "softwarePitch=1") } ); ENTRY( - "NES (Ricoh 2A03)", { + _("NES (Ricoh 2A03)"), { CH(DIV_SYSTEM_NES, 1.0f, 0, "") } ); ENTRY( - "Commander X16 (VERA only)", { + _("Commander X16 (VERA only)"), { CH(DIV_SYSTEM_VERA, 1.0f, 0, "") } ); ENTRY( - "ZX Spectrum (beeper only, SFX-like engine)", { + _("ZX Spectrum (beeper only, SFX-like engine)"), { CH(DIV_SYSTEM_SFX_BEEPER, 1.0f, 0, "") } ); ENTRY( - "ZX Spectrum (beeper only, QuadTone engine)", { + _("ZX Spectrum (beeper only, QuadTone engine)"), { CH(DIV_SYSTEM_SFX_BEEPER_QUADTONE, 1.0f, 0, "") } ); ENTRY( - "Sharp SM8521", { + _("Sharp SM8521"), { CH(DIV_SYSTEM_SM8521, 1.0f, 0, "") } ); if (settings.hiddenSystems) { ENTRY( - "Dummy System", { + _("Dummy System"), { CH(DIV_SYSTEM_DUMMY, 1.0f, 0, "") } ); } ENTRY( - "tildearrow Sound Unit", { + _("tildearrow Sound Unit"), { CH(DIV_SYSTEM_SOUND_UNIT, 1.0f, 0, "") } ); ENTRY( - "PowerNoise", { + _("PowerNoise"), { CH(DIV_SYSTEM_POWERNOISE, 1.0f, 0, "") } ); ENTRY( - "Dave", { + _("Dave"), { CH(DIV_SYSTEM_DAVE, 1.0f, 0, "") }, "tickRate=50" ); ENTRY( - "Nintendo DS", { + _("Nintendo DS"), { CH(DIV_SYSTEM_NDS, 1.0f, 0, "") } ); ENTRY( - "Bifurcator", { + _("Bifurcator"), { CH(DIV_SYSTEM_BIFURCATOR, 1.0f, 0, "") } ); ENTRY( - "SID2", { + _("SID2"), { CH(DIV_SYSTEM_SID2, 1.0f, 0, "") } ); ENTRY( - "Watara Supervision", { + _("SID3"), { + CH(DIV_SYSTEM_SID3, 1.0f, 0, "") + } + ); + ENTRY( + _("Watara Supervision"), { CH(DIV_SYSTEM_SUPERVISION, 1.0f, 0, "") } ); ENTRY( - "NEC μPD1771C", { + _("NEC μPD1771C"), { CH(DIV_SYSTEM_UPD1771C, 1.0f, 0, "") } ); CATEGORY_END; - CATEGORY_BEGIN("DefleMask-compatible","these configurations are compatible with DefleMask.\nselect this if you need to save as .dmf or work with that program."); + CATEGORY_BEGIN(_("DefleMask-compatible"),_("these configurations are compatible with DefleMask.\nselect this if you need to save as .dmf or work with that program.")); ENTRY( - "Sega Genesis", { + _("Sega Genesis"), { CH(DIV_SYSTEM_YM2612, 1.0f, 0, ""), CH(DIV_SYSTEM_SMS, 0.5f, 0, "") } ); ENTRY( - "Sega Genesis (extended channel 3)", { + _("Sega Genesis (extended channel 3)"), { CH(DIV_SYSTEM_YM2612_EXT, 1.0f, 0, ""), CH(DIV_SYSTEM_SMS, 0.5f, 0, "") } ); ENTRY( - "Sega Master System", { + _("Sega Master System"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, "") } ); ENTRY( - "Sega Master System (with FM expansion)", { + _("Sega Master System (with FM expansion)"), { CH(DIV_SYSTEM_SMS, 1.0f, 0, ""), CH(DIV_SYSTEM_OPLL, 1.0f, 0, "") } ); ENTRY( - "Game Boy", { + _("Game Boy"), { CH(DIV_SYSTEM_GB, 1.0f, 0, "") } ); ENTRY( - "NEC PC Engine/TurboGrafx-16", { + _("NEC PC Engine/TurboGrafx-16"), { CH(DIV_SYSTEM_PCE, 1.0f, 0, "") } ); ENTRY( - "NES", { + _("NES"), { CH(DIV_SYSTEM_NES, 1.0f, 0, "") } ); ENTRY( - "Famicom with Konami VRC7", { + _("Famicom with Konami VRC7"), { CH(DIV_SYSTEM_NES, 1.0f, 0, ""), CH(DIV_SYSTEM_VRC7, 1.0f, 0, "") } ); ENTRY( - "Famicom Disk System", { + _("Famicom Disk System"), { CH(DIV_SYSTEM_NES, 1.0f, 0, ""), CH(DIV_SYSTEM_FDS, 1.0f, 0, "") } ); ENTRY( - "Commodore 64 (6581 SID)", { + _("Commodore 64 (6581 SID)"), { CH(DIV_SYSTEM_C64_6581, 1.0f, 0, "clockSel=1") }, "tickRate=50.1245421" ); ENTRY( - "Commodore 64 (8580 SID)", { + _("Commodore 64 (8580 SID)"), { CH(DIV_SYSTEM_C64_8580, 1.0f, 0, "clockSel=1") }, "tickRate=50.1245421" ); ENTRY( - "Arcade (YM2151 and SegaPCM)", { + _("Arcade (YM2151 and SegaPCM)"), { CH(DIV_SYSTEM_YM2151, 1.0f, 0, ""), CH(DIV_SYSTEM_SEGAPCM_COMPAT, 1.0f, 0, "") } ); ENTRY( - "Neo Geo CD", { + _("Neo Geo CD"), { CH(DIV_SYSTEM_YM2610, 1.0f, 0, "") } ); ENTRY( - "Neo Geo CD (extended channel 2)", { + _("Neo Geo CD (extended channel 2)"), { CH(DIV_SYSTEM_YM2610_EXT, 1.0f, 0, "") } ); diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index ad760675d..f25ae80af 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -83,7 +83,7 @@ const char* locales[][3]={ //{"Nederlands (4%)", "nl_NL", "start Furnace opnieuw op om deze instelling effectief te maken."}, {"Polski (95%)", "pl_PL", "aby to ustawienie było skuteczne, należy ponownie uruchomić program."}, {"Português (Brasil) (90%)", "pt_BR", "reinicie o Furnace para que essa configuração entre em vigor."}, - {"Русский (90%)", "ru_RU", "перезапустите программу, чтобы эта настройка вступила в силу."}, + {"Русский", "ru_RU", "перезапустите программу, чтобы эта настройка вступила в силу."}, {"Slovenčina (15%)", "sk_SK", "???"}, {"Svenska", "sv_SE", "starta om programmet för att denna inställning ska träda i kraft."}, //{"ไทย (0%)", "th_TH", "???"}, @@ -4167,6 +4167,7 @@ void FurnaceGUI::drawSettings() { UI_COLOR_CONFIG(GUI_COLOR_INSTR_SID2,_("SID2")); UI_COLOR_CONFIG(GUI_COLOR_INSTR_SUPERVISION,_("Supervision")); UI_COLOR_CONFIG(GUI_COLOR_INSTR_UPD1771C,_("μPD1771C")); + UI_COLOR_CONFIG(GUI_COLOR_INSTR_SID3,_("SID3")); UI_COLOR_CONFIG(GUI_COLOR_INSTR_UNKNOWN,_("Other/Unknown")); ImGui::TreePop(); } diff --git a/src/gui/sysConf.cpp b/src/gui/sysConf.cpp index 997c3674e..15cac439a 100644 --- a/src/gui/sysConf.cpp +++ b/src/gui/sysConf.cpp @@ -2619,6 +2619,28 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl supportsCustomRate=false; ImGui::Text(_("nothing to configure")); break; + case DIV_SYSTEM_SID3: { + bool quarterClock=flags.getBool("quarterClock",false); + if (ImGui::Checkbox(_("Quarter clock speed"),&quarterClock)) { + altered=true; + } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip(_("Decreases clock speed and CPU audio load by 4 times.\nCan be used if your CPU is too slow for the chip." + "\nDoes not affect clock speed during export!\n\n" + + "Warning! Filters may become unstable at high cutoff and resonance\nif this option or lower clock speed are used!\n" + "Also filters' timbre may be different near these values.\n\n" + + "Default clock speed is 1MHz (1000000Hz).")); + } + + if (altered) { + e->lockSave([&]() { + flags.set("quarterClock",(int)quarterClock); + }); + } + break; + } default: { bool sysPal=flags.getInt("clockSel",0); diff --git a/src/gui/util.cpp b/src/gui/util.cpp index 94e33148a..ed2ae9b31 100644 --- a/src/gui/util.cpp +++ b/src/gui/util.cpp @@ -112,3 +112,109 @@ String getKeyName(int key, bool emptyNone) { } return ret; } + +double sinus(double x) { + return sin(x); +} +double rectSin(double x) { + return sin(x) > 0 ? sin(x) : 0; +} +double absSin(double x) { + return fabs(sin(x)); +} + +double square(double x) { + return fmod(x, (2 * M_PI)) >= M_PI ? -1 : 1; +} +double rectSquare(double x) { + return square(x) > 0 ? square(x) : 0; +} + +double quartSin(double x) { + return absSin(x) * rectSquare(2 * x); +} +double squiSin(double x) { + return sin(x) >= 0 ? sin(2 * x) : 0; +} +double squiAbsSin(double x) { + return fabs(squiSin(x)); +} + +double saw(double x) { + return atan(tan(x / 2)) / (M_PI / 2); +} +double rectSaw(double x) { + return saw(x) > 0 ? saw(x) : 0; +} +double absSaw(double x) { + return saw(x) < 0 ? saw(x) + 1 : saw(x); +} + + +double cubSaw(double x) { + return pow(saw(x), 3); +} +double rectCubSaw(double x) { + return pow(rectSaw(x), 3); +} +double absCubSaw(double x) { + return pow(absSaw(x), 3); +} + +double cubSine(double x) { + return pow(sin(x), 3); +} +double rectCubSin(double x) { + return pow(rectSin(x), 3); +} +double absCubSin(double x) { + return pow(absSin(x), 3); +} +double quartCubSin(double x) { + return pow(quartSin(x), 3); +} +double squishCubSin(double x) { + return pow(squiSin(x), 3); +} +double squishAbsCubSin(double x) { + return pow(squiAbsSin(x), 3); +} + +double triangle(double x) { + return asin(sin(x)) / (M_PI / 2); +} +double rectTri(double x) { + return triangle(x) > 0 ? triangle(x) : 0; +} +double absTri(double x) { + return fabs(triangle(x)); +} +double quartTri(double x) { + return absTri(x) * rectSquare(2 * x); +} +double squiTri(double x) { + return sin(x) >= 0 ? triangle(2 * x) : 0; +} +double absSquiTri(double x) { + return fabs(squiTri(x)); +} + +double cubTriangle(double x) { + return pow(triangle(x), 3); +} +double cubRectTri(double x) { + return pow(rectTri(x), 3); +} +double cubAbsTri(double x) { + return pow(absTri(x), 3); +} +double cubQuartTri(double x) { + return pow(quartTri(x), 3); +} +double cubSquiTri(double x) { + return pow(squiTri(x), 3); +} +double absCubSquiTri(double x) { + return fabs(cubSquiTri(x)); +} + diff --git a/src/gui/util.h b/src/gui/util.h index d82466a25..f21fc0312 100644 --- a/src/gui/util.h +++ b/src/gui/util.h @@ -30,4 +30,37 @@ #endif String getHomeDir(); -String getKeyName(int key, bool emptyNone=false); \ No newline at end of file +String getKeyName(int key, bool emptyNone=false); + +double sinus(double x); +double rectSin(double x); +double absSin(double x); +double square(double x); +double rectSquare(double x); +double quartSin(double x); +double squiSin(double x); +double squiAbsSin(double x); +double saw(double x); +double rectSaw(double x); +double absSaw(double x); +double cubSaw(double x); +double rectCubSaw(double x); +double absCubSaw(double x); +double cubSine(double x); +double rectCubSin(double x); +double absCubSin(double x); +double quartCubSin(double x); +double squishCubSin(double x); +double squishAbsCubSin(double x); +double triangle(double x); +double rectTri(double x); +double absTri(double x); +double quartTri(double x); +double squiTri(double x); +double absSquiTri(double x); +double cubTriangle(double x); +double cubRectTri(double x); +double cubAbsTri(double x); +double cubQuartTri(double x); +double cubSquiTri(double x); +double absCubSquiTri(double x); \ No newline at end of file diff --git a/src/gui/waveEdit.cpp b/src/gui/waveEdit.cpp index b6a86719c..1cda66865 100644 --- a/src/gui/waveEdit.cpp +++ b/src/gui/waveEdit.cpp @@ -19,6 +19,7 @@ #define _USE_MATH_DEFINES #include "gui.h" +#include "util.h" #include "plot_nolerp.h" #include "IconsFontAwesome4.h" #include "misc/cpp/imgui_stdlib.h" @@ -40,111 +41,6 @@ const char* waveInterpolations[4]={ _N("Cubic") }; -double sinus(double x) { - return sin(x); -} -double rectSin(double x) { - return sin(x) > 0 ? sin(x) : 0; -} -double absSin(double x) { - return fabs(sin(x)); -} - -double square(double x) { - return fmod(x, (2 * M_PI)) >= M_PI ? -1 : 1; -} -double rectSquare(double x) { - return square(x) > 0 ? square(x) : 0; -} - -double quartSin(double x) { - return absSin(x) * rectSquare(2 * x); -} -double squiSin(double x) { - return sin(x) >= 0 ? sin(2 * x) : 0; -} -double squiAbsSin(double x) { - return fabs(squiSin(x)); -} - -double saw(double x) { - return atan(tan(x / 2)) / (M_PI / 2); -} -double rectSaw(double x) { - return saw(x) > 0 ? saw(x) : 0; -} -double absSaw(double x) { - return saw(x) < 0 ? saw(x) + 1 : saw(x); -} - - -double cubSaw(double x) { - return pow(saw(x), 3); -} -double rectCubSaw(double x) { - return pow(rectSaw(x), 3); -} -double absCubSaw(double x) { - return pow(absSaw(x), 3); -} - -double cubSine(double x) { - return pow(sin(x), 3); -} -double rectCubSin(double x) { - return pow(rectSin(x), 3); -} -double absCubSin(double x) { - return pow(absSin(x), 3); -} -double quartCubSin(double x) { - return pow(quartSin(x), 3); -} -double squishCubSin(double x) { - return pow(squiSin(x), 3); -} -double squishAbsCubSin(double x) { - return pow(squiAbsSin(x), 3); -} - -double triangle(double x) { - return asin(sin(x)) / (M_PI / 2); -} -double rectTri(double x) { - return triangle(x) > 0 ? triangle(x) : 0; -} -double absTri(double x) { - return fabs(triangle(x)); -} -double quartTri(double x) { - return absTri(x) * rectSquare(2 * x); -} -double squiTri(double x) { - return sin(x) >= 0 ? triangle(2 * x) : 0; -} -double absSquiTri(double x) { - return fabs(squiTri(x)); -} - -double cubTriangle(double x) { - return pow(triangle(x), 3); -} -double cubRectTri(double x) { - return pow(rectTri(x), 3); -} -double cubAbsTri(double x) { - return pow(absTri(x), 3); -} -double cubQuartTri(double x) { - return pow(quartTri(x), 3); -} -double cubSquiTri(double x) { - return pow(squiTri(x), 3); -} -double absCubSquiTri(double x) { - return fabs(cubSquiTri(x)); -} - typedef double (*WaveFunc) (double a); WaveFunc waveFuncs[]={ @@ -495,7 +391,7 @@ void FurnaceGUI::drawWaveEdit() { ImGui::TableNextColumn(); ImGui::Text(_("Width")); if (ImGui::IsItemHovered()) { - ImGui::SetTooltip(_("use a width of:\n- any on Amiga/N163\n- 32 on Game Boy, PC Engine, SCC, Konami Bubble System, Namco WSG, Virtual Boy and WonderSwan\n- 64 on FDS\n- 128 on X1-010\nany other widths will be scaled during playback.")); + ImGui::SetTooltip(_("use a width of:\n- any on Amiga/N163\n- 32 on Game Boy, PC Engine, SCC, Konami Bubble System, Namco WSG, Virtual Boy and WonderSwan\n- 64 on FDS\n- 128 on X1-010\n- 256 on SID3\nany other widths will be scaled during playback.")); } ImGui::SameLine(); ImGui::SetNextItemWidth(96.0f*dpiScale); @@ -509,7 +405,7 @@ void FurnaceGUI::drawWaveEdit() { ImGui::SameLine(); ImGui::Text(_("Height")); if (ImGui::IsItemHovered()) { - ImGui::SetTooltip(_("use a height of:\n- 16 for Game Boy, WonderSwan, Namco WSG, Konami Bubble System, X1-010 Envelope shape and N163\n- 32 for PC Engine\n- 64 for FDS and Virtual Boy\n- 256 for X1-010 and SCC\nany other heights will be scaled during playback.")); + ImGui::SetTooltip(_("use a height of:\n- 16 for Game Boy, WonderSwan, Namco WSG, Konami Bubble System, X1-010 Envelope shape and N163\n- 32 for PC Engine\n- 64 for FDS and Virtual Boy\n- 256 for X1-010, SCC and SID3\nany other heights will be scaled during playback.")); } ImGui::SameLine(); ImGui::SetNextItemWidth(96.0f*dpiScale); diff --git a/src/icon/furIcons.h b/src/icon/furIcons.h index 71df76fd2..57bb8bf7e 100644 --- a/src/icon/furIcons.h +++ b/src/icon/furIcons.h @@ -1,7 +1,7 @@ // not auto-generated. update every time you change icons.ttf! #define ICON_MIN_FUR 0xe0f0 -#define ICON_MAX_FUR 0xe161 +#define ICON_MAX_FUR 0xe164 // test #define ICON_FUR_TEST0 u8"\ue0f0" @@ -73,10 +73,11 @@ #define ICON_FUR_INS_NDS u8"\ue15d" #define ICON_FUR_INS_GBA_DMA u8"\ue15e" #define ICON_FUR_INS_GBA_MINMOD u8"\ue15f" -#define ICON_FUR_INS_BIFURCATOR u8"\ue160" +#define ICON_FUR_INS_BIFURCATOR u8"\ue160" #define ICON_FUR_INS_SID2 u8"\ue161" #define ICON_FUR_INS_SUPERVISION u8"\ue162" #define ICON_FUR_INS_UPD1771C u8"\ue163" +#define ICON_FUR_INS_SID3 u8"\ue164" // sample editor #define ICON_FUR_SAMPLE_APPLY_SILENCE u8"\ue136" diff --git a/src/main.cpp b/src/main.cpp index 37f74ef2a..b1e2afd18 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -339,6 +339,8 @@ TAParamResult pVersion(String) { printf("- PowerNoise emulator by scratchminer (MIT)\n"); printf("- ep128emu by Istvan Varga (GPLv2)\n"); printf("- NDS sound emulator by cam900 (zlib license)\n"); + printf("- SID2 emulator by LTVA (GPLv2, modification of reSID emulator)\n"); + printf("- SID3 emulator by LTVA (MIT)\n"); printf("- openMSX YMF278 emulator (modified version) by the openMSX developers (GPLv2)\n"); return TA_PARAM_QUIT; }