Embedded_Z80/appmake output .bin, .rom?

Discussion about other targets
Post Reply
tangent3D
New member
Posts: 3
Joined: Sun Dec 19, 2021 12:23 am

Embedded_Z80/appmake output .bin, .rom?

Post by tangent3D »

Hi all,

I'm running the latest win32 nightly (as of this posting) as well as an up-to-date local build from the z88dk source on Debian. I've noticed that, when using -create-app, output binaries now use a '.rom' extension on win32 but remain as '.bin' in my Debian build. Changing between RAM model (-startup=0) and ROM model (-startup=1,2) does not appear to have an effect. :/

I maintain a Makefile that I use between platforms which processes the output, so I'm trying to resolve this inconsistency. Has this behavior been changed? I would be thrilled if a .bin could be produced when using the RAM model and a .rom could be produced when using the ROM model.

Example of my compile line:

Code: Select all

zcc +z80 -clib=sdcc_iy -o name -create-app source.c
User avatar
dom
Well known member
Posts: 1559
Joined: Sun Jul 15, 2007 10:01 pm

Re: Embedded_Z80/appmake output .bin, .rom?

Post by dom »

I can't reproduce this problem unfortunately (I'm using wine to run the windows binaries under MacOS)

The .rom extension is added if it's not a RAM compile AND -Cz--romsize=NNNN has been configured. Deducing from -startup= isn't sufficient because a lot of targets (both classic and newlib) create ROMs.
tangent3D
New member
Posts: 3
Joined: Sun Dec 19, 2021 12:23 am

Re: Embedded_Z80/appmake output .bin, .rom?

Post by tangent3D »

I'll share a more verbose compile line in case it may reveal a problem with my setup:

Code: Select all

zcc +z80 -clib=sdcc_iy -startup=0 -pragma-define:REGISTER_SP=-1 -pragma-define:CRT_ON_EXIT=0x10002 -ID:/depot/Z-FIGHTER/src/zf_lib -lD:/depot/Z-FIGHTER/src/zf_lib/zf_lib D:/depot/Z-FIGHTER/src/zf_lib/zf_init.asm -m -o poker points.o poker.o rnd.o -create-app --list
I decided to grab the latest win32 nightly (11 Jan) and built from source again on WSL. Unfortunately, all win32 outputs are .rom and all Linux outputs are still .bin using the above.

Thanks very much for the insight about --romsize. I'm not yet familiar with passing options to appmake. If not with -startup, are there any other ways I can be sure to specify a RAM compile?
User avatar
dom
Well known member
Posts: 1559
Joined: Sun Jul 15, 2007 10:01 pm

Re: Embedded_Z80/appmake output .bin, .rom?

Post by dom »

I've managed to reproduce the problem on windows, I think there's a workaround which is providing the -s option but I'd like to understand why it's happening.

If you think about the process there's really two stages:

1. -startup= determines the shape of the code (eg, RAM compile where variables are appended to the end of the code, ROM compile where variables are placed starting from an explicit address in memory)
2. The packaging - performed by appmake. This pulls together all the sections and creates a single binary/disc image/tape file depending on what target you're compiling for

z88dk-appmake has got (literally) 100s of options (it's really 80 programs in one), you can see the relevant ones for you with "z88dk-appmake +rom", they can be passed through by prefixing with "-Cz" as I showed above.
User avatar
dom
Well known member
Posts: 1559
Joined: Sun Jul 15, 2007 10:01 pm

Re: Embedded_Z80/appmake output .bin, .rom?

Post by dom »

dom wrote: Sat Jan 15, 2022 6:51 pm I've managed to reproduce the problem on windows, I think there's a workaround which is providing the -s option but I'd like to understand why it's happening.
And I wrote that post too soon. Thankfully it affected all platforms, I've just not rebuilt the zcc binary lately because I didn't realise it had changed It looks like it broke from the nightly on 9/1/2022
tangent3D
New member
Posts: 3
Joined: Sun Dec 19, 2021 12:23 am

Re: Embedded_Z80/appmake output .bin, .rom?

Post by tangent3D »

Thank you for the instructions and for taking another look!

I confirmed that adding -Cz--romsize=16384 to my ROM target results in the behavior I expected (.rom output) on both platforms. Adding -s/-gen-symbol-file to my RAM target produces a .bin file on win32.

This is exactly what I wanted! Many thanks for your time and I'll stay tuned for any further developments in this area.
Post Reply