Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team


charles wrote:xbtimer ,
when i change these inputs , the data and the control
of timer c
i can make the timer act faster or slower.....
charles wrote:where in the memory of the atari do these values go?
charles wrote:$fffa1d does not change ,its always 81
thats one of the 25 addresses at odd offset
for the hardware handoff vectors
and within the lpeek(lpeek($114)) i can get someinfo on data but as a 16 bit data struicture points to now where and values don't change .
PRINT PEEK($FFFA1D)
PRINT PEEK($FFFA23)
XBIOS (Tmp%L,31,2,113,255,L LPEEK($114))
PRINT PEEK($FFFA1D)
PRINT PEEK($FFFA23)
XBIOS (Tmp%L,31,2,81,192,L LPEEK($114))
PRINT PEEK($FFFA1D)
PRINT PEEK($FFFA23)
GroovyBee wrote:Charles you really should read some documentation, well any would help!
$fffa1d is not even a valid 68901 address. Its mapped in from $FFFA06 to $FFFA2E and accessed at even addresses in that range

Well. You are doing something wrong. I wrote and tested this Omikron Basic program:
Code: Select all
PRINT PEEK($FFFA1D)
PRINT PEEK($FFFA23)
XBIOS (Tmp%L,31,2,113,255,L LPEEK($114))
PRINT PEEK($FFFA1D)
PRINT PEEK($FFFA23)
XBIOS (Tmp%L,31,2,81,192,L LPEEK($114))
PRINT PEEK($FFFA1D)
PRINT PEEK($FFFA23)
And its output is:
81
107
113
191
81
76
So Xbtimer works as it should work. If it doesn't for you then you are doing something wrong.

charles wrote:the double lpeek at $114 will return the address of the timer ,
like how timer c is read at location $4ba
thats 1210 decimal
charles wrote:so i figure if you install a handler to user timer a
, this would apply to that timer to,
charles wrote:i don't know about that , using gfa in my experiment at the address $fffa23 would return differnt results , this number always changes as the program runs ,never stays the same.
charles wrote:nyh i will try again , i have my results written down and i will double check , so from here how do we start timer a ? just stuff all these values in it using xbtimer at location $134 ?


charles wrote:well if you don't change the interrupt handler to c
then we can change the data and contrl values,,
but if we use a new"vector" with our own routine
we can replace this old vector and call it our own
,,,with a label.... but since
i don't know where to put the final value of the installed harware handler , i do not know where its value from
....c is lpeek($4ba)
but where is value from "a" timer returned?,
charles wrote: i can allready do this is a sort of mixed up way.
you just told me how interrupt works
i tryed and does not really change to much if i replace lpeek($114) with ...pointer(@mycode) in pascal
program install handler;
var
x:longint;
function mycode:longint;
begin
inc (x);
mycode:=x;
end;
end;
begin;
xbtimer(2,112,96,pointer(@mycode))
end.
charles wrote:somtimes pointer(pointer(mycode));
charles

Nyh wrote:$FFFA1D is a valid Mfp address and points to Timer C+D Control register

charles wrote:i don't know about that , using gfa in my experiment at the address $fffa23 would return differnt results , this number always changes as the program runs ,never stays the same.


If you want to achieve this type of behaviour in your own routine, you will need to figure out a way to have the routine update a variable that's in scope for the parts of your code that want to read it.
'
old%=GEMDOS(32,L:0)
t%=LPEEK(&H114)
PRINT "lpeek: ";LPEEK(t%) !this must be address of routine
PRINT "dpeek: ";DPEEK(t%+4) !this one is the address of contents(timer in this case)
PRINT "dpeek: ";DPEEK(t%+6) !clueless
PRINT "dpeek: ";DPEEK(t%+8) !clueless
PRINT "dpeek: ";DPEEK(t%+10)!clueless
PRINT "dpeek: ";DPEEK(t%+12)!clueless
PRINT "dpeek: ";DPEEK(t%+14)!clueless
PRINT
'
~XBIOS(2,7,121361,L:LPEEK(&H114))
'
LPOKE &H4BA,1
REPEAT
a%=TIMER
PRINT AT(30,1);a%
UNTIL a%>321
'
~XBIOS(2,128,64,L:LPEEK(&H114))
old%=GEMDOS(32,L:old%)
'



'
old%=GEMDOS(32,L:0)
t%=LPEEK(&H114)
PRINT "lpeek: ";LPEEK(t%) !this must be address of routine
PRINT "dpeek: ";DPEEK(t%+4) !this one is the address of contents(timer in this case)
PRINT "dpeek: ";DPEEK(t%+6) !clueless
PRINT "dpeek: ";DPEEK(t%+8) !clueless
PRINT "dpeek: ";DPEEK(t%+10)!clueless
PRINT "dpeek: ";DPEEK(t%+12)!clueless
PRINT "dpeek: ";DPEEK(t%+14)!clueless
PRINT
'
nuts&=90
'
GOSUB xbtime
'
LPOKE &H4BA,1
'
REPEAT
'
ON MOUSEK GOSUB x,x,x
'
a%=TIMER
PRINT AT(30,1);a%
'
UNTIL INKEY$=" "
'
~XBIOS(31,2,112,64,L:LPEEK(&H114))
'
old%=GEMDOS(32,L:old%)
'
PROCEDURE x
IF MOUSEK=1 AND nuts&>1
DEC nuts&
xbtime
ELSE IF nuts&<65535 AND MOUSEK=2
INC nuts&
xbtime
ENDIF
PRINT AT(30,2);nuts&
RETURN
'
PROCEDURE xbtime
~XBIOS(31,2,nuts&,23,L:LPEEK(&H114))
RETURN

charles wrote:so whats happening with what data , variable,control frequency, handler address do i do this with
to kill some time i did this , this illustrates the routine address and the data handoff vector now do i need to set a up in same fashion , and where does the value of the a timer get read from?
timer_A_handler:
addq.l #1,timer_A_counter
rte
timer_A_counter:
dc.l 0
Users browsing this forum: CommonCrawl [Bot] and 0 guests