Jump to: Book reviews | Module news | IUG | Call Key | random | Mini Memory Assembly
What you have to ask yourself is 'what can I do with my computer' and the answer to that question really lies in what you want to get out of it. If you want to do nothing but play cartridge-style games or if you want to add memory expansion, disk drives and modems then you will probably be better off looking for another machine. If, however, you are interested in learning about computers, how they work, how to write programs and if you are prepared to do bit of looking around for information and software then you should find that the TEXAS will do everything you want it to.
Don't forget, the TI 99/4A is probably the best computer there is for learning how to write programs, the BASIC is very clear and powerful compared to some other machines.
If you want games there are many third party software houses who advertise regularly in the popular computer magazines. What makes computers fun though is not just the games but their flexibility. Try and think of all the things you use your computer for now, apart from games... not very many I’m sure! If you spend a little time thinking about it you will begin to discover that computers could do a lot more for you. Use your imagination! How about getting your TI to: Help with homework, keep track of your money, keep a list of all your records and tapes, make a list of your timetables (school, exams, work etc), these are all things your computer could do either by a small amount of programming or by buying software that will do it for you.
If you have the Extended Basic cartridge and are interested in using the sprite graphics to their full, then this is the book for you. Within its pages you will find detailed explanations of just about every use you can think of for sprites. Some chapter headings are:
Sprite Patterns, sprite chase, Shooting sprites, Pick up objects. Eat dots and lay down trail, etc.
Each new subject is handled clearly, with example programs (all those I typed in were bug free), and step by step explanations of how the program is doing what it is doing. The author is obviously very familiar with the operating system of the TI 99/4A and with the operations of BASIC since tips on how to speed up your programs and useful insights into the machine are liberally scattered through the book.
For those who have not yet discovered the delights of Peeking and Poking let me explain that the PEEK command in Extended Basic allows you to look directly into what is called the CPU RAM.
By looking directly at what is stored in this section of memory with CALL PEEK we have a very fast way of bypassing such slow basic operations as creating random numbers.
If all this is beyond you, don't worry, CALL PEEK covers only a small section of this interesting and useful book and I would strongly recommend it to anyone wishing to get more from their Extended Basic.
[sjs 2016- book available online.]
Is this the book that will satisfy all those mini-memory owning potential assembly language programmers? Well, it just may be at that.
The greatest problem in trying to teach aseembly language is the language and jargon is so very different from that of the BASIC programming environment.
Words such as Registers, Workspace, Operands and Mnemonics are just some of the terms which require clarification at a very early stage. To a small extent this book does make an attempt to explain such terms as they arise however, you do still find yourself presented with a host of unfamiliar terms at a very early stage. This is probably the boooks major shortcoming.
The rest of what I have to say of this publication is, thankfully, all good.
The reader is taken methodically through the various numbering systems, the features of EASY BUG, and the rudiments of using the Line-by-Line Assembler.
There are many example programs with detailed explanations, and all those we entered were bug free.
One of the things I liked most about the book was that it assumed the reader would experience some difficulty at first and even advises you to leave out some chapters until later or to go back and read certain chapters if you are having difficulty. Assembly language is bound to be a bit difficult at first but with his system of reading chapters when they are required you tend not to get as bogged down as you would with other publications.
Compared to the Editor/Assembler manual this book is a joy. I would, however, state that in my opinion there is no escaping the need for the E/A manual for the serious programmer.
All in all this is a usesful book: with some delightful assembly language programs such as thoae which allow you to draw on the screen in the high resolution BIT MAP MODE (not available in BASIC) and in the MULTICOLOUR MODE (also not available from BASIC).
The best tutorial yet for the potential assembly language programmer
[2016- This was a French book by Denise Amrouche and Roger Didi which can sometimes be found on ebay but has no online presence].
There are, however, some new modules about if you’re prepared to hunt for them and the ATARISOFT range is now being actively marketed by ATARI. In spite of representing a high standard of programming on some of the range, such as the excellent versions of Donkey Kong and Defender, these modules have caused some problems for a few TI-99/4a owners.
The plastic casings on some of the cartridqes have been prone to wobble a bit in the cartridge slot and for one or two unfortunate owners the modules have been found not to operate at all. I would stress that this is not really a fault of the cartridges but stems from Texas Instruments resolve to stop other companies producing games for their machine. In the later models of the TI-99/4a, the VERSION 2.2, TI have altered the circuitry so that only their own cartridges can use the port. So be warned, non-TI modules will not run on your machine if you have a version 2.2 computer. The version you have is written on the test card which appears when you first switch on the machine.
[2016-sjs- Some of the Atarisoft modules used the console's built in large character set that appears on the opening test card screen. They used a direct address which TI changed in some consoles, resulting in corrupted text in the games. There was no fix]
Apart from these problems, which affect only a minority of users, most of the Atarisoft games are great fun. If you haven't seen their Donkey Kong I would recommend it.
STOP PRESS - At the time of going to press the Atarisoft range is unavailable in the U.K
Titles. that I can remember are; Moonmine, Hopper, MASH, Slymoids, Space Bandit. Sewermania, Bigfoot, Superfly, Jawbreaker, Microsurgeon, Burgertime and Buck Rogers and the planet of Zoom. The last title is the only one I am very familiar with and can recommend it as an excellent game with superb 3d graphics. Other titles that are reputed to be of a high standard are MASH, Microsurgeon and Burgertime
Now that the TI is no longer in production it is becoming more and more important for TI owners to club toqether and communicate, to swap programs and ideas and to learn from each other. Specialist publications such as "99'er Magazine" specifically coverinq the TI-99/4A have always in the past been a boon to those of us who wish to get the most from our computer", Sadly, 99er magazine has withdrawn its excellent coverage and is now diversifying in order to stay competative, a departure which, I’m sure, leaves many TI-Users high and dry when it comes to their need for software and tutorial articles.
You may remember my mentioning in one of the earlier issues a group called the The International 99/4 Users Group, since that issue I have subscribed to the group and I am now very glad that I did. The group offers a monthly newsletter and a bi-monthly colour magazine called Enthusiast 99, a publication which rivals 99er for its programming ideas and software. The magazine deals with all facets of the TI and has its ear to the ground as far as computer news is concerned, articles cover everything from the very simplest basic programs to the most complex machine code ideas and information, all presented in a very sophisticated format.
As if this were not enough the group also offers a software market and exchange scheme, open to members only, with a selection of over two thousand software titles!
I would heartily recommend this magazine and user club since it offers very good professiona1 support and an access to software on the American market both cheaply and under the guarantee of the I.U.G
INTERNATIONAL 99/4 USERS GROUP BETHANY
[2016- Unfortunate timing this little article. The last issue of Enthusiast 99 produced by the IUG was May-June 1984. Ultimately it was wound up insolvent. There were issues about unmet subscriptions and other unfortunate matters.]
What can you do with CALL KEY? How can you use it to best effect?
Let's start by examining what it does and then perhaps we will be able to find one or two new uses for it. Take the statement:
100 CALL KEY (0,K,S)
100 is the program line number, CALL KEY tells the computer that it should prepare to scan the keyboard to see whether or not a key has been pressed.
Inside the brackets, the 0 tells the computer exactly what type of scan to perform - this is important and is something many people ignore. 0 is most often used simply because it is given as the main example in the reference
book, what it does is cause the computer to return the ASCII code (see pages 93 and 102 of the Users Reference Guide) for the key pressed and assign it to the variable K. So that if you were pressing the D key when line 100 was executed, the variable K would equal 68. If no key is pressed then K=-1. The variable S in line 100 will equal 0 if no key has been pressed, -1 if a key has been pressed and +1 if a key has been pressed that was different to that of the last keyboard scan.
The following short program will allow the user to press any key and see what values are returned for K
100 CALL CLEAR
110 CALL KEY (0,K,S)
120 PRINT K
130 GOTO 110
Try pressing keys with the alpha lock up and with it down, also use the function and control keys. when you are familiar with the kind of response you get and have looked at page 90 of the reference guide, alter the number in the brackets of line 110 to another number less than 6. Page 90 gives a rough explanation of the different numbers the keys will return.
Probably the most useful number to use is 3. This disables the entry of lower case characters (not their use in a program) so that whether the alpha lock is up or down you wi11 still only get the ASCII codes for capital letters. How
many times have you seen Play with the alpha lock down on your screen?
Codes 1 and 2 split the keyboard and the numbers returned are shown on page 91 of the |reference guide, these codes also read the fire buttons of the two joysticks - K will equal 18 if a button has been pressed.
On page 93 of the reference guide the table of function keys and control keys show the values returned when these keys are used. The control key table should be useful to those wishing to make use of the graphics capabilities of
the control keys as outlined in the first issue of TI-USER.
-------
How do you use random numbers to their best effect?
There are two Basic commands related to the generation of random numbers, they are RANDOMIZE and RND.
RND is concerned with creating a random number whilst RANDOMIZE allows you to specify the type of number you want and to control the RND command. Here’s how it works.
100 CALL CLEAR
110 PRINT RND
120 GOTO 110
what you get is a series of numbers greater than or equal to zero but less than a one. If you run the program again though
you will get exactly the same series of number, not very random!
This is where the RANDOMIZE statement comes in. If you add the line
50 RANDOMIZE
you will now get a different set of numbers every time the program is run.
You can further control the RND command by using what is called a seed with the RANDOMIZE command. what this does is to give you a sequence of numbers that is repeatable
eg. Alter line 50 to the following
50 RANDOMIZE 81
Once more you will get the same sequence of numbers every time you run the program. A different seed will produce a different sequence and each sequence is repeatable just by using the appropriate seed. Take note not to use more
than two figure numbers since the computer only uses the first two bytes of the number.
Now, after all that, how do you get a truly random number between say, 1 and 255? Well, let's start by adding 1 to the value of RND, this gets us a number between 1 and 2.9999999r. If we then multiply that by 255 and use INT to get a whole number we end up in the right place
100 CALL CLEAR
110 RANDOMIZE
120 R=INT(RND*255)+1
130 PRINT R
140 GOTO 120
Generally speaking, you can use the following formula to get the range of random numbers you require:
H=The highest random number required
L=The lowest random number required
R=INT(RND*(H-L))+L
There are quicker ways of generating random numbers with Extended Basic, by Peeking the scratch pad ram - for a detailed explanation see the Smart Programming Guide for Sprites- review this issue.
[Each to his own- I very quickly found this module pointless and boring-sjs]
So the command CALL PEEK(367,x) will perform an operation similar to that of
GCHAR, fetching a character code from address 367 om the screen. CALL
POKEV(367,161) will print an A in the centre of the screen. The big
advantage of this method is that it is much faster than the usual basic
commands and that you can Peek and Poke successive bytes in one command eg
CALL POKEV(365,72+96,69+96,7
6+96,79+96,79+96)
This prints ’HELLO’ very quickly in the middle of the screen. Here then is an
excellent way of speeding up your Basic programs
Now, lets have a look at the short assembly language routine that I gave you to
look at last issue. what this did, if you were one of those who managed to
make it work, was to print the words P'RINT THIS LINE on the screen and it
worked in a similar fashion to the basic line above.
Here is the program
listing. Remember to type a space whenever the ’sp’ appears
You will see the hexadecimal numbers and addresses qiven by the assembler.
sp AORG sp >7D00
T1 sp TEXT sp 'PRINT THIS LINE'
sp LI sp R0,>0126
sp LI sp R1,T1
sp LI sp R2,15
sp BLWP sp @>6028
L1 sp LIMI sp 2
sp LIMI sp 0
sp JMP sp L1
sp END
In order to see this program in action you should load the Line-by-Line
Assembler via the 'L' option of the EASY BUG, quit the easy bug and select minimemory RUN, using a program name NEW
Let's examine what this program is doing.
The Assembler commands are listed in both of the manuals previously mentioned.
In line 1, AORG stands for Absolute ORiGine and it tells the assembler (which
is the program you loaded and which you are usinq to enter the assembly
language program) where in the 4k of CPU memory to place the first machine code
instructions.
Now the assembler program is actually taking up much of the 4k so that you have about 1k of programming space left. Hex address >7D00 is at about the starting point of the free section of memory.
Line 2 is rather like the DATA command of Basic, only TEXT converts each letter
into its ASCII equivalent and places it in memory. T1 is a label and is simply
there so that you are able to locate the Start of the text.
In line 3 we are loading a hexadecimal number into what is called a REGISTER.
You can use 16 registers at any one time, each represents two bytes in a 32
byte section of memory called a WORKSPACE. These registers are numbered
R1,R2,R3 etc and are used in assembly language in a similar manner to variables in basic.
The actual command in this line reads 'Load Immediate Register 0 with the hex. number >0126' What we are doing is storing the screen address where the first byte of TEXT will be printed. Hex >0126 is equal to decimal 294.
Line 4 loads the start address in CPU RAM of the first byte of TEXT into Register 1. When we created the label T1, the assembler automatically made the label T1 equal to the address at which the data starts. Again the usage of labels is similar to that of variables.
Line 5 loads the number of bytes that will be read from CPU RAM onto the screen, in other words the number of letters and spaces in the 'PRINT THIS
LINE' ie fifteen. You will notice that the assembler understands decimal 15 as
15 and does not attempt to read it in hexadecimal because it is not preceded by
a greater than sign (> ). Either system of numbering is acceptable but it is
essential to become familiar with hex as early as you can.
Line 6 is like Basic GOSUB. Having stored in the registers all the information you need to transfer data from CPU memory to the screen in VDP memory, we can now Branch to a utility routine in the mini-memory which will do the the transfer work for us.
This routine uses a different set of registers to our own so we are using the command Branch and Load Workspace Pointer (BLWP) location >6028 the routine will find two address, one will be the start of the utility routine, the other will be the address in memory of the new workspace ie the utility program's set of variables. When the utility routine has
finished it then returns to your program to execute the next line.
Lines 7 and 8 are beyond the scope of this article, their function is to allow the prgram to be quitted - otherwise you would have to switch off to stop the
program running. L1 is a label similar to T1 and in Line 9 it is used to tell the program where to jump back to. The command JMP acts like the Basic GOTO.
So there it is we have used the machine code utility routine called VDP Mu1tiple Byte Write described in the Mini-Memory manual on page 35
end of article
[ TI Book front page |
TI Resources Page
| PC99 Review
| PC99 Programs
]