Jump to content
Sign in to follow this  
majestyx

Need help understanding how to utilize SAMS memory in RXB

Recommended Posts

So I'm trying to create a realistic statistics based baseball game and, due to the TI's limitations and my not wanting to learn assembly, I am trying to figure a way to utilize SAMS memory to store, for example, tables of data that I can look up and retrieve into variables, mostly strings. I'd also like to be able to use the extra memory to store in-game statistics like at-bats, RBIs, strikeouts, walks, etc. for each player in the game, as well as team statistics. I'm thinking I'm likely setting my sights too high for this machine, but would love to know if and how this might be possible, especially with 1 MB of memory just sitting there waiting to be used.

 

For example, I'd like to have many detailed plays such as "fly out to center," "6-4-3 double play," "out at first, other runners safe," and plenty others which I can look up in some sort of matrix in memory. I'm finding I'm really having to leave out more than I'd like to include using what's available on a 32K system. Having a way and understanding how to access SAMS memory, maybe even if used as a RAM disk, would be cool. Otherwise, I'll make do with what is possible to utilize, and try my best with what there is to work with.

 

I guess I'm just not understanding what use the extra memory is if it's not possible to utilize it easily. I've seen Rich's In the Dark but I don't think that's anywhere near what I'm trying to do. That game appears to be using the memory to store map sections and then move the data into program (or is it VDP?) memory. Also, I see subprograms in RXB that start with AMS, but I can't seem to make sense of them, likely because I'm clueless when it comes to TI machine language. If someone can point me to a tutorial or even just documentation on ways of using the SAMS memory in programs, especially along the lines of what I'm attempting to use it for (store and retrieve data) it would be appreciated.

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

You could consider making version 1 use a file based data base.  You would use a relative file that allows random access to any record. In Basic you would then need a way to calculate the correct record from the input data, or have an lookup table in a big array to find the record number or worst case, you search through each file record to find the correct data.

 

By using disk you have a clean interface to BASIC to get your ideas firmed up.  Then move them to SAMS.

 

I made and used a database of church hymns for my choir director job that used floppy disk and a binary search method. It found the correct file record to use in a second or two.😊

 

Another method called a hash table lookup is even faster. 

 

my 2 cents

 

0xBF

 

 

Edited by TheBF
  • Like 1

Share this post


Link to post
Share on other sites

Working on a better version of RXB that has even better SAMS memory manager built into RXB.

Hope to release it before end of year. Have the Documentation done so currently working on DEMO's.

Tested all the routines and looked for any bugs so just the Demo's and videos need to be done.

After that I will release RXB 2019 or call it RXB 2020.

 

As for current RXB 2015 I am happy people are writing games and software using it.

Conversions of RXB 2015 XB programs to RXB 2020 XB programs will be provided and should be easy to convert.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)

That may be the approach I'll need to use (files) unless someone can provide more insight on how to use the SAMS without having to program in assembly. I looked over what little documentation there is for it on the diskettes that are available on the WHTech FTP site, but it really doesn't go into much detail, especially on how to use it outside of the Editor/Assembler. I see that there is a way to load multiple PROGRAMS into the SAMS memory, acting like a RAM disk, but I'll need to delve a little deeper to see if this can be accomplished for data files. I'm thinking that IN THE DARK's program listing should provide more clues, but so far I'm just not "getting it" as far as what's happening with all the CALL AMSBANK, MOVES, and LOADs I am seeing.

 

For now, I'll likely make general plays such as FLY OUT, GROUNDER, DOUBLE PLAY, REACHED BASE ON ERROR, and so on, then add more detailed plays, if not in SAMS memory (my preferred method), then by using disk files.

 

Just saw Rich's post and am happy to hear that a new version of RXB is coming. I'm trying to utilize RXB as well as SAMS in order to take advantage of all the improvements and better tools that are now available for the TI that weren't previously. It seems to me the AMS/SAMS had a lot of potential, but in the more than 25 years it's been available, very little has been done to make use of it. I believe a big reason is because there doesn't seem to be much in the way of documenting how to use it, at least for the average non-assembly/non-Forth programmer.

Edited by majestyx
  • Like 1

Share this post


Link to post
Share on other sites

I believe you would have to use CALL LOAD and CALL PEEK to store and fetch variables in SAMS from RXB.  Quite cumbersome and slow - especially for floating point numbers.

 

I once thought about how to improve this, and suggested an XB extension to provide rudimentary array support:

https://atariage.com/forums/topic/261030-dungeons-of-asgard-game-under-development/?do=findComment&comment=4218621

Share this post


Link to post
Share on other sites

Yes indeed, those calls to arrays stored in the SAMS is EXACTLY what I could use, and I'm sure many others could as well. Since the results I'd like to store and use would be looked up in tables, this would be a fantastic solution.

Share this post


Link to post
Share on other sites

I think CALL LINK supports arrays...
I have used STRASG with XB in my LPC extractor program, but not with arrays.
The E\A manual sec. 17.2.2(p.286) documents how to use.
A subprogram to pass variables would probably be short and simple, but there is a bit of a learnig curve at first.

I don't see any support for STRASG mentioned in the XB manual.
I'm not certain how I found out that it equates to >2010 in XB.

Untill RXB 2019/2020, CALL LINK is probably the way to go!:)

  • Thanks 1

Share this post


Link to post
Share on other sites
3 minutes ago, HOME AUTOMATION said:

I'm not certain how I found out that it equates to >2010 in XB.

 

Page 415 in E/A manual.

 

...lee

  • Thanks 2

Share this post


Link to post
Share on other sites
6 hours ago, HOME AUTOMATION said:

I think CALL LINK supports arrays...
I have used STRASG with XB in my LPC extractor program, but not with arrays.
The E\A manual sec. 17.2.2(p.286) documents how to use.
A subprogram to pass variables would probably be short and simple, but there is a bit of a learnig curve at first.

I don't see any support for STRASG mentioned in the XB manual.
I'm not certain how I found out that it equates to >2010 in XB.

Untill RXB 2019/2020, CALL LINK is probably the way to go!:)

 

This post and the one following it deal with such arrays. The first limited to 100 array elements and the second unlimited.

 

...lee

  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, HOME AUTOMATION said:

January 30, 2016: A day that will live in infamy!:lolblue:

 

You have a strong mind!:-o

 

Though, perhaps, you can get some ideas from the code, I just realized that it does not directly address how you might manage string arrays.

 

...lee

Share this post


Link to post
Share on other sites

As TheBF suggested and as an experiment to see how it would work, I implemented an "out chart" using the file system and, while it does work, it's pretty slow even in emulation in Normal mode (i.e. not accelerated), so I'm guessing that real hardware it would be even slower with all the disk accessing it needs to perform. It would definitely perform faster if the charts could reside in the SAMS memory in an array as Asmusr suggested and as I was hoping might be possible. I will make do with this solution for now, but am not sure how deeply I want to delve if there may be an easier way to do it with SAMS using a future release of RXB. Thanks to all for the suggestions!

  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...