Jump to content
IGNORED

Atari ST RAM Detection Code ($FF8001)


Recommended Posts

Hi, I wrote some code a few weeks back to detect my CPU speed since I upgraded my CPU to 16Mhz.  Today I decided to detect the RAM and output that on boot as well - becauseI use a physical switch to toggle between 1Mb and 4Mb.Anyway, long story short I read from this address (despite the address being documented as $FF8001 I had to use a DEEK and pressumed it has read the two bytes sequentially from $FF8000,meaning the 2nd normally sits at $FF8001?:-$FF8000

I get back the following:-

 

Decimal 65290, FF0A HEX, or 1111111100001010 in binary

 

OR I get

 

Decimal 65285, FF05 HEX or 1111111100000101 in binary.

 

I've worked out (I think) that the lower 4 bits of that word are the banks and sizes in those banks? Is that correct?

 

My code is just doing an AND 10 (decimal), or AND 5 (decimal) in order to work out if its 4Mb or 1Mb and this appears to work. I noticed that the first byte there seems to change - I saw an instance where

it was 11111101 instead of 11111111 - anyone know what that first byte is at that address? What would 2Mb or 2.5Mb look like - just so I can add support in.

 

Any help appreciated!

Edited by GadgetUK
Link to comment
Share on other sites

Am I right in thinking that for a 512Kb config that the bank one (or bank two) bits are 11 (reserved?) I can't see how else half a meg could be represented?

 

I will change my code to check each bit and calc the RAM size from that - that should be accurate no matter what - provided my theory on half a meg is correct?

Edited by GadgetUK
Link to comment
Share on other sites

Thanks! When I originally got SIMMs in my STFM I managed to make it 256Kb in config lol. Can't remember how, I think I had 4 x 256Kb SIMMS and the A9 switch used or something, so it saw the RAM as 256Kb rather than 1Mb. I did the code change last night and it's working still but actually calculating the size based on those bit positions for each bank, so in theory it should show 256Kb, 512Kb, 1Mb, 2Mb, 2.5Mb, and 4Mb =) Thanks for your help!

Edited by GadgetUK
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...