summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/formats/os9_dsk.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/os9_dsk.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/os9_dsk.cpp')
-rw-r--r--src/lib/formats/os9_dsk.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/formats/os9_dsk.cpp b/src/lib/formats/os9_dsk.cpp
index 67ae74e5884..232f40e89f0 100644
--- a/src/lib/formats/os9_dsk.cpp
+++ b/src/lib/formats/os9_dsk.cpp
@@ -49,6 +49,7 @@
#include "coretmpl.h" // BIT
#include "ioprocs.h"
+#include "multibyte.h"
os9_format::os9_format() : wd177x_format(formats)
@@ -90,9 +91,9 @@ int os9_format::find_size(util::random_read &io, uint32_t form_factor, const std
size_t actual;
io.read_at(0, os9_header, sizeof(os9_header), actual);
- int os9_total_sectors = pick_integer_be(os9_header, 0x00, 3);
+ int os9_total_sectors = get_u24be(&os9_header[0x00]);
int os9_heads = util::BIT(os9_header[0x10], 0) ? 2 : 1;
- int os9_sectors = pick_integer_be(os9_header, 0x11, 2);
+ int os9_sectors = get_u16be(&os9_header[0x11]);
if (os9_total_sectors <= 0 || os9_heads <= 0 || os9_sectors <= 0)
return -1;
@@ -103,10 +104,10 @@ int os9_format::find_size(util::random_read &io, uint32_t form_factor, const std
int opt_dtype = os9_header[0x3f + 0];
int opt_type = os9_header[0x3f + 3];
int opt_density = os9_header[0x3f + 4];
- int opt_cylinders = pick_integer_be(os9_header, 0x3f + 5, 2);
+ int opt_cylinders = get_u16be(&os9_header[0x3f + 5]);
int opt_sides = os9_header[0x3f + 7];
- int opt_sectors_per_track = pick_integer_be(os9_header, 0x3f + 9, 2);
- int opt_track0_sectors = pick_integer_be(os9_header, 0x3f + 11, 2);
+ int opt_sectors_per_track = get_u16be(&os9_header[0x3f + 9]);
+ int opt_track0_sectors = get_u16be(&os9_header[0x3f + 11]);
int opt_interleave = os9_header[0x3f + 13];
int opt_mfm = util::BIT(opt_density, 0);