Overview
Thedevcpc build command compiles your complete project, including assembly code, BASIC programs, graphics conversion, and image generation. It follows a 14-step process to ensure everything is built correctly.
Build Command
devcpc.conf configuration.
Build Process (14 Steps)
DevCPC executes the following steps during compilation:Step 1: Convert Sprites (PNG → ASM)
IfSPRITES_PATH is configured:
- Searches for PNG files in the sprites directory
- Converts them to ASM format using
png2asm.py - Generates sprite data compatible with CPC palette
- Outputs to configured ASM file
Step 2: Convert Screens (PNG → SCN)
IfLOADER_SCREEN is configured:
- Converts PNG loading screens to SCN format
- Generates 16KB screen files for direct CPC memory
- Creates
.scn.infofiles with palette data - Stores in
obj/directory
Step 3: Compile ASM with ABASM
IfASM_PATH is configured:
- Modifies
ASSEMBLING_OPTIONbased onBUILD_LEVEL - Compiles assembly code with ABASM
- Generates binary, listing, and map files
- Outputs
8BP{LEVEL}.binor{TARGET}.bin
Step 4: Verify Graphics Limits
For 8BP projects:- Checks
_END_GRAPHsymbol in map file - Ensures graphics don’t exceed address 42040 (
0xA428) - Prevents memory corruption
Step 5: Create DSK Image
Creates an empty DSK file:- Generates blank 178KB disk image
- Places in
dist/directory - Ready to receive files
Step 6: Add ASM Binary to DSK
Adds compiled binary to disk:- For 8BP:
8BP0.bin,8BP1.bin, etc. - For pure ASM:
{TARGET}.bin - Sets load and execute addresses
Step 7: Add Screens to DSK
If loading screens exist:- Adds all
.scnfiles fromobj/ - Load address:
0xC000(video memory) - Execute address:
0xC000
Step 8: Compile C with SDCC
IfC_PATH is configured:
- Compiles C source with SDCC for Z80
- Converts Intel HEX to binary
- Adds C binary to DSK
- Code location:
C_CODE_LOC(default: 20000)
Step 9: Verify C Memory Limits
Checks C code size:- Ensures code < 23999 to avoid corrupting 8BP
- Validates memory layout
Step 10: Add BASIC Files to DSK
IfBASIC_PATH is configured:
- Finds all
.basfiles in directory - Adds them as ASCII files to DSK
- Preserves BASIC tokenization
Step 11: Add RAW Files to DSK
IfRAW_PATH is configured:
- Adds binary files without AMSDOS header
- Useful for data files, music, etc.
Step 12: Show DSK Catalog
Displays disk contents:- Lists all files on DSK
- Shows file types and sizes
- Displays data pages used
Step 13: Create CDT (if configured)
IfCDT and CDT_FILES are set:
- Creates tape image
- Adds files in specified order
- Generates sequential tape structure
Step 14: Show CDT Catalog
Displays tape contents:- Lists all blocks on CDT
- Shows file order and types
ASM Compilation Details
8BP Projects
8BP projects useBUILD_LEVEL to control which features are included:
| Level | Features | MEMORY | Size |
|---|---|---|---|
| 0 | All features | 23599 | 19120 bytes |
| 1 | Labyrinths | 24999 | 17620 bytes |
| 2 | Scrolling | 24799 | 17820 bytes |
| 3 | Pseudo-3D | 23999 | 18620 bytes |
| 4 | Basic | 25299 | 17320 bytes |
- Sets
ASSEMBLING_OPTIONin your ASM file - Compiles with ABASM
- Generates
8BP{LEVEL}.bin
Pure ASM Projects
For projects without 8BP:- Compile
asm/{SOURCE}.asm - Generate
{TARGET}.bin - Set load/execute address to
LOADADDR
BASIC File Handling
BASIC files are added automatically:.bas files in this directory are:
- Added to the DSK as ASCII files
- Preserved with proper tokenization
- Available to load from BASIC
C Compilation with SDCC
Requirements
Configuration
Compilation Process
-
Compiles with SDCC for Z80:
-
Converts Intel HEX to binary:
- Adds to DSK with load address
Memory Layout
Important: C code must not exceed address 23999 to avoid corrupting 8BP library.Using C with 8BP
Build Output Example
Cleaning Build Artifacts
Remove generated files:obj/directory (intermediates)dist/directory (final images)- Backup files in
ASM/
Troubleshooting
Compilation Errors
ABASM errors:- Check syntax in your ASM files
- Verify
BUILD_LEVELis correct - Ensure
make_all_*.asmexists
- Reduce sprite/image sizes
- Optimize graphics data
- Use higher
BUILD_LEVEL
Memory Issues
C code too large:- Use lower
C_CODE_LOC - Optimize code size
- Adjust
MEMORYin BASIC
- Ensure
C_CODE_LOC < 23599 - Check map files for symbol addresses
See Also
- Creating Projects - Initialize projects
- Graphics Conversion - PNG to ASM
- Disk Images - DSK management
- Emulator Integration - Testing with RVM