summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/formats/kc_cas.cpp
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-10-22 13:13:17 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-10-22 13:13:17 +0200
commitddb290d5f615019c33c42b8d94e5a5254cabcf33 (patch)
treea70f688b0df3acd19da7b1151e5902e3c6af3fa5 /src/lib/formats/kc_cas.cpp
parent333bff8de64dfaeb98134000412796b4fdef970b (diff)
NOTICE (TYPE NAME CONSOLIDATION)
Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
Diffstat (limited to 'src/lib/formats/kc_cas.cpp')
-rw-r--r--src/lib/formats/kc_cas.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/lib/formats/kc_cas.cpp b/src/lib/formats/kc_cas.cpp
index 2e9638d19c9..713def9ac83 100644
--- a/src/lib/formats/kc_cas.cpp
+++ b/src/lib/formats/kc_cas.cpp
@@ -43,7 +43,7 @@ static int kc_image_size;
/*******************************************************************
Generate one high-low cycle of sample data
********************************************************************/
-static inline int kc_cas_cycle(INT16 *buffer, int sample_pos, int len)
+static inline int kc_cas_cycle(int16_t *buffer, int sample_pos, int len)
{
int num_samples = KC_WAV_FREQUENCY / (len * 2);
@@ -63,7 +63,7 @@ static inline int kc_cas_cycle(INT16 *buffer, int sample_pos, int len)
/*******************************************************************
Generate n samples of silence
********************************************************************/
-static inline int kc_cas_silence(INT16 *buffer, int sample_pos, int len)
+static inline int kc_cas_silence(int16_t *buffer, int sample_pos, int len)
{
int i = 0;
@@ -78,7 +78,7 @@ static inline int kc_cas_silence(INT16 *buffer, int sample_pos, int len)
/*******************************************************************
Generate samples for 1 byte
********************************************************************/
-static inline int kc_cas_byte(INT16 *buffer, int sample_pos, UINT8 data)
+static inline int kc_cas_byte(int16_t *buffer, int sample_pos, uint8_t data)
{
int samples = 0;
@@ -103,7 +103,7 @@ static inline int kc_cas_byte(INT16 *buffer, int sample_pos, UINT8 data)
return samples;
}
-static int kc_handle_cass(INT16 *buffer, const UINT8 *casdata, int type)
+static int kc_handle_cass(int16_t *buffer, const uint8_t *casdata, int type)
{
int data_pos = (type == KC_IMAGE_KCC || type == KC_IMAGE_KCM) ? 0 : 16;
int sample_count = 0;
@@ -119,7 +119,7 @@ static int kc_handle_cass(INT16 *buffer, const UINT8 *casdata, int type)
// on the entire file
while( data_pos < kc_image_size )
{
- UINT8 checksum = 0;
+ uint8_t checksum = 0;
// 200 cycles of BIT_1 every block
for (int i=0; i<200; i++)
@@ -142,7 +142,7 @@ static int kc_handle_cass(INT16 *buffer, const UINT8 *casdata, int type)
// write the 128 bytes of the block
for (int i=0; i<128; i++)
{
- UINT8 data = 0;
+ uint8_t data = 0;
if (data_pos < kc_image_size)
data = casdata[data_pos++];
@@ -184,13 +184,13 @@ static int kc_handle_cass(INT16 *buffer, const UINT8 *casdata, int type)
}
-static int kc_handle_kcc(INT16 *buffer, const UINT8 *casdata)
+static int kc_handle_kcc(int16_t *buffer, const uint8_t *casdata)
{
return kc_handle_cass(buffer, casdata, KC_IMAGE_KCC);
}
-static int kc_handle_tap(INT16 *buffer, const UINT8 *casdata)
+static int kc_handle_tap(int16_t *buffer, const uint8_t *casdata)
{
if (!strncmp((const char *)(casdata + 1), "KC-TAPE by AF", 13))
{
@@ -210,9 +210,9 @@ static int kc_handle_tap(INT16 *buffer, const UINT8 *casdata)
}
}
-static int kc_handle_sss(INT16 *buffer, const UINT8 *casdata)
+static int kc_handle_sss(int16_t *buffer, const uint8_t *casdata)
{
- std::vector<UINT8> sss(kc_image_size + 11);
+ std::vector<uint8_t> sss(kc_image_size + 11);
// tries to generate the missing head
memset(&sss[0], 0xd3, 3);
@@ -232,7 +232,7 @@ static int kc_handle_sss(INT16 *buffer, const UINT8 *casdata)
/*******************************************************************
Generate samples for the tape image
********************************************************************/
-static int kc_kcc_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes)
+static int kc_kcc_fill_wave(int16_t *buffer, int sample_count, uint8_t *bytes)
{
return kc_handle_kcc(buffer, bytes);
}
@@ -241,7 +241,7 @@ static int kc_kcc_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes)
/*******************************************************************
Calculate the number of samples needed for this tape image classical
********************************************************************/
-static int kc_kcc_to_wav_size(const UINT8 *casdata, int caslen)
+static int kc_kcc_to_wav_size(const uint8_t *casdata, int caslen)
{
kc_image_size = caslen ;
@@ -284,7 +284,7 @@ static const struct CassetteFormat kc_kcc_format =
/*******************************************************************
Generate samples for the tape image
********************************************************************/
-static int kc_tap_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes)
+static int kc_tap_fill_wave(int16_t *buffer, int sample_count, uint8_t *bytes)
{
return kc_handle_tap(buffer, bytes);
}
@@ -293,7 +293,7 @@ static int kc_tap_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes)
/*******************************************************************
Calculate the number of samples needed for this tape image classical
********************************************************************/
-static int kc_tap_to_wav_size(const UINT8 *casdata, int caslen)
+static int kc_tap_to_wav_size(const uint8_t *casdata, int caslen)
{
kc_image_size = caslen ;
@@ -336,7 +336,7 @@ static const struct CassetteFormat kc_tap_format =
/*******************************************************************
Generate samples for the tape image
********************************************************************/
-static int kc_sss_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes)
+static int kc_sss_fill_wave(int16_t *buffer, int sample_count, uint8_t *bytes)
{
return kc_handle_sss(buffer, bytes);
}
@@ -345,7 +345,7 @@ static int kc_sss_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes)
/*******************************************************************
Calculate the number of samples needed for this tape image classical
********************************************************************/
-static int kc_sss_to_wav_size(const UINT8 *casdata, int caslen)
+static int kc_sss_to_wav_size(const uint8_t *casdata, int caslen)
{
kc_image_size = caslen ;