How d0nm/vinnie works
Project Type and Purpose
• This is a native, monolithic 2D platformer game (“Super Vinnie-Pooh”, 1995), written in C/C++ with inline and separate x86 assembly modules.
• It includes a custom script engine (.FMS/.FML scripts), a graphics library, audio playback (MOD tracker), input handling (joystick, mouse, keyboard), and build/deployment scripts for DOS/Windows consoles.
High-Level File Structure Analysis
• Source code:
• .CPP/.C files (GAME.CPP, DIALOG.CPP, EMS.CPP, FAMELIB.CPP, etc.)
• .H headers (JOY.H, EMS.H, FAMEGRAF.H, etc.)
• .ASM modules (FAMEGRAF.ASM, VOICE.ASM, JOYSTICK.ASM)
• Scripts & assets:
• Script files (.FMS, .FML) for levels, dialogs, AI triggers
• Binary level data (LEVELS/*.BIN, .DEF, .demo)
• Graphics data (.PCX imports, custom font, sprites)
• modmusic subfolder: third-party tracker playback code
• Build/deployment:
• .BAT scripts (MAKEFON.BAT, MAKELIB.BAT, asmbuild.bat, winbuild.bat)
• PRJ and .DSK project files for different modules
Key Components
a. Core Game Engine
– Main loop (GAME.CPP)
– Frame/timing manager (EMS.CPP)
– Resource loader (FLIB.CPP, FAMELIB.CPP)
b. Rendering Subsystem
– Graphics routines in FAMEGRAF.*
– Font/sprite renderer (MINIFONT.CPP)
– PCX to internal bitmap converter (PCX2REC.CPP)
c. Input Handling
– Keyboard (KEYS.CPP/H), joystick (JOY.CPP/H, JOYSTICK.ASM), mouse (MOUSE.CPP/H)
d. Audio Subsystem
– Sound effects via VOICE.ASM/H
– Music playback via modmusic/*.c/.h
e. Scripting Engine
– Script parser/interpreter (.FMS/.FML files handled by CUTSPR.CPP, FML.CPP)
– Level logic dispatcher (LEVELS/ definitions)
f. Asset Management
– Level data (.BIN, .DEF)
– Graphics assets (sprites, backgrounds)
– Sound/music data
g. Build System
– Compiler and assembler invocation (.BAT scripts)
– Multi-platform targets (DOS, Windows, GamePark32 port)
Relationships and Data Flows
• Input events → Input Handler → Event Queue → Game Logic
• Game Logic ↔ Scripting Engine (executes level scripts, triggers animations)
• Game Logic → Audio Subsystem (play SFX & music commands)
• Asset Manager loads binary data → Game Logic, Renderer, Audio
• Build System compiles all modules into a single executable
Architectural Patterns and Principles
• Modular engine split by concern: input, logic, rendering, audio, scripting
• Data-driven levels via external script and binary files
• Layered design: low-level hardware access (ASM) underneath C/C++ wrappers
• Single responsibility per module (e.g., FAMEGRAF only handles graphics)
Technologies and Frameworks
• Language: C, C++, x86 Assembly
• Custom script interpreter (.FMS, .FML)
• DOS/Windows batch scripts for builds
• External modmusic tracker code
• Graphics: custom PCX converter and blitter routines