I started my project using the SDCC (Small device C compiler), but was lacking some features for creating ROM and easy way to make Custom builds. I had looked at z88dk in the past, but seem at the time more support for the SDCC and C compiler supported a better standard C support. After some work with the SDCC, ended up looking back at z88dk. Found some of the features that would give me the best of both, z88dk supported the use of the SDCC C compiler section, then use it's assembler which supported Binary output vs, using a extra program to convert the output to binary. And easy to configure for Custom Z-80 builds with more assembler options.
Some Notes on using the SDCC C compiler with z88dk, you have to rebuild the binary from source using the z88dk patch to the SDCC C compiler (Linux version needs patch, windows z88dk comes with the binary already patched). Several sites have instructions on doing this.
My command line:
example:
zcc +z80 -m -g -s --max -allocs-per-node2000 -SO3 -startup=1 -clib=sdcc_iy Hyundai_256x128.c z80_io.c interrupt.asm z80lcd256_int.c -o z80lcd256_int -lm -create-app -pragma-include:simz80.inc --c-code-in-asm
Here is where I override the default settings for the Generic Z80 model.
simz80.inc
#pragma output CRT_ORG_CODE = 0
#pragma output CRT_INCLUDE_PREAMBLE = 0
#pragma output CRT_ORG_DATA = 0x20ff // Start of RAM
#pragma output CRT_MODEL = 1
#pragma output REGISTER_SP = 0x4000 // Place Stack pointer at top of Memory
#pragma output CRT_STACK_SIZE = 256
#pragma output CLIB_MALLOC_HEAP_SIZE = 0
#pragma output CLIB_STDIO_HEAP_SIZE = 0
#pragma output CRT_ORG_VECTOR_TABLE = -0x100
#pragma output CRT_ENABLE_RST = 0x80
#pragma output CRT_ENABLE_EIDI = 0x03
#pragma output CRT_INTERRUPT_MODE = 0