From 16ed4aae36d7380529ec2de37e02c310a2d68175 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Sun, 31 May 2015 14:11:06 +1000 Subject: [PATCH] camplynx: added a popmessage to tell user how to load the tape. --- src/lib/formats/camplynx_cas.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/lib/formats/camplynx_cas.c b/src/lib/formats/camplynx_cas.c index 8c467314e5a..4f53dbdd867 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 +#include "emu.h" // for popmessage and #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, bytes[i]); + } else return sample_count; byte_count++; } + pgmname.append(1, 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] = 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);