Added some default constructors to rom_entry(), and made it so changes to flags are done through a set_flags() accessor method

This commit is contained in:
Nathan Woods 2016-08-01 08:48:23 -04:00
parent ee302246c9
commit 7384598c25
2 changed files with 6 additions and 2 deletions

View File

@ -132,6 +132,10 @@ public:
, m_offset(offset)
, m_length(length)
, m_flags(flags) {}
rom_entry(rom_entry const &) = default;
rom_entry(rom_entry &&) = default;
rom_entry &operator=(rom_entry const &) = default;
rom_entry &operator=(rom_entry &&) = default;
// accessors
const std::string &name() const { return m_name; }
@ -139,7 +143,7 @@ public:
UINT32 offset() const { return m_offset; }
UINT32 length() const { return m_length; }
UINT32 flags() const { return m_flags; }
UINT32 &flags() { return m_flags; }
void set_flags(UINT32 flags) { m_flags = flags; }
private:
std::string m_name;

View File

@ -914,7 +914,7 @@ void rom_load_manager::process_rom_entries(const char *regiontag, const rom_entr
if (!ROM_INHERITSFLAGS(&modified_romp))
lastflags = modified_romp.flags();
else
modified_romp.flags() = (modified_romp.flags() & ~ROM_INHERITEDFLAGS) | lastflags;
modified_romp.set_flags((modified_romp.flags() & ~ROM_INHERITEDFLAGS) | lastflags);
explength += ROM_GETLENGTH(&modified_romp);