mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-27 00:00:07 -06:00
Simplify the SRAM's representation in NDSCartArgs
(#1914)
* Simplify the SRAM's representation in `NDSCartArgs` - I overthought this one. - I could've just checked `args && args->SRAM`, but then some other poor bastard might make this mistake. - Don't mix `pair`, `optional`, and `unique_ptr` all at once, kids. * Fix a `nullptr` read
This commit is contained in:
@ -62,9 +62,14 @@ struct NDSCartArgs
|
||||
std::optional<FATStorageArgs> SDCard = std::nullopt;
|
||||
|
||||
/// Save RAM to load into the cartridge.
|
||||
/// If \c nullopt, then the cart's SRAM buffer will be empty.
|
||||
/// If \c nullptr, then the cart's SRAM buffer will be empty.
|
||||
/// Ignored for homebrew ROMs.
|
||||
std::optional<std::pair<std::unique_ptr<u8[]>, u32>> SRAM = std::nullopt;
|
||||
std::unique_ptr<u8[]> SRAM = nullptr;
|
||||
|
||||
/// The length of the buffer in SRAM.
|
||||
/// If 0, then the cart's SRAM buffer will be empty.
|
||||
/// Ignored for homebrew ROMs.
|
||||
u32 SRAMLength = 0;
|
||||
};
|
||||
|
||||
// CartCommon -- base code shared by all cart types
|
||||
|
Reference in New Issue
Block a user