summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXANTRONIX Development2023-09-12 11:47:15 -0400
committerXANTRONIX Development2023-09-12 11:47:15 -0400
commita3e88aa0fb01db4bf986545f833e220bf8647036 (patch)
treea29e8ec19aab25446be7570c8c18b33d0fd24fc2
parentd782658bc0a970ad7ec8965057df93e85d74332c (diff)
downloadzxdump-a3e88aa0fb01db4bf986545f833e220bf8647036.tar.gz
zxdump-a3e88aa0fb01db4bf986545f833e220bf8647036.tar.bz2
zxdump-a3e88aa0fb01db4bf986545f833e220bf8647036.zip
Keep magic number for last line
-rw-r--r--main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/main.c b/main.c
index 2563a55..0a49f75 100644
--- a/main.c
+++ b/main.c
@@ -43,8 +43,6 @@
#define ZX_CHAR_TOKEN(c) \
(ZX_CHAR_TOKEN_LOW(c) || ZX_CHAR_TOKEN_HIGH(c))
-#define ZX_BASIC_STATE_SIZE 116
-
#define ZX_CHAR_TOKEN_INTEGRAL(c) \
(c == 0x0e)
@@ -55,6 +53,9 @@ typedef struct _zx_basic_line {
uint16_t num, len;
} zx_basic_line;
+#define ZX_BASIC_STATE_SIZE 116
+#define ZX_BASIC_LINE_LAST 0x7676
+
static uint32_t zx_charset[ZX_DUMP_CHARSET_LEN] = {
0x0020, 0x2598, 0x259d, 0x2580, 0x2596, 0x258c, 0x259e, 0x259b,
0x2592, '.', '.', '"', 0x00a3, '$', ':', '?',
@@ -281,7 +282,7 @@ static ssize_t zx_dump_basic(int fd) {
len = le16toh(line.len);
- if (be16toh(line.num) == len) {
+ if (be16toh(line.num) == len && len == ZX_BASIC_LINE_LAST) {
break;
}