Keep magic number for last line
This commit is contained in:
parent
d782658bc0
commit
a3e88aa0fb
1 changed files with 4 additions and 3 deletions
7
main.c
7
main.c
|
@ -43,8 +43,6 @@
|
||||||
#define ZX_CHAR_TOKEN(c) \
|
#define ZX_CHAR_TOKEN(c) \
|
||||||
(ZX_CHAR_TOKEN_LOW(c) || ZX_CHAR_TOKEN_HIGH(c))
|
(ZX_CHAR_TOKEN_LOW(c) || ZX_CHAR_TOKEN_HIGH(c))
|
||||||
|
|
||||||
#define ZX_BASIC_STATE_SIZE 116
|
|
||||||
|
|
||||||
#define ZX_CHAR_TOKEN_INTEGRAL(c) \
|
#define ZX_CHAR_TOKEN_INTEGRAL(c) \
|
||||||
(c == 0x0e)
|
(c == 0x0e)
|
||||||
|
|
||||||
|
@ -55,6 +53,9 @@ typedef struct _zx_basic_line {
|
||||||
uint16_t num, len;
|
uint16_t num, len;
|
||||||
} zx_basic_line;
|
} zx_basic_line;
|
||||||
|
|
||||||
|
#define ZX_BASIC_STATE_SIZE 116
|
||||||
|
#define ZX_BASIC_LINE_LAST 0x7676
|
||||||
|
|
||||||
static uint32_t zx_charset[ZX_DUMP_CHARSET_LEN] = {
|
static uint32_t zx_charset[ZX_DUMP_CHARSET_LEN] = {
|
||||||
0x0020, 0x2598, 0x259d, 0x2580, 0x2596, 0x258c, 0x259e, 0x259b,
|
0x0020, 0x2598, 0x259d, 0x2580, 0x2596, 0x258c, 0x259e, 0x259b,
|
||||||
0x2592, '.', '.', '"', 0x00a3, '$', ':', '?',
|
0x2592, '.', '.', '"', 0x00a3, '$', ':', '?',
|
||||||
|
@ -281,7 +282,7 @@ static ssize_t zx_dump_basic(int fd) {
|
||||||
|
|
||||||
len = le16toh(line.len);
|
len = le16toh(line.len);
|
||||||
|
|
||||||
if (be16toh(line.num) == len) {
|
if (be16toh(line.num) == len && len == ZX_BASIC_LINE_LAST) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue