Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add support for Amstrad PCW (and text-mode CP/M) to TRSE #590

Open
zzarko opened this issue Apr 19, 2021 · 0 comments
Open

Please add support for Amstrad PCW (and text-mode CP/M) to TRSE #590

zzarko opened this issue Apr 19, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request Low Priorty Low priority or will be ignored...

Comments

@zzarko
Copy link
Collaborator

zzarko commented Apr 19, 2021

Amstrad PCW is a Z80-based CP/M machine. It uses 3" disks that are, if I'm not mistaken, the same format as CPC 6128 disks and same tools for assembling them is used. I have successfully used dsktrans to make PCW DSK image from directory of files with:

dsktrans -itype rcpmfs <directory> <image.dsk>

dsktrans is part of libdsk:
https://www.seasip.info/Unix/LibDsk/

As a minimum, directory with files to transfer into dsk image should have these (they can be extracted from PCW disks):

  • setdef.com
  • submit.com
  • j14cpm3.ems
  • profile.sub
  • COM program to run
    To make the COM program to autoboot, content of profile.sub should be:
setdef [order = (sub,com)]
<com_program_name>

where com_program_name is the name of generated COM executable file. Also, profile.sub must be in DOS format, with DOS line endings.

Good compilation of PCW software can be found here:
http://8bitchip.info/oub/Amstrad%20PCW/Amstrad_PCW_8256_Games_Archive_1.1.tar.gz
(one can extract the needed files from there, also using dsktrans)

Joyce is a cross-platform emulator for PCW:
https://www.seasip.info/Unix/Joyce/index.html

The emulator is a bit picky about dsk file location, on Linux they must be placed inside "~/Joyce/Disks" and then you can run the emulator with:

xjoyce -a <dsk_image>

Maybe there is another way, but I haven't found one so far. Actually, to overcome this, I made another directory, "~/Joyce/Dsks" and made "~/Joyce/Disks" to be a symbolic link to "~/Joyce/Dsks". Then I use this script to run dsk image from anywhere I want:

#!/bin/bash

DIR="$( cd "$( dirname "$1" )" >/dev/null 2>&1 && pwd )"
rm /home/zzarko/Joyce/Disks
ln -s "$DIR" ~/Joyce/Disks 
xjoyce -a "$1"
rm ~/Joyce/Disks
ln -s ~/Joyce/Dsks ~/Joyce/Disks

CP/M programs must start from address $0100. There is a GPL2 C compiler for CP/M called MESCC:
https://github.com/MiguelVis/mescc
In there there is a manual, ZSC.DOC which states amongs other things:

Small  C programs should start with a statement: "#include CRUN2.LIB".The
run time routines in CRUN2.LIB include an initial section which  will  set  up
the  stack  and  then  call  the  function  "main()" which must exist in all C
programs.  The group of routines in CRUN2.LIB are essential  in  all  Small  C
programs,  except  for  the  "getp"  and  "putp"  functions.   The other three
libraries can be #included if required.  CONIO2.LIB  contains  functions  that
will  normally  be  needed for CP/M character and string I/O from the console,
FILE2.LIB (which assumes CONIO2.LIB is also present) can be #included if files
are going to be used.  NUMIO2.LIB contains some routines in  C  for  inputting
and outputting decimal and hexadecimal numbers.

Inside mentioned linbraries is the code to inteface with the CP/M OS. I do not know would it be safe to include that source, but it is GPL2, so maybe to ask the author?

So far I have been using this CPM emulator to run Z80 CP/M code:
https://github.com/jhallen/cpm
That one runs Z80 code at full speed of host computer, so it is not a good emulator of any specific machine, but it can be used to test the generated code for text-only programs very easily:

./cpm <com_program_name>

The same guy that made MESCC also made libraries for Amstrad PCW, all also GPL:
https://github.com/MiguelVis/xpcw
I guess those can be useful.

Well, that is more or less all I know about Amstrad PCW emulation and programming. If I can help with anything else, please ask, and I'll try.

@leuat leuat self-assigned this Apr 21, 2021
@leuat leuat added the enhancement New feature or request label Apr 21, 2021
@leuat leuat added the Low Priorty Low priority or will be ignored... label May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Low Priorty Low priority or will be ignored...
Projects
None yet
Development

No branches or pull requests

2 participants