home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / developmen / oplexamp / TELL.TXT < prev    next >
Text File  |  1993-09-27  |  2KB  |  52 lines

  1. ==========
  2. psion/2_series3 #1793, from dw2, 2232 chars, Sep 27 11:04 93
  3. Comment to 1787. 
  4. ----------
  5. Determining whether you're running on an S3 or an S3a
  6. ---------------------------------------------------
  7. Several people have asked about this.
  8.  
  9. The "official" (and simplest) way is to CALL($18b) (no parameters)
  10. and look at the bottom byte ("AL") of the return value.  This gives
  11. the so-called "LCD type", which is 5 for the 240x80 S3 screen, and 11
  12. for the 480x160 S3a screen.
  13.  
  14. This is adequate for many purposes.  But it has the limitations that
  15.    (*) it doesn't work on a PC emulator (since the PC screen has a
  16. different LCD size)
  17.    (*) there's no telling, for sure, what the LCD type of future
  18. machines in the S3 range may be.
  19.  
  20. A second line to consider is finding the Window Server version
  21. number.  To do this, PEEKB(PEEKW($18)+13), and consider the value
  22. obtained in terms of its high nibble and its low nibble.  The high
  23. nibble is the "machine type", and would be $00 for the MC, $10 for
  24. the S3, $20 for the HC, and $40 for the S3a.  More relevant is the
  25. low nibble, which is guaranteed to increase monotonically as more
  26. functionality is added into the Window Server.  Thus a "version 2"
  27. Window Server has low nibble 0, a "version 3" (as runs on the S3
  28. classic) has low nibble 1, and a "version 4" Window Server (as runs
  29. on the S3a) has low nibble 2.
  30.  
  31. The special advantage of this is, as I said, that you could test the
  32. low nibble for >=2 (say), and be guaranteed future-proof.  The
  33. DISadvantage, however, is that it only works after your program has
  34. connected to the Window Server.  (For Opl programs, there is *no*
  35. problem here, since the connection to the Window Server takes place
  36. before the first line of user code is executed.)
  37.  
  38. Some notes: $18 is the location of the handle of the Window Server
  39. channel control block for any process, in the dataspace of that
  40. process.  Incidentally, as an experiment, you can try either of the
  41. above mechanisms IN THE CALCULATOR (ie go there and just evaluate eg
  42. CALL($18b).)
  43.  
  44. A *third* approach, which is probably the most powerful, is to check
  45. whether the file "ROM::XADD.DYL" exists (use the FilStatusGet O/S
  46. service, call($887), as described on p39 of the O/S services manual
  47. in the SDK).  This can, clearly, be tested prior to connecting to the
  48. Window Server.
  49.  
  50. Regards, DavidW
  51.  
  52.