home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d2xx
/
d206
/
stereodemo.lha
/
StereoDemo
/
ReadMe
< prev
next >
Wrap
Text File
|
1989-04-30
|
8KB
|
157 lines
BADGE Killer Entry
by David M. McKinstry
Physics Department
Eastern Washington University
Cheney, WA 99004
Phones: 509-359-7462 (Work)
509-235-6074 (Home)
In the Drawer StereoDemo is the entry for the 1988 BADGE Killer
Contest. For the Demo to run properly, all three files in that drawer
must be kept together without making any changes in their names or
locations, or the name of the Drawer. However, the drawer may be copied
anywhere as long as kept intact. (Don't copy to RAM: because the program
'Stereo' will create RAM:c and RAM:StereoDemo and copy the files 'Window'
and 'Window2' to RAM:StereoDemo. These files will be deleted at the
termination of the program. In addition, c: is assigned to RAM:c so that
the Run command can be guaranteed without accessing the floppies.
Assignment to sys:c will be made at the termination of the program.
This is done specifically so that the floppy drives will not be
accessed during the animation sequence which uses the Blitter directly
by writing to the the hardware registers, rather than using the Draw()
function. As I have not yet figured out how to use packets in assembler
(or even C) yet, the floppies are not inhibited from operation. Thus, it
is possible to cause a crash if one inserts a new disk into a floppy drive
while the animation sequence is working. To avoid this, you should press
the I key to stop the animation and get back to the Intuition Screen before
doing anything that requires access to the floppies. If you do so, c:
will be assigned back to sys:c. If you do this for any reason, you will
have to continue the animation before terminating the program. Note: If
you press I or Ctrl C while the animation is not in progress, response
will not be made until the animation continues, as the Synchronous IO locks
out other IO.
It is not recommended that you temporarily stop the animation unless
for a fairly simple requirement, since doing so does not release any of the
memory or raster allocated. If you really have to do anything else, it's
better to simply terminate the program by using control c. The combined
size of all files needed in the animation is about 21000 bytes so it
won't take long to start it over, even from a floppy.
The program is written entirely in assembler, with the exception
that I have taken the easy way out for getting startup from workbench by
using a one-line C program that calls my assembler program. Incidently,
I am currently using the 'as' assembler by Manx as well as its C compiler
and 'ln' linker.
Following are some of the features of this demo that might not
be immediately apparent:
1) The intuition window 'StereoScopic Demonstration' has
center justification for its text. It uses GetPrefs to find
out whether the font is Topaz 60 or Topaz 80.
2) The custom screen(s) 'Stereoscopic Screen' uses the diamond 20
font, and is an intuition screen with a drag bar and depth gadgets,
even though they have been made invisible. Since they are there
are two screens, it does no good to use the depth gadget while
animation is in effect. However, if a narration is active while
using synchronous IO (some of the narration is of that type) the
depth gadget may be used. However, at such a time using the drag
bar to pull down a screen will only bring down one at a time.
If you have clicked the mouse into the custom screen, you will have
to pull down the screen to activate the Intuition window behind them.
3) All of the speech by 'Amy' is asynchronous. This does slow
down the animation significantly, but does illustrate the multi-
tasking capabilities of the Amiga. Normal animation is about 10
10 frames/s with a M68000, and is so slow in part because all drawing
is done in 640 by 400 mode (only 2 bit planes per screen) and involves
calcuations for both left and right eyes done in real time.
Of course, the trig is from a table rather than calculated real time.
4) The two windows that simulate the 'other computers' are run from
within 'Stereo' by using the AmigaDOS command Execute (i.e. not the
CLI Execute) of a command line 'Run Window' or 'Run Window2'. The
output is into NIL: opened using AmigaDOS. This was a simple way
of multitasking without worrying about sending messages or creating
new processes. These windows both have depth and drag gadgets , but
are made invisible for simulation purposes. No close gadgets are
provided, as they will terminate on their own. This option was
chosen as the demo is intended to run to completion and repeat if
the user pressed the space bar at the prompt given on the title
page. If you do abort before the demo is over, the screens may
not disappear for up to 2 minutes, but their memory requirements
are trivial compared to those of the custom screens, and you can
hide them behind other windows or drag them sideways to get them
out of the way of disk icons.
5) The two windows use GetPrefs to determine whether or not the
workbench is interlaced and adjusts their apparent sizes
accordingly.
Since this program is intended for Demo only, it assumes one has a
fully operating system of everything required in library version 33.
There are no error messages sent out if the system does not meet the needs
of the program, but it should give a soft landing. If the program quits
either partway through or even at the beginning, it is likely that there
is not enough unfragmented chip memory available. I have had a number of
cases where failure has occurred after running the program immediately after
an assembly/link. In those cases it has always worked after a reboot.
Other features to be added or bugs to be corrected.
1) Inclusion of a packet to inhibit floppy activity.
2) A disappearing mouse pointer. I have had work working version,
but it just works by brute force (saves the data for the current
pointer in a buffer and clears out the buffer of the original
pointer until termination of the program or motion of the mouse).
3) Inclusion of sound.
Please note that one of the reasons I am entering this in the BADGE
contest is that I feel the Amiga is being under-utilized for education in
general and science education in particular. It irritates me to see that
a clearing house for educational software in physics has the stipulation
that such software must run on MS-DOS machines. That requirement auto-
matically excludes software of a real-time interactive graphics nature.
I want to see more people become aware of the educational potential
of the Amiga and start to use it. The people in the physics department at
E.W.U. are aware of its power and other physicists are as well, but we are
still in a minority. Let's do something about this.
Included on this disk is a drawer titled Sources. The entire source
code for this demo is included. You are free to use anything in it for your
own software as long as it is provided without charge to the user and also
indicates the source of the original algorithms. Use in any commercial
venture requires permission of the author.
A third drawer (ES for eduational software) has the object codes for
several other programs I have written in the past. One, also titled
'Stereo' includes vector cross products, and crystal lattices as their
primary features. There is also a program titled 'Rays' that is an aid
for teaching optics. Feel free to give copies of these to anyone who has
a use for them. I know there is limited application for this software,
but would like to see it used by anyone who can do so.
If anyone has an interested is looking as at a simplified description of
the algorithms used for stereoscopic graphics you can read my article in
the September/October issue of Computers in Physics.
Thank you, and have fun with the best little computer in the world.
P.S. I'd like to thank Randy Spencer who is helping run the contest
this year for his suggestions in meeting some of the technical require-
ments, and Rick Schaeffer of Spokane, WA for his help and comments on
using Manx C, etc.