CWTA Issue 47 - November 1988 - Type-Ins

From CPCWiki - THE Amstrad CPC encyclopedia!
Revision as of 04:21, 15 August 2020 by Robbarton (Talk | contribs) (Created page with "The following listings were published in the November 1988 issue of ''Computing_with_the_Amstrad'': === Type-Ins === * Sprite System (Ian Sharpe) * File Interrogator (Pa...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The following listings were published in the November 1988 issue of Computing_with_the_Amstrad:

Type-Ins

  • Sprite System (Ian Sharpe)
  • File Interrogator (Paul Ford)
  • Escher's Triangle (E. Freestone)
  • Lucas's Solution (Sally Douglas)
  • 3D Surfaces (Hung Tan Ngo)
  • Advanced Art Studio Screen Loader (Simon Bond)
  • Micro Design Printout Utility (Richard Giles)

Notes

  • All files here originally created by Nich Campbell.
  • The Mysteries Of Ascii Codes by Ian Sharpe is an article about ASCII and control codes. These listings aren't on the dsk image.
  • In the Postbag section are two useful listings, provided on the dsk image:

Modified Picture Saver by Iain Purdie provides four RSXs |COPYD, |COPYU, |SAVEPIC and |LOADPIC to copy the screen down to &4000 and back to &C000, save the visible screen at &C000 down to &4000 along with screen colour, mode and border data, then saves the screen to tape in one chunk. |LOADPIC reverse the process (load file from tape to &4000, restore border, inks and mode and copy the stored screen to &C000).

Fast CLS by Ian Hoare is a machine code listing response to Ian Sharpe's article in August 1988 issue 44 to find a faster way of filling a block of memory.

Sprite System

If you want to use sprites in your own BASIC programs, this utility (SPRSYS.BAS) lets you design up to 25 sprites, although you can only use MODE 0 and all the sprites must be 8x8 pixels in size. On the left of the screen is a list of the inks and their colour values, which you'll need to write down so that you can set them correctly in your BASIC game. On the right of the screen is a column where the sprites are stored; the editor refers to this as the bank. The middle of the screen contains a rectangle where you edit a sprite.

When you have saved your sprites, you can load them into your BASIC program by typing: MEMORY &7FFF:LOAD"filename.bin",&8032:CALL &8032 replacing filename.bin with the name of the file containing your sprites.

To display a sprite, use one of the following commands: CALL &804C,x,y,number CALL &804C,oldx,oldy,oldnumber,x,y,number

The first command displays a sprite at the coordinates specified in x and y, and number contains the number of the sprite. The second command is more complex; it removes a sprite and displays a sprite elsewhere. Let's say that a sprite has been placed at the coordinates specified by oldx and oldy, and we want to remove it from the screen, and display a sprite at another location. In this instance, oldx and oldy contain the coordinates of the sprite to remove, and oldnumber contains the number of the sprite to display on top of that sprite (this will usually be 0, and you should define sprite 0 to be blank for this purpose). x and y contain the coordinates to display the new sprite, and number is the number of the new sprite. The second command is effectively the same as: CALL &804C,oldx,oldy,oldnumber:CALL &804C,x,y,number

A small game also accompanies the program. It's a simple Space Invaders clone which uses Sprite System to display sprites. Five aliens fall down the screen and reappear at the top, and you have to shoot all of them and avoid them crashing into your spaceship. The graphics are actually quite impressive. The DEMODATA.BAS program generates the machine code for this game, which is saved as DEMO.BIN. This file can be loaded into Sprite System.

Keys: Editor: Cursor keys - move cursor, SPACE - plot pixel, DEL - delete pixel, SHIFT+cursor up/down - select ink, SHIFT+cursor left/right - change first colour of ink, CONTROL+cursor left/right - change second colour of ink, CONTROL+cursor up/down - select sprite in bank, CONTROL+G - get sprite from bank, CONTROL+P - put sprite in bank, CONTROL+M - mirror sprite horizontally, CONTROL+V - mirror sprite vertically, CONTROL+L - load sprites, CONTROL+S - save sprites, CONTROL+H - help

Game: Cursor keys and SPACE.

Download

Screenshots