GadgetUK Posted March 29, 2014 Share Posted March 29, 2014 (edited) 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 March 29, 2014 by GadgetUK Quote Link to comment Share on other sites More sharing options...
ParanoidLittleMan Posted March 29, 2014 Share Posted March 29, 2014 You are pretty close to correct way. But should look some literature before going in this .. For instance Atari Compendium, or Atari Profibuch. Only $FF8001 is interesting, other byte does not exist in HW, so what you read there is mostly noise. Little better is in Profibuch, with accurate address: Quote Link to comment Share on other sites More sharing options...
GadgetUK Posted March 29, 2014 Author Share Posted March 29, 2014 Thanks ever so much!!! Quote Link to comment Share on other sites More sharing options...
GadgetUK Posted March 29, 2014 Author Share Posted March 29, 2014 (edited) 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 March 29, 2014 by GadgetUK Quote Link to comment Share on other sites More sharing options...
ParanoidLittleMan Posted March 30, 2014 Share Posted March 30, 2014 Right. 11 is actually what stays for empty bank - according to my tests. And it works not if bank 0 is empty. And 00 is not possible too, at least until someone tries with 64K chips and makes 130 or 260 ST Quote Link to comment Share on other sites More sharing options...
GadgetUK Posted March 30, 2014 Author Share Posted March 30, 2014 (edited) 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 March 30, 2014 by GadgetUK Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.