# mrneo240/openmenu architecture

> Architecture diagram of the GitHub repository mrneo240/openmenu, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mrneo240/openmenu
- Repository: https://github.com/mrneo240/openmenu

## Overview

##### Main System Components

a) User Interface Layer
- Grid UI Component
- Menu UI Component
- Credits UI Component
- Line Description Components
- Animation System
- Theme Manager
- Font Rendering System

b) Backend Systems
- GDEMU Control System
- Database Management
- GD List Handler
- DB List Handler
- GDEMU SDK

c) Resource Management Layer
- Texture Management System
- Block Pool
- LRU Cache
- Texture Allocator
- VMU Integration
- Crayon VMU Handler

d) Platform-Specific Layer
- PVR Texture Handler
- Input System
- Font Rendering (DC-specific)

##### Relationships and Data Flow

- UI Layer → Backend Services (for game/menu data retrieval)
- UI Layer → Resource Management (for texture and resource loading)
- Backend Services → Resource Management (for asset management)
- All components → Platform-Specific Layer (for hardware interaction)

##### External Tools Integration
- DAT Packer
- Menu Faker
- Metadata Tools
- File Format Converters

##### Notes for Implementation Details

Annotations for:
- File format handlers (DAT format)
- Debug systems
- VMU integration points
- Texture management strategy

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph UI["User Interface Layer"]
        direction TB
        GridUI["Grid UI"]:::ui
        MenuUI["Menu UI"]:::ui
        Credits["Credits UI"]:::ui
        LineDesc["Line Description"]:::ui
        AnimSys["Animation System"]:::ui
        ThemeMan["Theme Manager"]:::ui
        FontRender["Font Rendering"]:::ui
    end

    subgraph Backend["Backend Services"]
        direction TB
        GDEMU["GDEMU Control"]:::backend
        GDSDK["GDEMU SDK"]:::backend
        subgraph DB["Database Management"]
            GDList["GD List Handler"]:::backend
            DBList["DB List Handler"]:::backend
        end
    end

    subgraph Resources["Resource Management"]
        direction TB
        subgraph TextureMan["Texture Management System"]
            BlockPool["Block Pool"]:::resource
            LRUCache["LRU Cache"]:::resource
            TexAlloc["Texture Allocator"]:::resource
        end
        VMU["Crayon VMU Handler"]:::resource
    end

    subgraph Platform["Dreamcast Specific"]
        direction TB
        PVR["PVR Texture Handler"]:::platform
        Input["Input System"]:::platform
        DCFont["Font Rendering DC"]:::platform
    end

    subgraph Tools["External Tools"]
        direction TB
        DATPacker["DAT Packer"]:::tool
        MenuFaker["Menu Faker"]:::tool
        MetaTools["Metadata Tools"]:::tool
        FormatConv["File Format Converters"]:::tool
    end

    UI --> Backend
    UI --> Resources
    Backend --> Resources
    UI --> Platform
    Backend --> Platform
    Resources --> Platform

    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef resource fill:#f1c40f,stroke:#f39c12,color:black
    classDef platform fill:#e74c3c,stroke:#c0392b,color:white
    classDef tool fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Click events for components
    click GridUI "https://github.com/mrneo240/openmenu/blob/master/ui/ui_grid.h"
    click Credits "https://github.com/mrneo240/openmenu/blob/master/ui/ui_menu_credits.h"
    click LineDesc "https://github.com/mrneo240/openmenu/blob/master/ui/ui_line_desc.h"
    click AnimSys "https://github.com/mrneo240/openmenu/blob/master/ui/animation.h"
    click ThemeMan "https://github.com/mrneo240/openmenu/blob/master/ui/theme_manager.h"
    click GDEMU "https://github.com/mrneo240/openmenu/blob/master/backend/gdemu_control.c"
    click GDSDK "https://github.com/mrneo240/openmenu/blob/master/backend/gdemu_sdk.h"
    click GDList "https://github.com/mrneo240/openmenu/blob/master/backend/gd_list.h"
    click DBList "https://github.com/mrneo240/openmenu/blob/master/backend/db_list.h"
    click BlockPool "https://github.com/mrneo240/openmenu/blob/master/texture/block_pool.h"
    click LRUCache "https://github.com/mrneo240/openmenu/blob/master/texture/lru.h"
    click TexAlloc "https://github.com/mrneo240/openmenu/blob/master/texture/simple_texture_allocator.h"
    click VMU "https://github.com/mrneo240/openmenu/tree/master/external/libcrayonvmu/"
    click PVR "https://github.com/mrneo240/openmenu/blob/master/ui/dc/pvr_texture.h"
    click Input "https://github.com/mrneo240/openmenu/blob/master/ui/dc/input.h"
    click DCFont "https://github.com/mrneo240/openmenu/blob/master/ui/dc/font_bitmap.c"
    click MenuFaker "https://github.com/mrneo240/openmenu/blob/master/tools/menufaker.c"
    click MetaTools "https://github.com/mrneo240/openmenu/blob/master/tools/metapacker.c"
    click DATPacker "https://github.com/mrneo240/openmenu/blob/master/tools/packer.c"
    click FormatConv "https://github.com/mrneo240/openmenu/blob/master/tools/tsv_to_txt_ini.c"
```
