Menu ▾ ▴

#306 C64/Commodore mode renders PETSCII in the lowercase/text charset, ignoring the $8E uppercase/graphics shift

2.0
closed
X11
2.0α
1 day ago
4 days ago
No

Summary

In C64 / Commodore screen mode, SyncTERM renders a PETSCII stream using the lowercase/text character set even when the host is in the uppercase/graphics character set -- the C64 power-on default, and in this capture explicitly selected by the host with a $8E control code. SyncTERM appears to stay locked in the lowercase/text charset and never honours the $8E / $0E shift codes.

Visible result:

  • Text meant to be UPPERCASE ($41-$5A) displays as lowercase.
    • Graphic glyphs in the $C1-$DA range display as the letters A-Z instead of C64 graphics, so box/outline artwork is littered with stray capital letters.

Environment

  • SyncTERM 2.0a (Linux, X11), dialing-directory Screen Mode = C64 / Commodore.
    • Host: a C-Net 64 (DS2) BBS. Public example that shows the same banner: fw2.cnetbbs.net:6800.
    • Reference terminal that renders it correctly: RGTerm v1.10 (C64 mode, 40x25).

Steps to reproduce

  1. In SyncTERM, create/edit a dialing-directory entry with Screen Mode = C64 (Commodore).
    1. Connect to a C-Net 64 BBS (e.g. fw2.cnetbbs.net:6800). At the terminal-detect prompt ("PRESS BACKSPACE/DELETE"), SyncTERM's C64 mode sends PETSCII DEL ($14) and the board switches to PETSCII colour/graphics output.
    1. Observe the "C-NET" logo banner.

Expected vs Actual

  • Expected (as RGTerm renders it): "BULLETIN BOARD SYSTEM" in UPPERCASE; the "C-NET" logo is a clean, connected white outline. (See attachment rgterm.png.)
    • Actual (SyncTERM): "bulletin board system" in lowercase; the "C-NET" outline is broken up by stray capital letters (N, O, P, M, L, T, V) where graphics should be. (See attachment syncterm.png.)

Root cause -- byte-level evidence

Raw PETSCII captured from the host (telnet IAC stripped):

  1. The banner opens with 0D 8E 15 93 -- $8E = switch to uppercase/graphics charset, then $93 = clear. There is no $0E (switch to lowercase/text) anywhere in the stream, so the host is unambiguously in uppercase/graphics mode.
    1. "BULLETIN BOARD SYSTEM" arrives as 42 55 4C 4C 45 54 49 4E 20 42 4F 41 52 44 20 53 59 53 54 45 4D. In uppercase/graphics mode these are UPPERCASE "B U L L E T I N ...". SyncTERM shows them lowercase -- i.e. it is using the lowercase/text charset mapping where $41-$5A are lowercase.
    1. The "C-NET" logo uses graphic codes in the $C1-$DA range. In uppercase/graphics mode these are graphic glyphs; in the lowercase/text charset $C1-$DA are the letters A-Z. The exact codes in the capture map one-to-one to the stray letters seen on screen: $CF->O $CD->M $D0->P $CC->L $CE->N (and $D4->T $D6->V). That one-to-one correspondence is the smoking gun: SyncTERM is applying the text-charset $C1-$DA -> A-Z mapping to bytes the host intends as graphics.

Suggested fix

SyncTERM's C64/PETSCII emulation should default to the uppercase/graphics charset on connect (matching real C64 power-on), and honour the $8E (uppercase/graphics) and $0E (lowercase/text) shift codes to switch the active charset, rather than staying locked in the lowercase/text set.

(Distinct from existing ticket #198, which concerns black-bars / window sizing in the X11 backend on C64 BBSes -- not charset selection.)

2 Attachments

Related

Bugs: #306

Discussion

  • Stephen Hurd

    Stephen Hurd - 3 days ago

    Fixed on master in commit bd792c66.

    The PETSCII shift codes changed the font, but the decoder kept using the starting character set. C64 connections now default to uppercase/graphics. On both C64 and C128, $8E selects uppercase/graphics and $0E selects lowercase/text for subsequent bytes. Existing entries with a saved lowercase preference still start in that bank and follow either host shift, so you can keep your current entry.

    I replayed the banner bytes from your report in a headless bitmap test. “BULLETIN BOARD SYSTEM” appeared in uppercase, all seven logo bytes produced graphics, and the two upper corners had the expected white pixels. Thanks for including the raw bytes. They made it possible to reproduce the issue and test the fix.

     
  • Stephen James Hurd

    • status: open --> pending
    • assigned_to: Stephen James Hurd
     
  • Gary McCulloch

    Gary McCulloch - 2 days ago

    Follow-up -- thank you! Your fix (commit bd792c66) gives pixel-perfect native PETSCII in C64 mode; I verified it end to end against the live board and the C-NET logo now renders exactly like RGTerm.

    I've also put your work to use in my telnet gateway, RoFGate (front-ends three C-Net boards). When an ANSI SyncTERM caller selects the C64 board, the gateway now sends your ScreenMode APC (ESC _ SyncTERM:ScreenMode;30 ESC ) to flip the terminal into native PETSCII on the fly, then passes the board's bytes raw -- so a plain ANSI terminal sees the C64 board perfectly with no client-side change. For terminals that don't answer the APC, it falls back to a PETSCII->ANSI/CP437 transcode built from your petsciiu/petsciil Unicode tables (st_codepage.c).

    Really appreciate the quick turnaround, the clean ScreenMode APC design, and the headless bitmap test. Thanks for making this possible.

     
  • Stephen James Hurd

    • status: pending --> closed
     
    • Gary McCulloch

      Gary McCulloch - 23 hours ago

      Because of your work, I have set up ROFGate.  You can find it in my Github under SpitfireTN.  You can call into call.rofbbs.com:23 and view all 3 boards.  The gate uses some of your work and renders Petscii to the caller without changing your terminal preferences.  I am now working on having ROFGate also do the same if you SSH into call@call.rofbbs.com So now only 3 address need to be in the phone book.SSH: call@call.rofbbs.comTelnet: call.rofbbs.com:23Telnet: call.rofbbs.com:6800 with Skypix settings.I may work on adding Skypix to the gate later.Thanks for all your help.Gary T McCullochwww.spitfiretn.comwww.dubbchatt.comwww.rofbbs.com
      -------- Original message --------From: Stephen James Hurd deuce@users.sourceforge.net Date: 11/28/26 11:40 PM (GMT-05:00) To: "[syncterm:tickets]" 306@tickets.syncterm.p.re.sourceforge.net Subject: [syncterm:tickets] #306 C64/Commodore mode renders PETSCII in the lowercase/text charset, ignoring the $8E uppercase/graphics shift
      status: pending --> closed
      Comment:

      That sounds awesome, I didn't even think of that use case for the APC, despite being aware of multi-BBS front-ends. I've got just a few more exciting changes in the pipeline, then I'll be able to move v2.0 into beta and start testing!

      [tickets:#306] C64/Commodore mode renders PETSCII in the lowercase/text charset, ignoring the $8E uppercase/graphics shift
      Status: closed
      Milestone: 2.0
      Labels: petscii c64 commodore charset
      Created: Fri Nov 27, 2026 02:07 AM UTC by Gary McCulloch
      Last Updated: Sun Nov 29, 2026 02:41 AM UTC
      Owner: Stephen James Hurd
      Attachments:

      rgterm.png (sourceforge.net) (49.5 kB; image/png)
      syncterm.png (sourceforge.net) (62.5 kB; image/png)

      Summary
      In C64 / Commodore screen mode, SyncTERM renders a PETSCII stream using the lowercase/text character set even when the host is in the uppercase/graphics character set -- the C64 power-on default, and in this capture explicitly selected by the host with a $8E control code. SyncTERM appears to stay locked in the lowercase/text charset and never honours the $8E / $0E shift codes.
      Visible result:

      Text meant to be UPPERCASE ($41-$5A) displays as lowercase.

      Graphic glyphs in the $C1-$DA range display as the letters A-Z instead of C64 graphics, so box/outline artwork is littered with stray capital letters.

      Environment

      SyncTERM 2.0a (Linux, X11), dialing-directory Screen Mode = C64 / Commodore.

      Host: a C-Net 64 (DS2) BBS. Public example that shows the same banner: fw2.cnetbbs.net:6800.

      Reference terminal that renders it correctly: RGTerm v1.10 (C64 mode, 40x25).

      Steps to reproduce

      In SyncTERM, create/edit a dialing-directory entry with Screen Mode = C64 (Commodore).

      Connect to a C-Net 64 BBS (e.g. fw2.cnetbbs.net:6800). At the terminal-detect prompt ("PRESS BACKSPACE/DELETE"), SyncTERM's C64 mode sends PETSCII DEL ($14) and the board switches to PETSCII colour/graphics output.

      Observe the "C-NET" logo banner.

      Expected vs Actual

      Expected (as RGTerm renders it): "BULLETIN BOARD SYSTEM" in UPPERCASE; the "C-NET" logo is a clean, connected white outline. (See attachment rgterm.png.)

      Actual (SyncTERM): "bulletin board system" in lowercase; the "C-NET" outline is broken up by stray capital letters (N, O, P, M, L, T, V) where graphics should be. (See attachment syncterm.png.)

      Root cause -- byte-level evidence
      Raw PETSCII captured from the host (telnet IAC stripped):

      The banner opens with 0D 8E 15 93 -- $8E = switch to uppercase/graphics charset, then $93 = clear. There is no $0E (switch to lowercase/text) anywhere in the stream, so the host is unambiguously in uppercase/graphics mode.

      "BULLETIN BOARD SYSTEM" arrives as 42 55 4C 4C 45 54 49 4E 20 42 4F 41 52 44 20 53 59 53 54 45 4D. In uppercase/graphics mode these are UPPERCASE "B U L L E T I N ...". SyncTERM shows them lowercase -- i.e. it is using the lowercase/text charset mapping where $41-$5A are lowercase.

      The "C-NET" logo uses graphic codes in the $C1-$DA range. In uppercase/graphics mode these are graphic glyphs; in the lowercase/text charset $C1-$DA are the letters A-Z. The exact codes in the capture map one-to-one to the stray letters seen on screen: $CF->O $CD->M $D0->P $CC->L $CE->N (and $D4->T $D6->V). That one-to-one correspondence is the smoking gun: SyncTERM is applying the text-charset $C1-$DA -> A-Z mapping to bytes the host intends as graphics.

      Suggested fix
      SyncTERM's C64/PETSCII emulation should default to the uppercase/graphics charset on connect (matching real C64 power-on), and honour the $8E (uppercase/graphics) and $0E (lowercase/text) shift codes to switch the active charset, rather than staying locked in the lowercase/text set.
      (Distinct from existing ticket #198, which concerns black-bars / window sizing in the X11 backend on C64 BBSes -- not charset selection.)

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/syncterm/tickets/306/
      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #306

  • Stephen James Hurd

    That sounds awesome, I didn't even think of that use case for the APC, despite being aware of multi-BBS front-ends. I've got just a few more exciting changes in the pipeline, then I'll be able to move v2.0 into beta and start testing!

     

Anonymous
Anonymous

Add attachments
Cancel