Changes

Programming methods used in games

4,806 bytes added, 30 January
/* Firmware */
This section describes specific programming methods which are used in games and the games that use them.
 
=== Sampled Sound ===
 
Sampled music:
* Prehistorik 2
* Xyphoes Fantasy
 
The sampled speech is often stored as 4-bit values with 2 values packed into each byte. Each value is sent to one of the AY volume registers at a fixed rate.
 
Sampled speech:
* Chase HQ
* Bad Dudes vs Dragon Ninja
* Robocop
* Ghost Hunters
* Advanced Pinball Simulator
 
=== Rasters ===
 
[[Rasters]] is a colour changing effect.
 
Examples:
 
* Zynaps
* 007 The Living Daylights
=== Hardware Double Buffer ===
However, page flipping eats up a lot of memory area (which is crucial especially for 64Kb machines). This explains why a lot of games can have small game-areas !
For example:Pac-Man Emulator === Scrolling === The following types of scroll are used: 1. The player controls a character on the screen. When the character is moved the screen scrolls but the character remains in the same position on the screen. If they get to the edge of the map, they may walk up to the sides of the screen. If they walk back the other way when they reach a particular point on the screen it starts to scroll again and they remain in the same position. 2. The player controls a character on the screen. When the character is moved towards the edges of the screen, the scroll moves a whole screen in width or height. The character is now on the opposite side. e.g. the character moves left, the screen scrolls by a whole screen width, the character is now on the right. The screen only scrolls when they get close to the sides. 3. The screen always scrolls. The player controls a character who is either static or moves freely around the screen. === Parallax/Multi Layer Scroll=== Parallax or Multi Layer Scroll is an effect where there are 2 layers of tiles which scroll, one has priority over the other and often they move at different scroll rates. For example, the following games have parallax or multi layer scroll: * Wizard Willy* Teenage Mutant Hero Turtles* Astro Marine Corps (AMC)* Turrican I and II* Shadow Dancer  ==== Software Scrolling ==== The screen is scrolled using the CPU only. This can be done by moving the data on the screen, or re-drawing it in a different position to give the illusion of scrolling. Examples: * Robocop* Batman the Movie. ==== Hardware Scrolling ==== Hardware scrolling is performed by changing the CRTC registers R12 and R13 to define the start address of the screen. The display is automatically wrapped at 16K, so continuous incrementation of these values will scroll the screen and wrap around. The code must then update the display for new graphics.
Hardware The scrolling is performed in CRTC character sizes. * 1 CRTC char horizontally is 2 bytes of RAM at a time which corresponds to 4 mode 0 pixels, 8 mode 1 pixels or 16 mode 2 pixels.* The height of a CRTC char is defined by changing the CRTC registers 12 and 13 Register 9 (start addressMax Raster), which is normally set to 7. Resulting in 8 scanlines per character.
The Horizontal scrolling is normally 1 can be made smoother by using R3 (Hsync Width), in addition to using R12 and R13 and makes the scrolling effectively half a CRTC char (4 therefore 2 mode 0 pixels, 8 4 mode 1 pixels or 16 8 mode 2 pixels) in . This can be done by changing the horizontal HSYNC width values between 5 and 1 char line (scroll amount dependant 6. The movement is an effect of how the monitor handles the HSYNC. This effect works well on R9Amstrad monitors, but normally 8 scan lines) verticallydoesn't work on modern TFT screens and produces a black and white image on a MP-2 modulator because of the adjusted HSYNC timing.
Horizontal Vertical scrolling can be made smoother by using R3 R5 (Hsync Width) and makes the scrolling effectively half a CRTC char (2 mode 0 pixels, 4 mode 1 pixels, 8 mode 2 pixelsVertical Adjust). (Changing between values 5 and 6 for the horizontal sync causes a half CRTC char movement. This is an effect works on the monitor)all monitors.
This effect works well on Amstrad monitors but produces a black and white image on a MP-More recent games (e.g. Prehistorik 2 modulator because , Super Cauldron) use the rupture technique when doing vertical scroll to ensure the display is a constant number of scan lines in height, and so the refresh rate is always the adjusted HSYNC timingsame.
Vertical scrolling can be made smoother by using Older games adjust R5 and don't use rupture (Vertical Adjuste.g. LED Storm, Legend of Kage) , the time for a frame therefore varies by up to 7 extra scan-lines. This means the VSYNC to the monitor also varies in combination with Rupture/Splitting position by up to make perfect 1 scanline vertical scrolling7 extra scan-lines, and the stability of the image is then dependent on how the monitor handles the VSYNC.
This works on all monitorsIf the game uses a status panel, there are 2 ways to handle this.# Redraw the panel when the screen is scrolled to compensate for it.# Use rupture technique, the panel is in a different part of RAM and will not be affected by the scroll.
This following is an incomplete list of games using hardware scrolling. From this list it can be seen that hardware scrolling has been used from 1984 :
{| class="FCK__ShowTableBorders"
| Yes
|-
 
| [[Cessna Over Moscow]]
| 1987
| No
| Yes
| No
| No
| Yes
|-
 
 
| [[Cyborgs]]
| 1991
| Yes
| Yes
|-
| [[DJ Puff's Volcanic Eruption]]
| 1992
| Yes
| Yes
| No
| No
| No
|-
| [[Doctor Who and the Mines of Terror]]
| Yes
| No
| No
| Yes
|-
| [[Edge Grinder]]
| 2011
| No
| Yes
| Yes
| No
| Yes
| No
| No
| Yes
|-
| [[Glen Hoddle Soccer]]
| 1985
| No
| Yes
| No
| No
| Yes
|-
| [[Gothic]]
| No
| Yes
| No Yes
| No
| Yes
| Yes
| Yes
| Yes
| Yes
|-
| No
| No
| Yes
|-
| [[Mission Genocide]]
| Yes
| Yes
| Yes
|-
| [[Profanation]]
| 1987
| Yes
| Yes
| Yes
| Yes
| Yes
|-
| Yes
|-
| [[Realm!Rastan]] | 1987
| Yes
| Yes
| Yes
|-
| [[The Return of the Jedi|Return of the Jedi (The)Realm!]] | 1989 1987 | Diagonal Yes | scroll! Yes
| No
| No
| Yes
|-
| [[Rick Dangerous 2]]
|-
| [[Rockford]]
| 1988
| Yes
| Yes
| No
| No
| Yes
|-
 
| [[Star Sabre]]
| 2007
| No
| Yes
| No
| No
| Yes
|-
| [[The Return of the Jedi|Return of the Jedi (The)]]
| 1989
| Diagonal
| scroll!
| No
| No
| Yes
|-
| [[Thing on a Spring]]
| 1986
| No
| Yes
| Yes
| No
| Yes
|-
| No
| No
|-
| [[Star Sabre]]
| 2007
| No
| Yes
| No
| Yes
| Yes
|-
| [[Street Machine]]
| Yes
|-
| [[Top Level]]
|
| Yes
| No
| No
| No
|-
 
| [[Twin World]]
| 1990
| Yes
| No
| No
| No
| Yes
|-
 
| [[Ultima Ratio]]
| 1987
| No
| No
| No
| Yes
|-
| [[Unitrax]]
| 1987
| Yes
| Yes
| No
| No
| Yes
|-
| Diagonal
| scroll!
| No
| No
| Yes
|-
| [[Vikings (The)]]
| 1986
| Yes
| Yes
| No
| No
| No
| Yes
| Yes
|-
| [[Wonderboy]]
| 1987
| No
| Yes
| No
| No
| Yes
|-
In addition some games may have been programmed and tested on only 1 CRTC type so may not work on others.
Wonderboy sets R4 every frame to the same value - reason unknown. But it doesn't use Rupture, because if this code is removed it works fine. This is a an incomplete list of games that use this technique, but according to this list the earliest games used this technique was 1987:
{| class="FCK__ShowTableBorders"
| ''Year''
| ''Confirmed''
|-
| [[007 The Living Daylights|007 The Living Daylights]]
| 1987
| Yes
|-
| [[Action Force|Action Force]]
|-
| [[Dynamic Duo|Dynamic Duo]]
| 1988
|
|-
| [[DJ Puff's Volcanic Eruption]]
| 1992| Yes
|-
| [[Energy Warrior|Energy Warrior]]
|-
| [[Enlightenment: Druid 2|Enlightenment: Druid 2]]
| 1988
|
|-
| [[European 5-A-Side]]
| 1988
|
|-
| [[F1 Tornado Simulator]]
| 1991
| No
|-
| [[Grell and Falla|Grell and Falla]]
| 1992
|
|-
| 1989
| Yes
|-
| [[Para Academy]]
| 1990
| No
|-
| [[Prehistorik 2|Prehistorik 2]]
| 1992
| Yes
|-
| [[Q10 Tank Buster]]
| 1991
| Yes
|-
| [[Rastan]]
| 1987
| Yes
|-
| [[Rockford]]
| 1988
| Yes
|-
| [[Santa's Christmas Capers]]
| 1990
| Yes
|-
| [[Skate Ball|Skate Ball]]
|-
| [[Snowstrike|Snowstrike]]
| | |- | [[Sol Negro(opera)|Sol Negro(opera)]] | 1990
|
|-
| [[Twin World (Ubi Soft)|Twin World (Ubi Soft)]]
| 1990
| Yes
|-
| [[Ultima Ratio|Ultima Ratio]]
| 1987
| Yes
|-
| 1987
| Yes
|
|-
| [[Wonder BoyXyphoes Fantasy|Wonder BoyXyphoes Fantasy]] | 1987 1991
| Yes
|-
| [[Xyphoes Fantasy|Xyphoes Fantasy]]
|
|
|-
|}
 
==32 KB V-RAM Hardware Scrolling==
Using two full 16 KB blocks. One at &0000 and one at &C000 allows smooth 32 KB hardware scrolling, horizontally and vertically. R3 of the CRTC is used.
 
===Games===
*[[Return_of_the_Sisters]]
*[[Gerelakos]]
==Firmware==
This list is not exhaustive.
*[[Xevious]] [[Category:Programming]]
2,002
edits