How kirjavascript/tetrisgym works
Main Components to Include:
Core Game Engine
• Game state management system (/src/gamemodestate/)
• Play state controller (/src/playstate/)
Input/Output System
• NMI (Non-Maskable Interrupt) handlers (/src/nmi/)
• Controller and keyboard polling subsystems
Game Modes and Trainers
• Connections to different training features (T-Spins, Pace, etc.)
• Game type menu system (/src/gamemode/gametypemenu/)
Graphics System
• Sprite handling (/src/sprites/)
• Nametable management (/src/nametables/)
• Palette systems (/src/palettes.asm)
Memory and State Management
• RAM management component (/src/ram.asm)
• High score system (/src/highscores/)
• Save state functionality
Audio System
• Audio processing component (/src/audio.asm)
Design Guidelines:
• [Boot/Reset] → [Core Game Engine] → [Game Modes]
• ↑ ↑ ↑
• [Input System] → [State Management] ← [Graphics System]
• ↓ ↓ ↓
• [Audio System] → [Memory Management] ← [High Scores]
Connection types
• Double lines: Data flow
Component details to highlight
• Memory mapper support (NROM, MMC1, MMC3, MMC5, CNROM)
• PAL/NTSC mode switching
• Save state system
• High score persistence
• [Game Type Menu]
• ↓
• [Mode Selection] → [Specific Trainer]
• ↓ ↓
• [Level Config] → [Game Instance]
• The assembly-based architecture
• The NES hardware interaction layers
• The extensive modification systems
• The training mode framework
• The build and testing infrastructure