better unimplemented descs

This commit is contained in:
lif 2024-01-15 20:39:44 -08:00
parent 5e36a84f51
commit e84b6d2e3f

View file

@ -242,6 +242,7 @@ impl Lsdpack {
NextBank => { /* lol */ }
AmpDecPu0 => {
// https://github.com/LIJI32/SameBoy/blob/27b5935b8d0e0af988bcac8e55e92703af24f335/Core/apu.c#L341
/*
let base = TONE1_PATTERN.read();
TONE1_PATTERN.write(
base.with_volume(0)
@ -258,8 +259,10 @@ impl Lsdpack {
.with_step_increasing(true)
.with_step_time(0),
); // $FF12 <- $18
*/
}
AmpDecPu1 => {
/*
let base = TONE2_PATTERN.read();
TONE2_PATTERN.write(
base.with_volume(0)
@ -276,8 +279,10 @@ impl Lsdpack {
.with_step_increasing(true)
.with_step_time(0),
); // $FF17 <- $18
*/
}
AmpDecNoi => {
/*
let base = NOISE_LEN_ENV.read();
NOISE_LEN_ENV.write(
base.with_volume(0)
@ -294,53 +299,56 @@ impl Lsdpack {
.with_step_increasing(true)
.with_step_time(0),
); // $FF21 <- $18
*/
}
PitchPu0 => self.write_u16le(TONE1_FREQUENCY),
PitchPu1 => self.write_u16le(TONE2_FREQUENCY),
PitchPu0 => {} //self.write_u16le(TONE1_FREQUENCY),
PitchPu1 => {} //self.write_u16le(TONE2_FREQUENCY),
PitchWav => self.write_u16le(WAVE_FREQ),
SampleNext => self.write_next_samples(),
// general register writes:
Pu0Sweep => unsafe { TONE1_SWEEP.cast() }.write(self.next_byte()),
Pu0LengthWave => self.write_lsb(TONE1_PATTERN),
Pu0Env => self.write_msb(TONE1_PATTERN),
Pu0PitchLsb => self.write_lsb(TONE1_FREQUENCY),
Pu0PitchMsb => self.write_msb(TONE1_FREQUENCY),
Pu1LengthWave => self.write_lsb(TONE2_PATTERN),
Pu1Env => self.write_msb(TONE2_PATTERN),
Pu1PitchLsb => self.write_lsb(TONE2_FREQUENCY),
Pu1PitchMsb => self.write_msb(TONE2_FREQUENCY),
Pu0Sweep => {} //unsafe { TONE1_SWEEP.cast() }.write(self.next_byte()),
Pu0LengthWave => {} //self.write_lsb(TONE1_PATTERN),
Pu0Env => {} //self.write_msb(TONE1_PATTERN),
Pu0PitchLsb => {} //self.write_lsb(TONE1_FREQUENCY),
Pu0PitchMsb => {} //self.write_msb(TONE1_FREQUENCY),
Pu1LengthWave => {} //self.write_lsb(TONE2_PATTERN),
Pu1Env => {} //self.write_msb(TONE2_PATTERN),
Pu1PitchLsb => {} //self.write_lsb(TONE2_FREQUENCY),
Pu1PitchMsb => {} //self.write_msb(TONE2_FREQUENCY),
WavOnOff => WAVE_BANK.write(WaveBank::new().with_enabled(self.next_byte() != 0)),
WavLength => self.write_lsb(WAVE_LEN_VOLUME),
WavEnv => self.write_msb(WAVE_LEN_VOLUME),
WavPitchLsb => self.write_lsb(WAVE_FREQ),
WavPitchMsb => self.write_msb(WAVE_FREQ),
NoiLength => self.write_lsb(NOISE_LEN_ENV),
NoiEnv => self.write_msb(NOISE_LEN_ENV),
NoiWave => self.write_lsb(NOISE_FREQ),
NoiTrig => self.write_msb(NOISE_FREQ),
NoiLength => {} //self.write_lsb(NOISE_LEN_ENV),
NoiEnv => {} //self.write_msb(NOISE_LEN_ENV),
NoiWave => {} //self.write_lsb(NOISE_FREQ),
NoiTrig => {} //self.write_msb(NOISE_FREQ),
ChannelVolume => self.write_lsb(LEFT_RIGHT_VOLUME),
Pan => self.write_msb(LEFT_RIGHT_VOLUME),
SoundOffOn => unsafe { SOUND_ENABLED.cast() }.write(self.next_byte()),
WavePattern0 => todo!(),
WavePattern1 => todo!(),
WavePattern2 => todo!(),
WavePattern3 => todo!(),
WavePattern4 => todo!(),
WavePattern5 => todo!(),
WavePattern6 => todo!(),
WavePattern7 => todo!(),
WavePattern8 => todo!(),
WavePattern9 => todo!(),
WavePatternA => todo!(),
WavePatternB => todo!(),
WavePatternC => todo!(),
WavePatternD => todo!(),
WavePatternE => todo!(),
WavePatternF => todo!(),
WavePattern0 => todo!("WavePattern0"),
WavePattern1 => todo!("WavePattern1"),
WavePattern2 => todo!("WavePattern2"),
WavePattern3 => todo!("WavePattern3"),
WavePattern4 => todo!("WavePattern4"),
WavePattern5 => todo!("WavePattern5"),
WavePattern6 => todo!("WavePattern6"),
WavePattern7 => todo!("WavePattern7"),
WavePattern8 => todo!("WavePattern8"),
WavePattern9 => todo!("WavePattern9"),
WavePatternA => todo!("WavePatternA"),
WavePatternB => todo!("WavePatternB"),
WavePatternC => todo!("WavePatternC"),
WavePatternD => todo!("WavePatternD"),
WavePatternE => todo!("WavePatternE"),
WavePatternF => todo!("WavePatternF"),
_Invalid0B | _Invalid0C | _Invalid0D | _Invalid0E | _Invalid0F | _Invalid15
| _Invalid1F | _Invalid27 | _Invalid28 | _Invalid29 | _Invalid2A | _Invalid2B
| _Invalid2C | _Invalid2D | _Invalid2E | _Invalid2F => unimplemented!(),
| _Invalid2C | _Invalid2D | _Invalid2E | _Invalid2F => {
unimplemented!("Invalid command: {:x}", cmd as u8)
}
}
true
}