timer a emulation xbtimer and rte

All 680x0 related coding posts in this section please.

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

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2529
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: timer a emulation xbtimer and rte

Postby charles » Sun Jun 20, 2010 8:43 pm

how will this work with long integer values nyh?

i believe you ,
but somehow we are onto debugging items now
or
program design ,

and i am still at the figureing out timer run frequency.

charles
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2442
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: timer a emulation xbtimer and rte

Postby lp » Mon Jun 21, 2010 3:12 am

charles wrote:i know a strings address will not change if variables and memory are managed correctly, don't be silly


No, you are silly. I know the internal workings of GFA and you are completely wrong. Eventually GFA will juggle all strings around if the app is left running long enough. How long depends on many factors. The more strings you manipulate the sooner it will happen. The size of the string ram area plays a factor. The smaller it is the more often a garbage collection occurs. Also some GFA commands not even related to strings force a garbage in order to gain more free ram. Simply passing a string as a parameter can trigger it. Assuming a string in GFA never moves is like a ticking time bomb.
Last edited by lp on Mon Jun 21, 2010 7:27 am, edited 1 time in total.

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2529
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: timer a emulation xbtimer and rte

Postby charles » Mon Jun 21, 2010 3:35 am

any way is there to force postion dependant in gfa ??

or

disable the garbage collection ,,


i am very happy with the
a%=v:a$
or
a%=v:a|(0)


why don't they tell us that in the manual?

confused and let down

they should at least say
v: is a command that needs refreshed
its a just once only command ,
not to rely on correct memory indexing after executing other commands inbetween address checking............


i know "clr" has an effect on the memory position

i like fixed locations

how to ensure position placement?

charles
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2442
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: timer a emulation xbtimer and rte

Postby lp » Mon Jun 21, 2010 8:05 am

GFA works much like its predecessors. No, you can't disable that. Just don't use strings for things that require addresses. Pretty much as simple as that. If you need alternate methods, search past threads. You've been told several times about better ways.

User avatar
Nyh
Atari God
Atari God
Posts: 1496
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: timer a emulation xbtimer and rte

Postby Nyh » Mon Jun 21, 2010 8:10 am

charles wrote:why don't they tell us that in the manual?

confused and let down

they should at least say
v: is a command that needs refreshed
its a just once only command ,
not to rely on correct memory indexing after executing other commands inbetween address checking............

Well, from "Your Second GFA-BASIC 3 Manual":

You could load an assembler-routine into a string as follows:

Code: Select all

     OPEN "I",#1,file$
     LET bytes%=LOF(#1)            ! how much space is needed?
     CLOSE #1
     routine$=STRING$(bytes%,0)    ! create space for assembler-routine
     ~FRE()                        ! force a garbage collection
     adr%=V:routine$               ! where shall we put the routine?
     BLOAD file$,adr%              ! load the routine from disk


Don't use strings if garbage collection is a serious risk. If a large
array is declared in your program, the interpreter sometimes moves the
strings in memory to create space for the new array. This is necessary
because an old string is not erased from memory if you assign a new string
to an existing string-variable. During garbage collection all unused
strings are deleted (except strings that are exactly 32767 bytes long: a
GFA-bug) and the active strings are rearranged. This means that the
address of a string (accessed through 'VARPTR' or 'V:') is not fixed.
That's not important for a (S)GET-picture, because 'PUT x,y,pic$' and
'SPUT screen$' still work all right. But if you assigned a string-address
to a variable adr% and swap screens with '~XBIOS(5,L:adr%,-1,-1)', or call
a routine with '~C:adr%(...)', garbage collection will be fatal. One
solution is not to declare a variable for the address, but to use 'VARPTR'
or 'V:' so you'll always find the correct address.


If you have nothing better to do, you could watch how GFA collects
garbage (don't forget to wash your hands afterwards):

Code: Select all

     s1$=STRING$(1000,32)          ! create three strings
     s2$=STRING$(1000,32)
     s3$=STRING$(1000,32)
     adr.1%=V:s1$                  ! where are the strings?
     adr.2%=V:s2$
     adr.3%=V:s3$
     PRINT adr.1%'adr.2%'adr.3%
     s2$=""                        ! delete the second string
     adr.1%=V:s1$                  ! where are the strings now?
     adr.2%=V:s2$
     adr.3%=V:s3$
     PRINT adr.1%'adr.2%'adr.3%    ! nothing has changed
     ~FRE(0)                       ! force garbage collection
     adr.1%=V:s1$                  ! where are the strings now?
     adr.2%=V:s2$
     adr.3%=V:s3$
     PRINT adr.1%'adr.2%'adr.3%    ! watch the third string
     ~INP(2)                       ! wait for keypress


We have told you before how to put assembly in Gfa Basic a proper way but clearly you didn't listen. I suggest to search your previous posts on this subject and reread them.

Hans Wessels

Hans Wessels

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2529
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: timer a emulation xbtimer and rte

Postby charles » Mon Jun 21, 2010 11:33 am

so is it only the address of strings that will change ?
what about byte word and long arrays?
nyh you are jumping to conclusion , i am listening . i was the one who puts assembler from file into byte array.way back when in that other thread.
anyhow , i never use a string in most of my programs i use malloc or varptr byte array

so varptr is not a good ideal, even if i don't
clr x,
or
erase xxx()

variable/arrays

how come i have never had trouble with this , maybe the easy way is asking
which commands force garbage collection and then i'll stay away from them.


charles
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2529
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: timer a emulation xbtimer and rte

Postby charles » Mon Jun 21, 2010 11:41 am

whoa! sorry , mistake in last post.. i use a bbyte array now because i had trouble with bmove , this reason i used to use string in gfa to load asm ,now i use byte array cause reserve larger than 32767.. i ddidn't use malloc before because i had that same issue with reserveing more than32767 byte didn't allow to bmove bytes , i can use malloc , but it sounds like
gfa might loose malloc's address too? is this true?

update
charles
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2442
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: timer a emulation xbtimer and rte

Postby lp » Mon Jun 21, 2010 3:06 pm

This problem has also been discussed in previous threads. There is nothing wrong with malloc, in fact I can easily malloc several megabytes on my Hades which has 128mb of ram. It even works fine with the original unpatched GFA. Either your emulator is broken, or its something you are doing that causes it. I bet my money on you in this case. :wink:

User avatar
Nyh
Atari God
Atari God
Posts: 1496
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: timer a emulation xbtimer and rte

Postby Nyh » Mon Jun 21, 2010 3:48 pm

charles wrote:how come i have never had trouble with this , maybe the easy way is asking
which commands force garbage collection and then i'll stay away from them.

Your programs have never been complex enough to cause any problems.
Despite all the time you have been programming you are still a beginner in programming.

You attitude to the timer makes this very clear.
You think you need a resettable timer because you think it is easier than to do this simple math:
te%=timer-ts%.
Doing the math has one very big advantage:
No matter how many routines are doing time measurements ate the same time you will always get the right answer.
A resettable timer is only useful for one and only one timer measurement.
As soon as a second routine resets the timer the time measurement of the first routine is useless.

Same about the two complement math. I give you an example in 16 bit 2 complement and your first question is whether it will work for 32 bit too. If you would have taken the time to read about two complement numbers (which we said you should at the beginning of you assembly programming thread), you would have known 2 complement math will work for any number of bits.

charles wrote:whoa! sorry , mistake in last post.. i use a bbyte array now because i had trouble with bmove , this reason i used to use string in gfa to load asm ,now i use byte array cause reserve larger than 32767.. i ddidn't use malloc before because i had that same issue with reserveing more than32767 byte didn't allow to bmove bytes , i can use malloc , but it sounds like
gfa might loose malloc's address too? is this true?

We already told you what you were doing wrong with Malloc.

And no, it is not true. It doesn't sound at all like Gfa might loose malloc addresses too.

Hans Wessels

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2529
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: timer a emulation xbtimer and rte

Postby charles » Tue Jun 22, 2010 2:07 am

yes nyh ,
i thought ,
i thought somebody should know what feature it posses, that diffrers from the st timer c
it might be better for me , it might be better for who ever find interest in this ..

i think this timer thread is done ,, we hit on all the stuff surrounding the timer , i wrote a timer routine , and you bunch followed , thanks , i guess?.

until next trivial time

charles
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
Nyh
Atari God
Atari God
Posts: 1496
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: timer a emulation xbtimer and rte

Postby Nyh » Tue Jun 22, 2010 3:24 pm

So Charles,

Now I am curious.

With everything you have learned, can you explain in you own words what the right answers are to the questions you asked at the beginning of this thread?

charles wrote:does steem fully support the four timers of a st?


charles wrote: i know the span between two timer calls is "bluffed"
so does this effect the way xbtimer would be emulated
and
furthermore how timer a is induced?


charles wrote:timer_ms is @ adrress $442
and should be 20

but in steem its non affectable


Hans Wessels

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2529
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: timer a emulation xbtimer and rte

Postby charles » Tue Jun 22, 2010 11:18 pm

ok

#1
charles wrote:
does steem fully support the four timers of a st?

charles answer
timer a =yes
timer b =???? unknown i think its does screen vertical blanks ,so yes?
timer c =yes
timer d =???? unknown i think its for the baud rate of the rs232 modem , so yes?

============================================

#2
charles wrote:
i know the span between two timer calls is "bluffed"
so does this effect the way xbtimer would be emulated
and
furthermore how timer a is induced?

charles answer
at this moment in time to my knowledge no effect on the way xbtimer would be emulated relating to my physical case
as long as user is able to write timer handler , emulation of timer a is induced and accomplished succesfully.

=============================================

#3
charles wrote:
timer_ms is @ adrress $442
and should be 20

but in steem its non affectable

charles answer
this has not changed , the time between timer calls can not be changed within steem emulation,, so this still remains false,, it may be changed but has no effect compared to doing this on a real st.

================================================

how'd i do ?
charles
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
Nyh
Atari God
Atari God
Posts: 1496
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: timer a emulation xbtimer and rte

Postby Nyh » Wed Jun 23, 2010 8:43 am

charles wrote:#3
charles wrote:
timer_ms is @ adrress $442
and should be 20

but in steem its non affectable

charles answer
this has not changed , the time between timer calls can not be changed within steem emulation,, so this still remains false,, it may be changed but has no effect compared to doing this on a real st.

Are you really claiming that on real hardware writing a new value at $442 will change the speed of timer C?

Hans Wessels

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2529
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: timer a emulation xbtimer and rte

Postby charles » Wed Jun 23, 2010 11:31 am

yes it will change the speed on a real st , i use a st 1040 stf , years ago i tried while using gfa . it should read dec.20 but can range if changed 1-20 .

charles
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12771
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: timer a emulation xbtimer and rte

Postby wongck » Wed Jun 23, 2010 11:43 am

Nyh wrote:With everything you have learned, can you explain in you own words what the right answers are to the questions you asked at the beginning of this thread?


tough test, tough test.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5117
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: timer a emulation xbtimer and rte

Postby simonsunnyboy » Wed Jun 23, 2010 4:34 pm

And he already failed xD
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

User avatar
Nyh
Atari God
Atari God
Posts: 1496
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: timer a emulation xbtimer and rte

Postby Nyh » Thu Jun 24, 2010 9:39 am

charles wrote:yes it will change the speed on a real st , i use a st 1040 stf , years ago i tried while using gfa . it should read dec.20 but can range if changed 1-20 .

<Sigh>
No Charles, writing an other value as 20 at $442 will not change the speed of timer C. Not on a real ST and not under STeem.

I suggest you try yourself with STeem and a real ST running next to each other.

I don't even want to start explaining to you what happens when you write an other value as 20 at $442, because the effects are quite subtle and will be very confusing for you.

Hans Wessels

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2529
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: timer a emulation xbtimer and rte

Postby charles » Thu Jun 24, 2010 11:30 am

ok maybe i made a mistake ,, is it bios or xbios 6 thats the tick calc ? writing here makes timer go faster,, but this is off topic a little bit .
charles
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
Nyh
Atari God
Atari God
Posts: 1496
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: timer a emulation xbtimer and rte

Postby Nyh » Thu Jun 24, 2010 11:53 am

charles wrote:ok maybe i made a mistake ,, is it bios or xbios 6 thats the tick calc ? writing here makes timer go faster,, but this is off topic a little bit .

Maybe, just maybe you should at least take the time to look the right call up in something like The Atari Compendium.

Then you would have known that you can not write anything in the BIOS 6 function:
Tickcal()
LONG Tickcal( VOID )
Tickcal() returns the system timer calibration.
OPCODE 6 (0x06)
AVAILABILITY All TOS versions.
PARAMETERS None.
BINDING move.w #$06,-(sp)
trap #13
addq.l #2,sp
RETURN VALUE Tickcal() returns a LONG indicating the number of milliseconds between system
clock ticks.

Tickcal() returns the value that is written at $442.

So if you write a new value at $442, Tickcal() will return this value.
It will do so under STeem and on normal hardware.

This is very on topic because you are accusing STeem not to work as it should.

Once again writing at $442 does not change the speed of timer C. Writing at BIOS 6, Tickcal() is not possible. XBIOS 6 has to do something with colors and will not change the speed of timer C.

Hans Wessels

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2529
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: timer a emulation xbtimer and rte

Postby charles » Thu Jun 24, 2010 7:39 pm

well tickcal should alter the time of the timer because it calibrates the intervals between checking the system timer, so a smaller value will make it check the timer more often.

it does not work under steem but works on a real st....
i began using this years ago to make subtle tempo changes in my midi routine before i knew about all this other creative ways
bios (6)...tickcal.

xbios 6 is the color changer,, for the pallette

i almost certain bios 6 will have an effect on overall speed ,
but its more off topic as timer 'a' was originally addressed(look at the topic).

i finally wrote a timer a routine and it works for me , be proud or be loud , just do something.


charles
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2529
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: timer a emulation xbtimer and rte

Postby charles » Thu Jun 24, 2010 8:08 pm

you know what bios 6 does't even work on the st i am currently using , funny ????

i know it used to , i used it like timer or timer speed changer.. way way back before i worked outside canada and left the st for two or more years.. then i came back home and began some in depth programming.

sorry i guess i think the ste was the one it worked on , and i was dissapointed a few years after that steem didn't support the bios 6 command

charles
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
Nyh
Atari God
Atari God
Posts: 1496
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: timer a emulation xbtimer and rte

Postby Nyh » Fri Jun 25, 2010 8:32 am

charles wrote:well tickcal should alter the time of the timer because it calibrates the intervals between checking the system timer, so a smaller value will make it check the timer more often.

These are you words. I quoted the compendium and it says something different.
Which should I trust more, the Atari Compendium or the wisdom of Charles....

And the system timer is not checked by something but is called every fourth timer C interrupt.
As the timer C interrupt is a 200 Hz interrupt there is no way it can generate a 19 or 18 ms interrupt for the system timer. In theory it could generate a system timer that is a multiple of 5 ms (also 5, 10, 15, 20, 25, ...) but for that you have to rewrite the timer C interrupt handler.

charles wrote:i almost certain bios 6 will have an effect on overall speed ,
but its more off topic as timer 'a' was originally addressed(look at the topic).

And how do you want to use Tickcal() to change the system timer?

charles wrote:i finally wrote a timer a routine and it works for me , be proud or be loud , just do something.

You mean David Snow wrote in 1989 a timer interrupt for the Gfa Basic "MUSICBOX ASSEMBLY LANGUAGE SUBROUTINES" and you finally managed to use his timer interrupt routine.
Well done!

Hans Wessels

User avatar
Nyh
Atari God
Atari God
Posts: 1496
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: timer a emulation xbtimer and rte

Postby Nyh » Fri Jun 25, 2010 9:10 am

charles wrote:you know what bios 6 does't even work on the st i am currently using , funny ????

i know it used to , i used it like timer or timer speed changer.. way way back before i worked outside canada and left the st for two or more years.. then i came back home and began some in depth programming.

sorry i guess i think the ste was the one it worked on , and i was dissapointed a few years after that steem didn't support the bios 6 command

I guess some secret power has changed all ST hardware so that all the sudden the bios 6 command doesn't work like it used to.
At the same time this secret power changed all ST software too so it would work on the changed hardware without any bugs.
Then they continued to replace all documentation to reflect the changed hardware.
They did do all this just to make you look stupid in this forum.
Funny world, isn't it?????

Hans Wessels

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2529
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: timer a emulation xbtimer and rte

Postby charles » Fri Jun 25, 2010 11:32 am

david snows timer routine doesn't work nyh ,
and should i show the thread where you say

nyh

There is not much C specific code in the code you posted. Most of it is assembly. You posted the core of a MIDI replay routine in assembly.

This thread is not about creating the perfect code for all to use. But about the perfect example for all to understand.

After you understand you can write the perfect code for yourself to use.



well know you think somebody else is writting the code for me??????

you must have forgot i am very active and try alot of stuff, i'm all over the place with programming


where is this system timer located nyh?


i am not afraid to look or even be stupid on this forum nyh

and

you haven't read enough manuals yet ,,

every bodies mixed up

gfa programmers reference volume 1 by george miller
check gfa's description of bios 6

and more fyi for u

i think you are wrong about the timer getting updated every forth interupt ,,
it is 3 out 4 interupt
the 4th time it checks to see if other interupts have occured

ok ?

charles
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

User avatar
Nyh
Atari God
Atari God
Posts: 1496
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: timer a emulation xbtimer and rte

Postby Nyh » Fri Jun 25, 2010 1:19 pm

charles wrote:david snows timer routine doesn't work nyh

You have copied his routine almost verbatim.

charles wrote:you must have forgot i am very active and try alot of stuff, i'm all over the place with programming

Yes, you are all over the place using tons of programming languages and you try a lot of stuff.
I know.
But your understanding of programming and how the Atari and the OS work is minute.

charles wrote:where is this system timer located nyh?

There is no system timer that counts.
There is only a system timer that is called by the vector at $400 (evt_timer).
The value at $442 tells us the system timer is called ever 20 ms.

charles wrote:you haven't read enough manuals yet

I read the "Atari Profibuch ST-STE-TT".
That is enough for me.
When I want to tell you something I usually look up the equivalent part in the Atari Compendium.
Unfortunately the compendium is not as all knowing as the Profibuch so sometimes I have to look at other sources to get the right information for you in English.

charles wrote:i think you are wrong about the timer getting updated every forth interupt ,,
it is 3 out 4 interupt
the 4th time it checks to see if other interupts have occured

I know I am right about how the system timer is called every 4th timer C interrupt.
I already told you so in this thread: http://www.atari-forum.com/viewtopic.php?f=16&t=18842&start=1

Hans Wessels


Social Media

     

Return to “680x0”

Who is online

Users browsing this forum: No registered users and 3 guests