First Steps

Mark Hutchinson, Belfast

 

Issue 8

Mar/Apr 84

Next Article >>

<< Prev Article

 

 

 

I would firstly like to thank all of the people who wrote to me, especially those who enclosed a s.a.e. The majority of questions concerned GRAPHICS which I will not include here as it is just too big a subject. Watch out though for future developments. Let's take a mixed bag of questions that have arisen.

If you have a 16K system then memory is at a premium so why not have great graphics and sound in an intro, display and have this intro load the main program? The second program will clear out the first. Save your programs using SAVE 'C:' and then use RUN 'C:' to load and RUN in one go. This type of RUN looks to see if the RETURN key has been pressed so we put 12 (RETURN key) into location 764 (last key pressed). The last line of your first program must be

POKE 764,12:RUN 'C:'

You may find that any number less than 255, i.e. any key pressed, will do but better safe than sorry.

Why use LET when S=100 does just as well? When writing a program you should use REMs normally on lines that end in 9 and name your subroutines, for instance, GOSUB SOUND. Using SOUND=100 however will bring up an error as SOUND is a command. The answer is LET SOUND=100. Probably S=100 was used first and LET was added to allow commands to be used as variables. If so, then a good afterthought Messrs. Wilkinson and Co.

PEEK and POKE still cause a bit of trouble. What does POKE 106,PEEK(106)-8 mean? 106 is the location that tells you the top of memory in pages (a page is 256 bytes). P=PEEK(106) tells us how many pages are available. P-8 means we wish to reserve 8 pages for our use. Now we put this new figure into 106 so that the computer knows not to go higher, POKE 106,P-8. As you can see this has taken two commands whereas POKE 106, PEEK(106)-8 is only one - a memory saver.

A POINTER is a location that holds the address of another location usually in ROM which you cannot amend. Every time the computer wants to change your keystroke into a character it will go to 756 and normally find 224. Now, 224*256 = 53744 (Why? Surely you have read that excellent article Memories..!!) which is where the character set resides in ROM. If you save a bit of memory by lowering RAMTOP as explained above, and change 756 by POKE 756,PEEK(106) then the computer will be directed to the new address and retrieve your very own character set if you have stored it there. A bit like changing a road sign. Note that a GRAPHICS call will reset this POINTER.

Did you know that the whole of the Galactic Map on Star Raiders is redefined characters? The secret slipped out when I removed the cartridge from an XL.

If any readers have seen the COMMANDER 2400 keyboard advertised in American magazines, I can confirm it to be an excellent and worthwhile, albeit expensive, purchase. No matter what Jackie from Germany thinks, I will stick to my 48K 400!

I was asked by John Tolan why his variables should all suddenly appear as PMBASE. This reminded me of 'The Crypts of Terror'. When you BREAK and LIST, the intro, it comes out as graphics garbage. On investigation it seems that locations 130 and 131 hold the secret. These are variable name table pointers. If you POKE a number here and list your program, strange things occur. Your program runs because it has been set up in memory but you will get errors when you amend because poor Atari cannot understand the garbage. Pretty good 'in-home' protection. Of course this is not the answer to the original question but it held my attention for hours.

Finally, Les Lawson asked me what CTRL-3 is for. This caused a problem which turned into an embarrassment. CONTROL-3 is an End-of-File marker and I could not think why it should be on a keyboard. Quite obvious if I had read my DOS manual! You can directly create a file on disk from the screen by first opening a file OPEN #1,8,0, 'D:FILEDATA.' and then using DOS option C - Copy File - and E:,D: FILEDATA. Just type your data and when you have finished use CTRL-3 for the EOF marker.

Finally (really) our Editor limits my space! The time between receiving your letters and the printing of this column could involve two issues so if you want an earlier reply, please enclose a stamped addressed envelope.

Mark has answered many readers' questions direct. Write to him at BAUG software, P.O.Box 123, Belfast N. Ireland, BT10 0DB

top