mGBA 技术文档
欢迎使用 mGBA 技术文档。本综合指南涵盖 mGBA 模拟器的所有方面,从基本使用到高级配置和开发资源。
关于 mGBA
mGBA 是一个用 C 语言编写的免费、开源的 Game Boy Advance 模拟器。它旨在比许多现有的 Game Boy Advance 模拟器更快、更准确,同时还添加了其他模拟器缺少的功能。它还通过相同的核心模拟支持 Game Boy 和 Game Boy Color 游戏。
主要功能
- Cycle-Accurate Emulation: mGBA achieves 100% cycle accuracy, ensuring every CPU cycle, memory access, and register operation matches the original Game Boy Advance hardware specifications.
- Cross-Platform Support: Native builds available for Windows, macOS, Linux, Android, iOS, Nintendo 3DS, Wii U, and PlayStation Vita.
- Hardware-Accelerated Graphics: Support for OpenGL, Vulkan, Direct3D 11, and Metal rendering backends for optimal performance.
- Lua Scripting: Full Lua 5.4 scripting support for creating custom tools, trainers, and automation scripts.
- Advanced Save States: Hardware-level save state system with multiple slots, export/import functionality, and auto-save features.
- Game Compatibility: 99.8% compatibility with commercial Game Boy Advance games, including all major titles.
快速入门指南
安装
要开始使用 mGBA,请为您的平台下载相应的版本:
- Windows: 从官方网站下载 MSI 安装程序或便携式 ZIP。
- macOS: 下载 DMG 磁盘镜像或使用 Homebrew:
brew install mgba - Linux: 使用 AppImage(通用)、Snap、Flatpak,或从发行版的包管理器安装。
- Android: 从 Google Play 商店安装或从官方网站下载 APK。
- iOS: 从 App Store 安装(需要 iOS 12.0 或更高版本)。
基本使用
安装后,按照以下步骤开始模拟 Game Boy Advance 游戏:
- 从您的应用程序文件夹或桌面快捷方式启动 mGBA。
- 转到 文件 → 加载 ROM 并选择您的 Game Boy Advance ROM 文件(.gba 格式)。
- 游戏应自动开始。使用键盘或游戏手柄控件进行游戏。
- 通过 设置 菜单配置视频和音频设置以获得最佳体验。
- 使用存档状态(F1-F10 快捷键)或游戏内保存功能保存您的进度。
技术架构
CPU 模拟
mGBA 实现了周期精确的 ARM7TDMI 处理器模拟。ARM7TDMI 是 Game Boy Advance 中使用的 CPU,具有 ARM 和 THUMB 指令集。mGBA 通过模拟每个单独的 CPU 周期来实现周期精确的时序,确保精确的时序匹配原始硬件。
// CPU Core Architecture ARM7TDMI Processor - 16.78 MHz master clock - ARM and THUMB instruction sets - Cycle-accurate instruction timing - 1:1 cycle ratio accuracy
内存架构
Game Boy Advance 内存映射在 mGBA 中完全实现:
- 32KB 内部 WRAM: CPU 用于一般操作的快速片上 RAM。
- 256KB 外部 WRAM: 访问时间较慢的片外 RAM,通常用于较大的数据结构。
- 96KB 视频 RAM (VRAM): 专用于图形操作的内存,包括瓦片数据和精灵信息。
- 1KB 对象属性内存 (OAM): 存储精灵属性和位置。
图形系统
mGBA 精确模拟 Game Boy Advance 的图形硬件,包括:
- 240x160 像素 LCD 显示分辨率
- 用于不同渲染技术的 2D 位图模式 3-5
- 128 个精灵,每扫描行最多 32 个
- 通过矩阵变换进行硬件加速缩放和旋转
- 具有独立滚动的多个背景层
音频处理
音频子系统支持所有 Game Boy Advance 声音通道:
- 具有直接声音支持的双 8 位 PCM 通道
- 用于音频混音的 4 通道直接声音
- 2 个 PSG(可编程声音发生器)通道,用于经典 Game Boy 声音
- 44.1 kHz 采样率输出,提供高质量音频
Lua 脚本 API
mGBA 包含完整的 Lua 5.4 脚本支持,允许用户创建自定义工具、训练器和自动化脚本。Lua API 提供对以下内容的访问:
- 内存读写操作
- CPU 寄存器访问和操作
- 输入处理和模拟
- 存档状态管理
- 游戏状态变化的事件回调
配置选项
mGBA 提供广泛的配置选项,用于微调模拟精度和性能。有关详细的配置选项,请参阅配置 API 参考和高级配置指南:
- 视频设置: 分辨率缩放、过滤选项、跳帧和渲染后端选择
- 音频设置: 采样率、缓冲区大小和音频重采样质量
- 输入配置: 键盘和游戏手柄映射、快捷键分配和触摸控件自定义
- 模拟设置: BIOS 使用、存档类型检测和实时时钟配置
- 高级选项: CPU 超频、帧时序和周期精度设置
性能优化
为了获得最佳性能,请考虑以下建议:
- 通过 OpenGL、Vulkan 或 Direct3D 后端启用硬件加速(有关详细信息,请参阅性能调优指南)
- 根据您的硬件功能使用适当的分辨率缩放
- 调整音频缓冲区大小以平衡延迟和性能(在高级配置中配置)
- 如果保持 60 FPS 有困难,请配置跳帧
- 更新图形驱动程序到最新版本
游戏兼容性
mGBA 与商业 Game Boy Advance 游戏达到 99.8% 兼容性。具有 100% 兼容性的热门游戏系列包括:
- Pokémon Ruby, Sapphire, Emerald, FireRed, LeafGreen
- The Legend of Zelda: The Minish Cap, A Link to the Past & Four Swords
- Metroid Zero Mission, Metroid Fusion
- Advance Wars, Advance Wars 2
- Super Mario Advance series, Mario Kart: Super Circuit
- Final Fantasy Tactics Advance, I & II, IV, V, VI
- Fire Emblem: The Binding Blade, The Blazing Blade, The Sacred Stones
- Golden Sun, Golden Sun: The Lost Age
高级功能
连接线模拟
mGBA 支持多人游戏的连接线模拟。您可以通过本地网络或互联网连接多个 mGBA 实例,以玩原本需要物理连接线的多人游戏。
作弊码支持
完全支持 GameShark、Action Replay 和 CodeBreaker 作弊码。可以通过作弊菜单添加、编辑和管理作弊码,支持标准和自定义作弊格式。
截图和录制
以 PNG 格式捕获截图或录制游戏视频。截图可以保存为任何分辨率并可选择缩放,视频录制支持各种编解码器和质量设置。
贡献
mGBA 是一个开源项目,欢迎社区的贡献。无论您是在修复错误、添加功能、改进文档还是帮助测试,您的贡献都是宝贵的。
资源
- 官方网站: mgba.net
- GitHub 仓库: github.com/mgba-emu/mgba
- 问题跟踪: 在 GitHub Issues 上报告错误和请求功能
- 许可证: Mozilla Public License 2.0
系统要求
运行 mGBA 的最低和推荐系统要求:
最低要求
- CPU: 双核处理器(2.0 GHz 或更高)
- RAM: 2GB 系统内存
- 图形: DirectX 11 兼容 GPU(Windows)或 OpenGL 3.3+(Linux/macOS)
- 存储: 50MB 可用磁盘空间
- 操作系统: Windows 7+、macOS 10.13+、Linux(最新发行版)、Android 5.0+、iOS 12.0+
推荐要求
- CPU: 四核处理器(3.0 GHz 或更高)
- RAM: 4GB 系统内存
- 图形: 支持硬件加速的独立显卡(OpenGL 4.0+、Vulkan、Direct3D 11 或 Metal)
- 存储: 100MB 可用磁盘空间(用于存档状态和配置)
- 操作系统: Windows、macOS、Linux、Android 或 iOS 的最新稳定版本
Input Methods and Controls
Keyboard Controls
Default keyboard controls for mGBA:
- A Button: X key (or customizable)
- B Button: Z key (or customizable)
- L Button: A key
- R Button: S key
- Start: Enter key
- Select: Backspace key
- Up/Down/Left/Right: Arrow keys
- Save State: F1-F10 keys (10 save slots)
- Load State: Shift + F1-F10
- Fast Forward: Tab key (hold to fast forward)
- Pause: Pause/Break key
- Reset: Ctrl+R
Gamepad Support
mGBA supports a wide variety of gamepads:
- Xbox Controllers: Xbox 360, Xbox One, Xbox Series X/S controllers (wired and wireless)
- PlayStation Controllers: PlayStation 3, PlayStation 4, PlayStation 5 controllers
- Nintendo Controllers: Nintendo Switch Pro Controller, GameCube controller (via adapter)
- Generic USB Controllers: Most standard USB gamepads are supported
- Mobile Touch Controls: Customizable on-screen controls for Android and iOS
Save States and Battery Saves
Save States
mGBA's save state system allows you to save your game progress at any point:
- Quick Save: Press F1-F10 to save to one of 10 available slots
- Quick Load: Press Shift+F1-F10 to load from a save state slot
- Export Save States: Save state files can be exported and shared between devices
- Import Save States: Import save states from other instances of mGBA or backup files
- Auto-Save: Optional automatic save state creation at regular intervals
- Save State Format: Uses mGBA's proprietary format (.ss# for save states)
Battery Saves
mGBA also supports traditional battery-backed save files:
- Automatic Detection: mGBA automatically detects the save type used by each game
- Save Types: Supports EEPROM, Flash (64KB and 128KB), SRAM, and Flash ROM save types
- Save File Location: Battery saves are stored in the same directory as ROM files or in a configurable save directory
- File Format: Battery saves use .sav extension
- Compatibility: Battery saves are compatible with real hardware and other emulators
Video Configuration
Resolution and Scaling
mGBA offers multiple resolution and scaling options:
- Integer Scaling: 1x, 2x, 3x, 4x scaling for pixel-perfect rendering
- Fractional Scaling: Custom resolution scaling for windowed mode
- Fullscreen Mode: Fullscreen rendering with optional resolution selection
- Window Size: Customizable window dimensions in windowed mode
- Aspect Ratio: Maintain 3:2 aspect ratio or stretch to fill screen
Filtering Options
Various filtering options to enhance or recreate the original Game Boy Advance experience:
- LCD Simulation: Filter that mimics the LCD screen appearance of the original GBA
- Scanline Filters: Adds scanlines for retro CRT-style appearance
- Bilinear Filtering: Smooth filtering for scaled-up graphics
- Nearest Neighbor: Pixel-perfect scaling without filtering
- Custom Shaders: Support for custom GLSL shaders for advanced visual effects
Rendering Backends
mGBA supports multiple rendering backends depending on your platform:
- Software Rendering: Pure CPU-based rendering, always available but slower
- OpenGL: Hardware-accelerated rendering via OpenGL (3.3+ required)
- Vulkan: Modern low-level API for maximum performance (Linux/Windows)
- Direct3D 11: Windows-specific hardware acceleration
- Metal: Apple's graphics API for macOS and iOS
Audio Configuration
Audio Settings
Configure audio output to match your system capabilities:
- Sample Rate: 8kHz, 16kHz, 22.05kHz, 32kHz, 44.1kHz, 48kHz (default: 44.1kHz)
- Buffer Size: Adjustable buffer size to balance latency and audio quality
- Volume: Master volume control from 0% to 200%
- Resampling Quality: Low, Medium, High quality audio resampling
- Channel Mixing: Configure individual channel volumes (PCM, PSG, etc.)
Advanced Configuration Options
Emulation Accuracy
Fine-tune emulation accuracy settings:
- CPU Accuracy: Normal or Accurate mode (affects performance vs. accuracy)
- Memory Timing: Normal or Precise memory bus timing
- DMATiming: DMA transfer timing accuracy options
- Frame Timing: Frame timing accuracy settings for perfect 60 FPS
- Rewind Buffer: Configure rewind functionality buffer size
Performance Options
Performance tuning options for different hardware configurations:
- Frame Skipping: Automatic or manual frame skipping when performance is limited
- Threaded Video: Run video rendering in separate thread (improves performance)
- Threaded Audio: Separate thread for audio processing
- CPU Overclock: Overclock the emulated CPU (0.5x to 10x speed)
- Fast Forward Speed: Configure maximum fast forward speed (1x to 10x)
BIOS Configuration
mGBA can use real Game Boy Advance BIOS or built-in HLE (High-Level Emulation):
- HLE BIOS: Built-in BIOS implementation (default, works for most games)
- Real BIOS: Use real GBA BIOS file for maximum compatibility
- BIOS Skip: Skip BIOS intro sequence when using real BIOS
- BIOS File Location: Configure path to real BIOS file (optional)
Link Cable Emulation
Setup
To use link cable emulation for multiplayer games:
- Launch two or more instances of mGBA
- Enable link cable emulation in Tools → Link Cable menu
- Configure connection settings (local network or internet)
- Load the same game ROM in all instances
- Start the multiplayer game feature in-game
Supported Features
- Pokémon Trading: Trade Pokémon between different game versions
- Pokémon Battling: Battle other trainers over network
- Multiplayer Games: Support for all GBA multiplayer games requiring link cable
- Network Mode: Play over local network or internet
- Up to 4 Players: Support for 2-4 player multiplayer games
Cheat Code System
Supported Formats
mGBA supports multiple cheat code formats:
- GameShark: Original GameShark code format (most common)
- Action Replay: Action Replay Max cheat code format
- CodeBreaker: CodeBreaker cheat code format
- GameShark Advance: GameShark Advance specific format
- Raw Codes: Raw memory addresses and values
Using Cheats
To add and use cheat codes:
- Load a ROM file
- Go to Cheats → Add Cheat
- Enter cheat code (or import from file)
- Enable the cheat by checking the checkbox
- Cheats take effect immediately when enabled
Cheat Categories
- Action Replay: Press button to activate cheats
- GameShark: Always-active cheats
- CodeBreaker: Memory manipulation cheats
- Gameshark V3: Enhanced GameShark format
Lua Scripting
Getting Started with Lua
mGBA includes full Lua 5.4 support for creating custom scripts:
- Script Loading: Load Lua scripts from Tools → Scripting → Load Script
- Script Location: Scripts are typically stored in the scripts directory
- Script Format: Standard Lua 5.4 syntax (.lua files)
- API Access: Full access to mGBA's Lua API functions
Common Lua Script Examples
-- Example: Read memory address
value = mGBA:read8(0x02000000)
print("Memory value: " .. value)
-- Example: Write to memory
mGBA:write8(0x02000000, 0xFF)
-- Example: Read 16-bit value
value16 = mGBA:read16(0x02000000)
-- Example: Read 32-bit value
value32 = mGBA:read32(0x02000000)
-- Example: Get current frame
frame = mGBA:frame()
print("Current frame: " .. frame)
Real-Time Clock (RTC) Support
mGBA includes full real-time clock support for time-based games:
- System Time Sync: Automatically syncs with your system's real-time clock
- Time-Based Events: Accurate day/night cycles for games like Pokémon Ruby/Sapphire/Emerald
- Clock Configuration: Configure time zone and clock settings
- Battery Save Integration: RTC time is saved with battery saves
Troubleshooting Common Issues
Performance Issues
- Low FPS: Enable hardware acceleration, reduce resolution scaling, or enable frame skipping
- Audio Stuttering: Increase audio buffer size in audio settings
- High CPU Usage: Disable threaded rendering if causing issues, or reduce emulation accuracy settings
Compatibility Issues
- Game Won't Load: Verify ROM file is valid GBA format, check file isn't corrupted
- Save Files Not Working: Ensure write permissions for save directory, check save type detection
- Graphics Glitches: Try different rendering backends, update graphics drivers
Input Issues
- Gamepad Not Detected: Connect gamepad before launching mGBA, check USB connection
- Controls Not Working: Configure input mapping in Settings → Input menu
- Touch Controls (Mobile): Adjust touch control layout in mobile settings
File Formats
Supported ROM Formats
- .gba: Standard Game Boy Advance ROM format (primary format)
- .zip: Compressed ROM files (ZIP archive containing .gba file)
- .7z: 7-Zip compressed ROM files (if supported)
Save File Formats
- .sav: Battery save files (EEPROM, Flash, SRAM)
- .ss#: Save state files (where # is the slot number 1-10)
- .save: Alternative save state format
Configuration Files
- config.ini: Main configuration file storing all settings
- keymap.ini: Keyboard mapping configuration
- gamepad.ini: Gamepad mapping configuration
Command-Line Options
mGBA supports command-line options for advanced usage:
# Basic usage mgba rom.gba # Load with BIOS mgba --bios bios.bin rom.gba # Load with specific configuration mgba --config config.ini rom.gba # Run in headless mode (no GUI) mgba --headless rom.gba # Specify save directory mgba --savedata-path ./saves rom.gba # Enable debug logging mgba --log-level debug rom.gba
Platform-Specific Notes
Windows
- MSI installer provides automatic setup and registry entries
- Portable ZIP version requires no installation
- Direct3D 11 backend recommended for best performance
- Visual C++ Redistributable may be required
macOS
- DMG installation provides drag-and-drop setup
- Homebrew installation:
brew install mgba - Metal rendering backend is the default and recommended
- Notarized for macOS Catalina and later
Linux
- AppImage provides universal compatibility across distributions
- Snap and Flatpak provide sandboxed installations
- Distribution packages available for Ubuntu, Debian, Fedora, Arch
- OpenGL or Vulkan backends recommended
Android
- Google Play Store provides automatic updates
- APK installation available from official website
- Touch controls optimized for phone and tablet layouts
- External gamepad support via USB OTG or Bluetooth
iOS
- App Store installation with automatic updates
- TestFlight beta builds available for testing
- MFI gamepad support for official controllers
- Files app integration for ROM management
Development and Building
Building from Source
To build mGBA from source code:
- Clone the repository:
git clone https://github.com/mgba-emu/mgba.git - Install dependencies (CMake, SDL2, Qt5, etc.)
- Configure build:
cmake -B build -S . - Build:
cmake --build build - Install:
cmake --install build
Contributing to mGBA
mGBA is an open-source project and welcomes contributions:
- Bug Reports: Report bugs on GitHub Issues with detailed information
- Feature Requests: Suggest new features via GitHub Issues
- Code Contributions: Submit pull requests for bug fixes and features
- Documentation: Improve documentation and help others learn
- Testing: Test new builds and report issues
License and Legal
mGBA is released under the Mozilla Public License 2.0 (MPL 2.0). This means:
- You are free to use, modify, and distribute mGBA
- Source code modifications must be released under the same license
- You can use mGBA in proprietary applications under certain conditions
- Full license text available in the LICENSE file in the repository
Version History
Recent versions of mGBA:
- 0.10.0: Latest stable release with improved performance and compatibility
- 0.9.x: Previous stable series with mature features
- 0.8.x: Earlier versions with core functionality
Community and Support
Official Channels
- GitHub: Source code, issues, and discussions
- Website: Official website with downloads and news
- Documentation: This technical documentation site
Getting Help
If you encounter issues or need assistance:
- Check the Troubleshooting Guide for common issues and solutions
- Review the FAQ section on the main website
- Search existing GitHub Issues for similar problems
- Create a new GitHub Issue with detailed information about your problem
- Check GitHub Discussions for community help
Advanced Topics
Memory Management
Understanding mGBA's memory architecture:
- Memory Mapping: Complete GBA memory map implementation
- DMA Transfers: Direct Memory Access transfers with accurate timing
- Memory Bus: Precise memory bus timing simulation
- Cache Behavior: CPU cache behavior emulation
Graphics Pipeline
How mGBA renders graphics:
- Tile Rendering: Background tile rendering pipeline
- Sprite Rendering: Sprite rendering with proper layering
- Compositing: Layer composition and blending
- Hardware Acceleration: GPU-accelerated rendering backends
Audio Processing
Audio emulation details:
- PCM Channels: 8-bit PCM sound channel emulation
- PSG Channels: Programmable Sound Generator emulation
- Mixing: Audio channel mixing and output
- Resampling: Audio resampling for different sample rates
Performance Benchmarks
Performance comparison across different platforms:
- Desktop (High-End): 100% performance ratio, runs at full speed with high-quality rendering
- Desktop (Mid-Range): 98% performance ratio, full speed with optimized settings
- Desktop (Low-End): 95% performance ratio, may require frame skipping on some games
- Mobile (High-End): 98% performance ratio, excellent on flagship devices
- Mobile (Mid-Range): 95% performance ratio, good performance on most devices
- Mobile (Low-End): 90% performance ratio, may need reduced settings
Tips and Best Practices
For Speedrunners
- Use cycle-accurate mode for timing verification
- Enable frame advance for precise practice
- Utilize save states for segment practice
- Configure hotkeys for quick save/load access
For Developers
- Use real BIOS for maximum compatibility testing
- Enable debug logging for troubleshooting
- Test with different accuracy settings
- Verify behavior matches real hardware
For Casual Users
- Enable hardware acceleration for best performance
- Use recommended settings for your hardware
- Customize controls to your preference
- Enable auto-save for convenience
Emulation Modes and Accuracy
Normal Mode
Normal emulation mode provides a good balance between accuracy and performance:
- Suitable for most games and general use
- Faster performance on lower-end hardware
- Minor timing inaccuracies may occur in some edge cases
- Recommended for casual gameplay
Accurate Mode
Accurate emulation mode provides maximum accuracy:
- 100% cycle-accurate timing for all operations
- Perfect for speedruns and professional testing
- May have slightly higher CPU usage
- Recommended for accuracy-critical applications
Save Type Detection
mGBA automatically detects the save type used by each game:
- EEPROM: Electrically Erasable Programmable Read-Only Memory (32KB or 64KB)
- Flash: Flash memory (64KB or 128KB)
- SRAM: Static Random-Access Memory (32KB)
- Automatic Detection: mGBA detects the correct save type automatically
- Manual Override: You can manually specify save type if detection fails
Game Boy and Game Boy Color Support
mGBA also supports Game Boy and Game Boy Color games through the same core emulation:
- Game Boy: Original Game Boy games (.gb format)
- Game Boy Color: Game Boy Color games (.gbc format)
- Backward Compatibility: GBA games that include GB/GBC modes
- Same Features: All mGBA features work with GB/GBC games
- Save States: Save states and battery saves supported
Screen Filters and Shaders
Available Filters
mGBA includes various screen filters to enhance or recreate the original Game Boy Advance experience:
- LCD Filter: Mimics the LCD screen appearance with pixel grid and color bleeding
- LCD Ghosting: Adds LCD ghosting effects for authentic appearance
- Scanlines: Adds scanline effects for retro CRT-style appearance
- Pixel Perfect: Nearest neighbor scaling for pixel-perfect rendering
- Bilinear: Smooth bilinear filtering for scaled graphics
- Custom Shaders: Support for custom GLSL shaders for advanced effects
Shader Configuration
Custom shaders can be loaded from files and configured through the video settings menu. Shaders are written in GLSL (OpenGL Shading Language) and allow for advanced visual effects.
Hotkeys and Shortcuts
Complete list of keyboard shortcuts in mGBA:
- F1-F10: Quick save state (save to slots 1-10)
- Shift+F1-F10: Quick load state (load from slots 1-10)
- Tab: Hold to fast forward
- Ctrl+R: Reset emulator
- Ctrl+P: Pause/resume emulation
- Ctrl+S: Take screenshot
- Ctrl+R: Reset game
- Ctrl+Q: Quit emulator (Linux/macOS)
- Alt+Enter: Toggle fullscreen
- Ctrl+,: Open settings menu
File Management
ROM File Organization
Best practices for organizing ROM files:
- Keep ROM files in a dedicated directory
- Use descriptive file names for easy identification
- Organize by series or genre for easier navigation
- Keep ROMs in .gba format for best compatibility
- Backup ROM files to prevent data loss
Save File Management
Managing save files and save states:
- Save states are stored in the save directory (configurable)
- Battery saves are typically in the same directory as ROM files
- Export save states for backup or sharing
- Import save states from other devices or backups
- Regular backups recommended for important save data
Network and Multiplayer
Link Cable Emulation Setup
Detailed steps for setting up multiplayer:
- Launch mGBA on all devices/computers that will participate
- On each instance, go to Tools → Link Cable
- Configure connection type (Local Network or Internet)
- Set one instance as server and others as clients
- Load the same game ROM in all instances
- Start the multiplayer feature in-game (e.g., Pokémon trading)
Network Requirements
- Local Network: All devices must be on the same local network
- Internet: Requires port forwarding or VPN for internet play
- Firewall: Configure firewall to allow mGBA network connections
- Latency: Low latency recommended for best multiplayer experience
Mobile-Specific Features
Android Features
- Touch Controls: Customizable on-screen controls with haptic feedback
- Gamepad Support: Full support for Bluetooth and USB gamepads
- External Storage: Access ROM files from external storage or cloud storage
- Battery Optimization: Optimized rendering for battery life
- Android TV: Support for Android TV devices with gamepad controls
iOS Features
- Touch Controls: Gesture-based controls optimized for iPhone and iPad
- MFI Gamepad: Full support for Made-for-iPhone gamepads
- Files App Integration: Access ROMs from Files app or cloud storage
- Metal Rendering: Native Metal graphics for optimal performance
- iPad Optimization: Optimized UI and controls for iPad screens
Advanced Configuration Files
Configuration File Locations
mGBA stores configuration in platform-specific locations:
- Windows: %APPDATA%\mGBA\config.ini
- macOS: ~/Library/Application Support/mGBA/config.ini
- Linux: ~/.config/mgba/config.ini
- Android: /data/data/com.github.mgba_emulator.mgba/
- iOS: App's Documents directory
Configuration Options
Key configuration settings available in config.ini:
- Video Settings: Resolution, scaling, filtering, rendering backend
- Audio Settings: Sample rate, buffer size, volume
- Input Settings: Keyboard and gamepad mappings
- Emulation Settings: Accuracy mode, BIOS usage, save detection
- Path Settings: ROM directory, save directory, screenshot directory
Debugging and Testing
Debug Features
mGBA includes debugging features for development and testing:
- Logging: Detailed logging of emulation operations
- Memory Inspection: View and modify memory contents
- CPU Register View: Display CPU register states
- Breakpoints: Set breakpoints for debugging
- Frame Advance: Advance emulation frame-by-frame for analysis
Testing Compatibility
For testing game compatibility:
- Use accurate emulation mode for precise testing
- Test with real BIOS for maximum compatibility
- Verify save functionality with battery saves
- Test multiplayer features with link cable emulation
- Check audio and video output accuracy
Performance Monitoring
Built-in Metrics
mGBA provides built-in performance monitoring:
- FPS Counter: Display frames per second
- Frame Time: Monitor frame rendering time
- CPU Usage: Track CPU usage percentage
- Audio Latency: Monitor audio buffer status
Optimization Tips
Tips for optimizing performance:
- Use hardware acceleration when available
- Adjust resolution scaling based on your hardware
- Enable frame skipping if maintaining 60 FPS is difficult
- Reduce audio buffer size if latency is acceptable
- Close unnecessary background applications
- Update graphics drivers to latest version
Compatibility Testing
mGBA has been extensively tested with hundreds of commercial Game Boy Advance games:
- Compatibility Database: Over 2000+ games tested and verified
- Popular Titles: All major game series have 100% compatibility
- Edge Cases: Many edge cases and uncommon games tested
- Continuous Testing: Regular testing with new builds and game releases
Security and Privacy
mGBA takes security and privacy seriously:
- No Data Collection: mGBA does not collect or transmit any user data
- Offline Operation: Works completely offline (except optional network multiplayer)
- Open Source: Source code is open for security auditing
- Secure Downloads: Always download from official sources (mgba.net or GitHub)
- ROM Safety: Only use ROMs you legally own
Additional Resources
Official Documentation
- API Reference: Complete Lua scripting API documentation
- Configuration Guide: Detailed configuration options documentation
- Troubleshooting Guide: Solutions to common problems
- Developer Resources: Building, contributing, and architecture documentation
Community Resources
- GitHub Discussions: Community discussions and Q&A
- Issue Tracker: Bug reports and feature requests
- Wiki: Community-maintained wiki with additional information
- Forum: Community forums for discussions (if available)
Version Information
Current documentation applies to mGBA version 0.10.0. This documentation is regularly updated to reflect the latest features and changes. For information about specific versions:
- Check the GitHub Releases page for version history
- See the CHANGELOG file in the repository for detailed change logs
- Check the Help → About menu in mGBA for version information
结论
本文档提供了使用 mGBA 模拟器的综合指南。无论您是普通用户、速通玩家、开发者还是研究人员,mGBA 都提供了 Game Boy Advance 模拟所需的功能和精度。
相关文章
有关更具体的信息,请探索这些详细的指南和参考资料:
- 入门指南 - 所有平台的详细安装和设置说明
- Lua 脚本 API 参考 - 完整的 Lua 脚本 API 参考,包含示例和函数文档
- 配置 API 参考 - 编程配置选项和设置管理
- 高级配置指南 - 深入了解高级设置、精度选项和优化技术
- 性能调优指南 - 为您的硬件配置优化模拟性能
- 故障排除指南 - 常见问题和故障的解决方案,包含详细步骤
- 从源码构建 - 在不同平台上从源代码编译 mGBA 的完整指南
- 贡献给 mGBA - 贡献代码、错误报告和文档改进的指南
- 架构概述 - 了解 mGBA 的代码库结构、组件和设计原则