Overview
DSK files are disk images for Amstrad CPC that store programs, data, and graphics. DevCPC automatically creates and manages DSK files during the build process.What is a DSK?
A DSK file is a 178KB disk image that emulates a 3” floppy disk used by Amstrad CPC computers. It contains:- BASIC programs
- Binary files (compiled code)
- Screen files (SCN)
- Data files
- Raw binary data
- Emulators (RetroVirtualMachine, WinAPE, etc.)
- Real hardware via M4 Board, HxC, Gotek
- Disk utilities for CPC
Automatic DSK Creation
DevCPC creates DSK files automatically duringdevcpc build.
Configuration
Build Process
During compilation, DevCPC:- Creates empty DSK (178KB)
- Adds compiled binary (8BP or ASM)
- Adds screen files (if LOADER_SCREEN configured)
- Adds BASIC programs (if BASIC_PATH configured)
- Adds RAW files (if RAW_PATH configured)
- Shows catalog (lists all files)
DSK Structure
A typical DevCPC DSK contains:File Types on DSK
| Type | Extension | Description | Load Address | Size |
|---|---|---|---|---|
| Binary | .BIN | Compiled code | Configurable | Variable |
| Screen | .SCN | Full screen | 0xC000 | 16KB |
| BASIC | .BAS | BASIC program | Auto | Variable |
| Raw | Any | Data files | N/A | Variable |
Adding Files to DSK
Binary Files (.BIN)
Binary files are added with load and execute addresses. 8BP Projects:Screen Files (.SCN)
Screens are automatically added ifLOADER_SCREEN is configured.
.scn files from obj/ are added with:
- Load address:
0xC000(video memory) - Execute address:
0xC000 - Size: 16KB each
BASIC Files (.BAS)
BASIC programs are added as ASCII files..bas files in the directory are added to DSK.
From CPC:
RAW Files
Raw binary files without AMSDOS headers.- Music data
- Level data
- Tile maps
- Graphics resources
DSK Contents Example
Typical game DSK layout:Manual DSK Operations
DevCPC includesdsk.py for manual operations:
DSK Capacity
Standard CPC DSK:- Total size: 178KB (178,688 bytes)
- Usable space: ~170KB (depends on files)
- Maximum files: ~64 (depends on directory)
- Each page = 1KB
- Files use multiple pages
- Example: 16KB file = 16 pages
Using DSK Files
In Emulator
From BASIC on CPC
Auto-execution
Create aDISC file to auto-run on boot:
DISC:
Complete Example
Project Configuration
File Structure
Build Result
BASIC Loader
DSK vs CDT vs CPR
DevCPC can generate three distribution formats:| Format | Medium | Speed | Use Case | Size |
|---|---|---|---|---|
| DSK | Disk | Fast | Emulators, M4 | 178KB |
| CDT | Tape | Slow | Retro feel | Variable |
| CPR | Cartridge | Instant | GX-4000/Plus | 512KB max |
When to Use DSK
✅ Use DSK for:- Emulator testing
- M4 Board deployment
- Random file access
- Frequent file updates
- Multiple programs
- CDT: For authentic tape experience
- CPR: For GX-4000/Plus cartridges
Troubleshooting
DSK Creation Failed
Error: Python not foundFile Not Added
Binary not on DSK:- Check compilation succeeded
- Verify file exists in
obj/ - Check for error messages in build log
- Verify
BASIC_PATHis set - Check
.basfiles exist - Ensure files have correct extension
DSK Full
Error: No space on disk- Remove unused files
- Compress graphics
- Split into multiple DSKs
- Use higher BUILD_LEVEL (smaller binary)
Load Errors on CPC
File not found:- Check filename (8.3 format)
- Use uppercase:
LOAD"FILE.BIN" - Verify file on DSK:
CAT
- Check map file for correct address
- Verify MEMORY statement in BASIC
- Ensure no memory conflicts
Best Practices
- Keep DSK organized - Use clear filenames
- Test frequently - Use
devcpc runto test - Check catalog - Verify all files added
- Document addresses - Note load/exec addresses
- Backup DSKs - Save working versions
- Monitor size - Keep under 170KB
See Also
- Compiling Code - How files are generated
- Tape Images - CDT alternative
- Cartridge Images - CPR format
- Emulator Integration - Testing DSK files