diff options
Diffstat (limited to 'src/lib/formats/camplynx_cas.c')
-rw-r--r-- | src/lib/formats/camplynx_cas.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/formats/camplynx_cas.c b/src/lib/formats/camplynx_cas.c index 8c467314e5a..02133da4da4 100644 --- a/src/lib/formats/camplynx_cas.c +++ b/src/lib/formats/camplynx_cas.c @@ -23,7 +23,7 @@ Each byte is 8 bits (MSB first) with no start or stop bits. ********************************************************************/ -#include <assert.h> +#include "emu.h" // for popmessage and <string> #include "camplynx_cas.h" @@ -84,13 +84,13 @@ static int camplynx_handle_cassette(INT16 *buffer, const UINT8 *bytes) UINT32 byte_count = 0; UINT32 i; - /* header zeroes */ for (i=0; i<555; i++) sample_count += camplynx_output_byte(buffer, sample_count, 0); if (bytes[0] == 0x22) { + std::string pgmname = " LOAD \""; byte_count++; sample_count += camplynx_output_byte(buffer, sample_count, 0xA5); sample_count += camplynx_output_byte(buffer, sample_count, 0x22); @@ -99,14 +99,25 @@ static int camplynx_handle_cassette(INT16 *buffer, const UINT8 *bytes) for (i=1; bytes[i]!=0x22; i++) { if (i < camplynx_image_size) + { sample_count += camplynx_output_byte(buffer, sample_count, bytes[i]); + pgmname.append(1, (char)bytes[i]); + } else return sample_count; byte_count++; } + pgmname.append(1, (char)0x22); sample_count += camplynx_output_byte(buffer, sample_count, bytes[byte_count++]); // should be 0x22 + // if a machine-language program, say to use MLOAD + if (bytes[byte_count] == 0x4D) + pgmname[0] = (char)0x4D; + + // Tell user how to load the tape + popmessage("%s",pgmname.c_str()); + /* data zeroes */ for (i=0; i<555; i++) sample_count += camplynx_output_byte(buffer, sample_count, 0); |