aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-06-29 23:17:52 -0400
committerB. Watson <urchlay@slackware.uk>2024-06-29 23:18:02 -0400
commit674f19a6a9b44f74724a6c26f655be02dd8d39b8 (patch)
tree210399c6362d6958a4466695d64f7701fc6199c6
parent5a69998e3d97ef78fcc9fd105a9d47bfa5fecee7 (diff)
downloadbw-atari8-tools-674f19a6a9b44f74724a6c26f655be02dd8d39b8.tar.gz
a8xd: show hex values >=0x80 in inverse, with -m; tweak doc.
-rw-r--r--a8xd.17
-rw-r--r--a8xd.c6
-rw-r--r--a8xd.rst5
3 files changed, 10 insertions, 8 deletions
diff --git a/a8xd.1 b/a8xd.1
index 246dfbd..6e2f322 100644
--- a/a8xd.1
+++ b/a8xd.1
@@ -134,10 +134,11 @@ missing are:
\fB\-cols\fP (\fBa8xd\fP only supports 16 column dumps).
.IP \(bu 2
\fB\-b\fP (bits mode).
+.IP \(bu 2
+support for files larger than 2GB. This won\(aqt be a problem for Atari 8\-bit\-related files!
+.IP \(bu 2
+replacing duplicate lines in the output with \fB*\fP\&.
.UNINDENT
-.sp
-Another difference is that \fBa8xd\fP doesn\(aqt support files larger than
-2GB. This won\(aqt be a problem for Atari 8\-bit\-related files!
.SH COPYRIGHT
.sp
WTFPL. See \fI\%http://www.wtfpl.net/txt/copying/\fP for details.
diff --git a/a8xd.c b/a8xd.c
index e08e260..625152f 100644
--- a/a8xd.c
+++ b/a8xd.c
@@ -120,7 +120,6 @@ char *get_color(unsigned char c) {
if(color) {
sprintf(outbuf, "\x1b[0;3%dm", color);
- if(c & 0x80) strcat(outbuf, inverse_on);
} else {
outbuf[0] = '\0';
}
@@ -178,13 +177,14 @@ void dump_line(const unsigned char *buf, int len) {
while(len) {
if(color) hpos += sprintf(hex + hpos, "%s", get_color(*buf));
+ if(*buf & 0x80) hpos += sprintf(hex + hpos, "%s", inverse_on);
hpos += sprintf(hex + hpos, byte_format, *buf);
- if(color) hpos += sprintf(hex + hpos, "%s", color_off);
+ if(color || *buf & 0x80) hpos += sprintf(hex + hpos, "%s", color_off);
hex[hpos++] = ' ';
if(count - len == 7) hex[hpos++] = ' ';
- if(*buf & 0x80) apos += sprintf(asc + apos, "%s", inverse_on);
if(color) apos += sprintf(asc + apos, "%s", get_color(*buf));
+ if(*buf & 0x80) apos += sprintf(asc + apos, "%s", inverse_on);
apos += sprintf(asc + apos, "%s", table[*buf & 0x7f]);
if(color || *buf & 0x80) apos += sprintf(asc + apos, "%s", color_off);
diff --git a/a8xd.rst b/a8xd.rst
index 75a086a..ec8868d 100644
--- a/a8xd.rst
+++ b/a8xd.rst
@@ -101,7 +101,8 @@ missing are:
- **-b** (bits mode).
-Another difference is that **a8xd** doesn't support files larger than
-2GB. This won't be a problem for Atari 8-bit-related files!
+- support for files larger than 2GB. This won't be a problem for Atari 8-bit-related files!
+
+- replacing duplicate lines in the output with **\***.
.. include:: manftr.rst