Z88DK :- ZX Next Target (+zxn)

If you like transforming your statements into code, this is the place for you

Moderator: Programming Moderators

Spec-chum
Posts: 36
Joined: Tue May 30, 2017 11:14 am

Re: Z88DK :- ZX Next Target (+zxn)

Post by Spec-chum » Mon Aug 28, 2017 11:04 pm

Thanks AA, I'll try new update when it drops tomorrow.

Issue is tho, just to be clear, the .sna file isn't even being built, z80asm is giving a fatal error with

Code: Select all

z80asm --cpu=z80-zxn -b -d  -o"loadit.sna" -m -s -L.  -L"D:\Retro\Speccy\z88dk\lib\config\..\..\\libsrc\_DEVELOPMENT\lib\sdcc_iy"   -D__SDCC -D__SDCC_IY -I"D:\Retro\Speccy\z88dk\lib\config\..\..\\libsrc\_DEVELOPMENT\target\zxn" -izxn    "C:\Users\specc\AppData\Local\Temp\zcc938D3.o" "C:\Users\specc\AppData\Local\Temp\zcc938D2.o"
Assertion failed!

Program: D:\Retro\Speccy\z88dk\bin\z80asm.exe
File: modlink.c, Line 381

Expression: expr->target_name == NULL
It's not that the sna files doesn't work (it does, I tried it on ZXSpin when I built it with with +zx instead of +zxn) but it doesn't build at all when +zxn is selected.

Thanks for all your help as always :)
I'm not insane; my mother had me tested

Alcoholics Anonymous
Posts: 511
Joined: Mon May 29, 2017 7:00 pm

Re: Z88DK :- ZX Next Target (+zxn)

Post by Alcoholics Anonymous » Mon Aug 28, 2017 11:16 pm

Spec-chum wrote:
Mon Aug 28, 2017 10:06 pm
Tried the esxdos example and getting this:

Code: Select all

Assertion failed!

Program: D:\Retro\Speccy\z88dk\bin\z80asm.exe
File: modlink.c, Line 381

Expression: expr->target_name == NULL
Is this from the windows nightly build?

My binaries are here if you want to try again with these:
https://drive.google.com/file/d/0B6XhJJ ... sp=sharing

I'll try the nightly build binaries now. It could be the nightly is broken as there were changes in the last couple of days. The nightly build binaries are cross compiled from linux whereas mine are built with vs2015.

Spec-chum
Posts: 36
Joined: Tue May 30, 2017 11:14 am

Re: Z88DK :- ZX Next Target (+zxn)

Post by Spec-chum » Mon Aug 28, 2017 11:24 pm

Latest from tonight, 28/08/17 yeah.

I can't try again tonight, I've gone to bed now lol

Will certainly give it another go tomorrow tho.
I'm not insane; my mother had me tested

Alcoholics Anonymous
Posts: 511
Joined: Mon May 29, 2017 7:00 pm

Re: Z88DK :- ZX Next Target (+zxn)

Post by Alcoholics Anonymous » Mon Aug 28, 2017 11:43 pm

Spec-chum wrote:
Mon Aug 28, 2017 11:24 pm
Latest from tonight, 28/08/17 yeah.

I can't try again tonight, I've gone to bed now lol

Will certainly give it another go tomorrow tho.
I tried on my machine with the last nightly build and it also works.
Let's see if it goes away in the next build (fingers crossed but I haven't found many of my problems go away with this method :P )

The compile line:

zcc +zxn -v -m -startup=31 -clib=sdcc_iy loadit.asm -o loadit.sna -subtype=sna -create-app

will give you another error though (from appmake):

zx: Error: Input and output filenames must be different
Building application code failed

because appmake will want to create "loadit.sna" and it will worry you already have one. For -o just use the root output filename and z88dk will add appropriate extensions for the various files it creates.

EDIT: I found the problem. The nightly build is not building the zx next library properly. I'm not sure why yet but the problem will go away if you build the z80 libraries yourself. From z88dk/libsrc/_DEVELOPMENT, do "Winmake all" and all the libraries will be built.
https://github.com/z88dk/z88dk/issues/338

Spec-chum
Posts: 36
Joined: Tue May 30, 2017 11:14 am

Re: Z88DK :- ZX Next Target (+zxn)

Post by Spec-chum » Tue Aug 29, 2017 6:35 pm

I got it all working using GIT and VS2017 now :)
I'm not insane; my mother had me tested

User avatar
varmfskii
Posts: 186
Joined: Fri Jun 23, 2017 1:13 pm
Location: Albuquerque, NM USA

Re: Z88DK :- ZX Next Target (+zxn)

Post by varmfskii » Wed Jan 24, 2018 3:17 am

Is there somewhere I can find details about the -startup option for the next?
Backer #2741 - TS2068, Byte, ZX Evolution

Alcoholics Anonymous
Posts: 511
Joined: Mon May 29, 2017 7:00 pm

Re: Z88DK :- ZX Next Target (+zxn)

Post by Alcoholics Anonymous » Tue Jan 30, 2018 8:52 pm

varmfskii wrote:
Wed Jan 24, 2018 3:17 am
Is there somewhere I can find details about the -startup option for the next?
Sorry I'm quite busy atm so I haven't been keeping up. The following is in the context of the newlib.

The startup numbers determine what crt is attached to the compile. The crt is just some initialization code (eg zero bss) and some exit code (eg close open files) but it can also define what drivers (if any) are attached to stdin,stdout,stderr. It's possible for you to decide that yourself at compile time but easy options are pre-made and assigned to some crt numbers.

For the zx spectrum, some of this is briefly explained at the end of this page:
https://github.com/z88dk/z88dk/blob/mas ... loWorld.md

This mentions all the pre-made crts for the zx spectrum except the ones for if2 cartridges (they use the same crts but add "-subtype=if2" to the compile line).

The set for the zx next are still under construction. It inherits from the zx spectrum and adds a few more:

-startup=0 (crt0) spectrum screen
32x24 mode, no control code support

-startup=1 (crt1) spectrum screen
32x24 mode, control codes supported

-startup=4 (crt4) spectrum screen
64x24 mode, no control code support

-startup=5 (crt5) spectrum screen
64x24 mode, control codes supported

-startup=8 (crt8) spectrum screen
fzx proportional fonts, no control code support

-startup=9 (crt9) spectrum screen
fzx proportional fonts, control codes supported

-startup=16 (crt16) timex hi res screen
64x24 mode, no control code support

-startup=20 (crt16) timex hi res screen
128x24 mode, no control code support

-startup=24 (crt24) timex hi res screen
fzx proportional fonts, no control code support

-startup=30 (crt30) spectrum screen
32x24 rom print routine, no scanf much smaller than other crts because the rom is used for output

-startup=31 (crt31)
stdio not supported at all

The startup values can be modified by a subtype determined on the compile line:

-subtype=dot make a regular 8k dot command
adds 0x100 to startup

-subtype=dotx make extended dot command
adds 0x200 to startup

-subtype=dotn make Next dot command
adds 0x300 to startup

(see https://github.com/z88dk/z88dk/tree/mas ... xn/startup for the actual crt code and what is currently there).

The adds select another crt with the same characteristics. A different crt is needed because dot commands have special requirements that the crt takes care of. So "-startup=30 -subtype=dot" will make a regular dot command using "-startup=30 (crt30) spectrum screen 32x24 rom print routine, no scanf much smaller than other crts because the rom is used for output" as above.

As mentioned, these are pre-set for your convenience but in a compile you can decide what terminals are open - there can be many windows of different sizes. The drivers are also object oriented so you can customize their behaviour by adding a little code too.

dodger
Posts: 1
Joined: Sat Sep 22, 2018 1:12 pm

Re: Z88DK :- ZX Next Target (+zxn)

Post by dodger » Thu Sep 27, 2018 10:30 am

Hi,

I'm used to C development with IDE's to hide all the command-line compiler details. Are there any IDE's that have integrated +zxn compilation? :)

Stefan123
Posts: 102
Joined: Mon Jun 05, 2017 9:38 pm

Re: Z88DK :- ZX Next Target (+zxn)

Post by Stefan123 » Thu Sep 27, 2018 10:51 am

I'm using Eclipse CDT together with a top-level makefile in my projects with the usual 'all' and 'clean' makerules. In that way, it's easy to compile from Eclipse and CDT's C parser and indexer are really good nowadays.

Alcoholics Anonymous
Posts: 511
Joined: Mon May 29, 2017 7:00 pm

Re: Z88DK :- ZX Next Target (+zxn)

Post by Alcoholics Anonymous » Fri Sep 28, 2018 1:58 pm

The one thing makefiles will get you is incremental compilation.

However it is possible to compile an entire project with one line. I do that all the time in a terminal window under windows. Press up arrow and enter to compile.

There are some example dot command projects in the official zx-next repository now, here's one:
https://gitlab.com/thesmog358/tbblue/tr ... s/find/128

All the files that need to be part of the output are listed in "zproject.lst" (asm, c, etc). Options are detailed in "zpragma.inc" and then it is all compiled in one line which I've extracted from "BUILDME.BAT":

zcc +zxn -v -startup=30 -clib=sdcc_iy -SO3 --max-allocs-per-node200000 --opt-code-size @zproject.lst -o find -pragma-include:zpragma.inc -subtype=dotn -Cz"--clean" -create-app

This builds from scratch so there is no incremental compilation. The makefile route adds that and it can be very helpful especially if you are using zsdcc to compile the c code and have optimization turned up high.

Post Reply