Skip to main content

Overview

The devcpc build command compiles your complete project, including sprite conversion, screen loading, ASM compilation, C compilation, and DSK/CDT/CPR generation.

Syntax

devcpc build

Build Process (14 Steps)

The build process executes the following steps automatically:
  1. Convert PNG sprites to ASM (if SPRITES_PATH is defined)
  2. Convert PNG screens to SCN (if LOADER_SCREEN is defined)
  3. Compile ASM code with ABASM (if ASM_PATH is defined)
  4. Verify graphics limits (_END_GRAPH < 42040)
  5. Create DSK image
  6. Add ASM binary to DSK (8BP0.bin, 8BP1.bin, etc.)
  7. Add SCN screens to DSK (if LOADER_SCREEN is defined)
  8. Compile C code with SDCC (if C_PATH is defined)
  9. Verify C memory limits (< 23999)
  10. Add BASIC files to DSK (if BASIC_PATH is defined)
  11. Add RAW files to DSK (if RAW_PATH is defined)
  12. Show DSK contents
  13. Create CDT tape image (if CDT and CDT_FILES are configured)
  14. Show CDT catalog

Output Example

═══════════════════════════════════════
  Compilar Proyecto: mi-juego
═══════════════════════════════════════

ℹ Sistema: macOS (arm64)
ℹ Build Level: 0 (Todas las funcionalidades)
ℹ Memoria BASIC: MEMORY 23599

═══════════════════════════════════════
  Convertir Sprites PNG a ASM
═══════════════════════════════════════

ℹ Ruta sprites:    assets/sprites
ℹ Modo CPC:        0
ℹ Archivo salida:  ASM/sprites.asm
ℹ Tolerancia RGB:  8

✓ Sprites convertidos exitosamente

═══════════════════════════════════════
  Compilar Código ASM
═══════════════════════════════════════

ℹ Archivo ASM: asm/make_all_mygame.asm
ℹ Build Level: 0
ℹ Memoria: 23599

→ Compilando con ABASM...
✓ Compilación exitosa
✓ Límite de gráficos respetado (< 42040)

═══════════════════════════════════════
  Crear Imagen DSK
═══════════════════════════════════════

ℹ DSK: mi-juego.dsk
ℹ Ubicación: dist/mi-juego.dsk

✓ DSK creado

→ Añadiendo 8BP0.bin al DSK...
✓ 8BP0.bin añadido

→ Añadiendo archivos BASIC...
✓ 1 archivo(s) BASIC añadidos

Contenido del DSK:
0: 8BP0    .BIN  [ st: 0 extend: 0 data pages: 128 ]
1: LOADER  .BAS  [ st: 0 extend: 0 data pages: 3 ]

═══════════════════════════════════════
  Compilación Completada
═══════════════════════════════════════

✓ Proyecto compilado exitosamente

ℹ Archivos generados:
  DSK: dist/mi-juego.dsk
  BIN: obj/8BP0.bin

ℹ Uso desde BASIC:
  MEMORY 23599
  LOAD"8BP0.bin"
  CALL &6B78

ℹ Para ejecutar: devcpc run

Build Levels (8BP Projects)

For 8BP projects, BUILD_LEVEL determines which features are included:
LevelDescriptionMEMORYCommandsSize
0All features23599|LAYOUT, |COLAY, |MAP2SP, |UMA, |3D19120 bytes
1Maze games24999|LAYOUT, |COLAY17620 bytes
2Scroll games24799|MAP2SP, |UMA17820 bytes
3Pseudo-3D games23999|3D18620 bytes
4Basic (no scroll/layout)25299Basic commands17320 bytes

Sprite Conversion

If SPRITES_PATH is configured in devcpc.conf:
SPRITES_PATH="assets/sprites"
MODE=0
SPRITES_OUT_FILE="ASM/sprites.asm"
SPRITES_TOLERANCE=8
The build automatically:
  • Scans all PNG files recursively
  • Converts to ASM format compatible with Amstrad CPC
  • Generates palette information
  • Creates sprites.asm ready to include

Screen Loading

If LOADER_SCREEN is configured:
LOADER_SCREEN="assets/screen"
MODE=0
The build automatically:
  • Converts PNG screens (160x200, 320x200, or 640x200)
  • Generates SCN files in obj/
  • Creates .scn.info files with palette data
  • Adds screens to DSK

C Compilation

If C_PATH is configured:
C_PATH="C"
C_SOURCE="main.c"
C_CODE_LOC=20000
The build:
  • Compiles C code with SDCC
  • Verifies memory limits (< 23999)
  • Converts to binary format
  • Adds to DSK

CDT Tape Generation

If CDT and CDT_FILES are configured:
CDT="${PROJECT_NAME}.cdt"
CDT_FILES="loader.bas 8BP0.bin"
The build:
  • Creates empty CDT
  • Adds files in specified order
  • Generates catalog
Note: Order in CDT_FILES is critical - files load sequentially.

CPR Cartridge Generation

If CPR is configured:
CPR="${PROJECT_NAME}.cpr"
CPR_EXECUTE="loader.bas"
The build:
  • Converts DSK to CPR format
  • Configures auto-boot command
  • Patches ROMs (OS, BASIC, AMSDOS)
  • Creates cartridge for GX-4000/Plus

Generated Files

Intermediate Files (obj/)

  • *.bin - Compiled binaries
  • *.lst - Assembly listings
  • *.map - Memory maps
  • *.scn - Screen files
  • *.scn.info - Palette information
  • *.ihx - Intel HEX (C code)

Output Files (dist/)

  • *.dsk - Disk image
  • *.cdt - Tape image (optional)
  • *.cpr - Cartridge ROM (optional)

Validation

The build automatically validates:
  • Configuration is correct
  • Source paths exist
  • Graphics limits respected
  • Memory limits respected
  • Required tools installed

Error Handling

# Not in a DevCPC project
devcpc build
# Error: No estás en un proyecto DevCPC

# Compilation error
devcpc build
# Error: Compilación fallida
# (Shows detailed error from ABASM)

# Graphics limit exceeded
devcpc build
# Error: Límite de gráficos excedido: 42500 (max: 42040)

Performance

Build time depends on:
  • Number of PNG files to convert
  • Size of ASM source code
  • Number of files to add to DSK/CDT
  • C code complexity
Typical build times:
  • Small project: 1-3 seconds
  • Medium project: 3-8 seconds
  • Large project: 8-15 seconds

Build docs developers (and LLMs) love