neser 0.1.1

NESER - NES Emulator in Rust - is a NES emulator written in Rust. It aims to be a high-quality, hardware-accurate emulator that is also easy to use and extend. It supports a wide range of NES games and features, including various mappers, audio processing, and input handling. NESER is designed to be modular and extensible, allowing developers to easily add new features or support for additional hardware. It can be run using one of two frontends: a native desktop application using SDL2, or a web application using WebAssembly. The desktop application provides a high-performance, feature-rich experience with support for various input devices and display options, while the web application allows users to play NES games directly in their browsers without needing to install any software in a BYOR manner (Bring Your Own Roms).
Documentation
mod cartridge_catalog;
mod config;
mod nes;
mod ram_init;

use crate::app_context::SharedAppContext;
use crate::debugging::log_info;

pub use crate::cartridge::TimingMode;
pub use cartridge_catalog::{
    CartridgeCatalogOptions, default_catalog_csv_path, refresh_cartridge_catalog,
};
pub use config::ApuChannels;
pub use config::AutorunMode;
pub use config::Config;
pub use config::ExpansionPort;
pub use config::HardwareMode;
#[allow(unused_imports)] // Used by integration tests and lib consumers
pub use config::HardwareModel;
pub use config::ParseResult;
pub use config::RamInitMode;
pub use nes::Nes;
pub use nes::SaveState;
pub use ram_init::initialize_ram;

pub fn log_hardware_selection(app_context: &SharedAppContext, timing_applied: bool) {
    let binding = app_context.borrow();
    let cfg = binding.config();

    let hardware_desc = match cfg.hardware_mode {
        config::HardwareMode::Famicom => "Famicom".to_string(),
        config::HardwareMode::Nes => match cfg.hardware_model {
            config::HardwareModel::NesNtsc => "NES NTSC".to_string(),
            config::HardwareModel::NesPal => "NES PAL".to_string(),
        },
    };

    let source =
        if cfg.hardware_mode == config::HardwareMode::Famicom && !cfg.hardware_mode_explicit {
            "from ROM DB"
        } else if cfg.hardware_mode_explicit || cfg.hardware_model_explicit {
            "from configuration"
        } else if timing_applied {
            "detected from ROM"
        } else {
            "default"
        };

    log_info(format!("Emulating {hardware_desc} ({source})"));
}