z88dk v1.99A Release Candidate
Z88DK VERSION 1.99A RELEASE CANDIDATE
Download from:
http://nightly.z88dk.org/Releases/
The release candidate will be available for testing until December 23 when it will be replaced by an official release of v1.99A.
The download options are a binary win32 build, a binary mac osx build and a generic source tree for other platforms. Installation hints can be found here. Instructions for installing the MacOSX binary are missing so if MacOSX user is able to submit those, it would be appreciated :)
z88dk has undergone some significant development in the past two years. The version number reflects this (v1.99) and anticipates a v2.0 when the development roadmap is completed.
WHAT'S NEW
Quite a lot and we don't have a complete list of changes yet.
In broad terms:
* [z80asm] Sections introduced for creating memory maps and compiling for bankswitched memory
* [z80asm] Modern operator syntax introduced
* [z80asm] PUBLIC, EXTERN, GLOBAL scoping keywords introduced to replace XDEF, XREF, XLIB, LIB, etc
* [sccz80] Numerous bugfixes
* [classic c library] New targets and new libraries which will be enumerated at official release
* [new c library] A new c library has been written from scratch in assembly language and currently contains more than 700 functions
* [new c library] Compatible with sdcc
* [new c library] Many unique libraries including zx7 (compression), adt (C++ STL containers), fzx (proportional fonts), BIFROST/NIRVANA/SP1 (zx), tritone music and bitfx sound effects for 1-bit audio devices.
* [new c library] Object oriented stdio allowing writing of sophisticated drivers using code inheritance from the library. Currently base classes implement serial character devices and terminal (console) devices.
* [new c library] Targets supported initially include cp/m, embedded (generic z80) and zx (zx spectrum). The built-in crts allow creation of terminal windows with assignable input source using fixed width or proportional fonts, output as ROM or RAM-resident programs.
* [new c library] The library and crts are highly configurable. Library built time options allow selection between fast and small library code and the crts can be configured at compile time by embedded pragmas in the C source code.
* [sdcc] sdcc is fully supported as alternate C compiler using the new C library.
* [sdcc] sdcc's output is improved by an additional 400 peephole rules supplied by z88dk
* [sdcc] sdcc's calls to its primitives are modified to use smaller and faster callee linkage
The combination sdcc+z88dk supplies a C compiler that behaves similarly to 32-bit C compilers. sdcc implements a large subset of C90/C95/C11 standards and the z88dk library completes the compliance. The only missing element is the disk i/o which is currently under development.
sccz80 will often create smaller code than sdcc particularly when longs and floats are in use.
Some benchmarks including Dhrystone 2.1 and Whetstone 1.2 comparing with some other commercial compilers:
http://www.z88dk.org/wiki/doku.php?id=temp:front#benchmarks
New documentation under construction:
http://www.z88dk.org/wiki/doku.php?id=temp:front
Collection of links describing how to compile with sdcc:
http://www.z88dk.org/wiki/doku.php?id=temp:front#compiling_with_sdcc
Example programs using the classic library:
z88dk/examples
Example programs using the new c library and sdcc:
z88dk/libsrc/_DEVELOPMENT/EXAMPLES
PURPOSE OF A RELEASE CANDIDATE
We are hoping to identify problems with installation and use before an official release. Particularly we are looking for problems with using the new elements in the release.
1. Try making the new c library.
cd z88dk/libsrc/_DEVELOPMENT
windows: "Winmake all" (10-15 mins to complete)
other: "make"
2. Try compiling your own programs and some of the examples.
Thanks to anyone who can find the time at this time of year to do a little testing :)
Download from:
http://nightly.z88dk.org/Releases/
The release candidate will be available for testing until December 23 when it will be replaced by an official release of v1.99A.
The download options are a binary win32 build, a binary mac osx build and a generic source tree for other platforms. Installation hints can be found here. Instructions for installing the MacOSX binary are missing so if MacOSX user is able to submit those, it would be appreciated :)
z88dk has undergone some significant development in the past two years. The version number reflects this (v1.99) and anticipates a v2.0 when the development roadmap is completed.
WHAT'S NEW
Quite a lot and we don't have a complete list of changes yet.
In broad terms:
* [z80asm] Sections introduced for creating memory maps and compiling for bankswitched memory
* [z80asm] Modern operator syntax introduced
* [z80asm] PUBLIC, EXTERN, GLOBAL scoping keywords introduced to replace XDEF, XREF, XLIB, LIB, etc
* [sccz80] Numerous bugfixes
* [classic c library] New targets and new libraries which will be enumerated at official release
* [new c library] A new c library has been written from scratch in assembly language and currently contains more than 700 functions
* [new c library] Compatible with sdcc
* [new c library] Many unique libraries including zx7 (compression), adt (C++ STL containers), fzx (proportional fonts), BIFROST/NIRVANA/SP1 (zx), tritone music and bitfx sound effects for 1-bit audio devices.
* [new c library] Object oriented stdio allowing writing of sophisticated drivers using code inheritance from the library. Currently base classes implement serial character devices and terminal (console) devices.
* [new c library] Targets supported initially include cp/m, embedded (generic z80) and zx (zx spectrum). The built-in crts allow creation of terminal windows with assignable input source using fixed width or proportional fonts, output as ROM or RAM-resident programs.
* [new c library] The library and crts are highly configurable. Library built time options allow selection between fast and small library code and the crts can be configured at compile time by embedded pragmas in the C source code.
* [sdcc] sdcc is fully supported as alternate C compiler using the new C library.
* [sdcc] sdcc's output is improved by an additional 400 peephole rules supplied by z88dk
* [sdcc] sdcc's calls to its primitives are modified to use smaller and faster callee linkage
The combination sdcc+z88dk supplies a C compiler that behaves similarly to 32-bit C compilers. sdcc implements a large subset of C90/C95/C11 standards and the z88dk library completes the compliance. The only missing element is the disk i/o which is currently under development.
sccz80 will often create smaller code than sdcc particularly when longs and floats are in use.
Some benchmarks including Dhrystone 2.1 and Whetstone 1.2 comparing with some other commercial compilers:
http://www.z88dk.org/wiki/doku.php?id=temp:front#benchmarks
New documentation under construction:
http://www.z88dk.org/wiki/doku.php?id=temp:front
Collection of links describing how to compile with sdcc:
http://www.z88dk.org/wiki/doku.php?id=temp:front#compiling_with_sdcc
Example programs using the classic library:
z88dk/examples
Example programs using the new c library and sdcc:
z88dk/libsrc/_DEVELOPMENT/EXAMPLES
PURPOSE OF A RELEASE CANDIDATE
We are hoping to identify problems with installation and use before an official release. Particularly we are looking for problems with using the new elements in the release.
1. Try making the new c library.
cd z88dk/libsrc/_DEVELOPMENT
windows: "Winmake all" (10-15 mins to complete)
other: "make"
2. Try compiling your own programs and some of the examples.
Thanks to anyone who can find the time at this time of year to do a little testing :)
Post edited by Alcoholics Anonymous on
Comments
Argh, I really should be doing a game these weeks. But I'm probably too lazy...
Games List 2016 - Games List 2015 - Games List 2014
Thanks to anyone who had a chance to do some testing. A few minor issues were found and corrected in the release.
CHANGES (brief)
z88dk 1.99A 23.Dec.2015
Major changes incorporated into z88dk. This is a transition release in anticipation of v2.0.
Two C compilers are supported (sccz80 - z88dk's native C compiler - and sdcc).
Two different C libraries are present (classic - the same library as pre 1.99A - and new).
Accordingly, there are now three different compile modes:
1. Compile with sccz80 and the classic C library. This is equivalent to pre-1.99A.
2. Compile with sccz80 and the new C library. Compile lines include "-clib=new".
3. Compile with sdcc and the new C library. Compile lines include "-clib=sdcc_ix" or "-clib=sdcc_iy".
[z80asm] Sections have been introduced for generating memory maps and compiling to bankswitched memory.
[z80asm] Modern logical operators have been adopted.
[z80asm] New scoping keywords PUBLIC, EXTERN and GLOBAL introduced.
[z80asm] Relocate files are generated for output binaries for patching assembled code to a new address at load time.
[sccz80] Numerous bugfixes.
[sdcc] SDCC is now fully supported as alternate C compiler for the new C library.
[sdcc] SDCC's generated code is improved by a large set of aggressive peephole rules (use -SO3 to enable).
[sdcc] SDCC's calls to its primitive functions are modified to use callee linkage.
[new c lib] New C library written in assembly language from scratch aiming for a subset of C11 compliance. Contains more than 700 functions currently.
[new c lib] Stdio made object-oriented so that drivers can inherit library code to implement features with a minimal amount of additional code.
[new c lib] Stdio base classes currently include serial character i/o and terminal i/o implementing windows and proportional fonts. Disk i/o is missing in this release.
[new c lib] Unique stdio implementation allows removal of high level buffers without affecting performance.
[new c lib] Many functions from GNU and POSIX are present beyond the C11 standard.
[new c lib] Many unique libraries including some C++ STL containers, data compression, obstacks, game libraries, sound, fzx proportional fonts, etc. The new C lib contains libraries not present in the classic C lib and vice versa. Over time the two libraries will homogenize.
[new c lib] CRTs are supplied for three initial targets: embedded (generic z80), cpm, zx (zx spectrum). Specialized crts allow immediate compilation without customization by the user.
[new c lib] The library and crts are highly configurable at library build time and at compile time. Options allow easy generation of binaries for ROM or RAM targets.
[tools] New tool ticks is a command line z80 emulator able to exactly measure execution time of a code block.
[tools] New tool dzx7 is a decompressor counterpart to zx7.
[tools] New tool zx7 is an optimal lz77/lzss data compressor with companion decompression subroutines in the z80 library.
[appmake] +rom added to manipulate raw binaries; options include code injection, extraction and conversion to intel hex format.
The new C library completes C standards compliance for sdcc and leads to much smaller and faster output binaries. sdcc's longlong type is not supported in this release.
Documentation is a work in progress.
Installation:
http://www.z88dk.org/wiki/doku.php?id=temp:front#installation
Overview, Classic C Library Information:
http://www.z88dk.org/wiki/doku.php
Overview, New C Library Description, SDCC compilation described:
http://www.z88dk.org/wiki/doku.php?id=temp:front
Some benchmarks:
http://www.z88dk.org/wiki/doku.php?id=temp:front#benchmarks
Write games in C using Z88DK and SP1
Games List 2016 - Games List 2015 - Games List 2014
Yes but you will have to include different header files: z80.h, alloc/balloc.h
balloc has changed a little bit. The balloc table size can be specified with a suitable pragma at the top of your main.c "#pragma output CLIB_BALLOC_TABLE_SIZE = 4". This will set aside space for four memory queues. By default the table size is 0 and the table is not created. If you keep it like that you can still create the table manually as is done in the current classic lib. The address of the table probably has a different name but you'll find that out on the first compile.
The reason it's sucked into the library is that the new c lib is going to be muti-threading since C11 has defined some multi-threading features. The block table may become part of a thread's properties so that it is swapped out on context switch.
Anything using sccz80 and the classic c lib should compile as usual :-/
Is it a small program or are you able to isolate where the problem is? Also try compiling at different optimization level -O2 or -O3.
If you can isolate to a code example I can have a look.
Most people are going to be in the malls for last minute shopping. That will be me until the stores close at 4 o'clock today :P
If you do get a chance though, even checking if some existing programs continue to compile using the classic c lib would be helpful. I think you were using a nightly build? If it's 1.10 the library format has changed so external libraries like sp1, eg, would have to be re-built.
Write games in C using Z88DK and SP1
I'll give it another go later, although I don't think I'll do the switch with this project.
Thanks for the tips!
There is a lot more customization possible in the new clib compile. Someone has already pointed out that binaries using stdio are a little bigger. Einar started this thread: http://www.z88dk.org/forum/viewtopic.php?id=9159 to inquire about some of the things you can do to shrink the binary size. Stdio itself is not bigger but the terminal drivers are -- this is because the new c lib zx target is completely rom independent and the terminal drivers are 'real' as in similar in structure to 32-bit machines.
Write games in C using Z88DK and SP1
I use Linux and I don't install the compiler. Z88DK is not in my path and the env variables aren't set, I set everything per Makefile.
I'm confident that that wasn't the problem :)
It compiles, but when the BAS loader gives control to the game, it hangs. That surprised me, I was expecting the old clib to just work.
I don't use stdio. As long as sp1 and its dependencies work it'll be OK :)
I'd be interested to use the SDCC backend with sp1, other than that the old version of Z88DK works for me.
That should be "ZCCCFG" and not "Z80_ZCCCFG"
Write games in C using Z88DK and SP1
Crisis I see where that came from -- it's in the wiki as "Z80_ZCCCFG". I've changed the wiki now - let me know if this solves the problem.
Write games in C using Z88DK and SP1
Anyway, I need to give it another go when I have my current code "working" :)
It might.. it could be it is using the config files from another install instead of the new one.
The best thing to do to rule out interference from an old install is just rename the root dir of the old install to "z88dk_110" or something so that nothing points into it anymore.
The linux version I am a little more nervous about because I haven't personally tested it. I'm on windows and I know everything works there very well but I have to depend on others to test linux and macosx.
If you're on linux and you've just installed, there are some example programs using the new parts of z88dk in z88dk/libsrc/_DEVELOPMENT/EXAMPLES . If you can test compile these and confirm it works that would be awesome.
EXAMPLES/zx/demo_tritone
contains some of FrankT's tritone music. The build process can be run by Windows users by executing "Winmake" from the command line to get a tap file. For linux, the last two lines of "Winmake.bat" have to be replaced:
should be changed to:
After that is done you should be able to "source Winmake.bat" to execute the command list.
EXAMPLES/zx/demo_bifrosth
EXAMPLES/zx/demo_nirvanap
EXAMPLES/zx/demo_sp1
contain demos for bifrost, nirvana+ and sp1. The compile lines are listed at the top of the c files. Usually there are two: one with "-clib=new" and one with "-clib=sdcc_**". You only need to run one of these of course; the former uses sccz80 to compile and the latter uses sdcc to compile.
The are more general examples in the main EXAMPLES directory that can also be compiled for cpm, eg. Compiling startrek.c requires the most effort as only sdcc can compile it (so you have to go through the sdcc install process) and the library has to be re-built to enable %f for printf.
The next thing to try is to make sure you can rebuild the C library. In the new part of z88dk this will be commonly done to reduce code size or increase execution speed.
cd to z88dk/libsrc/_DEVELOPMENT
see if you can build the zx library:
"make zx"
Windows users can use "Winmake zx" but I know that works :)
After building the library try to compile one of the example programs again to make sure it still runs.
Write games in C using Z88DK and SP1
.../lib/z80_crt0.hdr' line 15: Unknown identifier
.../lib/z80_crt0.hdr' line 16: Unknown identifier
...
If I set Z80_OZFILES to .../lib/config; it compiles and runs fine. The program binary size is the same as when using the old compiler.
I'm lost at this point to be honest.
With "-clib=new" I get the same behaviour so that makes me think that the test is wrong.
Went to libsrc/_DEVELOPMENT and run "make all":
cp target/m/clib_cfg.asm .
cp: cannot stat ‘target/m/clib_cfg.asm’: No such file or directory
I need to read the docs in case something has changed in the CLI interface.
Either the docs are unclear or I'm reading them wrong (could be the case!). I'll investigate further later.
The examples won't work in an operating system with case sensitive file system. Consider using lower case only to avoid issues ;) Also it would be nice if Makefiles were used (Makefile.linux is fine!), but I see this is development code and not a final release.
I compiled and run the tritone example and works just fine.
From this it looks like the binaries you are running are the old ones. There are no identifiers in z80_crt0.hdr:
However the old binaries will not recognize "EXTERN" and might think those are identifiers.
Can you check your path variable "echo $PATH" and see if the old z88dk/bin is ahead of the new z88dk/bin ?
Does the make continue or does it abort? A "make all" should be building "zx", "m", "cpm", "embedded". "m" is the float math library and it does not have those cfg files so the error is correct (the build process for "m" does not need them). In the Windows batch file we just ignore errors on those copies by sending stderr to oblivion so no error message is printed. In the linux makefile we can send stderr to /dev/nul if the makefile is not aborted or maybe it's better to test for the existence of the files before copying.
The new side of z88dk is completely independent from the classic side. The z80 makefile is independent, the libraries are separate, the include files are separate, the crts are separate, and the z80 build process is separate. z88dk/libsrc/_DEVELOPMENT (and z88dk/include/_DEVELOPMENT for the header files) is the root of everything to do with the new side except for the cfg files which are shared with the classic side. The CLI interface is the same insofar as the same binaries are used but with some different command line options.
The filenames are generated from section names defined in the C or assembler where they are case sensitive. In the source code I've been using capitalized section names to indicate sections with their own ORG that will ultimately be output in their own binary files. Lower case section names correspond to sections that are absorbed into larger (upper case) ones.
Case issues are not something that can be gotten away from because of the connection to case sensitive names in C and asm. It will have to be up to the user to make sure there are no section names that differ only in case.
I did go back to that tritone example and saw that I did forget to capitalize the last "s" in "MUSIC_SUPER70s.bin.zx7". I've fixed that now. Now there should be no trouble with a case sensitive file system :)
Yes some sort of makefile should accompany that windows batch file. I will put something in for the next release, or this one if it turns out there are problems present and we have to replace the download.
I would call the new side beta but because the library is so large a lot of functions have only been tested superficially. Part of putting it out in the wild is, ashamedly, trying to gather help in identifying problems :P The core stuff is pretty solid though as that has seen some unusual (for the z80) code tested against it.
The 2.0 release will probably see a directory restructure so that the classic and new are side-by-side possibly with space for other z80 related things.
Que? To successfully compile that example you have to be using the correct binaries and "-clib=new" must work. You reported at the beginning that "-clib=new" caused the same errors?
I'll ask stefano and dom to do a clean install and see what they discover.
Write games in C using Z88DK and SP1
I don't know what happened, but it happened on that z88dk2 directory where the new Z88DK version is!
BTW thanks for the new Z88DK
JSpeccy-win32-portable
Actually I went ahead and did something almost similar: I made a Knoppix CD and booted from that.
I went through the install process. What I found was build.sh needs to have execute permission but otherwise everything built fine.
I was able to compile the new examples and old examples using the classic lib without any problem (save the lower case 's' in the tritone demo's song.asm).
For building the new C lib in z88dk/libsrc/_DEVELOPMENT, the makefile is not equivalent to the Windows batch file. I probably didn't communicate clearly to dom what the requirements are and looking at the makefile itself I thought it might be doing what was expected (but it's not). The missing cfg files for the "m" target is a problem that stops the build process but for now that can be ignored by building with "make -i all". But the makefile is supposed to be able to build individual target libraries using things like "make zx" or "make cpm" but it can't do that. Right now you must build all the target libraries under linux. I don't think dom was aware at that time that each individual target library is customizable so it's important to be able to build each target's library individually. As it turns out, when I did "make -i all" under Knoppix, all the target libraries were built in about 20 seconds on my machine. When I run "Winmake all" for Windows, it takes 10 minutes. I kid you not :P On windows it's very important to be able to build individual target libraries or you'll be twiddling your thumbs a lot. The same might be true for linux as more targets are added.
So I think I will probably change the linux and macosx distributions so that:
* build.sh has execute permission
* demo_tritone has the case issue resolved and there is a companion makefile
* The new c lib makefile is fixed up somewhat so there is no error that stops the build.
But before that happens I'd like to know what is going on with reidrac's install :D
Write games in C using Z88DK and SP1
This also looks like you are executing zcc from 1.10.
If you do a "which zcc" is it pointing into the new install?
I would think it would overwrite but erase and refetch is probably the easiest to rule out some problems.
It does look to me like you have an older install present which is ahead of the new install in your path so that the old zcc is run instead of the new one. If you have an older z88dk install, maybe change the name of its root directory from "z88dk" to "z88dk_110" to see if the problems go away and to rule out interference from a previous install.
Write games in C using Z88DK and SP1
Ok so after everything is built by the makefile it should work inside the current terminal (the path and config would have to be exported as part of your bash_profile in order to persist across logout and opening of new terminals).
And it does not work in that terminal after making?
I'll have to take another look at the source to make sure the linux version is preferring the explicit environment vars instead of looking for default directories.
Write games in C using Z88DK and SP1
Not exactly. Those values only work for that make session, so I know things are OK but after that my session doesn't have any of the env variables.
So when you run "make" everything is OK, but then after that your environment is clean.
I don't know what is happening. I'll try to investigate further.
I also installed sdcc along with the patch for z88dk using these steps:
svn checkout svn://svn.code.sf.net/p/sdcc/code/trunk@9419 sdcc-code
copy "z88dk-sdcc.patch" from http://z88dk.cvs.sourceforge.net/viewvc/z88dk/z88dk/libsrc/_DEVELOPMENT/sdcc_z88dk_patch.zip?revision=1.21 into the sdcc-code directory
cd sdcc-code
patch -p0 < z88dk-sdcc.patch
cd sdcc
./configure
(you may need to apt-get some things here including boost)
make
(the libraries will fail to build - this is caused by our patch and is why it is not accepted into sdcc)
in sdcc-code/sdcc/bin rename "sdcc" to "zsdcc"
cd back to sdcc-code
patch -Rp0 < z88dk-sdcc.patch
(this undoes the patch)
cd sdcc
make
(build should be successfully completed this time)
sudo make install
which sdcc
(find out where the sdcc binary was installed)
sudo cp the zsdcc binary in sdcc-code/sdcc/bin to the same location
zsdcc -v
(indicates version information if successful)
I think we will update the linux and macosx packages. We're looking at supplying the zsdcc binaries so the update may be another day or two,
After this you can go into z88dk/libsrc/_DEVELOPMENT/EXAMPLES and try some sdcc compiles. The compile lines are listed in the .c files.
Write games in C using Z88DK and SP1
Started from the beginning, cleaning everything, and it builds my game perfect. Something was left in the way; still don't know what, but I made a mistake.
Sorry about that!
(the program hangs, but at least i know compiles!)
Crisis I think your issue is very likely having an old install ahead of the new install in your path. Let me know if you are still unable to get things to work.
Write games in C using Z88DK and SP1
That's a system install so it's definitely an older version of z88dk since the wiki instructions are doing a home directory install instead.
[/code]
ch@linux-4xd4:~> cd usr/local/bin
bash: cd: usr/local/bin: No such file or directory
[/code]
That directory is not accessible to users so you must access it as root or sudo everything as in "sudo cd usr/local/bin"
I would get rid of the old install too which is in usr/local/bin.
Another thing you could do is instead of adding the new z88dk/bin to the end of your path, you could add it to the front:
export PATH=${HOME}/z88dk/bin:${PATH}but this is an unsafe thing to do since people can hijack you by putting their own versions of common binaries like "ls" or "cd" into z88dk/bin.
Write games in C using Z88DK and SP1
More details in this thread. But not too many more :P
Write games in C using Z88DK and SP1
For a system install to work, some files will have to be kept in the user's local z88dk directory because the new c library itself is meant to be customizable and that is not set up yet.
For the next release we will have to sort out a new directory structure to accommodate that. The fault is mine -- I wasn't using linux so the issues didn't come up and the other devs were not aware of the new functionality.
Write games in C using Z88DK and SP1
Thanks for all the hard work, in any case!