How israpps/romman works
Project Type and Purpose
• Romman is a native C++ command‐line tool for creating, extracting, and inspecting PlayStation 2 ROM images (IOPRP files and modules). There is no GUI or network layer; it’s a single executable with a core library and CLI front‐end.
File‐Structure Analysis
• Top-level build & config:
• CMakeLists.txt – defines build targets, links sources under src/ with headers under include/
• .github/workflows/ci.yml – CI pipeline for building and testing
• Source code layout:
• / – public headers: ELF parser (ELF.h), ROM abstraction (rom.h), utilities (utils.h), error codes (romman-errno.h), debug, versioning
• src/ – implementation: main.cpp (CLI entry point), rom.cpp (ROM operations), utils.cpp
• This idiom suggests a two‐tier architecture:
• CLI layer (main.cpp + argument parsing + dispatch)
• Core library (rom + ELF + utils + error management)
Architectual Patterns & Design Principles
• Single‐executable monolith, layered by responsibility:
• Presentation/CLI layer
• Core library layer with clear API (headers in include/)
• Error‐handling centralized via romman-errno.h
• Build configuration and CI separate from runtime logic
Main Components
a. CLI Front‐End
• Parses command‐line flags (-l, -x, -g, -a)
• Dispatches to corresponding core functions: list, extract, generate, add
b. Core ROM Manager Library
• rom.cpp/h: high‐level API for reading/writing ROM images
• IOPRP & module handling
• Configuration CSV parser/generator
c. ELF Module Parser
• ELF.h / utils: parses and extracts submodules (handles big/little endian)
d. Utilities
• debug.h: logging support
e. Error Management
• romman-errno.h: defines error codes and error‐to‐message mapping
f. Build & CI Pipeline (external to runtime)
• CMake build graph
• GitHub Actions workflow for continuous integration
Relationships & Data Flows
• User CLI → CLI Front‐End → Core Library API
• Core Library ↔ ELF Parser (for module introspection)
• Core Library ↔ Utilities (CRC, date, coloring)
• Core Library ↔ File System (read/write binary ROM, extract modules, write CSV)
• Core Library → Error Manager → CLI Front‐End (error reporting to user)
• Build System (CMake) → compiles src/ + include/ → produces romman executable
• CI Pipeline → triggers CMake build → runs smoke tests (if any)
Technologies & Frameworks
• C++17 (assumed from headers/source)
• CMake (build system)
• GitHub Actions (CI)
• CSV parsing: custom, in core library
• Terminal coloring: ANSI codes (Windows 10+ & Unix)