Re: LF: fargo libs and doc
[Prev][Next][Index][Thread]
Re: LF: fargo libs and doc
On Wed, 16 Jul 1997 14:50:03 -0400 (EDT) Hmlacage@aol.com writes:
>there are a few things which have made me think:
>1) the use of ( $adress ) instead of $adress to get something from a
>constant adress in mem... why ? jimmy' s guide precises that you
>don' t need parentheses...
Assemblers for the 68000 processor never require parentheses around the
address. Just $address refers to the contents of the address. You must
put a # in front of the number for it to be treated as a constant. The
parentheses make no difference at all, but sometimes are included for
purposes of clarity...
>2) the idle_loop in flib: it seems that the prog tests if a key has
>been pressed: it checks a certain area in mem... Such a feature is not
>precised in fargo docs...then , it checks what the author calls a
keybuffer >where the value of the key pressed is stored ... ???? as
soner, i don' t >remember any ref to such afeature in the docs.
Here's the (somewhat obscure) documentation of it...
075AA : (000A) circular word buffer (used for key buffer)
+0000.W : buffer tail (insert word at [buffer+tail])
+0002.W : buffer head (read word from [buffer+head])
+0004.W : size of buffer (default: 0002)
+0006.W : number of bytes currently stored in buffer
+0008 : circular buffer
What it means is that : $75b0 contains the number of keystrokes stored
in the buffer, and the actual scancodes (the same as the ones listed
in the TI-92 manual) start at $75b2.
>3) the use of many vars which are not defined in the var declaration
>part. as: "apd_timer" in the "idle_loop" label how is this possible ?
APD_TIMER is defined in "TI-92.H." The "@library" at the top of the
source includes the "@LIBRARY" file, which includes "TI-92.H"
>4) in graylib, the use of the adress to int_1:
> in the docs, the exception vector table begins at $00000000
>then, in this table, we got the position of int_1 : $0064
>however, in graylib, the adress of int_1 is $00020064 ???? why ?
The TI-92 doesn't allow accesses to the vector table. When a program
writes to it, a level 7 interrupt is generated to restore the table
and display an error. The TI-92's RAM is only 128 kilobytes in length,
and (since addresses are only partially decoded) writes beyond the
end of the TI-92's memory wrap around to the beginning.
>5) in ports.txt, it is precised that port: $00600016 is a an adress to
>a timer which, every 16th time it is incremented allows the screen to be
>refreshed... is there a way to detect that 16th time ?
>by, first , waiting the timer to reset and then , the 16 th time it
>would be incremented , it would mean that the screen is beeing refreshed
?
Auto-interrupt 1 is trigerred every fourth time $600016 is incremented,
so you can just take over this interrupt and you'll know that the screen
update starts every fourth time this interrupt is trigerred.
Whenever the counter reaches $100, it cycles back to zero. When it next
incremented, it is set to the initial value (which you can set by writing
to $600016). If you write $f1 to the port, it will be reset to that
value
every 16 times.
Auto-interrupt 5 is trigerred when it is reset to its initial value.
Therefore, after writing $f1 to $600016, you can capture interrupt
5 and your code should be called once every screen refresh.
At least that's my guess; I'm not sure if it's correct.
--
Patrick Davidson (ariwsi@juno.com)
Visit my home page! Stuff for Amiga, TI-85, TI-92, even DOS!
http://www.calweb.com/~kwdavids/patrick/
http://www.toptown.com/hp/ariwsi/
References: