# markmoxon/elite-source-code-commodore-64 architecture

> Architecture diagram of the GitHub repository markmoxon/elite-source-code-commodore-64, 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/markmoxon/elite-source-code-commodore-64
- Repository: https://github.com/markmoxon/elite-source-code-commodore-64

## Overview

##### Main Components

a) Build System Components:
- Source Files (1-source-files/)
- Build Scripts (2-build-files/)
- Assembly Output (3-assembled-output/)
- Reference Binaries (4-reference-binaries/)
- Game Disk Images (5-compiled-game-disks/)

b) Game Components:
- Main Game Code
- Loader System
- Graphics System
- Music System
- Data Files

**[Source Files] -> [Build Scripts] -> [Assembled Output] -> [Game Disk Images]**

- [Reference Binaries]
- (for verification)

**[Loader System]**

**[Main Game Code] <-> [Graphics System]**

**[Music System] <-> [Data Files]**

**[Low Memory] -> [Game Code] -> [High Memory]**

**[LOCODE.bin]  [Game Data]    [HICODE.bin]**

##### Important Relationships

a) Build Process:
- BeebAsm compilation flow
- Python script processing
- Checksum verification
- Disk image creation

b) Game Components:
- Memory management between code segments
- Data flow between game systems
- Resource loading paths

##### Technical Details to Note

- Assembly source files (.asm)
- Binary data files (.bin)
- Build scripts (Python, Make)
- Disk image format (.d64)

##### The variant handling system

Keep the focus on the assembly and build process, as this is primarily a development tool project rather than a runtime system.

This structure will help developers understand both the build process and the game's architecture while maintaining historical accuracy to the original Commodore 64 Elite implementation.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Build Process Layer
    subgraph Build_Process
        SourceFiles["Source Files"]
        BuildScripts["Build Scripts"]
        AssemblyOutput["Assembly Output"]
        RefBinaries["Reference Binaries"]
        GameDisks["Game Disk Images"]
        
        SourceFiles --> BuildScripts
        BuildScripts --> AssemblyOutput
        AssemblyOutput --> GameDisks
        RefBinaries -.-> AssemblyOutput
    end

    %% Game Architecture Layer
    subgraph Game_Architecture
        LoaderSys["Loader System"]
        MainGame["Main Game Code"]
        GraphicsSys["Graphics System"]
        MusicSys["Music System"]
        DataFiles["Data Files"]
        BuildConfig["Build Configuration"]
        
        LoaderSys --> MainGame
        MainGame <--> GraphicsSys
        MainGame <--> MusicSys
        MainGame <--> DataFiles
        BuildConfig --> MainGame
    end

    %% Memory Layout Layer
    subgraph Memory_Layout
        LowMem["Low Memory (LOCODE)"]
        GameMem["Game Memory"]
        HighMem["High Memory (HICODE)"]
        
        LowMem --> GameMem
        GameMem --> HighMem
    end

    %% Resource Components
    subgraph Resources
        FontRes["Font Resources"]
        ImageRes["Image Resources"]
        Checksum["Checksum Verification"]
        
        FontRes --> MainGame
        ImageRes --> GraphicsSys
        Checksum --> AssemblyOutput
    end

    %% Styling
    classDef source fill:#ddf,stroke:#99f
    classDef build fill:#fdd,stroke:#f99
    classDef game fill:#dfd,stroke:#9f9
    classDef memory fill:#ffd,stroke:#ff9
    classDef resource fill:#dff,stroke:#9ff

    class SourceFiles,DataFiles source
    class BuildScripts,AssemblyOutput,GameDisks build
    class LoaderSys,MainGame,GraphicsSys,MusicSys game
    class LowMem,GameMem,HighMem memory
    class FontRes,ImageRes,Checksum resource

    %% Click Events
    click SourceFiles "https://github.com/markmoxon/elite-source-code-commodore-64/tree/main/1-source-files/"
    click BuildScripts "https://github.com/markmoxon/elite-source-code-commodore-64/tree/main/2-build-files/"
    click AssemblyOutput "https://github.com/markmoxon/elite-source-code-commodore-64/tree/main/3-assembled-output/"
    click RefBinaries "https://github.com/markmoxon/elite-source-code-commodore-64/tree/main/4-reference-binaries/"
    click GameDisks "https://github.com/markmoxon/elite-source-code-commodore-64/tree/main/5-compiled-game-disks/"
    click MainGame "https://github.com/markmoxon/elite-source-code-commodore-64/blob/main/1-source-files/main-sources/elite-source.asm"
    click LoaderSys "https://github.com/markmoxon/elite-source-code-commodore-64/blob/main/1-source-files/main-sources/elite-loader.asm"
    click GraphicsSys "https://github.com/markmoxon/elite-source-code-commodore-64/blob/main/1-source-files/main-sources/elite-sprites.asm"
    click MusicSys "https://github.com/markmoxon/elite-source-code-commodore-64/tree/main/1-source-files/music/"
    click DataFiles "https://github.com/markmoxon/elite-source-code-commodore-64/blob/main/1-source-files/main-sources/elite-data.asm"
    click LowMem "https://github.com/markmoxon/elite-source-code-commodore-64/blob/main/3-assembled-output/LOCODE.bin"
    click HighMem "https://github.com/markmoxon/elite-source-code-commodore-64/blob/main/3-assembled-output/HICODE.bin"
    click BuildConfig "https://github.com/markmoxon/elite-source-code-commodore-64/blob/main/1-source-files/main-sources/elite-build-options.asm"
    click Checksum "https://github.com/markmoxon/elite-source-code-commodore-64/blob/main/2-build-files/elite-checksum.py"
    click FontRes "https://github.com/markmoxon/elite-source-code-commodore-64/tree/main/1-source-files/fonts/"
    click ImageRes "https://github.com/markmoxon/elite-source-code-commodore-64/tree/main/1-source-files/images/"
```
