Skip to content

Commit

Permalink
Changed output of 8-bit characters (TECO-32 compatibility).
Browse files Browse the repository at this point in the history
Removed 8-bit characters embedded in test scripts.
  • Loading branch information
Franklin Pierce Johnston committed Oct 28, 2021
1 parent 6e7915f commit a4c4a57
Show file tree
Hide file tree
Showing 19 changed files with 241 additions and 200 deletions.
52 changes: 46 additions & 6 deletions src/term_out.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,12 +460,52 @@ void type_out(int c)
break;
}
}
else if (f.et.eightbit) // Can terminal display it?
else // Must be 8-bit character
{
tputc(c, false);
}
else // No, make it printable
{
tprint("%s", table_8bit[c & 0x7f]);
// This table is used to ensure we print 8-bit characters like TECO-32.

static const char convert_table[] =
{
// 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
// 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
// A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1,
// B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0,
// C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
// E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
};

// If the entry in the table above for the 8-bit character we want to
// output is non-zero, then that means we will print it in the form
// specified in table_8bit[].

bool convert_chr = convert_table[c & 0x7f] ? true : false;

#if !defined(__DECC)

// For any non-VMS environment, we will additionally use the ET flag to
// determine whether to do any special output.

convert_chr = convert_chr || !f.et.eightbit;

#endif

if (convert_chr)
{
tprint("%s", table_8bit[c & 0x7f]);
}
else
{
tputc(c, false);
}
}
}
76 changes: 38 additions & 38 deletions tests/benchmarks/FC_01.lis
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
Jabberwocky
by Lewis Carroll
Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.
Beware the Fluffy, my son!
The jaws that bite, the claws that catch!
Beware the Jubjub bird, and shun
The frumious Snorklesnatch!
He took his mickle sword in hand;
Long time the turtle foe he sought
So rested he by the Tumtum tree
And stood awhile in thought.
And, as in uffish thought he stood,
The Jabberwock, with eyes of flame,
Came toodling through the tulgey wood,
And burbled as it came!
One, two! One, two! And through and through
The vorpal blade went snicker-snack!
He left it dead, and with its head
He went galumphing back.
And hast thou slain the Jabberwock?
Come to my arms, my beamish boy!
O frabjous day! Callooh! Callay!
He chortled in his joy.
Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.
!PASS!
Jabberwocky
by Lewis Carroll

'Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.

"Beware the Fluffy, my son!
The jaws that bite, the claws that catch!
Beware the Jubjub bird, and shun
The frumious Snorklesnatch!"

He took his mickle sword in hand;
Long time the turtle foe he sought --
So rested he by the Tumtum tree
And stood awhile in thought.

And, as in uffish thought he stood,
The Jabberwock, with eyes of flame,
Came toodling through the tulgey wood,
And burbled as it came!

One, two! One, two! And through and through
The vorpal blade went snicker-snack!
He left it dead, and with its head
He went galumphing back.

"And hast thou slain the Jabberwock?
Come to my arms, my beamish boy!
O frabjous day! Callooh! Callay!"
He chortled in his joy.

'Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.
!PASS!
16 changes: 8 additions & 8 deletions tests/benchmarks/P_03.lis
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Jabberwocky
by Lewis Carroll
Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.
!PASS!
Jabberwocky
by Lewis Carroll

'Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.
!PASS!
16 changes: 8 additions & 8 deletions tests/benchmarks/P_04.lis
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Jabberwocky
by Lewis Carroll
Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.
!PASS!
Jabberwocky
by Lewis Carroll

'Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.
!PASS!
76 changes: 38 additions & 38 deletions tests/benchmarks/T_01.lis
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
Jabberwocky
by Lewis Carroll
Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.
Beware the Jabberwock, my son!
The jaws that bite, the claws that catch!
Beware the Jubjub bird, and shun
The frumious Bandersnatch!
He took his vorpal sword in hand;
Long time the manxome foe he sought
So rested he by the Tumtum tree
And stood awhile in thought.
And, as in uffish thought he stood,
The Jabberwock, with eyes of flame,
Came whiffling through the tulgey wood,
And burbled as it came!
One, two! One, two! And through and through
The vorpal blade went snicker-snack!
He left it dead, and with its head
He went galumphing back.
And hast thou slain the Jabberwock?
Come to my arms, my beamish boy!
O frabjous day! Callooh! Callay!
He chortled in his joy.
Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.
!PASS!
Jabberwocky
by Lewis Carroll

'Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.

"Beware the Jabberwock, my son!
The jaws that bite, the claws that catch!
Beware the Jubjub bird, and shun
The frumious Bandersnatch!"

He took his vorpal sword in hand;
Long time the manxome foe he sought --
So rested he by the Tumtum tree
And stood awhile in thought.

And, as in uffish thought he stood,
The Jabberwock, with eyes of flame,
Came whiffling through the tulgey wood,
And burbled as it came!

One, two! One, two! And through and through
The vorpal blade went snicker-snack!
He left it dead, and with its head
He went galumphing back.

"And hast thou slain the Jabberwock?
Come to my arms, my beamish boy!
O frabjous day! Callooh! Callay!"
He chortled in his joy.

'Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.
!PASS!
57 changes: 29 additions & 28 deletions tests/benchmarks/T_02.lis
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
-----
So rested he by the Tumtum tree
-----
Long time the manxome foe he sought—
-----
Long time the manxome foe he sought—
-----
So rested he by the Tumtum tree
-----
So rested he by the Tumtum tree
And stood awhile in thought.
-----
He took his vorpal sword in hand;
Long time the manxome foe he sought—
-----
So rested he by the
-----
Tumtum tree
-----
Tumtum
-----
y the
-----
One, two! One, two! And through and through
The vorpal blade went snicker-snack!
He left it dead, and with its head
He went galumphing back.
!PASS!
-----
So rested he by the Tumtum tree
-----
Long time the manxome foe he sought --
-----
Long time the manxome foe he sought --
-----
So rested he by the Tumtum tree
-----
So rested he by the Tumtum tree
And stood awhile in thought.
-----
He took his vorpal sword in hand;
Long time the manxome foe he sought --
-----
So rested he by the
-----
Tumtum tree
-----
Tumtum
-----
y the
-----
wo! One, two! And through and through
The vorpal blade went snicker-snack!
He left it dead, and with its head
He went galumphing back.

"And !PASS!
4 changes: 2 additions & 2 deletions tests/benchmarks/_T_02.lis
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
����ﬠ�����
!PASS!
�����[AC][A0]����
!PASS!
18 changes: 9 additions & 9 deletions tests/scripts/FB/FB_01.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
@I/Jabberwocky
by Lewis Carroll

Twas brillig, and the slithy toves
'Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.

Beware the Jabberwock, my son!
"Beware the Jabberwock, my son!
The jaws that bite, the claws that catch!
Beware the Jubjub bird, and shun
The frumious Bandersnatch!
The frumious Bandersnatch!"

He took his vorpal sword in hand;
Long time the manxome foe he sought
Long time the manxome foe he sought --
So rested he by the Tumtum tree
And stood awhile in thought.

Expand All @@ -34,12 +34,12 @@ One, two! One, two! And through and through
He left it dead, and with its head
He went galumphing back.

And hast thou slain the Jabberwock?
"And hast thou slain the Jabberwock?
Come to my arms, my beamish boy!
O frabjous day! Callooh! Callay!
O frabjous day! Callooh! Callay!"
He chortled in his joy.

Twas brillig, and the slithy toves
'Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.
Expand All @@ -63,8 +63,8 @@ All mimsy were the borogoves,

-3:@FB/Bander/ [["U]] ! Test: -nFB !

550,590:@FB/whiffling/ [["U]] ! Test: m,nFB !
544,584:@FB/whiffling/ [["U]] ! Test: m,nFB !

550,590:@FB/burbled/ [["S]] ! Test: m,nFB !
544,584:@FB/burbled/ [["S]] ! Test: m,nFB !

[[exit]]
Loading

0 comments on commit a4c4a57

Please sign in to comment.