Skip to main content

PX-41CX to Unicode FOCAL Converter

PX-41CX to Unicode FOCAL Converter #

Rekindle the retro magic of the HP-41CX with hp41cx_tools-px41_to_unicode, a sleek tool that converts PX-41CX-encoded FOCAL source code (.px41.focal) to Unicode format (.utf8.focal). Built in Ada 2022 for unshakeable reliability, this filter expertly handles special characters (~, ^, #) with context-sensitive conversions and uses HP-style quotes for alpha strings, ensuring seamless Unicode compatibility. Unlike its DM41 counterpart, it restores XROM key assignments, as PX-41CX supports them natively. Part of the work-in-progress hp41cx_tools suite, it’s tested with Make (make test) and runs flawlessly on macOS, Linux, and Windows, outpacing Windows-only tools.

Features #

  • Smart Conversion: Transforms .px41.focal (ASCII, single quotes) to .utf8.focal (Unicode, HP-style quotes), with precise handling of special characters.
  • Context-Sensitive Handling:
    • In ALPHA Strings:
      • ~Σ
      • ^
      • \x1D
    • In Commands:
      • ENTERENTER↑
      • ^
      • SΣ
      • #
  • XROM Support: Restores XROM key assignments (e.g., ; KEY = XOR -81), as PX-41CX supports them natively.
  • Pipe-Friendly: Reads from standard input and writes to standard output, ideal for scripting and pipelines.
  • Cross-Platform: Works on macOS, Linux, and Windows, perfect for any retro computing setup.
  • Open Source: Explore the code on SourceForge.
  • Comprehensive Docs: Explore detailed guides via GNATdoc.
  • Robust Testing: Backed by AUnit tests via make test for reliable performance.

Usage #

No command-line options—just pipe PX-41CX FOCAL code in and get Unicode code out:

hp41cx_tools-px41_to_unicode < in_program.px41.focal > out_program.utf8.focal

Notes #

  • Input/Output: Reads .px41.focal (ASCII, single quotes) and outputs .utf8.focal (Unicode, HP-style quotes).
  • Character Handling: Uses AdaCL.Wide_Strings.Spitbol.Patterns for context-sensitive substitutions, as regular expressions fall short for distinguishing ALPHA strings from commands.
  • XROM Preservation: Unlike the DM41 converter, XROM key assignments are restored intact, as PX-41CX supports them.
  • Work in Progress: Part of the evolving hp41cx_tools suite, with more features planned.

Relive the HP-41CX’s golden era with this sharp converter, transforming PX-41CX code into Unicode elegance with the finesse of a vintage calculator!