summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/formats/oric_tap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/formats/oric_tap.cpp')
-rw-r--r--src/lib/formats/oric_tap.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/formats/oric_tap.cpp b/src/lib/formats/oric_tap.cpp
index 97cdc8097e0..7f900808f21 100644
--- a/src/lib/formats/oric_tap.cpp
+++ b/src/lib/formats/oric_tap.cpp
@@ -3,6 +3,8 @@
#include "oric_tap.h"
#include "imageutl.h"
+#include "multibyte.h"
+
#define ORIC_WAV_DEBUG 0
#define LOG(x) do { if (ORIC_WAV_DEBUG) printf x; } while (0)
@@ -314,8 +316,8 @@ static int oric_cassette_calculate_size_in_samples(const uint8_t *bytes, int len
oric.cassette_state = ORIC_CASSETTE_WRITE_DATA;
oric.data_count = 0;
- end = (((header[4] & 0x0ff)<<8) | (header[5] & 0x0ff));
- start = (((header[6] & 0x0ff)<<8) | (header[7] & 0x0ff));
+ end = get_u16be(&header[4]);
+ start = get_u16be(&header[6]);
LOG(("start (from header): %02x\n",start));
LOG(("end (from header): %02x\n",end));
oric.data_length = end - start + 1;
@@ -451,8 +453,8 @@ static int oric_cassette_fill_wave(int16_t *buffer, int length, uint8_t *bytes)
oric.cassette_state = ORIC_CASSETTE_WRITE_DATA;
oric.data_count = 0;
- end = (((header[4] & 0x0ff)<<8) | (header[5] & 0x0ff));
- start = (((header[6] & 0x0ff)<<8) | (header[7] & 0x0ff));
+ end = get_u16be(&header[4]);
+ start = get_u16be(&header[6]);
LOG(("start (from header): %02x\n",start));
LOG(("end (from header): %02x\n",end));
oric.data_length = end - start + 1;