TRS-80
TRS-80
Hi everybody, I thought to put an official post for this somewhere in the forum.
I'm proud to announce that z88dk is now able to compile programs for the TRS-80 !
Simple sound and graphics support is available, so libraries are complete enough to make the "Death Star" game run with bells and whistles.
Due to the lack of Model II emulators, it has been roughly tested on Model I, III, and IV only, and it never run on the real hardware so far.
If someone in the list owns a real TRS-80 computer and is willing to help, he is welcome.
I'm proud to announce that z88dk is now able to compile programs for the TRS-80 !
Simple sound and graphics support is available, so libraries are complete enough to make the "Death Star" game run with bells and whistles.
Due to the lack of Model II emulators, it has been roughly tested on Model I, III, and IV only, and it never run on the real hardware so far.
If someone in the list owns a real TRS-80 computer and is willing to help, he is welcome.
-
- New member
- Posts: 3
- Joined: Wed Oct 28, 2009 3:44 am
Back in the late '70s and early '80s I used to manufacture a clone of the Model I/III (kit) called the Cyzern System 7000. We still have a bunch of the units in inventory and I want to try running with the NewDos 80 OS and the original hardware. It may need some tweeking, but it would be great so push some electrons around the original ICs! Let me know if you are interested in any of the documentation!
-
- New member
- Posts: 3
- Joined: Wed Oct 28, 2009 3:44 am
Stefano, okay, I will start with the Death Star. As far as sound is concerned, the Cyzern has an 8 bit sound port. It is also quite easy to modify the original TRS-80 Model I, III or IV for 8 bit sound. Stefano, I am very interested in your software and will try to make it work with the older hardware, because I want to put a "modern" version of the TRS-80 (single board machine that uses standard VGA and PSII keyboard) into the public domain for experimenters who would like to build their own. I have the Level II Basic ROM code that we modified to use in our system, and it would be nice for experimenters to be able to run C as well as Basic from ROM, disk or flash. Thanks again!
Tiny docs for TRS are here.. http://www.z88dk.org/wiki/doku.php?id=platform:trs80
Then read the dstar.c source some compile hint is included.
Then read the dstar.c source some compile hint is included.
-
- New member
- Posts: 7
- Joined: Mon Mar 31, 2014 12:25 am
I'm just trying out z88dk for TRS-80, and I get this when trying to compile any program (e.g. a simple hello world)
Error at file 'C:\PROGRA~2\Z88DK\lib\/trs80_crt0.asm' line 109: Unknown identifier
^ ---- _vfprintf
Have I missed some prerequisite? I don't remember seeing any errors during the install ...
Error at file 'C:\PROGRA~2\Z88DK\lib\/trs80_crt0.asm' line 109: Unknown identifier
^ ---- _vfprintf
Have I missed some prerequisite? I don't remember seeing any errors during the install ...
Can you post the compile line you are using? Maybe direct all output to a file with "zcc ... 2>&1 > output.txt" so we can see all the text.Nels_P_Olsen wrote:Error at file 'C:\PROGRA~2\Z88DK\lib\/trs80_crt0.asm' line 109: Unknown identifier
^ ---- _vfprintf
Have I missed some prerequisite? I don't remember seeing any errors during the install ...
-
- New member
- Posts: 7
- Joined: Mon Mar 31, 2014 12:25 am
I got z88dk-1.10.1-setup.exe from SourceForge and installed it to C:\z88dk. In a Command Prompt window, I run z88dkenv.bat and then try compiling my trivial "hello world" test program:
zcc +trs80 -lndos hello.c
I get this output:
1 file(s) copied.
1 file(s) copied.
Error at file 'C:\Z88DK\lib\/trs80_crt0.asm' line 109: Unknown identifier
1 errors occurred during assembly
copy c:\z88dk\lib\trs80_crt0.opt C:\Users\Nels\AppData\Local\Temp\s418_1.opt
copy C:\Users\Nels\AppData\Local\Temp\s418_1.opt C:\Users\Nels\AppData\Local\Temp\s418_1.asm
zcpp -I. -DZ80 -DSMALL_C -DTRS80 -D__TRS80__ -DSCCZ80 -Ic:\z88dk\include hello.c C:\Users\Nels\AppData\Local\Temp\s418_.i
sccz80 C:\Users\Nels\AppData\Local\Temp\s418_.i
copt c:\z88dk\lib\z80rules.2 < C:\Users\Nels\AppData\Local\Temp\s418_.asm > C:\Users\Nels\AppData\Local\Temp\s418_.op1
copt c:\z88dk\lib\z80rules.1 < C:\Users\Nels\AppData\Local\Temp\s418_.op1 > C:\Users\Nels\AppData\Local\Temp\s418_.opt
z80asm -eopt -ns -Mo -Ic:\z88dk\lib C:\Users\Nels\AppData\Local\Temp\s418_.opt
z80asm -a -m -Mo -Lc:\z88dk\lib\clibs -Ic:\z88dk\lib -oa.bin -indos -itrs80_clib -iz80_crt0 C:\Users\Nels\AppData\Local\Temp\s418_1.opt C:\Users\Nels\AppData\Local\Temp\s418_.o
Key to filenames:
C:\Users\Nels\AppData\Local\Temp\s418_.o = hello.c
Error at file 'C:\Z88DK\lib\/trs80_crt0.asm' line 109: Unknown identifier
^ ---- _vfprintf
z88dkenv.bat contains:
@echo off
rem *********************************
rem ** z88dk environment variables **
rem *********************************
rem
rem **************************************************
rem ** You can call this file from the command line **
rem ** before running the compiler executables; or **
rem ** from inside another .bat file using the CALL **
rem ** statement. **
rem **************************************************
IF NOT "%Z88DK_ENV_id110141%"=="" GOTO exit_without_settings
SET Z80_OZFILES=C:\Z88DK\lib\
SET ZCCCFG=C:\Z88DK\lib\config\
SET PATH=C:\Z88DK\bin;%PATH%
SET Z88DK_ENV_id110141=true
GOTO the_end
:exit_without_settings
rem echo Nothing to set :-)
:the_end
zcc +trs80 -lndos hello.c
I get this output:
1 file(s) copied.
1 file(s) copied.
Error at file 'C:\Z88DK\lib\/trs80_crt0.asm' line 109: Unknown identifier
1 errors occurred during assembly
copy c:\z88dk\lib\trs80_crt0.opt C:\Users\Nels\AppData\Local\Temp\s418_1.opt
copy C:\Users\Nels\AppData\Local\Temp\s418_1.opt C:\Users\Nels\AppData\Local\Temp\s418_1.asm
zcpp -I. -DZ80 -DSMALL_C -DTRS80 -D__TRS80__ -DSCCZ80 -Ic:\z88dk\include hello.c C:\Users\Nels\AppData\Local\Temp\s418_.i
sccz80 C:\Users\Nels\AppData\Local\Temp\s418_.i
copt c:\z88dk\lib\z80rules.2 < C:\Users\Nels\AppData\Local\Temp\s418_.asm > C:\Users\Nels\AppData\Local\Temp\s418_.op1
copt c:\z88dk\lib\z80rules.1 < C:\Users\Nels\AppData\Local\Temp\s418_.op1 > C:\Users\Nels\AppData\Local\Temp\s418_.opt
z80asm -eopt -ns -Mo -Ic:\z88dk\lib C:\Users\Nels\AppData\Local\Temp\s418_.opt
z80asm -a -m -Mo -Lc:\z88dk\lib\clibs -Ic:\z88dk\lib -oa.bin -indos -itrs80_clib -iz80_crt0 C:\Users\Nels\AppData\Local\Temp\s418_1.opt C:\Users\Nels\AppData\Local\Temp\s418_.o
Key to filenames:
C:\Users\Nels\AppData\Local\Temp\s418_.o = hello.c
Error at file 'C:\Z88DK\lib\/trs80_crt0.asm' line 109: Unknown identifier
^ ---- _vfprintf
z88dkenv.bat contains:
@echo off
rem *********************************
rem ** z88dk environment variables **
rem *********************************
rem
rem **************************************************
rem ** You can call this file from the command line **
rem ** before running the compiler executables; or **
rem ** from inside another .bat file using the CALL **
rem ** statement. **
rem **************************************************
IF NOT "%Z88DK_ENV_id110141%"=="" GOTO exit_without_settings
SET Z80_OZFILES=C:\Z88DK\lib\
SET ZCCCFG=C:\Z88DK\lib\config\
SET PATH=C:\Z88DK\bin;%PATH%
SET Z88DK_ENV_id110141=true
GOTO the_end
:exit_without_settings
rem echo Nothing to set :-)
:the_end
Last edited by Nels_P_Olsen on Thu Apr 10, 2014 12:57 am, edited 1 time in total.
-
- New member
- Posts: 7
- Joined: Mon Mar 31, 2014 12:25 am
I am getting the same thing.. looks like a recent change is causing a problem with communicating the start address to appmake.Nels_P_Olsen wrote:I got the latest build and unzipped that over the 1.10.1 install. It now fails during appmake:
appmake +trs80 -b a.bin -c C:\Users\Nels\AppData\Local\Temp\s4cc_1
Could not find parameter ZORG (not z88dk compiled?)
Building application code failed
You can do this for the time being:
zcc +trs80 hello.c -o hello -lndos
and then invoke appmake manually:
appmake +trs80 -b hello --org 20992
(20992 = $5200 is the default start address)
-
- New member
- Posts: 7
- Joined: Mon Mar 31, 2014 12:25 am
Thanks, that got me past that. "Hello world" is operational through Matthew Reed's TRS32 emulator :-)
Sorry if this is a n00b question, especially since I've been a software developer for almost 25 years, but I haven't worked with C in at least 13 years. How do I figure out which library command line argument (if any) is needed when including a given header file, in the absence of documentation? I'm trying to make a simple demo of graphics, sound and joystick capabilities, so I'm including <graphics.h>, <sound.h> and <input.h>. But it's not clear to me what libraries to reference when compiling. Can someone throw together a sample source file that shows a single use of graphics (e.g. plot some points), sound (make a simple note) and joystick reading (output "you moved left" or "you moved right") that will work for TRS-80 (where these are implemented) and the commands necessary to compile it?
Once I can get that far, if certain things aren't implemented yet for TRS-80, I'd be happy to do that and add it to the z88dk project.
Sorry if this is a n00b question, especially since I've been a software developer for almost 25 years, but I haven't worked with C in at least 13 years. How do I figure out which library command line argument (if any) is needed when including a given header file, in the absence of documentation? I'm trying to make a simple demo of graphics, sound and joystick capabilities, so I'm including <graphics.h>, <sound.h> and <input.h>. But it's not clear to me what libraries to reference when compiling. Can someone throw together a sample source file that shows a single use of graphics (e.g. plot some points), sound (make a simple note) and joystick reading (output "you moved left" or "you moved right") that will work for TRS-80 (where these are implemented) and the commands necessary to compile it?
Once I can get that far, if certain things aren't implemented yet for TRS-80, I'd be happy to do that and add it to the z88dk project.
Glad to hear it. You should be able to compile things with -create-app but there is a lot of stuff changing on almost a daily basis so sometimes the build tools have become broken for a short while.Nels_P_Olsen wrote:Thanks, that got me past that. "Hello world" is operational through Matthew Reed's TRS32 emulator :-)
You shouldn't require any extra library linking except for "-lm" for float math, "-lndos" (which you are using) for targets without a full stdio backend, and I think the main trunk still needs "-lmalloc" for dynamic memory. Ah, found a few more in z88dk/lib/clibs (adt, im2) -- requirements to link against these libraries will be mentioned in the wiki.Sorry if this is a n00b question, especially since I've been a software developer for almost 25 years, but I haven't worked with C in at least 13 years. How do I figure out which library command line argument (if any) is needed when including a given header file, in the absence of documentation?
The bit in the command line "+trs80" automatically selects a library and crt startup put together for the trs80. You can see the list of library functions put together for the trs80 in z88dk/libsrc/trs80.lst. Inside that list, anything beginning with "@" refers to another list in the same directory.
input.h is currently only available for the zx spectrum, zx81 and sam (I think it's listed in the wiki). Graphics and sound are available for the trs80 (although I don't remember the trs80 having sound; it has been a long time ).I'm trying to make a simple demo of graphics, sound and joystick capabilities, so I'm including <graphics.h>, <sound.h> and <input.h>. But it's not clear to me what libraries to reference when compiling. Can someone throw together a sample source file that shows a single use of graphics (e.g. plot some points), sound (make a simple note) and joystick reading (output "you moved left" or "you moved right") that will work for TRS-80 (where these are implemented) and the commands necessary to compile it?
There are some example programs in z88dk/examples/graphics and z88dk/examples/sound. See if you can build those -- you should be able to use the same compile line:
zcc +trs80 -vn julia.c -o julia -lndos -lm (-create-app when it works again)
That particular example compiles for me but I don't know enough about the trs80 to run it right away. Just ignore the warnings -- we're trying to locate case-insensitive names and redo them as case-sensitive so the assembler is spitting out warnings to help locate them.
In sound:
zcc +trs80 -vn synthdemo.c -o synthdemo -lndos
also works for me.
Very nice, having a knowledgable person help build a target is very helpful. There is actually a lot of changes occurring within z88dk right now. If you wander into z88dk/libsrc/_DEVELOPMENT (for source) and z88dk/include/_DEVELOPMENT (for headers) you will see a second independent clib. This clib goes very far in trying to cover C11 and it's written to work with sdcc as well (we are introducing a way to compile with sdcc so that there are two compiler options). The target I am using for testing is a zx spectrum target which can be found in a slightly messy target subdirectory. If you want to try to get something going there for the trs80 you are welcome to. In the coming week I'll try to add the other libraries from the main core code so that the non-standard things like graphics, sound, etc can work. Right now, it's only core clib stuff that is in there (malloc, obstacks, stdio, stdlib, string, some stl-like containers, etc).Once I can get that far, if certain things aren't implemented yet for TRS-80, I'd be happy to do that and add it to the z88dk project.
Watch out, the sound output is a single bit device based on the "tape output" port, whinch might require some (probably simple) mod on the original trs80. I hope to remember correctly. The graohics is based on the bulky text symbols, so you can't expect much, but I think that the graphics demos should work.
The startup stub is bery basic, perhaps the command line parameters parsing can be added as an option.. do you think it could be intersting ?
The startup stub is bery basic, perhaps the command line parameters parsing can be added as an option.. do you think it could be intersting ?
-
- New member
- Posts: 7
- Joined: Mon Mar 31, 2014 12:25 am
That's strange.. the code generated for synthdemo on the trs80 should be the same as for the zx spectrum and I can hear sound on that.Nels_P_Olsen wrote:I get sound from sndtest but not synthdemo.
Could you list one that does work and one that does not? That might help to locate the problem.Only some of the modes in fx give sound.
Stefano is the one who knows most about the library but we'll get a head start while he is sleeping
Was it a warning? The assembler is emitting warnings for case insensitive names to help locate them so that we can change them. Stef, graphics/draw is still using "line" rather than "Line".Trying to use draw() from graphics.h gives an error about undefined symbol 'line', although plot() works.
Yes those are not implemented for the trs80. stdio provides another method :- getk() but usually (as in this case) the stdio routines will use a system rom routine.The keyboard functions defined in <input.h> don't work for me.
-
- New member
- Posts: 7
- Joined: Mon Mar 31, 2014 12:25 am
-
- New member
- Posts: 7
- Joined: Mon Mar 31, 2014 12:25 am
>Problem found.
>Spot the TRS80 section in {z88dk}/libsrc/games and set sndbit_mask to 1.
>(...)
No, it wasn't !
Sorry I lately discovered it is a missing cleanup directive in the libbrary build makefile (gamesdeps wasn't called).
For the record while waiting for the appmake parameter passing to be solved you can explicitly define your location for ORG, in example:
zcc +trs80 -Cz--org -Cz20992 -create-app -lm -DSOUND dstar.c
>Spot the TRS80 section in {z88dk}/libsrc/games and set sndbit_mask to 1.
>(...)
No, it wasn't !
Sorry I lately discovered it is a missing cleanup directive in the libbrary build makefile (gamesdeps wasn't called).
For the record while waiting for the appmake parameter passing to be solved you can explicitly define your location for ORG, in example:
zcc +trs80 -Cz--org -Cz20992 -create-app -lm -DSOUND dstar.c