Forum > Other
How to compile for spectrum?
(1/1)
Learner:
On the wiki is a large complicated Make file for linux.
Can someone please tell me what command line arguments/options to use to compile for zx spectrum?
I tried compiling the latest FPC from Git. Then I did 'fpd -it ' to see what available targets there are. But z80 or spectrum were not on there.
af0815:
Dis you know https://wiki.freepascal.org/Z80 and https://wiki.freepascal.org/MSX-DOS
TRon:
--- Quote from: Learner on September 13, 2023, 02:08:47 pm ---On the wiki is a large complicated Make file for linux.
--- End quote ---
Large and complicated ? Link please ?
You are required to make both the trunk compiler because that adds support for the target and then create the cross-compiler for your target.
--- Quote from: Learner on September 13, 2023, 02:08:47 pm ---I tried compiling the latest FPC from Git. Then I did 'fpd -it ' to see what available targets there are. But z80 or spectrum were not on there.
--- End quote ---
z80 and spectrum are two different things (cpu vs 'os').
--- Code: ---$> fpc -Pz80 -it
Embedded
zxspectrum
MSXDOS
amstradcpc
--- End code ---
and you can compile with:
--- Code: ---fpc -Pz80 -Tzxspectrum helloworld.pas
--- End code ---
Learner:
ok for the latest version from GIT it says 'illegal processor' for Z80
so can someone just tell me how to get the 'trunk' version. As I am not a GIT expert.
here is the large and complicated Make file from the wiki:
https://wiki.freepascal.org/Z80#ZX_Spectrum
TRon:
--- Quote from: Learner on September 15, 2023, 02:59:53 pm ---ok for the latest version from GIT it says 'illegal processor' for Z80
--- End quote ---
Results as shown in my reply is based on git (when I posted, plusminus 10 minutes)
--- Quote ---so can someone just tell me how to get the 'trunk' version. As I am not a GIT expert.
--- End quote ---
Do you have a working FPC 3.2.2 compiler that is able to compile from a terminal/command window ?
--- Quote ---here is the large and complicated Make file from the wiki:
https://wiki.freepascal.org/Z80#ZX_Spectrum
--- End quote ---
That is not considered long and complicated but bare minimum that is necessary (you can omit the options that you don't use/need to save a few lines).
step 1: https://wiki.freepascal.org/Installing_the_Free_Pascal_Compiler#Downloading_FPC_sources_from_Git_or_zip
step 2: https://wiki.freepascal.org/Installing_the_Free_Pascal_Compiler#Compiling_the_FPC_source.2C_using_preinstalled_FPC
then follow the steps as in your link (minus the cloning as you already have done that in step 1). The rest of that article in your provided link is for creating the cross-compiler. Make sure to install to the same INSTALL_PREFIX directory as used in step 2
Before you can compile the cross compiler you need to make sure you have a working fpc.cfg file that is setup for the trunk compiler (so all paths should point to your INSTALL_PREFIX directory (or somewhere below that directory)).
If you want detailed instructions (do express that if wanted) and in case coming from me then you would have to wait a couple of hours for me to be able to get home.
Note that I do not know if the cross compiler is actually able to create a working executable for zx-spectrum and/or if other dependencies are required (zx-spectrum support /is/ experimental, so I have no idea).
Navigation
[0] Message Index