On a more positive tone, those speccy ports had the merit to exist, or else Amstrad would have a smaller games catalogue.
It is worth noting that Spectrum ports also existed on [[MSX]], Enterprise64[[Enterprise]] 64/128, [[SAM Coupé]] and non-[[Z80]] [[Thomson ]] MO/TO and , [[Commodore 64|C64]].
=Reasons=List of Spectrum Ports==[[List of Speccy Ports]]
==How these should have looked== This section shows games which were made specifically for the Amstrad's abilities or Spectrum ports that were done correctly. Here are some examples of Amstrad games done well, and how these games could have looked if more care was taken. The following list shows how a game can be done right using the cpc capabilities. These do not necessarily share any Spectrum code, and are not necessarily recoloured from the Spectrum: * Renegade* Gryzor* Xyphoes Fantasy* [[Head Over Heels]]* Atic Atac Some CPC games share similarities with the Spectrum version, and probably share a lot of code, yet are in mode 0 (16 colours, lowest resolution). [[Ocean]] made a lot lilke and thanks to a more professional graphic treatment (compared to many other British companies) and actually good porting tactics this produced some of the finest CPC games. Those games are examples: *'''Robocop'''*'''Chase HQ''' Some of the games in the list below use mode 1 but fully supported the 2bpp re-coding of graphics done right (by a human, not by an automatic method) and hence got properly coloured backgrounds and sprites. *'''Shadow of the Beast'''*'''Midnight Resistance'''*'''Wec le Mans''' =Reasons for a Spectrum Port= The [[ZX Spectrum]] shared similar hardware with the Amstrad CPC (see Machine comparionscomparisons).
The Spectrum was very popular and with the CPC having a much smaller market share, it made sense to develop the Spectrum version first and to save on time and money, the Spectrum code, music and graphics were re-used. (A typical port to the Amstrad is said to have been done in 3 days so was financially good).
*Spectrum and Amstrad both have a '''bitmapped''' display.
*while''' ZX spectrum''' has a quite '''basic 1bpp character based colour display''', '''Amstrad CPC''' can be considered an '''upgraded CGA display minus the Character based text modes''' (with a 16colours modes such as the Tandy's own custom "CGA" had... and a differently logic based palette), with a range or 4bpplow resolution, 2bpp square resolution and 2bpp 1bpp high resolution Attribute free video display.
*'''They have a similar screen size.''' But '''Amstrad CPC''' actually produces smaller pixels in it's "equivalent" video mode (mode 1). The normal display resolution on the Amstrad CPC is '''320x200''' (mode 1) while '''ZX Spectrum''' produces "only" '''256x192''' pixels. Amstrad's screen can be reduced in size to match the Spectrum's (256x192, in Mode1) but then the actual display window is quite smaller than on a spectrum (on the same monitor) and has a larger border because the generated pixels are slightly smaller.
*Spectrum 48K had a 1-bit beeper sound. Playing sounds through the beeper is very CPU intensive. The Amstrad doesn't have a beeper. The only way to simulate the beeper sound would be to convert it to AY sound.
====Input====
* Spectrum has multiple joystick standards. The common standards are Kempston, Sinclair and Cursor. Kempston was a common interface used on the Sinclair made Spectrum's. It plugged into the back of the machine and provided support for a single joystick. This type of joystick doesn't clash with the keyboard. The Sinclair standard is used on the Amstrad made Spectrums. These machines have two joystick ports. The Sinclair standard works by simulating keys pressed on the Spectrum keyboard. (Does the sinclair joystick cause keyboard clash?) All of these standard for the Spectrum supported the directions and 1 fire button. In comparison the Amstrad CPC models have a single joystick port which with a splitter cable can support two joysticks. The joysticks support the directions and up to 3 fire buttons on the CPC, but only 2 fire buttons on the later Plus machines. In addition using the joysticks and keyboard together on the Amstrad CPC causes keyboard clash where unwanted keys are pressed. Clash between joysticks and keys can be avoided with careful choice of keys. This clash was resolved on the Plus and can be resolved with diodes on the CPC joystick port. In general though, Amstrad games supported a single joystick, they didn't use key mappings that would avoid clash and many users didn't have these fixes so the games would suffer from keyboard clash. An example of this can be seen when playing two player Gauntlet where players could be fighting to move where they wanted to.
* The 48K spectrums had a rubber membrane keyboard, later versions had proper keys, and the Amstrad made Spectrum's have the best keyboards. The early Amstrad CPC464's and 664's had really good strong keyboards, comparable to those on the BBC Micro, whereas later ones were more flat and less good. Both Amstrad and Spectrum have a good selection of keys.
Amstrad then improved the build quality and enhanced the Spectrum's design. The result was that the Spectrum +2, which was closer in looks and build to the CPC464/6128 (same kind of compact keyboard as CPC6128, but built-in "Datacorder"). The Spectrum +3 was also quite similar to the Amstrad CPC6128 because both had a internal 3" drive. So the Spectrum became closer in design to the CPC. However, the overall hardware of the Spectrum didn't change, the graphics were the same, the sound was the same, but those later Spectrum's had built in joysticks, built in cassette or disc, connections for printer etc, just like the CPC, but almost all of which the Amstrad had starting with the CPC464.
===Disc drive=== The Spectrum didn't have an official floppy disc interface so there were different interfaces.In Russia the Betadisk interface is common, this used a WD1793 disc controller and 3.5" discs. This interface is incompatible with the Amstrad's. When Amstrad designed the +3, the used a similar disc interface to the Amstrad. The Amstrad designed Spectrum +3 has the following in common with the CPC6128:* same disc media (3")* same disc controller (NEC765 compatible)* the floppy controller is polled for data transfer* Similar disc format (CP/M based) However, the Spectrum+3 uses a different DOS than the Amstrad CPC6128. This means that the functions for reading/writing files are different on the Spectrum compared to the CPC. The Spectrum's DOS is more powerful than the CPC's. It can read CPC discs, Spectrum +3 and PCW discs easily. In order for the Amstrad to read Spectrum and PCW discs, it needs to have a special XDPB (Expanded Disc Parameter Block) configuration installed. The Spectrum +3's DOS is based on the disc functions in Locoscript the CPC's DOS is AMSDOS. The Spectrum's DOS was developed after the CPCs, so clearly they saw the weakness in the CPC's DOS design and improved it. The Spectrum Technical wiki can be found here. This describes the Spectrum hardware in more depth: http://scratchpad.wikia.com/wiki/ZX_Spectrum_technical_information =Consequencesof a Spectrum Port= ==Input== The Spectrum has more joystick standards than the CPC, however reading the keyboard and joysticks and handling the input on the Spectrum is much simpler, takes less code and takes less CPU time than on the Amstrad. On the Amstrad it is best to read the keyboard and joystick in one pass and store the data into a buffer which can then be queried later. Then read from this buffer when you need to check the inputs. ==Disc Loading== The Spectrum +3's disc interface had a design that was close to the Amstrad CPC6128's. This meant that disc loading software that used the disc interface directly could be modified easily to be used on the CPC. There are disc versions of the Alkatraz, Hexagon and Speedlock loaders common to both the CPC and Spectrum. However, the method for accessing the DOS is different. The good thing is that both shared good disc interfaces, so a disc loading system on the Spectrum, if ported to the CPC would not be a bad thing.
====Tape Loading====
Both the Spectrum and Amstrad had a similar method for loading or saving on cassette. For both it is CPU intensive and for both the method of representing the 1 or 0 bits is the same.
Some CPC games used the original block loader which meant loading took much longer compared to Spectrum, some used the firmware headerless block loader (CAS READ) which was a bit faster, and some CPC games used a modified Spectrum tape loader (extracted from the Spectrum's ROM and modified for the Amstrad's hardware).
Sometimes the Spectrum loader was modified for the CPC without exact knowledge of how it worked, this resulted in some games with bad loaders that either didn't check for errors, or which didn't work in some circumstances. This lead to unreliable loading.
Two good loaders that appeared on both systems are Alkatraz and Speedlock. Both were reliable and fast.
The Amstrad's ROM loader was a bit better than the Spectrum's ROM loader because it had CRC error checking, compared to XOR, based checksum and block based loading (so you could rewind and try a block again) compared to a single load.
Consequences for porting to CPC:
*On the good side, the Spectrum utilised the border to indicate both the stage of loading (indicated by different colours used in the border) and the loading progress, so a modified loader for CPC would also indicate loading progress. If messages were turned off in the Amstrad ROM loader you didn't have any indication of loading progress.
==Examples of loaders common to both Amstrad and Spectrum:* Speedlock (commonly used by Ocean).* Alkatraz (commonly used by US Gold). Spectrum loader ported to Amstrad:* Aliens (UK version, original release). ==Colours====
The Spectrum palette (15 colours, bright at bottom):
[[image:AmstradCPC_palette.png|Amstrad palette (from wikipedia)]]
A comparison of the palettesin CPC palette:
[[image:CPC_Speccy_palette_comparison.png|Comparison of the palettes ]]
* Recolour the graphics using the Amstrad's palette to improve the look.
====Colour Clash==from the Cell based colouring==
The cell based colouring used on the Spectrum has its disadvantages. [[image:clash.png|right|thumb|Colour clashing in Knight Tyme. Observe the appearance of the character sprite as it merges with the background. (Background colours have priority here in this game.)]]
If a sprite's colours takes priority, and it moves with pixel by pixel movement, as soon as it enters a new cell, the background will take on it's colours. The colour clash seems to extend furthur than the sprite. This is down to the 8x8 cell colouring.
The 6 raster interrupts on the CPC can be used to change the colours on the screen. You can redefine all the available colours, e.g. each interrupt you could re-program all the 4 available colours in mode 1. This can be done to increase the number of colours visible.
However, while there are more visible colours, each region is still limited to the number of available colours (e.g. limited to 4 colours in mode 1).
If a sprite passes between two raster interrupt regions it will suffer from a form of colour clash, where the part in the new region takes the colours from that region, and the part in the old region remains in the colours from that region.
Various ports use the raster interrupts, but how they chose to use them differs.
'''Possible resolutions on Spectrum:'''
* Use the Amstrad interrupts and change the colours multiple times each frame, this will give each region (between each interrupt) it's own colours increasing the number of colours on screen. Each region is 52 scanlines in height, and the whole screen in width. Note that the colours must be set for each region for each frame to maintain them, and that the pixels within each region are still limited to 4 colours in mode 1. The colour regions like this are ideal for having different colours for the HUD and for the main game area. This can be a CPU intensive technique.
NOTEExamples of colour clash ported to the CPC: The 6 raster interrupts (These examples show colour clash implemented on the CPC can be used to change in the palette. However, while same way as the screen displays 6 colours, the actual games window is still monocolour (2 colours... generally Black+one other ink...) or "almost monocolour (only background being monocolour and sprites having 3 inks... or some inks different from background's tiles...) typical examples are Strider (monocolour tiles and 3 inked sprrites), SuperWonderboy (Monocolour Background and monocolour sprites yet differently inked), PacMania or Black Tiger (monocolour game's window/playfield yet multicoloured HUD...) and so on (see later in this page for more examplesspectrum would show it).* Bionic Commando
====Sound====Examples of attribute based colour system ported to CPC:* Badlands
There is 1 sound source on 48K spectrums: it's beeper, and 2 sources Examples of sound on 128K spectrumsgames with little colour because attribute colours have been removed: beeper and AY.* Peter Pack Rat
Examples of using raster interrupts to increase colours:* Pacmania and Black Tiger (main play area remains 2 colours)* Strider 4 colours in game area, 4 colours in status panel.* Super Wonder Boy (Monochrome background and monochrome sprites)* [[Deflektor]] (main play area has one set of colours, status panel has another set) ==Advantages of the cell based colouring== The Spectrum's cell based colouring has advantages. === Conveying state on a HUD === The state of a game play element on the HUD can be coloured accordingly. e.g. a bomb that is about to explode could change colour from white to red. '''What should be done on CPC:'''* If you have enough free palette entries, e.g. mode 0, then you can change the colour for the pen used to display the item in the palette. This is quick. However if you are using mode 1, then the number of palette entries is much more limited and you should draw the bomb in a different way. The consequence of this is that you may need to store additional graphics for this and it will take much longer to update the HUD than on the Spectrum. === General colouring === Since the background and foreground colour can be defined per cell then you can use all the Palette of the Spectrum at once. '''What should be done on CPC:'''* If you are using mode 0 then you are free to define the colours per pixel from the 16 colour palette. This is ok if the chunkier pixels can be used, not so good if there is detail in the graphics that needs to be retained.* If you are using mode 1 then you will see less colour. You can set the colour palette for multiple regions on the screen, or you can use the 4 colour palette more creatively. ==Sound== There is 1 sound source on 48K spectrums: its beeper, and 2 sources of sound on 128K spectrums: beeper and AY. Beeper sound is simple. The spectrum has a speaker which you can turn on/off through a I/O port on the Spectrum's ULA. To make different sounds, you turn it on and off at different rates, all under control of the CPU. Speaker sound is CPU intenstive intensive because the timing is all done through the CPU and delay loops. The consequence on the Spectrum is that not many games have beeper music during the game, and those that do are often staccato like (e.g. Manic Miner) (the game takes some time to update, then some time for sound, and this repeats). If the sound was made for the Spectrum beeper, this would need to be converted to AY sound for the CPC, the result would not be exactly the same.
Sound written for the AY in the Spectrum can't be ported directly because it would be out of tune, this is down to the difference in master clock given to the AY (1.7Mhz on Spectrum, 1.0Mhz on Amstrad). The music would need to be altered. When this is done, the music is almost the same.
* For AY sounds, convert the music/effects to the CPC's AY master clock so that it is in tune (the tune may loose some of it's accuracy if this is done, especially regarding the hardware envelopes and noise, and this means the sound will not be exactly the same, but is much more acceptable).
====Graphics====Examples of Spectrum Beeper sound converted to AY:* Knightmare* Last Ninja 2* Super Hang On
The Spectrum's graphics use 1 bit per pixel to define them. The colour is then defined by the attribute system.==Graphics==
The Spectrum's graphics use 1 bit per pixel to define them. Each byte therefore represent defines 8 pixels. The colour of each pixel is then defined by the attribute system.
The attribute "ram" define the background colour (where a bit is 0), a foreground colour (where a bit is 1), if the dark variant of the colours should be used, or if the colours should flash at a fixed rate. If the background is a single colour, the sprites can be ORed on. If shading is to be used, a mask is often stored with the pixels. The mask is used to remove or retain (depending on the mask type) pixels on the screen. The sprite final result on the screen is the result of the mask then combined with the screen sprite pixels. On the Amstrad, the number of bits to make define a pixel, the final resultnumber of colours that can be used, and the width of the pixels is different for each mode. * Mode 0 uses 4 bits for each pixel. Each byte defines 2 pixels. 16 colours can be used without restriction. Wide pixels. This is lower resolution than the spectrum.* Mode 1 uses 2 bits for each pixel. Each byte defines 4 pixels. 4 colours can be used without restriction. Pixels the same size as the spectrum.* Mode 2 uses 1 bit for each pixel. Each byte defines 8 pixels. 2 colours can be used without restrictions. Pixels are thinner than the spectrum. This is higher resolution.
Consequences:
* The pixel data and colours are stored in a different way than the CPC, so some conversion must be done before the graphics can be used. Either the graphics are remade, or often converted through some automatic process.
* There is a trade off between mode 1, keeping the same resolution as the Spectrum but having only 4 colours, or using mode 0, with half the horizontal resolution but 16 colours. The choice depends on the detail required in the graphics.
The following sections describe possible ways to handle the graphics on the Amstrad.
Yet the common mask tecnique ===Techniques used for sprites implies that another set of 1bpp sprites is needed for each sprites... totaling 2bpp (bit per pixels...) Amstrad could actually use one ink (colour) to mask sprites, hence the mundane 2bpp mode1 could getSprites masks with almost no extra DATA in RAM (just a few extra routines...). Graphics===
Full masked games on Spectrum then have the same weight as Amstrad games concerning masked Graphical Data (often the case in monocoloured games or isometric games...)====Graphics with transparency====
As a result, games like Head over Heals or HeroQuest (isometric) or Shadow of the beast (2D but masked sprites, and parralax scrolling meaning even some masked background tiles...) could easily get the proper recode of Sprites/Tiles in 2bpp for close to no extra RAM used by DATAs..=====Storage=====
Anyway due A common way to "lazyness", some speccy Ported games still use 1bpp masks do this is on CPC (the same as on speccy...) becauyse such ports had Spectrum is to be done in less than 2-3 weeks store 1 byte of mask, followed by a lone coder with no Grapician extras.1 byte of pixel data, and to repeat this for the width of the sprite divided by 8.(Each byte representing a 8 pixel wide single line slice of the sprite).
====Techniques used If we consider a sprite which is 16x16. Each byte contains 8 pixels. For each line 2 bytes would be needed for Graphics===pixel data and 2 bytes for mask. The total storage space required would be (2+2)*16 =64 bytes.
If we consider mode 1 on the Amstrad, and we used the same representation, we could freely use 4 colours for the sprites. The Amstrad would also need 2 times the ram space to store the data, because in mode 1 there is half the number of pixels per byte.So, each byte contains 4 pixels. For each line 4 bytes would be needed for pixel data and 4 for mask: (4+4)*16 =====Graphics with transparency=====128 bytes.
A common way to do this is to store 1 byte of maskHowever, followed by if we sacrifice 1 byte of pixel datacolour, so we have 1 pen which is fully transparent and 3 for opaque sprite colours then we don't need the mask to repeat be stored this way. The mask is common for all sprites and we could store this as a single 256 byte array. We would still need 4 bytes for the width of pixel data but the spriteresult now is: 4*16 = 64 bytes. The same weight as the Spectrum.
If we consider a sprite which Mode 2 is 16x16generally not used for games on the Amstrad because of it's lack of colour. Each byte contains 8 The pixelsin this mode are half as wide as the Spectrum's. 2 bytes If the Spectrum data was used directly, which it could be, then the sprites would be needed for pixel half the width of the Spectrum's. In this case the data and storage is the same as on the Spectrum. If we wanted to maintain the same resolution we would need to double up each pixel, effectively magnifying it in the width by 2 bytes for mask. The total storage space required result would be (2+2)*8 = 32 bytestwice the size of the Spectrum data.
Now, if the same representation was If mode 0 is used on the Amstrad, we could either store a mask and mode 1 was usedbyte, as for the Amstrad would need 2 times Spectrum, or more commonly we use pen 0 for full transparent and leave the ram space other 15 pens to store define the data, because in mode 1 there is sprite. We could then use half the number of pixels per bytehorizontally and lower resolution too.So, each Each byte now contains 4 2 pixels. 4 bytes would be needed for pixel data and 4 for mask: The sprite is 8x16 now = (4+48/2)*8 16 = 64 bytes. However, if we sacrific This the same storage size as for mode 1 colour, so we have 1 pen for transparency and 3 for sprite colours. If the size of the sprites were too small, then we don't would need to increase the mask. The mask is common for all sprites. We still need 4 bytes for size and the pixel data but the result now is: 4*8 = 32 bytes. The same as the Spectrumstorage space.
Therefore, depending on the representation, this would determine how much ram is consumed on the Amstrad.
=====Real-Time Conversion of The best choices are to go for mode 1, and use a common mask table, with 3 colours per sprite. Or use mode 0, use a common mask table, with 15 colours per sprite. In both cases we use 256 bytes more than the Spectrum equivalent graphics=====.
A common way to get So we show that some games could be recoloured and still use about the Speccy game running on the CPC was to perform real-time conversion same amount of data as the Spectrum graphics.
The above do not consider the size or speed of the code to clip or draw the sprite to the Amstrad's screen compared to the Spectrum code. The values above assume the Spectrum version is not storing pre-shifted sprites, or using a pre-shift table, and when drawing to pixel positions is shifting the pixel data during draw. The comparison becomes more complicated when these are involved. Examples of games probably ported from the Spectrum (the use a Spectrum sized screen), in mode 1 and recoloured:* HeroQuest* [[Head Over Heels]]* Shadow of the Beast Examples of games where re colouring could have been done:* [[Pacmania]] ====Graphics without transparency==== =====Storage===== Tiles are often used to define background graphics. These are opaque and don't need masks. The benefit here is that on CPC we can use all the colours in the palette, so for mode 1, all 4 colours can be used and in mode 0 all 16 colours can be used. However on CPC generally non-transparent graphics will often take more storage space: For the spectrum a 8x16 tile: (8/8)x16 = 16 bytes. CPC mode 0: (4/2)x16 = 32 bytes CPC mode 1: (8/4)x16 = 32 bytes CPC mode 2: (8/8)x16 = 16 bytes In mode 0 and mode 1, the tiles on the CPC will take twice as much space compared to the Spectrum. This will impact the memory used and depending on the number of tiles this is a significant memory impact. ====Real-Time Conversion of Spectrum graphics==== A common way to get the Speccy game running on the CPC and using the same storage space for the graphics was to perform real-time conversion from the Spectrum graphics. * Graphics are stored on the Amstrad in the same format as on the Spectrum (2 colour, 1BPPwith sprites having masks)
* Amstrad's mode 1 is used to maintain the same pixel resolution.
* A routine function converts the graphics on-demand, while the game is running, into the form that is displayed for the screen.
Needless to say, this enabled the port without the use of additional graphics artists, so . Therefore it was would be cheaperand easier if a programmer was tasked with making a conversion alone.
Disadvantages:
* This process takes a lot more CPU power compared to the Spectrum version, because in addition to drawing and erasing the sprites, the pixel data must also be converted at the same time.
* This resulted in a significantly slower game.
* Amstrad version had less colours (often as little as 2 colours)
Advantages:
* Pixel data took less RAM compared to storing than if it ====Mode 0==== When using mode 0, the screen can be reprogrammed to use the same sized screen as when using mode 1. However the resolution would be 128x192. Using mode 0 has additional impact on the gameplay and game logic:- there are fewer pixels horizontally therefore both tiles and sprites are described by fewer pixels in Amstrad's width (although pixels are wider). Then any calculations that use pixel coordinates will need to be adjusted. This includes positioning sprites on the screen, sprite to sprite collision, converting sprite pixel coordinates to a tile map location, converting sprite pixel coordinates to a collision map location, determining if a sprite is moving off the right side of the screen. If the original sprites were square on the Spectrum (e.g. 16x16), then with mode 0 they are 8x16, and we may need additional code for these calculations to handle that. - movement per pixel will be faster horizontally than vertically. We can accept that, or if movement is meant to be the same in all directions then sprites may need to move faster vertically to ensure the movement is consistent. This then has an impact on gameplay because sprites will take less time to move over the screen and any time based goals may need to be adjusted to compensate and make the game goals consistent. Using mode 1 is the route to a quicker port because there are less changes to the game code. was stored in an Amstrad native form, so the game could run on a 64K Ram machine (CPC464 and CPC664, 464Plus).* If the colour attributes of the Spectrum were not simulated then the attribute data would not need to be stored for the CPC. ====Mode 1==== Amstrad's mode 1 is the closest mode which compares with the Spectrum's graphical abilities. The pixels are almost the same size. The CPCs screen dimensions can be reprogrammed to re-create the Spectrum's 256x192 resolution. However, the CPC has a different "pixel clock" compared to the Spectrum. The CPC was designed for a 320x200 display instead of a 256x192 display and in fact the the pixels are smaller on the screen when you compare mode 1 (the closest equivalent on the CPC) to the Spectrum. So when the screen is reprogrammed you end up with a larger border on the CPC. This (the larger border) led to the false argument that the CPC's resolution was inferior to the Spectrum one although the amount of pixels on the screen is EXACTLY the same. ====Double buffering==== TODO: ==Screen dimensions== By setting CRTC register settings the Amstrad's screen dimensions can be reprogrammed to match the Spectrum's.The normal values used are R1=32, R6=24. There are advantages to reprogramming the screen dimension to match the Spectrum's.* The gameplay is similar because the player sees the same amount of map and there are the same number of enemies and they move in the same way.* Graphics/levels would not need to be designed for a wider screen (e.g. in mode 1, 320 compared to 256)* For a smaller screen less memory is used for the screen (16KB vs 12K). The memory used by the screen is the same regardless of CPC mode used. Unused areas can be used to store graphics, code and music. For a CPC screen at &c000, the unused areas are: c600-c7ff, ce00-cfff, d600-d7ff, de00-dfff, e600-e7ff, ee00-efff, f600-f7ff, fe00-ffff ==Random numbers== Sometimes Spectrum games generate random numbers by reading from the Spectrum's ROM which is always readable in the memory range &0000-&3fff. ''Consequences for CPC:'' * There is often not enough memory to store the Spectrum ROM in the Amstrad's memory. If the range read could be determined then possible a smaller range could be stored. * It would be wasteful to store part or all of the Spectrum's ROM in the memory* It is not legal to store any part of the Spectrum's ROM in memory Some games may use the 'R' register to generate a semi-random number. ''Consequences for CPC:'' * The R register value is based on the number and which instructions are executed. It is likely that the number of instructions between each read of the 'R' register could differ. For both of these methods the consequences for CPC are: * the numbers generated are likely to produce numbers which will differ compared to the Spectrum version and therefore the gameplay could be different. It may be subtle, it may be significant.* reading a random number may take more CPU instructions to do this making it slightly slower. Where possible the Spectrum and Amstrad versions should use the same random number generation based on a stored seed. ==Memory arrangement== Spectrum game's often use the memory from &5500-&ffff. ''Consequences for CPC:''- If you are not using a custom disc or tape loader then during loading you will need to preserve the firmware memory regions. The easiest thing to do is start the game lower in memory (&0040), use the default screen at &c000-&ffff, and then once loaded copy data over these areas (provided you are not doing furthur loading/saving).
====Original consequences (under construction)====
The Amstrad CPC was one of the best 8-bit computers of its time in terms of graphical capabilities. But those advanced capabilities had an impact on CPU resources.
On the other hand, as mentioned before, those games weren't always bad. Games with no need of scrolling and with re-coded graphics could actually be good.
=Investigation into a Speccy Port=
Arnoldemu attempted a Speccy Port in 2022-2023 and the result is 'Mayhem'. The documentation with this game has comparisons and describes the decisions made when making this conversion. You can read about the elements of this journey.
=Lists of speccy ports=
Note: these lists are by no means comprehensive, they just include the most high-profile releases.
* [[Mayhem]] - [[https://www.cpc-power.com/index.php?page=detail&num=18884]] A recent Speccy port to CPC and PCW done by a single person. Read the document to see the comparison, issues encountered, choices made, read about the journey.
=='''Computer originals Hits'''==
(most of them ended up being decent) :
*[[H.A.T.EHostile All Terrain Encounter]]
*Highway encounter
*Lotus turbo Esprit challenge
*Last Ninja2
*Myth, history in the making
*[[Saboteur ]] I
*Saboteur II
*SWIV
*Shadow of the beast
The numerous CodeMaster or Hewson games are not listed. Many of them were cheap budget Speccy games to begin with, and were quite well ported or remained good...
=='''Well known franchises'''==
*Salamander
*Dragon Breed
*Scramble spiritSpirits
*[[Black Tiger]] - [[Black Tiger CPC-Spectrum Comparison]]
*Strider
*Pit fighter
*Cabal
*Street Fighter]
*Karnov
*Dynasty Wars
*Salamander
*Dragon Breed
*Scramble spiritSpirits
*Black Tiger
*Strider
*'''Gauntlet 3''' : HUD is properly recolored (3 shades) but in-game window is monochrome (1bit coded sprites and tiles)
*'''R-type''' : Monochrome background while sprites still are "coloured" as with Colour attributes, hence even featuring less colours than original Spectrum game, while the entire screen still displays more than the only 4 Mode1 colours...(HUD raster trick). This game was done in 3 weeks by only one man, who simply emulated the speccy stuff on CPC. Given that the Spectrum game was a great release the CPC port is not too bad.
An special mention must go for '''Mevlut "Speccy" Dinc''', one of the worst offenders with nightmares as '''Big Trouble In Little China''', '''Enduro Racer''', '''Hammerfist''', '''Knightmare''', '''Last Ninja 2''', '''Last Ninja 2 Remix''', '''Prodigy''', '''Super Hang-On''' and '''Time Machine'''.
==Semi-lazy==
Graphics, despite sharing a common ancestry, are well redone, and take into account the Amstrad power. Sometimes those games are not that well ported, yet their concept and gameplay are such that this is not that important: the game is simply too good to be annoyed by such detail as the use of Mode1, and they were still sufficiently re-done.
*'''Head over heels'''[[File:Head Over Heels.png]] This one was the prime example of what every Spectrum port should have been. Even the C64 version was totally like the Speccy version (monochromatic game's area) while the Amstrad graphics were perfectly recoloured and colour clash was avoided. Also as this games didn't need scrolling the animation was almost as good as in other 8 bit versions, and colour palette often changed inks to actually get a colourful feeling all around.*'''[[Deflektor]]''' : example of a good speccy "cross development", thanks to a clever concept. Could perhaps have been better yet the concept of the game makes it a clever port. Details like the Tape version loading parts or the good chiptunes enable a proper CPC experience.
*'''Switchblade''': the GX4000 cartridge version displays extra features such as large vertical ditherings in a lot of Red shades (sky) or PLUS Hardware sprites "patches" as extra coloured tiles. This is more than enough to get a properly coloured feeling.
=Techniques used=
==Mode1 and screen dimensions==
The use of Mode1 enabled the CPC to keeps the same graphics as Spectrum, in appearance only. While the square pixels looks almost the same, the code was completely different. Also, the CPC being set for a 320x200 display instead of a 256x192 display, the pixels are in fact smaller on screen, hence a bigger border was needed for the exact same resolution.
This (the larger border) led to the false argument that this was the CPC resolution and therefore it was inferior to the Spectrum one, although the amount of pixels on the screen is EXACTLY the same.
==Monochromatic playfield and Sprite Masks==
*'''Enduro Racer'''
==Attribute /Character based Sprites and Animation==
The cell based colouring used on the Spectrum has it's disadvantages.
The problem then comes down to is that the graphics with a lower priority then takes the colour of the higher priority graphics.
Such games had no smooth movement of sprites. The sprite moved "character per character". As such the sprites are often unmasked, being not really more than "tile-mapped". This meant the sprites had to actually fill the character tile or there would be artifacts introduced for the unmasked character's corner.
This was a "good" other way to get rid of Attributes Clashes and having actual "colours" on ZX Spectrum. But some speccy ports were then emulating the attribute system, which can be quite bad because CPC in Mode1 has half the colours the Speccy has.
*'''R-Type''': the background has a smooth scrolling while the sprites are fixed character grid based. *'''Space gun''': this game was even released for Amstrad PLUS... Although coming very late in the CPC era is not really good and was probably rushed to the release. Yet the Character based engine enabled enormous sprites - but lacked smooth movement. Such a technique was actually used for quite a fair amount of Mode0 games. This is not "Speccy port" but it is good to to mention, as it was a common game design technique for both machines. *'''AMC (Astro Marines corps)''': speccy version has no attribute clashes and is great. Amstrad version is in Mode0, feature multiscroll effect and remains fast. *'''Satan''': this one is like R-Type, but the sprite layer is masked, so the game is monocolour on Spectrum. Still the Character system for the sprite has the advantage of giving good speed. The CPC version is fully in Mode0 and great, still the engine is clearly shared with speccy.
==Rasters==
Providing a game had to deal with 1bpp to 2 bpp conversion, Software Sprites and Scrolling and complicated gameplay, adding some Raster interrupt to the equation is a really bad move and a good way to waste even more CPU time.
==Partial code re-use for proper CPC gamesAmstrad interrupt positions==
Some CPC games The following image shows where the Amstrad's interrupt positions are in mode0 yet located relative to the similarities with screen. Here the speccy version CRTC Register values used are still obvious. [[Ocean]] was actually a lot into thisR1=32, but thanks to a more professional graphic treatment (compared to many other British companies) R2=42, R6=24 and R7=30 and actually good porting tactics (though not always the case) this produced some of colours are changed at the finest CPC games. Those games are examples start of Cross-dev done right. They remain quite playable because the CPU doesn't waste time to decipher 1bpp graphics or get Rasters interruptsinterrupt. *'''Robocop'''*'''Chase HQ'''
Some of To have different positions vertically you can change the games below were Mode1 but fully supported the 2bpp re-coding value of graphics done right R7 (by and if the monitor will accept it R5) to move the screen up and down.For example Gryzor sets R7=29 to have a human, not by 1 char tall panel at the CPU bottom in real time) hence got properly coloured backgroundsmode 1.
*'''Shadow of the Beast''': basically an almost playable Amiga Demo from the start this just turns into To change at later positions you can also use a quite good speccy port on CPC.*'''Midnight Resistance''' : some elements such as the projectile sprites (bulletssoftware timing loop, explosions) are certainly far too big on or fill the CPC time with other code to get it smooth and fast enough. Also some animations should have skipped delay the colour change from a few frames to lighten the proceedings. But at least this is an example of Mode1 looking good..chosen interrupt position.*'''Wec le Mans''' [[File: excellent CPC version, just a bit on the slow sideInterrupt_positions_spectrum_sized_screen. Burnin' Rubber is the Plus version png|Screenshot of this gameAmstrad interrupt positions showing where mode and colours can be changed quickly relative to pixel graphics. R1=32, sort of.R2=42, R6=24,R7=30]]
This image demonstrates that if you wish to use mode 1, and change palette colours for HUD and game area, then the graphics need to be arranged or re-sized so that the colour change positions are most optimal. For some games, the dimensions of the HUD or play area may not allow the palette to be changed easily.
[[Category: Games| ]][[Category:Programming]][[Category:Games Programming]][[Category:CrossDev]][[Category:CPC History]][[Category:Non CPC Computers]]