summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/formats/cbm_tap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/formats/cbm_tap.cpp')
-rw-r--r--src/lib/formats/cbm_tap.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/formats/cbm_tap.cpp b/src/lib/formats/cbm_tap.cpp
index 9ae77bffb7d..743ad4282d2 100644
--- a/src/lib/formats/cbm_tap.cpp
+++ b/src/lib/formats/cbm_tap.cpp
@@ -97,6 +97,8 @@ below could be not working. FP ]
#include "cbm_tap.h"
#include "imageutl.h"
+#include "multibyte.h"
+
#define CBM_WAV_FREQUENCY 44100
@@ -136,7 +138,7 @@ static int len;
/* This in fact gives the number of samples for half of the pulse */
static inline int tap_data_to_samplecount(int data, int frequency)
{
-// return (int) (0.5 * (0.5 + (((double)CBM_WAV_FREQUENCY / frequency) * (double)data))); // MESS TZX formula
+// return (int) (0.5 * (0.5 + (((double)CBM_WAV_FREQUENCY / frequency) * (double)data))); // MAME TZX formula
return (int) (0.5 * (((double)CBM_WAV_FREQUENCY / frequency) * (double)((data) + 0.5))); // tap2wav formula
}
@@ -281,7 +283,7 @@ static int cbm_tap_do_work( int16_t **buffer, int length, const uint8_t *data )
if (j >= 4)
{
- over_pulse_length = ((over_pulse_bytes[2] << 16) | (over_pulse_bytes[1] << 8) | over_pulse_bytes[0]) >> 3;
+ over_pulse_length = get_u24le(over_pulse_bytes) >> 3;
byte_samples = tap_data_to_samplecount(over_pulse_length, tap_frequency);
/* waveamp_high = WAVE_PAUSE; */
j = 0;