Where 32768 is my CRT_ORG_CODE value. However, the generated SNA file is 131103 bytes (although my binary file is only 4009 bytes) so I think this tool creates a Spectrum 128K snapshot. It is my impression that CSpect only supports Spectrum 48K snapshots.
I also tried to create a snapshot file by loading my test program in the ZEsarUX emulator and save a snapshot but ZEsarUX doesn't support snaphsots in TBBlue mode.
Other than that there are other sna converters around but they are very old because sna hasn't been in common use since the early days of spectrum emulation.
snapconv from http://www.worldofspectrum.org/utilities.html may be able to do what you want too but the included binary no longer works on 64-bit windows even with compatibility mode switched on.
I tried your suggestion to truncate my SNA file with appmake but the SNA file still doesn't work in CSpect.
I'm not sure I trust the makesna tool. When I look at the SNA file it creates in a HEX editor, the code is placed in the display memory (0x4000) not at 0x8000 as I would have expected.
I erroneously thought an SNA file included the lower 16 KB ROM as well but now I realize that, naturally, it only includes the 48 KB RAM, hence why my code at 0x8000 was placed at 0x4000 in the SNA file.
However, CSpect still doesn't like my SNA files...
Alvin, I tried your added support for creating sna files today but I get the following error when using the z88dk build from 2017-07-22:
zcc +zx -vn -O3 -startup=31 -clib=new -m -L../zxnext_sprite/lib/sccz80 -lzxnext_sprite -I../zxnext_sprite/include src/zxnext_layer2_demo.c src/zxnext_layer2.c -o bin/sccz80/zxnext_layer2 -create-app -Cz"--sna"
sccz80:"src/zxnext_layer2.c" L:95 Warning:#55:Implicit definition of function 'intrinsic_ldi_num_256' it will return an int. Prototype it explicitly if this is not what you want.
zx: Error: File D:\Spectrum\z88dk\lib\config\..\..\bin/appmake/zx_48.sna not found
Building application code failed
Should there be a file called z88dk/bin/appmake/zx_48.sna in the z88dk installation?