How nafmo/bastext works
Key Components to Include:
Input Processing Layer
• Two possible input sources:
• Binary BASIC files (.prg)
• T64 archive files
• Using dtokeniz.c and t64.c components
Core Processing Pipeline
• Main processing flow with these components:
a. Input Mode Handler (inmode.c)
b. Tokenizer (tokenize.c)
c. Token Management (tokens.c)
d. Selection Logic (select.c)
e. Output Mode Handler (outmode.c)
Format Support Layer
• Supported BASIC dialects:
• BASIC 2.0
• BASIC 3.5
• BASIC 4.0
• BASIC 7.0
• BASIC 7.1
• Various extensions (TFC III, Graphics52, etc.)
[Input Sources] → [Input Handler] → [Processing Core] → [Output Handler] → [Output Formats]
Component Relationships
• Use double lines for file I/O operations
Decision Points
• Format detection logic
• Command-line option handling
• BASIC dialect selection process
Specific Implementation Details:
Version.h information as a metadata component
Key Aspects to Emphasize:
Command-Line Interface
• How -i/-o/-h flags affect the processing flow
• Optional modifier handling (-t, -a, -s, -d)
Format Detection
• Address-based autodetection logic
• Header parsing system
Error Handling
• Error paths for unsupported formats
• Validation checkpoints
• File types (Binary, Text, T64)
• Processing states
• Control flow types
• Component types
• Format indicators
Level of Detail:
• Keep the main flow clear and prominent
• File format specifications in notes
• Version information and supported BASIC dialects in a reference section
• Clear typography for labels
• Consistent spacing
• Export to common formats (SVG, PNG)