-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDocumentation of TURBO Plus.txt
1704 lines (1373 loc) · 70 KB
/
Documentation of TURBO Plus.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
**** SEARCH FOR MEEKS ****
This documentation of TURBO Plus is a patched-up version of TURBO V1.0.
Any reference to PLAYFIELD! and Ryan Scott are no longer valid!
Since I haven't heard or received any reaction from Ryan Scott for the past
year, I hereby declare that he has no more rights on distributing/selling
TURBO Plus.
Since Manuel ANDRE is the only programmer involved with this package,
he retains the rights to sell or distribute it without further notice.
The Scene Editor and Color Font Editor are not included in this package and
are © C. B. Meeks.
I would like to apologize to all people who were left behing with no technical
support and help.
You can contact me for bugs/help:
Manuel ANDRE
Arbeidersstraat Nr. 9
2600 BERCHEM
BELGIUM
P.S.: I'm planning to release TURBO Plus in the PUBLIC DOMAIN after I've had the
time to update this docfile further.
I would be very pleased if you could help me to come up with a better doc/guide.
The following functions are no longer part of TURBO_Plus :
=Xscr Mouse
=Yscr Mouse
=Xscr Sprite
=Yscr Sprite
=Inscr Mouse
They are now included in the PowerBobs extension.
CONGRATULATIONS!
You have purchased the most powerful AMOS language extension
available. With the TURBO PLUS extension, you can manipulate
maps, handle scrolls, and perform complex graphics operations at
machine language speeds. You have a vastly extended array of
new useful AMOS commands at your fingertips. Please read this
manual thoroughly as it contains all the useful information you will
need to take full advantage of your new command set and utilities.
THANK YOU!
I have worked very hard to bring TURBO PLUS to the world.
I appreciate your support greatly.
Without you, TURBO PLUS would not exist today!
TURBO PLUS was created to fill user's needs and requests.
If you have any ideas for future enhancements/additions, or bug fixes, please
contact us right away!
I want to hear from you!
TURBO will continue to grow and expand as long as there is interaction from you!
Please do not give copies of TURBO to anyone.
I spent many, many long hours working on this and I think I'm justified
in earning a fair wage for it. Do not spread TURBO and I'll continue working
on it.
PLEASE!
Should you become so enamoured with the TURBO PLUS EXTENSION that you use it
in your next great mega game, I encourage you to be so kind as to credit me
and the TURBO PLUS EXTENSION.
This will generate more interest, more users, and more new commands!
Support your AMOS community and it will support you!
DISCLAIMER
I cannot be held responsible for any damage to you, your computing
equipment, your programs, or any data as a result of use of the TURBO
PLUS extension, either directly or consequentially as a result of its use.
By using the TURBO PLUS extension you agree to these terms and agree not
to hold me liable for any damages arising from the use of this package.
Use the TURBO PLUS extension package at your own risk.
This manual was created with the excellent Devpac 2.14 © HISOFT.
AMOS, AMOS Professional (AMOS Pro), AMOS Compiler, AMOS Professional Compiler
are all trademarks of Europress Software.
CONTENTS
INTRODUCTION
3 Credits
5 TURBO History
6 INSTALLATION
Changes from previous versions
Conversion from older TURBO versions
Installation of the extension
COMMANDS
10 Graphics 24 Starfields
12 3D Drawing 26 Vector Objects
13 Zones 29 Blocks
14 Check 31 Icons
16 Miscellaneous 33 Scenes
20 Bitwise Operations 38 Scrolling
22 Bitplane Operations
SCENE EDITOR 42 (not included)
COLOR FONT EDITOR 56 (not included)
APPENDIX ??
? FUTURE of TURBO PLUS
? PLAYFIELD! and TURBO SUPPORT
? Other Products
INDEX
CREDITS
From Manuel Andre:
I want to thank all these people mentioned below for their wonderfull
support and idea's.
Let's hope this list will grow and grow...
Dominique: my wife.
Michael Cox: Creator of AmoNER and my first contact in the U.S.A.
For more info write to :
Michael Cox
11128 Rock Garden Rd.
Fairfax, VA 22030-4935
USA
And last but not least: François. Lionet, the creator of the "CREATOR"!
Ok, now a personal profile :
Age : 28 (born 26/06/1967)
Married : with Dominique
Occupation : system administator/operator
SIEMENS H90/H100 main-frame
Hobby's : programming and programming, programming,...
Pets : my dog Joelle
First computer : Acorn Electron
Second Sinclair QL
Third AMIGA 500 !!!
Present configuration : A2000 1MB 52MB HD
A1200 HD40, 030 accell. 'crawling' at 42 Mhz
with 4MB FAAAASSSSSTT RAM.
INSTALLATION
Installation is simple. The AMOS and AMOSPro versions use slot number 12.
If you were running a previous version of the TURBO extension, please be sure
to remove it from the extensions list. In AMOS, the TOME extension does not
work with TURBO PLUS and must be removed. You will most likely rather use
TURBO PLUS's richer command set.
It is strongly recommended that you read this entire chapter before proceeding
with the installation. Operate only with a BACKUP of your system disk!
CHANGES from previous versions
Certain commands have changed from earlier versions of the TURBO
extension. Make note of these changes so you can update your older programs
successfully.
F Stars command became Stars Draw.
Object Load Chip became Object Load.
CONVERSION from an older TURBO
If you have worked with an older version of the TURBO extension (earlier than
v1.9), you must follow this procedure to convert your older TURBO programs to
work with your new TURBO PLUS.
If you do not need to perform the conversion, skip to straight to Installation, and
begin installing your new TURBO PLUS extension. Otherwise, proceed with the
conversion process, then install your new TURBO PLUS extension.
The TURBO PLUS extension library changed slot numbers upon becoming an
official extension (v1.9+). Programs expecting TURBO PLUS in another slot
number will not run unless converted. DO NOT proceed with the Installation
until you have performed this conversion process.
To convert your older TURBO programs, you will need to save all of your
TURBO programs in ASCII format. After saving all programs in this manner,
perform the installation, then bring the old ASCII saved programs back into
memory.
CONVERSION PROCESS:
STEP 1: Save your program in ASCII format
In AMOS:
Load the program to convert
Move to the top of the text by pressing Ctrl-Shift and the Up Arrow key
Press Ctrl-B to mark the beginning of the text
Press Ctrl-Shift- Down arrow to move to then end of the text
Hold Ctrl and use the mouse to click on the top right hand button, Save ASCII
Save the program in ASCII format as 'filename.ASC', as opposed to
'filename.AMOS'
In AMOS Pro:
Load the program to convert
Press Ctrl A to select all the text
Press Ctrl S to store the text
Press Ctrl Shift A to save the text as an ASCII file. Save the program in ASCII
format as 'filename.ASC', as opposed to 'filename.AMOS'
STEP 2: Install the new TURBO PLUS extension
Read the next section, INSTALLATION and perform the necessary operations
to install the new TURBO PLUS extension into your AMOS or AMOS Pro
system.
STEP 3: Bring your ASCII saved programs back into memory
An ASCII saved program will not contain the banks (graphics, sound, etc) that
the original program used for its operation. You will need to first Load the
program in normally using the Load option, erase all the text, then Merge the
ASCII saved program into memory:
In AMOS:
Load the program to convert. If you look through the program, or click on test,
some commands may say "Extension I". The program will not run.
Press Ctrl A to select all the text
Press Ctrl C to cut the text (it is stored in a buffer)
The current program now contains just the banks the program used for
operation, none of the program text. We will bring the program text back into
the program and it will be tokenized (converted to an internal AMOS format) for
the new TURBO PLUS extension
Hold the Shift Key and use the mouse to select Merge ASCII from the top right
hand menu item.
Select the ASCII version of the program you are converting ('filename.asc'
instead of 'filename.AMOS')
The ASCII text program will be merged into the program window
Save the program to disk ('filename.AMOS') (Amiga-S)
Your program is now converted. Perform this operation for all relevent
programs.
In AMOS Pro:
Load the program to convert. If you look through the program, or click on test,
some commands may say "Extension I". The program will not run.
Press Ctrl A to select all the text
Press Ctrl C to cut the text (it is stored in a buffer)
Press Ctrl F to erase the cut text from the buffer (optional if you have lots of free
RAM)
The current program now contains just the banks the program used for
operation, none of the program text. We will bring the program text back into
the program and it will be tokenized (converted to an internal AMOS format) for
the new TURBO PLUS extension
Press Amiga-M to Merge an ASCII file into the current program
Select the ASCII version of the program you are converting ('filename.asc'
instead of 'filename.AMOS')
The ASCII text program will be merged into the program window
Save the program to disk ('filename.AMOS') (Amiga-S)
Your program is now converted. Perform this operation for all relevent
programs.
INSTALLATION
HARD DRIVE USERS:
You can perform the installation easily right on your hard drive. See
instructions below.
ATTENTION FLOPPY USERS:
Perform the installation only on a COPY of your system disk!
Before installing TURBO PLUS, you need to make sure there is enough room
on your AMOS or AMOS Pro system disk for TURBO_PLUS.Lib (apx 30,000
bytes as of this writing). If not, you will have to erase or move enough files to
make room.
On an AMOS system disk, you can move or erase Config1_3.AMOS to make
enough room. Make sure you have a good copy of this program on another
disk for later use. You will need it for the installation process!
On an AMOS Pro system disk, you can erase Install.AMOS to free up 40,000
bytes. Make sure you keep a good copy somewhere in case you need it at a
later date.
After freeing up some space, procede with the installation:
AMOS installation
1 Copy the AMOS_TURBO_PLUS.LIB into the AMOS_SYSTEM drawer.
2 Load AMOS.
3 Load and run the CONFIG1_3.AMOS program.
4 Select 'Load default configuration' from the 'Disc' menu.
5 Select 'Loaded extensions' from the 'Set' menu.
6 Click onto line number 12.
Now enter the path and the name of the new extension.
Ex.: AMOS_SYSTEM/AMOS_TURBO_PLUS.LIB [enter]
7 Click onto the QUIT gadget.
8 Select 'Save configuration' from the 'Disc' menu.
9 Select 'Exit to system' from the 'Amos' menu.
10 Very Important! You must also change the AMOS1_3_NTSC.ENV and the
RAMOS1_3.ENV configurations in this same way! Instead of
selecting 'Load default configuration' (step 4 above), select 'Load other
configuration'.
AMOS PRO installation
1 Copy the AMOSPro_TURBO_PLUS.LIB into the APSYSTEM drawer.
Floppy users: use a COPY of your system disk and erase
Install.AMOS to make enough room for the TURBO PLUS library.
2 Load AMOSPro.
3 Load and run the Interpreter_Config.AMOS program.
4 Select 'Load Default Configuration'.
5 Select 'Set Loaded Extensions'.
6 Click onto line number 12.
Now enter the name of the new extension.
AMOSPro_TURBO_Plus.Lib [ENTER]
7 Click onto the Ok gadget.
8 Exit the Loaded Extensions setup
9 Select 'Save configuration'.
10 Quit the Interpreter_config program.
11 Exit AMOSPro.
The TURBO Plus Extension is now installed. Reload your AMOS system.
GRAPHICS
The TURBO PLUS extension introduces an array of enhanced graphics commands.
Replace older graphics commands with TURBO's graphics commands for an appreciable speed up!
All commands below that are 'Relative' begin their drawing from the current graphics position. To set
the position of the graphics cursor for relative positioning, use the AMOS command Gr Locate x,y.
The command may leave the graphics cursor in a different position than where it began, read the
descriptions for more information.
F Plot
F Plot x,y,colour
This instruction plots a point of colour on the current screen at coordinates X,Y. It is exactly the
same as the normal AMOS Plot instruction, except that it is 2 to 3 times faster than the standard
AMOS version and that you must give the COLOUR parameter. F Plot is fully compatible with the
AMOS double buffering process.
=F Point
r=F Point(x,y)
This function returns the colour register of the pixel located on screen at coordinates X,Y. It does the
same thing as the normal AMOS Point instruction, except that it is 2 to 3 times faster.
R Move
R Move dx,dy
Relative move of the graphics cursor.
Example:
Gr Locate 10,10 : Rem place graphics cursor at 10,10
R Move 5,-5 : Rem graphics cursor is now at 15,5
Does the same thing as: Gr Locate Xgr+dx,Ygr+dy but is shorter and faster.
The graphics cursor will be moved to the new position.
R Draw
R Draw dx,dy
Draw a line relative to the graphics cursor. Does the same thing as:
Gr Locate X,Y
Draw To X2,Y2
but it is shorter and faster. At the completion of the command, the graphics cursor will be located at
the end of the line.
R Box
R Box dx,dy
Draw a box relative to the graphics cursor. Does the same thing as:
Box X1,Y2 To X2,Y2
but it is shorter and faster. At the completion of the command the position of the graphics cursor
remains unchanged.
R Bar
R Bar dx,dy
draws a filled bar relative to the graphics cursor. Does the same thing as:
Bar X1,Y1 To X2,Y2
but it is shorter and faster. The graphics cursor remains unmoved.
F Draw
F Draw X,Y
Does the same thing as:
Draw To X,Y
but it is up to 200% faster than the original Draw routine! (1-2 bitplane screen). The graphics cursor
will be moved to the end of the line. The Set Line MASK command has no effect when using F
Draw, this will be corrected in a future update. It is exactly the same as R Draw X,Y but is included
to remain consistent with the F Draw command.
F Draw To
F Draw x,y To x1,y1
Does the same thing as:
Draw X,Y To X1,Y1
But it is up to 200% faster than the original Draw routine ! (2 bitplane screen). The graphics cursor
will move to X1,Y1. The Set Line MASK command currently has no effect when using F Draw.
F Circle
F Circle x,y,radius,colour
Draw a circle with center at x,y. Does the same thing as the normal Circle command but this new
version is up to 550% faster than the original AMOS BASIC version when drawing large circles. For
smaller circles you get a speed factor of 250 to 400%.
All parameters are the same as in the normal Circle command except that you must give a colour
parameter. You can currently only use this command in LOWRES screens or HIRES+LACED
screens or your circle will actually be an ellipse. Also, keep the radius of the circle below 180.
Blit Clear
Blit Clear x
This is a simple command for clearing any bitplane of a screen.
If x <0, all bitplanes of a screen will be erased.
If x >0, clear bitplane x
An 8 colour screen has 3 bitplanes, numbered 1 -> 3.
Blit Clear is about 80 % faster than the Cls command.
Three Dimensional Drawing
Line 3d
Line 3D x,y,z To x1,y1,z1
Will draw a line from (X,Y,Z) to (X1,Y1,Z1) in three dimensional space. To do this I assume a fixed
eye position. Further I take the eye position as the origin. To form a perspective view, we need to
define a 'vanishing point', a theoritical point at which all distant parallel lines meet. If you were
standing on the white lines in the middle of a straight road and you looked along the road towards the
horizon, the vanishing point would be where the white line and the two road edges meet. By taking
this eye position, our perspective calculations can be simplified to: X=X*D/Z and Y=Y*D/Z. Where D
is the distance between the eye position and the picture plane (the screen). The value I use for
D=128. So the greater the value of 'Z' the further away the object and therefore the smaller the
resultant 'X' and 'Y' values. This implies that objects appear smaller at a distance.
Eye 3d
Eye 3d x,y
This instruction changes the location of the vanishing point. If not initialised when using the Line 3d
instruction, X will have a value of 160 and Y a value of 100.
ZONES
TURBO PLUS offers an array of faster AMOS Zone compatible commands in addition to TURBO
PLUS Check commands for hyper speed screen zone checking.
These commands can be used with the normal AMOS Zone commands.
=Hit Spr Zone
x=Hit Spr Zone(dx,dy,n)
Checks if sprite number N enters a zone. DX and DY are optional.
DX and DY allow you to specify an offset from the sprite's hot spot.
This command does the same thing as:
A=Hzone(X Sprite(n)+dx,Y Sprite(n)+dy)
But it is shorter and faster. (20 to 50 %)
=Hit Bob Zone
x=Hit Bob Zone(dx,dy,n)
Checks if bob number N enters a zone. DX and DY are optional.
DX and DY allow you to specify an offset from the bob's hot spot.
This command is the same as:
A=Zone(X Bob(n)+dx,Y Bob(n)+dy)
But it is shorter and faster. (20 to 50 %)
CHECK
CHECK commands are the TURBO version of AMOS Zone commands
These commands are not compatible with the normal Zone commands! You will most likely rather
use these more flexible TURBO commands.
Before defining your screen zones, you will need to reserve enough memory for the various Checks
using Reserve Check. Set Check allows you to define the various Check areas and Check (x,y) lets
you check to see if a given coordinate is within a defined Check Zone. Superfast Bob Check and
Sprite Check commands are available for monitoring objects entering screen zones.
Reserve Check
Reserve Check x
Reserves x check ZONES for TURBO zone (CHECK) routines. Execute this command before
Setting any Check zones.
Check Erase
Check Erase
releases the memory used by Reserve Check and erases all definitions. You must Reserve more
Check zones before Setting any after this command. This operation is performed automatically
when you execute Default or exit the AMOS system.
Reset Check
Reset Check z
Erases a Check zone's definition. You must give the zone number.
Set Check
Set Check z,x1,y1 To x2,y2
Does the same thing as the Set Zone command. Define a rectangular screen area to be monitored
by the Check commands. This command sets Check zone Z to lie within screen coordinates X1, Y1
to X2, Y2.
=Check
x=Check (start To end,x,y)
Checks if the given coordinates X,Y are within a Check zone. The START and END parameters
indicate which zones you want to check. Ideal if there are many zones and you want to exclude
some zones. Returns 1 is the result is true, 0 if not.
=Hit Spr Check
x=Hit Spr Check(start To end,dx,dy,n)
Checks if sprite number N has entered a Check zone. DX and DY are optional and give a
displacement from the sprite's hot spot. The START and END parameters indicate which zones you
want to check. Ideal if there are many zones and you want to exclude some zones. Returns 1 is the
result is true, 0 if not.
=Hit Bob Check
x=Hit Bob Check(start To end,dx,dy,n)
Checks if bob number N has entered a zone. dx and dy are optional and give a displacement in
opposite to the bob's hot spot. The start and end parameters indicate which zones you want to
check. Ideal if there are many zones and you want to exclude some zones. Returns 1 if the result is
true, 0 if not.
MISCELLANEOUS
Multi Yes
Sets the priority to normal (0). Normal multitasking takes place.
Multi No
Turn off the multitasking process, giving more time for your AMOS programs to execute. This
command makes screen synchronization much better. Warning! Under AMOS, CTRL-C
combination is disabled as well as the entire keyboard! If your program crashes with Multi No, you
will not be able to get to the editor! Your system will essentially be locked up. Under AMOS Pro, you
can still use CTRL-C and the keyboard.
With AMOS it is possible to entirely disable the multitasking process, but with AMOS Pro
this is a different case. Another task is supplying AMOS Pro with VITAL information. So blocking
this task crashes AMOS Pro. Under AMOS Pro, Multi No sets the priority of AMOS Pro to 20,
blocking most tasks, but not blocking the VITAL task. Screen synchronization is still much smoother
than when multitasking is enabled.
With Multi No, the keyboard and mouse are disabled. See Left Click and Raw Key for
more information.
Amos Pri
Amos Pri x
Set the priority of AMOS. Value ranges from -128 to 20 (see Multi No). For most uses it is best to
keep it at 0, the default value.
=Raw Key
x=Raw Key(n)
Does the same thing as the Key State function but works even if multitasking is disabled. Returns
true (-1) if key N is being pressed. N is the Scancode of the key to be checked.
Check the AMOS Pro help file under Key State, Scancode, and TABLES for some useful scancodes.
To find out other Scancodes run this routine:
Repeat
T$=Inkey$
If T$<>""
Home : Cls
Print T$,Scancode
End If
Until Left Click
Raw Key (69) detects the ESC key.
Thanks SyNTAX/TsL for a version of Raw Key that works on all Amigas.
KEY=Is Raw Key
Returns the last key press in raw format. Beware ! It gives
different values if the key is pressed or released.
Works even if multitasking is disabled.
=Left Click
x=Left Click
With this command you can check for the LEFT mousebutton. Use this because when multitasking
is disabled the Mouse Key function does not work anymore. Returns TRUE if left mouse is pressed.
This function has become unnecessary for AMOS Pro since multitasking can not be stopped! But if
you want your programs to be compatible with all AMOS versions and you use Multi No, we strongly
suggest you use Left Click. You may wish to use the following construct:
=Right Click
x=Right Click
See Left Click function, but then for right mousebutton.
Multi No
Repeat
'some code
Until Left Click
Multi Yes
Workbench Open
Reopen the Workbench after closing it, assuming there is enough memory available.
Vbl Wait
Vbl Wait x
Wait until the raster beam has reached a given value. 0 <= X <= 256. AMOS's Wait Vbl doesn't work
if you turn multitasking off. Vbl Wait also gives a better screen synchronization than the original Wait
Vbl command.
Example.:
'Let's take a standard screen...
Screen Open 0,320,200,8,Lowres
'And lot's of scrollers...
SCROLL_NR=0
For I=0 To 100 Step 10
Inc _SCROLL_NR
Blit Store Left 0,SCROLL_NR,0,0 To 320,I,-1
Next I
'the maximum Y value of the screen that will be scrolled is 100. The other screen lines will not be
affected by the scroll. So there is no point waiting until the raster beam has reached the TOP of your
screen before executing your scrollers.
Repeat
'wait until line 101 of your screen is reached
Vbl Wait 101
'execute the scrolls
Multi Blit 1 To 10
Until Mouse Click
A screen display is made of lines and they are scanned from the top of the display (line 0) to the
bottom (line 312 --> PAL, line 262 --> NTSC). It is possible to alter anything on the screen even if
the raster beam is already further than the area of the screen to be changed! It will become visible
during the next scan of the screen. So you are able to use the SCAN LINES (more processing time)
that are not used by the actual screen for displaying more bobs, scrollers, etc, without any annoying
flicker on your screen. Sometimes it takes some experimentation to find the right value. But a
smoother display is guaranteed!
=Byte Hunt
x=Byte Hunt (start To end,action,val1 To val2)
Byte Hunt searches the memory area defined by the given START and END addresses for certain
values defined by VAL1 and VAL2 bytes. If START is greater than END the addresses are swapped
so that the command still works. Upon finding the requested byte, it returns the address of the byte,
or 0 if not found. The ACTION parameter defines how the search will be performed.
If ACTION=0 the Byte Hunt command behaves just like the normal Hunt command. Only
VAL1 is checked for.
If ACTION=-1 the Byte Hunt command behaves as a Range Hunt . It searches for any
value lying outside the values VAL1 to VAL2, inclusive.
If ACTION=1 the Byte Hunt command behaves as a Range Hunt. It searches for any
value lying inside the values VAL1 to VAL2, inclusive.
VAL1 and VAL2 are always included in the search.
=Word Hunt
x=Word Hunt(params)
See Byte Hunt(params) but now for word hunting...
START and END adress are made automatically even.
=String Hunt
x=String Hunt(start To end,action,step,string)
This is a very powerfull string search routine, it will search the given string
in the memory area defined by the start and end adresses.
The action parameter has the same meaning as with the Byte/Word Hunt routines.
The step parameter is used to skip a certain amount of bytes for each comparison.
When step is negative, this routine will search from end to start!
Memory Fill
Memory Fill start To end,"string variable"
Fill the memory between START and END address with the data held in 'string variable'. 'String
variable' may also be represented as such: A$, A$+B$, or any standard string expression. If START
is greater than END the addresses are swapped so that the command still works.
If you wish to use this command to fill memory will a pattern of numbers, you can put the numbers
into a string variable before executing Memory Fill.
ex:
to fill bank 6 with this pattern - 0123401234...
A$=""
For T= 0 to 4
A$=A$+Chr$(T)
Next T
Memory Fill Start(6) to Bank End (6), A$
Texp
x=Texp(ex, true val, false val)
Texp will first evaluate expression EX. If EX is true (-1), Texp returns TRUEVAL. If EX is false (0), Texp
returns FALSEVAL.
ex:
x=Texp (4=3,1,2)
'since 4=3 is false, x now equals 2, the falseval
A useful construct would be:
x=Texp(expression,1,-1)
'if expression is true, x = 1, else x = -1.
'this is in contrast to using just x=(expression) which if true returns -1, else returns 0.
Range
x=Range(var, lowvalue To highvalue)
Returns variable var adjusted to fit within lowvalue, highvalue. It is important to make sure lowvalue
is less than highvalue or this function returns erroneous values.
ex:
x=Range(3, 5 to 100)
'x now equals 5
x=Range(105,5 to 100)
'x now equals 100
x=Range(40,5 to 100)
'x now equals 40
This function replaces the need for this construct:
x=Min(highvalue,Max(var,lowvalue))
Also, Range can be very useful to replace a construct such as this:
Inc X
If X<lowvalue Then X=lowvalue
If X>highvalue Then X=highvalue
is functionally the same as
X=Range(X+1,lowvalue To highvalue)
=Between
x=Between(low,value,high)
Returns true is value is between low and high.
NOTE: If high is smaller than low, then these values are exchanged so the function still works.
This function replaces this AMOS expression:
x=((low<value) and (value<high))
=T Clip
x=T Clip(var,clipat)
Clip a value at a certain interval. Used to make a variable a multiple of a certain value.
VAR is the value to be clipped (positive or negative allowed)
clipat is the 'clip' value (positive value only)
ex: T Clip(var,32) will make var a multiple of 32 (0,32,64...).
Print T Clip (50,15)
returns 45, since 45 is the next lowest multiple of 15
This operation is functionally identical to the integer operation:
=(var/clipat)*clipat
=Chip Largest
LARGEST_CHIP=Chip Largest
Return the largest continguous CHIP memory block in bytes.
=Fast Largest
LARGEST_FAST=Fast Largest
Return the largest continguous FAST memory block in bytes.
=Bank End
x=Bank End(banknumber)
Return the address of the end of a memory bank.
Bank End returns almost the same result as:
=Start(banknumber)+Length(banknumber)
but it has some extra features:
· If you ask for the Bank End of a Sprite or Icon bank the result will be NEGATIVE. It gives
the negative amount of Sprite/Icon definitions stored in the bank. =Abs(result) will remove
the negative if you wish to use this value.
· If the result is positive, the bank does not contain Sprites or Icons. The result will be the
END adress of that bank.
· If the result is 0, the bank is only 0 bytes long. This is only a possibility in AMOS, not
AMOS Pro.
If you ask TURBO PLUS to return the Bank End of a bank that is not reserved you will get useless
information - you will not get an error.
MACHINE LEVEL
and BIT OPERATIONS
=Lsl.b
x=Lsl.b(value,shift count)
bytewise logical shift to the left.
ex.: ANSWER=Lsl.b(value,shift count)
A=Lsl.b(5,1) gives A=10
A=Lsl.b(C,1) gives A=10 with C=5
=Lsl.w
x=Lsl.w(x,y)
wordwise logical shift to the left
=Lsl.l
x=Lsl.w(x,y)
long logical shift to the left
The same commands exist for logical shifting to the right...
X=Lsr.b(x,y)
X=Lsr.w(x,y)
X=Lsr.l(x,y)
=L Swap
x=L Swap(x)
Swap the lower half of the longword with the upper half.
ex.: A=$FFFF1111
B=L Swap(A)
returns B=$1111FFFF
=Test.b
x=Test.b(x,y)
Compares the lower 8 bits of a variable with a given value. Returns 0 if false, -1 if true.
AMOS variables are 32 bits wide. We may use the Test commands to check for a value in only part
of that 32 bit wide variable. To check the lower 8 bits, use Test.b
Test.b(x,y) is equivalent to the following AMOS code:
If (X And $FF) = (Y AND $FF)
=Test.w
x=Test.w(x,y)
Compares the lower word (16 bits) of a variable with a given value. Returns 0 if false, -1 if true.
Equivalent to the following AMOS code:
If (X And $FFFF) = (Y AND $FFFF)
Cpu Info
x=Cpu Info
This function returns what cpu-type is in your AMIGA.
00 plain 68000
10 68010 processor
20 68020 processor
30 68030 processor
40 68040 processor
=Math Info
x=Math Info
This functions returns what type of math coprocessor you have in your AMIGA.
000 no coprocessor installed
881 MC68881 coprocessor installed
882 MC68882 coprocessor installed
=Bit Field Ext
x=Bit Field Ext(var,startbit,width)
This function extracts a field of bits from a variable and returns the result. STARTBIT is the bit where
to the start the extraction from and WIDTH indicates how many bits are to be extracted. This
function is very useful in database management and other applications where bit fields contain
attributes.
Extracting a field that would extend beyond the end of a variable causes the function to return a
result from STARTBIT through bit 31. Both the STARTBIT and the WIDTH are interpreted mod 31.
=Bit Field Ins
x=Bit Field Ins(var,startbit,width,value)
This function inserts a field of bits into a variable and returns the result. STARTBIT is the bit where
to start the insertion and WIDTH indicates how many bits are to be inserted. VALUE contains the
actual bits to be inserted. Inserting a field that would extend beyond the end of a variable causes the
function to return a result from STARTBIT through bit 31. Both the STARTBIT and the WIDTH are
interpreted mod 31.
BITPLANE OPERATIONS
Set Planes
Set Planes mask
Restricts most drawing operations to a number of bitplanes, defined by the MASK parameter.
Each bit represents a bitplane.
Ex.: Set Planes %101, enables planes 1 and 3.
Always remember to reset the value to 255, else some strange things might happen with the editor
window. All the new BLITTER commands use this parameter.
All normal graphic AMOS commands use this parameter.
TURBO commands that recognize and use the mask:
Multi Blit
all Object commands.
all Draw routines,R Draw, R Box,... (except F Draw)
Blit Clear if all planes are selected (-1 as param)
Blit Left enables you to scroll only those planes you want to.
Blit Int On enables you to scroll only those planes you want to.
TURBO commands where the mask is not recognized:
F Draw
F Plot
F point
F Circle
Plane Offset
Plane Swap
Plane Shift Up/Down
Plane Update
all Icon commands
all Scene commands
all Block commands
Plane Offset
Plane Offset scrnr,planenr,xoffset,yoffset
Sets the offset for a particular bitplane used by screen SCRNR. X should always be even, allthough
an uneven value is possible. This command can be used to program some interesting effects such
as interference without having to use the dual playfield mode or the slow Screen Copy commands.
To set all offsets for all planes to zero, you should use the Plane Offset command with a negative
PLANENR parameter. This is because I store the offset for each particular plane. To reset the offset
of a particular plane, set the XOFFSET and YOFFSET parameters to zero.
Ex.: to reset all offsets of screen 3 --> Plane Offset 3,-1,0,0
to reset plane two of screen 1 --> Plane Offset 1,2,0,0
See Plane Update for further information.
Plane Swap
Plane Swap scrnr,plane1,plane2
Swap PLANE1 with PLANE2 of screen SCRNR. See Plane Update for further information.
Plane Shift Up
Plane Shift Up scrnr,start To end
Shifts the planes up by 1 from START to END used by screen SCRNR.
Ex.: PLANE1 = 55555
PLANE2 = 66666
PLANE3 = 77777
PLANE4 = 88888
Plane Shift Up 1 To 3 will result in:
PLANE1 = 77777
PLANE2 = 55555
PLANE3 = 66666
PLANE4 = 88888
See Plane Update for further information.
Plane Shift Down
Plane Shift Down scrnr,start To end
The opposite of Plane Shift Up. Bitplanes from START to END are shifted downward one plane.
See Plane Update for further information.
Plane Update
Plane Update scrnr
This command is used to reflect the changes made with the Plane commands. Normally you could
use the AMOS View command to display what is changed. This is true for all Plane commands
except the Plane Offset command. In fact the bitplane addresses are not changed at all. Use Plane
Update instead of the AMOS View command.
STARFIELDS
TURBO PLUS allows you to define and control hundreds of individual points manually or under
interrupt control. A TURBO PLUS starfield is a collection of one color stars (points) drawn on
bitplane one. As such, only single coloured stars are possible. You can change the color of them
with the Palette or Colour commands.
TURBO PLUS uses the main processor (the MC68000) for displaying the stars. So if you own an
A3000 or accelerator board you can display many more.
Limits on a 68000 system (7.14 Mhz):
If you use only an X SPEED (Y SPEED = 0), 670 stars can be displayed in 1 VBL.
If you use only an Y SPEED (X SPEED = 0), 660 stars can be displayed in 1 VBL.
If you use both speeds, 540 stars can be displayed in 1 VBL.
For aesthetics, we suggest you limit a normal 320x200 size screen to 100 stars or less. WIth more
stars the display starts to look crowded. You will be saving more time for your AMOS program as
well.
Always be sure that you are displaying the stars on the screen where you reserved them because
the start offsets of every line from the current screen are precomputed when you call the Reserve
Stars command.
example: Screen SSTARSCREEN : Display Stars
Reserve Stars
Reserve Stars COUNT
Reserves memory for COUNT star definitions for the current screen. At this point you can reserve
memory for up to 4000 stars. This command computes in advance the address of the start of every
line. This is done for more speed when displaying the stars. You can calculate the amount of
memory needed with this formula:
COUNT*8+Heigth of screen*2
So with 4000 stars in a 320 by 250 screen, 32500 bytes are reserved.
For the average 320x200 screen you will need only about 150 stars for a nice display and good
speed. More than 300 stars results in a crowded appearing display, and wasted computational time.
Define Star
Define Star nr,x,y,x speed,y speed
Defines 'star' NR. X and Y are the initial coordinates of the 'STAR'. X SPEED and Y SPEED define
the speed of the 'STAR'. XSPEED and YSPEED are added to the star's coordinates when you
Display them. Your stars can fly in any direction. Star definitions are put into FAST ram if available.
Display Stars
Displays the stars onto the screen and computes their next position, dependent on the X- and Y
SPEEDS.
Note: Display Stars is identical to:
Stars Draw : Stars Compute.
Stars Draw
Displays the stars onto the screen without computing the next star position. So your stars can be
frozen without having to change the SPEED of them to 0.
Stars Compute
Stars Compute start To end
Computes the next position of the stars START to END without displaying them on the screen.
Stars Speed
Stars Speed start To end,x speed,y speed
Changes the speed of stars numbered from START to END to X SPEED and Y SPEED.
Stars Erase
Gives back the memory used by the Reserve Stars command. The memory used by the TURBO
PLUS stars is automatically erased from memory if you do a Default or if you leave AMOS.
Stars Clip
Stars Clip x,y,x1,y1
The Stars Clip instruction limits all stars to a rectangular region of the screen. X,Y represent the
coordinates of the top left corner of the rectangle, and X1,Y1 hold the coordinates of the bottom right
corner.
Stars Int On
Stars Int On CLEAR
This command adds a new interrupt server to the VBLANK server chain which will do the same thing
as the Display Stars command. The Display Stars command will be executed every Vbl and run
totally independently of your AMOS program.
If CLEAR is not equal to 0 the display will be cleared before displaying the stars. This is the
AUTOMATIC CLEAR MODE. Only the the first bitplane, the 'starfield plane', is cleared. Always be
sure that the screen where you have reserved the stars remains open when the stars interrupt is on
or a crash will be certain! This command stores the screen address of the screen where the Reserve
Stars command was executed, so the stars will only be displayed in that particular screen.
With the stars interrupt, time is saved for your AMOS programs. You do not have to wait for the Vbl
to synchronize the display of the stars with your screen display.
Disadvantages: Only the X-speed is changed (for more speed). Can not be used with Double
Buffered screens even if Autoback is set to 0 (zero).
Stars Int Off
Turn off the stars interrupt.
WARNING: It is very important that you do not start the Stars Interrupt in Direct mode! A crash will
most certainly result. It is also suggested you do not exit your program without turning Stars Int Off.
Turn Break Off and check for a key press to exit (Raw Key (69) works well for the esc key). Then if
your program detects this key, it turns Stars Int Off and then Ends. Save your programs often when
working with Stars Interrupts, mistakes can cause crashes!
VECTOR OBJECTS
A vector object is a series of connected lines drawn rapidly at machine language speeds. You may
draw them at any screen position, magnification or reduction.
OBJECT DEFINING
· We will define objects as a series of Move and Draw commands. The
first step is to tell the system how many objects we want to define:
Object Limit
Object Limit X
Sets the maximum amount of objects. You MUST set the limit before you can reserve and define the
objects. When X is set to zero, the OBJECT structure is erased from memory. You can define up to
32.000 objects. Old object files (from PD versions of TURBO) are compatible with the new ones.