summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/formats/cbm_crt.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2023-09-17 09:41:35 -0400
committer AJR <ajrhacker@users.noreply.github.com>2023-09-17 09:43:06 -0400
commit676e44ca955121808828ddc7a8a024dc721f682c (patch)
tree64ca682d6e9dc0a752339f39f1900cc3b3c50fdb /src/lib/formats/cbm_crt.cpp
parent2f7b1f05c72e568032930e7ceba2db0b4cb63e1a (diff)
imageutl.h: Retire pick_integer_[bl]e and place_integer_[bl]e in favor of the simpler functions in multibyte.h
* multibyte.h: Add constexpr for getters and noexcept for all functions
Diffstat (limited to 'src/lib/formats/cbm_crt.cpp')
-rw-r--r--src/lib/formats/cbm_crt.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lib/formats/cbm_crt.cpp b/src/lib/formats/cbm_crt.cpp
index 2aca7688711..b088507208f 100644
--- a/src/lib/formats/cbm_crt.cpp
+++ b/src/lib/formats/cbm_crt.cpp
@@ -42,6 +42,7 @@
#include "cbm_crt.h"
#include "corefile.h"
+#include "multibyte.h"
#include "osdcore.h" // osd_printf_*
@@ -141,7 +142,7 @@ std::string cbm_crt_get_card(util::core_file &file)
if (!err && (CRT_HEADER_LENGTH == actual) && !memcmp(header.signature, CRT_SIGNATURE, 16))
{
- uint16_t hardware = pick_integer_be(header.hardware, 0, 2);
+ uint16_t hardware = get_u16be(header.hardware);
return std::string(CRT_C64_SLOT_NAMES[hardware]);
}
@@ -166,7 +167,7 @@ bool cbm_crt_read_header(util::core_file &file, size_t *roml_size, size_t *romh_
if ((CRT_HEADER_LENGTH != actual) || (memcmp(header.signature, CRT_SIGNATURE, 16) != 0))
return false;
- uint16_t hardware = pick_integer_be(header.hardware, 0, 2);
+ uint16_t hardware = get_u16be(header.hardware);
*exrom = header.exrom;
*game = header.game;
@@ -186,9 +187,9 @@ bool cbm_crt_read_header(util::core_file &file, size_t *roml_size, size_t *romh_
if (file.read(&chip, CRT_CHIP_LENGTH, actual) || (CRT_CHIP_LENGTH != actual))
return false;
- const uint16_t address = pick_integer_be(chip.start_address, 0, 2);
- const uint16_t size = pick_integer_be(chip.image_size, 0, 2);
- const uint16_t type = pick_integer_be(chip.chip_type, 0, 2);
+ const uint16_t address = get_u16be(chip.start_address);
+ const uint16_t size = get_u16be(chip.image_size);
+ const uint16_t type = get_u16be(chip.chip_type);
if (LOG)
{
@@ -233,8 +234,8 @@ bool cbm_crt_read_data(util::core_file &file, uint8_t *roml, uint8_t *romh)
if (file.read(&chip, CRT_CHIP_LENGTH, actual) || (CRT_CHIP_LENGTH != actual))
return false;
- const uint16_t address = pick_integer_be(chip.start_address, 0, 2);
- const uint16_t size = pick_integer_be(chip.image_size, 0, 2);
+ const uint16_t address = get_u16be(chip.start_address);
+ const uint16_t size = get_u16be(chip.image_size);
std::error_condition err;
switch (address)