How mjdarby/fic works
Key Components to Include:
Input Processing Layer
• File Input Handler (for Z-code game files)
• User Input Handler (for game commands)
• Input Stream Manager (for handling different input sources)
Core Interpreter Components
• Memory Manager (mentioned in TODOs as needing splitting)
• Opcode Executor (extensive list of implemented opcodes)
• State Manager (for save/restore/undo functionality)
Output Processing Layer
• Text Renderer
• Window Manager (for terminal display)
• Stream Manager (for output handling)
• [Game File/User Input] → [Interpreter Core] → [Display Output]
Component Relationships
• File input → Memory Manager
• Memory Manager ↔ Opcode Executor
• Opcode Executor → Output Manager
• User Input → Input Stream Manager → Opcode Executor
Memory Management
• Planned split of Memory class into subcomponents
• Interaction with save/restore functionality
Opcode Execution
• Opcodes by version (V1-V5, V7-V8)
• Separation between implemented and pending opcodes
Input/Output Streams
• Multiple input sources (file, user, replay)
• Output streams with different purposes
• Version-specific features (different patterns)
• Data flow directions
• Component interaction types
Additional Notes:
Clear boundaries between
• File handling
• Memory management
• Opcode execution
• Rendering