1+ // //////////////////////////////////////////////////////////////////////////////
2+ // Copyright 2015 by Joseph Forgione
3+ // This file is part of VCC (Virtual Color Computer).
4+ //
5+ // VCC (Virtual Color Computer) is free software: you can redistribute itand/or
6+ // modify it under the terms of the GNU General Public License as published by
7+ // the Free Software Foundation, either version 3 of the License, or (at your
8+ // option) any later version.
9+ //
10+ // VCC (Virtual Color Computer) is distributed in the hope that it will be
11+ // useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
13+ // Public License for more details.
14+ //
15+ // You should have received a copy of the GNU General Public License along with
16+ // VCC (Virtual Color Computer). If not, see <http://www.gnu.org/licenses/>.
17+ // //////////////////////////////////////////////////////////////////////////////
118#pragma once
219#include < vcc/devices/rom/rom_image.h>
320
@@ -12,20 +29,21 @@ namespace vcc::devices::rom
1229 using rom_image_type = ::vcc::devices::rom::rom_image;
1330 using value_type = rom_image_type::value_type;
1431 using size_type = rom_image_type::size_type;
32+ using path_type = std::string;
1533
1634 static const unsigned BankSize = 16384 ; // 8k banks
1735
18- bool empty () const
36+ [[nodiscard]] bool empty () const
1937 {
2038 return rom_image_.empty ();
2139 }
2240
23- std::string filename () const
41+ [[nodiscard]] path_type filename () const
2442 {
2543 return rom_image_.filename ();
2644 }
2745
28- LIBCOMMON_EXPORT bool load (std::string filename);
46+ LIBCOMMON_EXPORT [[nodiscard]] bool load (path_type filename);
2947
3048 void clear ()
3149 {
@@ -39,7 +57,7 @@ namespace vcc::devices::rom
3957 select_bank (0 );
4058 }
4159
42- unsigned char selected_bank () const
60+ [[nodiscard]] unsigned char selected_bank () const
4361 {
4462 return bank_register_;
4563 }
@@ -53,7 +71,7 @@ namespace vcc::devices::rom
5371 }
5472 }
5573
56- value_type read_memory_byte (size_type memory_address) const
74+ [[nodiscard]] value_type read_memory_byte (size_type memory_address) const
5775 {
5876 return rom_image_.read_memory_byte (bank_offset_ + memory_address);
5977 }
0 commit comments