Difference between revisions of "Programming:Cross Development"

From CPCWiki - THE Amstrad CPC encyclopedia!
Jump to: navigation, search
(Linux: sorted alphabetically, added CPCSDK)
(Fix some typos.)
Line 1: Line 1:
 
= Introduction =
 
= Introduction =
  
Cross development is a development method where you use another machine (the host) to develop programs for the CPC (target). This is interesting because you can make a big program wich sourcecode does not even fit on the CPC ram.
+
Cross development is a development method where you use another machine (the host) to develop programs for the CPC (target). This is interesting because you can make a big program which sourcecode does not even fit on the CPC ram.
  
The main drawback is that transferring the compiled code to the CPC can be quite difficult. But there are pretty good emulators wich you can use for testing.
+
The main drawback is that transferring the compiled code to the CPC can be quite difficult. But there are pretty good emulators which you can use for testing.
  
 
Once you have your binary file you have two choices depending on if the game will be for [[Datacorder|cassette]] or [[Disk drives|disc]].
 
Once you have your binary file you have two choices depending on if the game will be for [[Datacorder|cassette]] or [[Disk drives|disc]].
Line 11: Line 11:
 
*[[Atari|Atari ST]] was a common 16 bit computer actually used in cross development of games on CPC.  
 
*[[Atari|Atari ST]] was a common 16 bit computer actually used in cross development of games on CPC.  
  
Of course nowaday's cross development use far more powerfull modern computers.
+
Of course nowadays cross development use far more powerful modern computers.
  
 
*[[ZX Spectrum]] was also a source of cross development...er... let's better say [[Speccy Port|Gross Development]] indeed.
 
*[[ZX Spectrum]] was also a source of cross development...er... let's better say [[Speccy Port|Gross Development]] indeed.
Line 19: Line 19:
 
== Linux ==
 
== Linux ==
  
=== Cartidge management ===
+
=== Cartridge management ===
 
* [[buildcpr]] [http://www.cepece.info/amstrad/download/buildcpr.zip]
 
* [[buildcpr]] [http://www.cepece.info/amstrad/download/buildcpr.zip]
  
Line 69: Line 69:
  
 
=== Useful scripts ===
 
=== Useful scripts ===
==== Supress header information of a file ====
+
==== Suppress header information of a file ====
 
<pre>
 
<pre>
 
cat file_with_header | tail -c+129 > file_without_header
 
cat file_with_header | tail -c+129 > file_without_header
Line 81: Line 81:
 
* a good emulator which can be integrated in other tools. (Ramlaid first try to change Caprice is a good start)
 
* a good emulator which can be integrated in other tools. (Ramlaid first try to change Caprice is a good start)
 
* an integration of Ramlaid's tools with Nautilus
 
* an integration of Ramlaid's tools with Nautilus
* ameliorations of Caprice in order to have similars fonctionnalities than WinApe (disasm, asm, ...)
+
* ameliorations of Caprice in order to have similar functionalities than WinApe (disasm, asm, ...)
 
* debug the libdsk which seems to work very bad on actual computers (writting fail a lot)
 
* debug the libdsk which seems to work very bad on actual computers (writting fail a lot)
 
* a lot of macros, or libraries for SJASMPlus shared by people in order to share code
 
* a lot of macros, or libraries for SJASMPlus shared by people in order to share code

Revision as of 23:42, 8 January 2013

Introduction

Cross development is a development method where you use another machine (the host) to develop programs for the CPC (target). This is interesting because you can make a big program which sourcecode does not even fit on the CPC ram.

The main drawback is that transferring the compiled code to the CPC can be quite difficult. But there are pretty good emulators which you can use for testing.

Once you have your binary file you have two choices depending on if the game will be for cassette or disc.


  • Atari ST was a common 16 bit computer actually used in cross development of games on CPC.

Of course nowadays cross development use far more powerful modern computers.

Tools needed for cross development

Linux

Cartridge management

Cross assemblers

Crunching

Disassemblers

Disc management

Editing

  • pico
  • xemacs
  • Vim

Emulators

Tape management

Toolkits

  • CPCSDK toolkit which contains useful tools for cross-development under Linux - [16]

Useful scripts

Suppress header information of a file

cat file_with_header | tail -c+129 > file_without_header

Needed Tools

These tools have to not require a lot of requirement and most of them must work in command line without GUI. This will allow to use them with Makefile scripts. They have to be fast too, it will be disappointing to wait more when doing CrossDev than when doing code on a real CPC. A good thing (like most of CPCTools) is to have a portable code which compile on most platforms.

  • a good emulator which can be integrated in other tools. (Ramlaid first try to change Caprice is a good start)
  • an integration of Ramlaid's tools with Nautilus
  • ameliorations of Caprice in order to have similar functionalities than WinApe (disasm, asm, ...)
  • debug the libdsk which seems to work very bad on actual computers (writting fail a lot)
  • a lot of macros, or libraries for SJASMPlus shared by people in order to share code
  • share a generic Makefile able to be use for build CPC project
  • a lot of little command line utilities (could be add to CPCTools ?) really well done  :
    • graphics tools :
      • convert images from PC to CPC, or CPC to PC (cf. tools based on ImageMagick or GD)
      • equivalent of Anoine's FontCatcher
    • 2 tools which work with BASIC :
      • one for create BASIC AMSDOS files from ASCII or UTF-8 text files
      • one for create ASCII or UTF-8 text files from BASIC AMSDOS files
      • (this can already be done with manageDSK for files inside a DSK, maybe extract the code from there)
    • data manipulation tools :
      • ability to arrange data files for example modify bytes order in a picture file by using Gray code capabilities for changing line with modifying 1 bit

Windows

Cross Assemblers

Cross compilers (C)

Graphics

  • AMSprite - Sprite/Loading Screen Editor and graphics conversion tools

Sound

Testing on a real CPC

For cassette

  • 2CDT to add the files to a Cassette Image File (CDT)
  • Tape2WAV to convert the Cassette Image file (CDT) into a WAV file.
  • Then you can run the program on the emulator the same way as you would run it on a real CPC, or
  • Connect your CPC (CPC664 and CPC6128 have a cassette input) to the Line-Out output of your PC soundcard
  • On the CPC type:
|TAPE:RUN"
  • Start your WAV player
  • Set the volume to maximum
  • play the WAV file
  • Wait for the program to load...

For disc

  • Use CPCFS or CPCXFS to put the binary files into a Disk Image file (DSK)
  • Then you can run the program on the emulator the same way as you would run it on a real CPC

If your CPC has a 3.5" disc drive then the easiest method is to transfer the DSK to a 3.5" disc using the PC.

- Then use CPCDiskXP to write the DSK to a 3.5" disc drive - Put the disc into your CPC's 3.5" disc drive and type - |B: RUN "<gamename>

Snapshots

The fastest way of testing your code on an emulator is by creating a snapshot. Use CPCSnapshot to insert your assembled code into a snapshot file. Then just load the snapshot file into the emulator. Windows users may also try WinAPE's integrated assembler which assembles the code directly into the emulated CPC's memory.

Web links