gba.rsannotatedgba.rssource58 lines · 2.1 KB · raw
1use gba_config::{GbaAspectRatio, GbaAudioInterpolation, GbaColorCorrection, GbaSaveMemory};
2use jgenesis_proc_macros::deserialize_default_on_error;
3use serde::{Deserialize, Serialize};
4use std::path::PathBuf;

Significantly darken

7const DEFAULT_CORRECTION_GAMMA: f64 = 3.2;
9#[deserialize_default_on_error]
10#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11#[serde(default)]
12pub struct GameBoyAdvanceAppConfig {
13    pub bios_path: Option<PathBuf>,
14    pub skip_bios_animation: bool,
15    pub aspect_ratio: GbaAspectRatio,
16    pub color_correction: GbaColorCorrection,
17    pub color_correction_gamma: f64,
18    pub frame_blending: bool,
19    pub forced_save_memory_type: Option<GbaSaveMemory>,
20    pub audio_interpolation: GbaAudioInterpolation,
21    pub psg_low_pass: bool,
22    pub pulse_1_enabled: bool,
23    pub pulse_2_enabled: bool,
24    pub wavetable_enabled: bool,
25    pub noise_enabled: bool,
26    pub pcm_a_enabled: bool,
27    pub pcm_b_enabled: bool,
28    pub allow_opposing_joypad_directions: bool,
29    pub solar_brightness_step: u8,
30    pub solar_min_brightness: u8,
31    pub solar_max_brightness: u8,
32}
33
34impl Default for GameBoyAdvanceAppConfig {
35    fn default() -> Self {
36        Self {
37            bios_path: None,
38            skip_bios_animation: false,
39            aspect_ratio: GbaAspectRatio::default(),
40            color_correction: GbaColorCorrection::default(),
41            color_correction_gamma: DEFAULT_CORRECTION_GAMMA,
42            frame_blending: true,
43            forced_save_memory_type: None,
44            audio_interpolation: GbaAudioInterpolation::default(),
45            psg_low_pass: false,
46            pulse_1_enabled: true,
47            pulse_2_enabled: true,
48            wavetable_enabled: true,
49            noise_enabled: true,
50            pcm_a_enabled: true,
51            pcm_b_enabled: true,
52            allow_opposing_joypad_directions: false,
53            solar_brightness_step: gba_config::DEFAULT_SOLAR_BRIGHTNESS_STEP,
54            solar_min_brightness: gba_config::DEFAULT_SOLAR_MIN_BRIGHTNESS,
55            solar_max_brightness: gba_config::DEFAULT_SOLAR_MAX_BRIGHTNESS,
56        }
57    }
58}