bugbiter Posted May 10, 2016 Share Posted May 10, 2016 In my BGP Picture viewer I'm trying to add a feature for Sparta Dos to navigate btween subdirectories. If the program is not run in Sparta Dos, there is no need to display a Directory path, the drive letter and number will do. So the program should detect if it is running in SDX or not to select the appropirate display routines. How do I do that for best practice? Quote Link to comment Share on other sites More sharing options...
+David_P Posted May 10, 2016 Share Posted May 10, 2016 But MyDos also supports subdirectories, and would benefit from that function as well. Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted May 10, 2016 Share Posted May 10, 2016 (edited) But MyDos also supports subdirectories, and would benefit from that function as well. After a fashion, and if you attempt to handle MyDOS subdirectories using the same methods as those applicable with SDX, there's a chance of problems, despite the fact common XIO calls can be applied to both. MyDOS for a start has no default drive, instead using "D:" to refer to the "current" directory, while "Dn:" always points to the root of the corresponding drive. I've written software designed to handle both SDX and MyDOS subdirectories (via a kind of file selector in the The Last Word), and trying to get the thing to work in an intuitive manner under MyDOS was a frustrating exercise. In my BGP Picture viewer I'm trying to add a feature for Sparta Dos to navigate btween subdirectories. If the program is not run in Sparta Dos, there is no need to display a Directory path, the drive letter and number will do. So the program should detect if it is running in SDX or not to select the appropirate display routines. How do I do that for best practice? If you find "S" at $700, you have some variant of SpartaDOS. If you also find $40 or higher at $701 (the BCD revision number), you're running SpartaDOS X. Of course earlier SpartaDOS versions can also handle directories, as can one or two SpartaDOS clones (BeweDOS being an example, and it puts "B" at $703). Very old Sparta versions have $0B or $E8 at $700. Edited May 10, 2016 by flashjazzcat Quote Link to comment Share on other sites More sharing options...
mgr_inz_rafal Posted May 11, 2016 Share Posted May 11, 2016 Please take a look here: http://atariki.krap.pl/index.php/Programowanie:_Jak_stwierdzi%C4%87_obecno%C5%9B%C4%87_SpartaDOS_X_oraz_jego_konfiguracj%C4%99_pami%C4%99ci I used it to detect the extram bank used by SDX and it worked flawlessly. Quote Link to comment Share on other sites More sharing options...
Rybags Posted May 11, 2016 Share Posted May 11, 2016 Problem is, SpartaDos can run in non expanded Ram situations. We've been through this before, I don't think any 100% reliable solution was come across. I should think though that detecting if a Dos supports subdir structure might be easy enough. In theory you could issue commands or maybe try certain wildcards for a directory open. Then look for specfic error codes on return. Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted May 11, 2016 Share Posted May 11, 2016 Well the suggested method returns even more information than is necessary (the presence of SDX, plus its memory configuration), but I don't see why interrogating $700/$701 should not be 100 per cent reliable unless some other DOS happens to put the exact same values there. The aforementioned word processor has no difficulty distinguishing between MyDOS and SDX and tailoring its operation accordingly. Pragmatically observing the signature information provided by almost every DOS and reacting accordingly is a reliable approach. Quote Link to comment Share on other sites More sharing options...
1050 Posted May 13, 2016 Share Posted May 13, 2016 MyDOS for a start has no default drive, instead using "D:" to refer to the "current" directory, while "Dn:" always points to the root of the corresponding drive. That's a dance thru the minefield of words there. 2170 ; 070B 2180 DFUNIT 070B 01 2190 .BYTE 1 ; DEFAULT UNIT NUMBER 2200 ; MyDOS always has a default drive. "D:" always works for it. "D:" then will also work if you have set your default directory as well but default directory string and how to get to that part is a much bigger bucket of worms. But yes, using a drive number with "Dn:" does point to the root of that drive always. And even when the default directory has been set for this same drive, you won't get that without doing "D:" instead. Intuits fine here. Beta 4 has moved some of this around to make it such that one no longer loses the default directory it was set to with a RESET press like earlier versions will do. Issue of semantics more than a real argument here, 'current' directory is the trouble term as I see it, it does exist in MyDOS, it's just not the same critter everybody else has so it's NOT going to behave the same way. You can only have one for the entire system, each drive then does not remember it's own as in MS-DOS or Sparta so it's best if each path is explicit in MyDOS if you want reliable access across drives/directories. Default drive behavior may be the term to be using instead of default drive in the above quote? The behavior of MyDOS is decidedly different here as to "D:" and "Dn:" use, but it does make sense when you are aware that there is only one default allowed ever. When you change it, you also lose the old one. I've written software designed to handle both SDX and MyDOS subdirectories (via a kind of file selector in the The Last Word), and trying to get the thing to work in an intuitive manner under MyDOS was a frustrating exercise. Uh-huh, I'm tending to believe that part. If you find "S" at $700, you have some variant of SpartaDOS. If you also find $40 or higher at $701 (the BCD revision number), you're running SpartaDOS X. Of course earlier SpartaDOS versions can also handle directories, as can one or two SpartaDOS clones (BeweDOS being an example, and it puts "B" at $703). Very old Sparta versions have $0B or $E8 at $700. "M" for MyDOS at 0700h, all 4.50 and above versions. And I've seen this byte 700 test in many applications such as disk communicator, super arc and super un-arc too. De facto standard in my opinion. Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted May 13, 2016 Share Posted May 13, 2016 "M" for MyDOS at 0700h, all 4.50 and above versions. And I've seen this byte 700 test in many applications such as disk communicator, super arc and super un-arc too. De facto standard in my opinion. Heh... it's ironic that the question "How do I detect SpartaDOS X" results in instructions on how to detect MyDOS, and yet when SDX is raised in a MyDOS topic, we are run out of the thread with torches and pitchforks. Nevertheless, I try to support MyDOS too, and hopefully handling both won't be too daunting for the OP if he wants to do so... MyDOS always has a default drive. "D:" always works for it. "D:" then will also work if you have set your default directory as well but default directory string and how to get to that part is a much bigger bucket of worms. Well, since "D:" is also shorthand for a working drive/directory combo, it's just that: not really a default drive per se, but I understand how it works anyway. But yes, using a drive number with "Dn:" does point to the root of that drive always. And even when the default directory has been set for this same drive, you won't get that without doing "D:" instead. Intuits fine here. Heh... when I first discovered this ("Dn:" always referring to the root) back in 1990 or so, I felt like I had stumbled upon some easter egg intended to fox developers. This puzzling design is exactly what makes developing a file selector which works with SDX and MyDOS so damned difficult, at least when using relative paths (which is reasonable unless you want to devote 64 x 15 bytes of RAM to drive path buffers). So: user calls the file selector or disk menu. "D3:" is the current drive, so he gets the root of drive 3. He then hits return on a subdirectory name. Program does a CWD to the desired path then redisplays the root directory of "D3:". WTF? Ah - he must edit out the drive number first to display the content of the folder he just logged. OK - so drive 3 has the folder logged now. He wants to check some folder on drive 2. By the time he's done that, any history of drive 3's working path is lost forever. Beta 4 has moved some of this around to make it such that one no longer loses the default directory it was set to with a RESET press like earlier versions will do. Well, that behaviour (losing the working directory on reset) was the thing I hated most about ICD's SDX versions, but the problem with MyDOS seems to be that even if the odd pathing behaviour could be fixed properly, it would break existing software, so I guess we're stuck with it. Issue of semantics more than a real argument here, 'current' directory is the trouble term as I see it, it does exist in MyDOS, it's just not the same critter everybody else has so it's NOT going to behave the same way. You can only have one for the entire system, each drive then does not remember it's own as in MS-DOS or Sparta so it's best if each path is explicit in MyDOS if you want reliable access across drives/directories. Exactly. Relative pathing is out of the window in the situations I've described. What makes the use of absolute paths awkward, meanwhile, is that MyDOS has no way of reporting the working drive/directory to the application. That might at least be a start, and won't break existing software. Default drive behavior may be the term to be using instead of default drive in the above quote? The behavior of MyDOS is decidedly different here as to "D:" and "Dn:" use, but it does make sense when you are aware that there is only one default allowed ever. When you change it, you also lose the old one. "Different" is one way to describe it. Anyway, it is what it is, and we have to make the best of it. 2 Quote Link to comment Share on other sites More sharing options...
fujidude Posted May 14, 2016 Share Posted May 14, 2016 SDX is BORG. Everyone must assimilate. 1 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.