rsrc_saddr where are some examples

GFA, ASM, STOS, ...

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

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

rsrc_saddr where are some examples

Postby charles » Tue Feb 03, 2009 2:30 am

rsrc_saddr
is there a chance rsrc_saddr has ever been used by anyone here in their code?
..and if so can we have an example?

i thought it corrected the rsc file's placement and offsets , but
any user actually used this without bombing?

it only allows one object to be "set" or is the index,input, as requiring an address ?
i been using gfa to try

~rsrc_saddr(type,index,adr)

it did not work well for me and i don't want to identify these actions as bugs!
charles
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

User avatar
daeghnao
Captain Atari
Captain Atari
Posts: 479
Joined: Wed Oct 27, 2004 12:41 pm
Location: York, UK
Contact:

Re: rsrc_saddr where are some examples

Postby daeghnao » Tue Feb 03, 2009 9:45 pm

I haven't myself seen any example of this call being used. The GEM documentation says:

Code: Select all

To get or set any pointer in the OBJECT, TEDINFO, ICONBLK or BITBLK structures, the application calls RSRC_GADDR and RSRC_SADDR.


So, to point the TEDINFO index 3 to your reserved memory mem%, you'd do:

Code: Select all

tedinfo&=2 ' Standard GEM definition
~RSRC_SADDR(tedinfo&,3,mem%)


charles wrote:i thought it corrected the rsc file's placement and offsets


This doesn't sound like what the call does. Why do your placement and offsets need fixing? Are you doing something other than RSRC_LOAD()?

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

Re: rsrc_saddr where are some examples

Postby charles » Wed Feb 04, 2009 12:05 am

yep doing it the hard way .
loading resource right from data lines.
embedding we called it ....

i tried and tried ,
and
what appears to be a easy code
to pass the tedinfo ///....///or whatever type
at a given offset///....//whatever index
to the peice address///....///appropriate address

i got the compendium out and consulting it to find items in the rsrc header
but am now boggled ,

few more tests then maybe goes on a list i have called .."areas of uncertainty"

i came to a conclusion that if i had two object trees to
pass the adress to
i would not be able to differenciate them apart!

so which adress would i be setting?

and am i iniatating the proper term setting?

which is what i made of"set" in the instructions..

because i know the rsc file is not consistant ,
it has displacement in the file where pointer to address go
for tedinfo,image icon ,,etc etc..
and all this is to create a format known as the resource.

which is what rsrc_load does at execution time/ and can not be done if the resource data is in data lines.

rsrc_saddr=this function sets the address of a resource daqta in the memory.

so would adr in the call as the last parameter
woul;d it return a adress
or
need a value to set an address?



maybe i went to far again!

charles
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

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

Re: rsrc_saddr where are some examples

Postby lp » Wed Feb 04, 2009 3:18 am

Dumping a rsc into data lines is a waste of time. In a raw RSC file all pointers are stored as offsets and all x/y coordinates are stored in characters, not pixels. Even if you manage to get rsrc_saddr() to work at the tree level, you are still screwed. Bombs away. :lol: I guess you didn't bother to read how RSC files are stored on disk.

CAll RSRC_LOAD() and be done with it. Or plan "B", ignore me. :wink:

ppera

Re: rsrc_saddr where are some examples

Postby ppera » Wed Feb 04, 2009 3:21 pm

Yeah. rsrc_saddr is one of AES calls which are almost never used (or saying it not so nice: useless one :D ).
Real thing with RSCs is to integrate them in executable.

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

Re: rsrc_saddr where are some examples

Postby charles » Wed Feb 04, 2009 11:45 pm

plus lonny forgot to mention it only seems to work if the file is loaded with rsrc_load

i consult the gfa manual , then later consulted the compendium.

what does this means of x/y by character indicate?

for simple rsc i can get all the co-ordinates corrected and the images and strings , but for large multiple tree rsc i get screwd ,,or better yet bombed ,,i have survived several thosand bombings in the past week.

charles
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

User avatar
stevee
Atariator
Atariator
Posts: 22
Joined: Tue Dec 30, 2008 8:31 pm
Location: South East, UK

Re: rsrc_saddr where are some examples

Postby stevee » Thu Feb 05, 2009 12:54 am

Of course we do have 'rsrc_rcfix' which will do exactly what you want but available only in MagiC and AES versions 4.0 and greater.
Shame!

As for the coors stored in character base, thats because low/med res the chars are 8bit high, and hi res 16bit high.
Stevee

Atari ST programming - my first love

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

Re: rsrc_saddr where are some examples

Postby lp » Thu Feb 05, 2009 12:56 am

charles wrote:plus lonny forgot to mention it only seems to work if the file is loaded with rsrc_load

i consult the gfa manual , then later consulted the compendium.

what does this means of x/y by character indicate?

for simple rsc i can get all the co-ordinates corrected and the images and strings , but for large multiple tree rsc i get screwd ,,or better yet bombed ,,i have survived several thosand bombings in the past week.


I didn't forget to mention that. It should be obvious if you researched stuff before attempting to do it. Seriously, just look at the parameters for rsrc_saddr(). Do you see a parameter that tells the ASE the base address of the rsc file? No. Obviously it's going to fail.

Since ppera is so keen on the idea, I'll leave all further assistance to him. Good luck. :mrgreen:

User avatar
Desty
Atari God
Atari God
Posts: 1951
Joined: Thu Apr 01, 2004 2:36 pm
Location: 53 21N 6 18W
Contact:

Re: rsrc_saddr where are some examples

Postby Desty » Thu Feb 05, 2009 12:56 am

charles wrote:but for large multiple tree rsc i get screwd ,,or better yet bombed ,,i have survived several thosand bombings in the past week.

"... So I turned my ST upside down and it said on the bottom: Manufactured in Israel. No wonder it was bombing so much."

:ehum:
tá'n poc ar buile!

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

Re: rsrc_saddr where are some examples

Postby charles » Sun Nov 19, 2017 12:33 am

I don't think ppera is with us anylonger......
so here goes a more specific question ,,,where in a object tree would I write the objkect trees address>?

type-object tree
index?????
adr=address of the object tree
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

ThorstenOtto
Captain Atari
Captain Atari
Posts: 179
Joined: Sun Aug 03, 2014 5:54 pm

Re: rsrc_saddr where are some examples

Postby ThorstenOtto » Sun Nov 19, 2017 7:57 am

You can't set the object address of some arbitrary object. The object address of the root of all formulars, menus etc is in a list that is accessible through the resource header, but other objects are in consecutive memory after that. As already mentioned, rsrc_saddr is one of the most useless calls.
What you can change though is the address of the substructures (TEDINFOs etc). But you don't need a AES call for that.
So the question is: what are you going to achieve?

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

Re: rsrc_saddr where are some examples

Postby charles » Sun Nov 19, 2017 12:04 pm

im very confused
what if you have three different rsc loaded?
how does it know which object tree im trying to address?
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 689
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: rsrc_saddr where are some examples

Postby mfro » Sun Nov 19, 2017 12:26 pm

charles wrote:im very confused
what if you have three different rsc loaded?
how does it know which object tree im trying to address?


Dealing with multiple resource files in a single application is not a concept the AES were designed for. This doesn't mean that you can't make that situation work, however. It's just that you are basically on your own to manage it. The AES global[5] and global[6] fields are key for that.

joska
Hardware Guru
Hardware Guru
Posts: 3692
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: rsrc_saddr where are some examples

Postby joska » Tue Nov 21, 2017 1:23 pm

An easy way to deal with multiple RSC-files in AES is to do something like this:

1. Load the first RSC.
2. Get the pointer(s) to the tree(s) in that RSC using rsrc_gaddr. Save these pointers.
3. Load the second RSC.
4. Get the pointer(s) to the tree(s) in that RSC using rsrc_gaddr. Save these pointers.

...and so on. rsrc_load will allocate a new memory block for the RSC so the previously loaded RSC will not be overwritten.

You can also switch between loaded RSC's by manipulating the AES global arrays as mfro suggests, but it's a bit easier to create very confusing bugs that way.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 689
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: rsrc_saddr where are some examples

Postby mfro » Tue Nov 21, 2017 1:54 pm

Yes, its a bit easier that way but also less flexible. If you want *true* dynamic handling of multiple resource files (i.e. if you want to be able to do a rsrc_free() in between), you'll need to save and restore those global pointers.

joska
Hardware Guru
Hardware Guru
Posts: 3692
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: rsrc_saddr where are some examples

Postby joska » Tue Nov 21, 2017 4:07 pm

Correct, but in this case I think "easier" is the keyword.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

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

Re: rsrc_saddr where are some examples

Postby charles » Tue Nov 21, 2017 10:58 pm

no u have misunderstood
can I have an example of rsrsc_saddr
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

joska
Hardware Guru
Hardware Guru
Posts: 3692
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: rsrc_saddr where are some examples

Postby joska » Tue Nov 21, 2017 11:08 pm

I think you have misunderstood. What does rsrc_saddr have to do with multiple RSC files? The answer is "Nothing".
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

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

Re: rsrc_saddr where are some examples

Postby charles » Wed Nov 22, 2017 12:27 am

which bugs are you referring to joshka?
I have experience with multiple rsrc.
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

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

Re: rsrc_saddr where are some examples

Postby charles » Wed Nov 22, 2017 12:31 am

i should be able to have a tedinfo vector indata line and beable to set as tedinfo using rsrc saddr , but how does it know which rsrc i want to set the address into?
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 689
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: rsrc_saddr where are some examples

Postby mfro » Wed Nov 22, 2017 6:53 am

rsrc_saddr() is basically just a shortcut to

Code: Select all

rsrc_gaddr(type, index, &addr);
*addr = new_addr;


nothing fancy.

As stated above, rsrc_gaddr() will always use the AES global resource pointer. rsrc_saddr() behaves exactly the same. So if you want to use rsrc_saddr() on a particular resource file of several, you have to set this pointer first.

User avatar
Desty
Atari God
Atari God
Posts: 1951
Joined: Thu Apr 01, 2004 2:36 pm
Location: 53 21N 6 18W
Contact:

Re: rsrc_saddr where are some examples

Postby Desty » Wed Nov 22, 2017 9:15 am

Can you post the code you've written so far Charles? It might be easier to see how to help then.
tá'n poc ar buile!

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

Re: rsrc_saddr where are some examples

Postby charles » Wed Nov 22, 2017 11:11 am

no desty becAUSE
I am asking for an example code of rsrc saddr not a huge belittling ...
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

User avatar
Desty
Atari God
Atari God
Posts: 1951
Joined: Thu Apr 01, 2004 2:36 pm
Location: 53 21N 6 18W
Contact:

Re: rsrc_saddr where are some examples

Postby Desty » Thu Nov 23, 2017 9:10 am

Haha, fair enough :lol: I'm always willing to show my code because you learn a lot from people reviewing and criticising it, but if you're not comfortable with that, no worries.
tá'n poc ar buile!

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

Re: rsrc_saddr where are some examples

Postby charles » Thu Nov 23, 2017 11:11 pm

what worries me is that you replied to a thread that requested examples and then ask the orignator of the thread to give an example ..... seems like you are in the same vote as me
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 2 guests