53 lines
1.9 KiB
Markdown
53 lines
1.9 KiB
Markdown
# Memory Map Documentation
|
||
|
||
#### PCM Buffer
|
||
|
||
| Function | Address |
|
||
|----------------------------------|----------|
|
||
| **PCM Voice Buffer (High Byte)** | `0xDF00` |
|
||
| **PCM Voice Buffer (Low Byte)** | `0xDF01` |
|
||
|
||
If you want to write to both, write low byte first
|
||
|
||
#### Voice Generators
|
||
|
||
| Voice | Volume | Waveform | Phase | Frequency (High Byte, write last) | Frequency (Low Byte) |
|
||
|-------------|----------|----------|----------|-----------------------------------|----------------------|
|
||
| **Voice 0** | `0xDF02` | `0xDF03` | `0xDF04` | `0xDF05` | `0xDF06` |
|
||
| **Voice 1** | `0xDF07` | `0xDF08` | `0xDF09` | `0xDF0A` | `0xDF0B` |
|
||
| **Voice 2** | `0xDF0C` | `0xDF0D` | `0xDF0E` | `0xDF0F` | `0xDF10` |
|
||
|
||
#### Display Controls
|
||
|
||
| Display | Address |
|
||
|---------------|----------|
|
||
| **Display A** | `0xDF12` |
|
||
| **Display B** | `0xDF13` |
|
||
| **Display C** | `0xDF14` |
|
||
| **Display D** | `0xDF15` |
|
||
| **Display E** | `0xDF16` |
|
||
| **Display F** | `0xDF17` |
|
||
| **Display G** | `0xDF18` |
|
||
| **Display H** | `0xDF19` |
|
||
|
||
#### Switch Inputs
|
||
|
||
| Switch Bank | First 2 rows Address | Last 2 rows Address |
|
||
|----------------|----------------------|---------------------|
|
||
| **Switches A** | `0xDF20` | `0xDF21` |
|
||
| **Switches B** | `0xDF22` | `0xDF23` |
|
||
| **Switches C** | `0xDF24` | `0xDF25` |
|
||
| **Switches D** | `0xDF26` | `0xDF27` |
|
||
|
||
### GPU Memory
|
||
|
||
- **Base Address:** `0xEF00`
|
||
- **Size:** `160 × 160` pixels
|
||
- **End Address:** `0xEF00 + (160 × 160) = GPU_END`
|
||
- **Color Encoding:**
|
||
- Red: Bits `[7:5]` scaled (0-7 → 0-255)
|
||
- Green: Bits `[4:2]` scaled (0-7 → 0-255)
|
||
- Blue: Bits `[1:0]` scaled (0-3 → 0-255)
|
||
- Pixels are stored in a texture-compatible `RGBA8888` format.
|
||
|
||
## Memory Operations |