home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / atari / 8bit / 5827 < prev    next >
Encoding:
Text File  |  1993-01-10  |  12.3 KB  |  456 lines

  1. Newsgroups: comp.sys.atari.8bit
  2. Path: sparky!uunet!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!cs.tu-berlin.de!rossi
  3. From: rossi@opal.cs.tu-berlin.de (Oliver Rosenkranz)
  4. Subject: S.A.M. Part II (Accessory and address)
  5. Content-Type: text/plain
  6. Message-ID: <1993Jan10.180104.16978@cs.tu-berlin.de>
  7. Sender: news@cs.tu-berlin.de
  8. Content-Transfer-Encoding: 8bit
  9. Organization: Techn. University of Berlin, Germany
  10. Mime-Version: 1.0
  11. Date: Sun, 10 Jan 1993 18:01:04 GMT
  12. Lines: 442
  13.  
  14. Hi there !
  15.  
  16. Last week I posted an article covering the program Screen Aided Management
  17. for the ATARI XL/XE computers.
  18. I have been asked several times where you can get it and some other
  19. things. So I decided to write it down and post it here :
  20.  
  21. Screen Aided Management (S.A.M.) is powerful software package. It gives the
  22. XL/XEs a desktop with windows/icons pull-down-menues and 80 columns per row
  23. (and many other great features I described before - If you wanna have the
  24. first text send me a mail (rossi@cs.tu-berlin.de).).
  25.  
  26. S.A.M. is a commercial product. Its basic parts had been published in 1988/89
  27. in the German computer magazine ATARImagazin .
  28. Now it is distributed by a German company. Here is its address :
  29.  
  30. Power per Post (PPP)
  31. Postfach 1640
  32. 7518 Bretten
  33. Germany
  34.  
  35. You may also get there other products for the 8 bit ATARIs, so be clever
  36. and order a catalog first.
  37.  
  38. The newest version of S.A.M. is V1.25 and it seems that this is the last
  39. update. The authors of S.A.M. are working on an English version (the software
  40. itself/commands/... are in English but the manual is written in German) of
  41. it which will be distributed in the US. But I can't say when.
  42.  
  43. Some people wrote me that they want to hear more about how to program
  44. accessories which are compatible to S.A.M. . Okay, here it is. There
  45. may be some lines of my first posting of it but this is for those who
  46. didn't catch it.
  47.  
  48. S.A.M. has the ability to start accesories to give the progammer a chance to
  49. use all the features S.A.M. is providing.
  50. There are still some accessories out there. They were mentioned and described
  51. in my first posting. I'm actually working on an accessory (a Filelist utility).
  52.  
  53. Okay here, again, is the memory map of the 800 XL having S.A.M. installed :
  54.  
  55. $0000-----------------------------------------------
  56.     OS variables and vectors
  57. $0600-----------------------------------------------
  58.     S.A.M. variables
  59. $0700-----------------------------------------------
  60.     DOS
  61. $1F00-----------------------------------------------
  62.     free memory
  63. $2400-----------------------------------------------
  64.     S.A.M.
  65. $2600-----------------------------------------------
  66.     free memory (but is temporary used by S.A.M.)
  67. $3000-----------------------------------------------
  68.     font
  69. $3400-----------------------------------------------
  70.     player graphics
  71. $3800-----------------------------------------------
  72.     S.A.M. vector list
  73. $3900-----------------------------------------------
  74.     S.A.M.
  75. $6010-----------------------------------------------
  76.     Screen
  77. $8000-----------------------------------------------
  78.     S.A.M. utility
  79. $xxxx----(depends on length of utility)-------------
  80.     free memory
  81. $C000-----------------------------------------------
  82. .
  83. .
  84. .
  85. The utility which loads the accessories and controls them uses
  86. the memory from $8000 to $83FF.So, S.A.M. accessories are machine
  87. language programs executable at address $8400.
  88. S.A.M.s title screen is still active when an accessry starts.
  89.  
  90. There is a number of system variables an accessory can work with :
  91.  
  92. XPOS    Byte    $0601    horizontal position for PRINT routine (00 - 79)
  93. YPOS    Byte    $0602    vertical position for PRINT routine (00 - 23)
  94. VALIN    Word    $0603    univarsial variable, mostly used to carry parameters
  95. VALOUT    Word    $0605    as VALIN ; if routine gives back a parameter it is this
  96. PULLF    Byte    $0607    0 - no Pull Down Window (PDW) open
  97.             1 - there is a PDW open
  98. STORE    Byte    $0609    intermittent memory for flags and registers
  99. PULLX    Byte    $060A    x position of PDW (00 - 79)
  100. PULLY    Byte    $060B    y position of PDW (00 -23)
  101. PULLH    Byte    $060C    length of PDW
  102. RMARG    Byte    $0611    right margin for CPRINT routine
  103. BMARG    Byte    $0612    bottom margin for CPRINT routine
  104. LMARG    Byte    $0613    left margin for CPRINT routine
  105. XARR    Byte    $0614    x position of joystick/mouse arrow (00 - 159)
  106. YARR    Byte    $0615    y position of joystick/mouse arrow (00 - 191)
  107. PULLN    Byte    $0616    number of choosen desktop menu item (doubled)
  108. COLL    Byte    $0617    0 - arrow outside PDW
  109.             1 - arrow inside PDW
  110. BOXX1    Word    $0622    x positon of the top/left corner of the box made by the
  111.             BOX routine (00 - 319)
  112. BOXY1    Byte    $0624    y position of the top/left corner of a boxmade by the
  113.             BOX routine (00 - 191)
  114. BOXX2    Word    $0625    x position (bottom/right); for BOX routine
  115. BOXY2    Byte    $0627    y position (bootom/right); for BOX routine
  116. BOXSL    Byte    $062C    X position for BOX slider (00 - 207,
  117.             >200 --> disabled )
  118. TEXT    Word    $062D    address of the string given back by the GETHEX routine
  119. DIRFL    Byte    $0634    0 - show the "FREE SECTORS" message with the directory
  120.                 in the SHOWDIR routine
  121.             1 - don't show this message
  122. ILEN    Byte    $0635    maximum length of the input in the INPUT routine
  123.             (up to 45 !)
  124. FILE    String    $5555    cotains choosen file after SHOWDIR routine
  125. DRIVE    Byte    $507C    actual drive number (ASC code)
  126. IBUF    String    $5568    contains input after INPUT routine
  127. MMU    Byte    $00EC    0 - memory (from $8200 to $BFFF) changed or used
  128.             This byte has to be set to ZERO in each accesory !!!
  129.  
  130. The zero page variables $CB to $F0 are also used by S.A.M. but can be also
  131. used by an accessory.
  132.  
  133.  
  134. There is also a number of system routines you can work with :
  135.  
  136. name        adr    job
  137.  
  138. PULLDOWN    $4039    opens PDW (latitude is 16 characters)
  139.             Input :
  140.             X register - x position
  141.             Y register - y position
  142.             A register - length
  143.             Output :
  144.             PULLX,PULLY,PULLH,PULLF
  145. PULLUP        $40E1    closes PDW
  146. INPUT        $4F83    reads a text string from keyboard
  147.             IMPORTANT: You have to save PULLF before use the INPUT
  148.                    routine and you have to restore it after
  149.                    returning from it.
  150.             Input : ILEN - maximum string length
  151.             Output: IBUF and following - text string
  152.                 A register       - ESC pressed (1)
  153.                              or not (0)
  154. GETHEX        $4BE0    writes text string to status row and reads hex value
  155.             from keyboard
  156.             Input :
  157.             TEXT - pointer to text string
  158.             Output :
  159.             VALIN - hex value
  160.             A register - ESC pressed (1) or not (0)
  161. PRINT        $43E1    writes text to screen or in PDW if open
  162.             Input :
  163.             XPOS - x position
  164.             YPOS - y position
  165.             X register - Highbyte of the text string address
  166.             Y register - Lowbyte
  167.             A register - length of the text string
  168. CPRINT        $43FF    writes text in screen chapter
  169.             Input :
  170.             XPOS - x position
  171.             YPOS - y position
  172.             $CC  - Highbyte of text string address
  173.             $CB  - Lowbyte of text string address
  174.             X register - length of the string
  175.             LMARG,RMARG,BMARG - see description
  176. ARROW        $40F6    controlles joystick/mouse and moves the arrow
  177.             returns when trigger is pressed
  178.             Output : XARR, YARR - joystick/mouse position
  179. GETDIR        $4F2B    loads directory in the buffer at $2B00
  180.             Input : DRIVE - drive number
  181. SHOWDIR        $4D85    shows directory, returns when file is chosen or button
  182.             pressed in the MENU line
  183.             IMPORTANT : Before you start SHOWDIR you have to
  184.                     call GETDIR and open a PDW (x=32,y=2,
  185.                     length=17)
  186.             Input :
  187.             DIRFL
  188.             Output :
  189.             A register - 0: file chosen
  190.                      1: exit (button in menu line pressed)
  191.             FILE - Filename
  192. BOX        $4CFB    draws rectangle and sets slider
  193.             Input :
  194.             BOXX1,BOXX2,BOXY1,BOXY2 - see description
  195. CLRSTAT        $5031    clears status lines (row 22 and 23)
  196.             IMPORTANT: save PULLF before and restore it after using
  197.             this routine.
  198. PUSHBS        $4489    copies screen to screen buffer
  199. PULLBS        $44D3    copies screen buffer to the screen
  200. MULT        $453D    multiplies two integers
  201.             Input :
  202.             VALIN - integer #1
  203.             VALIN +1 - integer #2
  204.             Output :
  205.             VALOUT - result
  206. CHAROUT        $4376    prints character on the screen
  207.             Input :
  208.             XPOS,YPOS - position
  209.             A register - character code
  210. ARRSET        $417A    sets arrow to a certain position
  211.             Input :
  212.             XPOS,YPOS - position
  213. SAM        $401F    Return to S.A.M.
  214.             the S.A.M. graphic and menu line will be rebuilt
  215.  
  216.  
  217.  
  218. The menu line stuff :
  219.  
  220. This is a bit more complex, so be sure that you are really willing to follow
  221. through...
  222.  
  223. S.A.M. wasn't originally created to be an 'open' system. So there are no
  224. administration routines for the menu line and the pull down menues suitable
  225. in accessories.
  226. You have to write your own (and I show you in this text how it goes).
  227.  
  228. To create a menu line you have to print 80 characters in line 0.
  229.  
  230. ...
  231. LDA #0
  232. STA XPOS
  233. STA YPOS
  234. LDY #DATAFIELD
  235. LDX /DATAFIELD
  236. LDA #$50
  237. JSR PRINT
  238. ...
  239. DATAFIELD has to be a data field as this :
  240.  
  241. DATAFIELD    .AT "FILE             OPTIONS     EXIT       "
  242.         .AT "                                        "
  243.  
  244. To let the user choose a PDW from the menu line you have to do this loop
  245.  
  246. ...
  247. LOOP    JSR ARROW
  248.     LDA PULLF
  249.     BNE WOPEN
  250.     JSR CHOOSE
  251.     LMP LOOP
  252. WOPEN    JSR WCHOOSE
  253.     JMP LOOP
  254.  
  255. If you want be let things happen while waiting for the user to choose a PDW
  256. it must happen in this loop (or in an interrupt routine).
  257.  
  258. As you see there have to be two routines : CHOOSE and WCHOOSE.
  259. But there have to be also another three data fields :
  260.  
  261. 1) DTAB (for the menu line) :
  262.  
  263. Byte 0:        number of entries
  264. Byte 1:        left margin for first entry (00 -79) in the 80 character string
  265.         DATAFIELD
  266. Byte 2:        right margin for first entry
  267. Byte 3:        left margin for second entry
  268. Byte 4:        right margin for second entry
  269. ...
  270.  
  271. or with the data field mentioned before
  272.  
  273. DTAB    .HX 03000311171D20
  274.  
  275. 2) TXTAB (to control the menu lines' PDWs) :2) TXTAB (to control the menu lines' PDWs) :
  276.  
  277. In this field 4 bytes are reserved for each menu line entry. So the length
  278. of this field is /number of entries/ * 4 .
  279.  
  280. Byte 0 :    number of entries in pull down window (PDW) #1 (*16)
  281. Byte 1/2:    adress of the string where all PDW#1 entries are specified
  282. Byte 3 :    ZERO (0)
  283. Byte 4 :    number of entries in PDW #2 (*16)
  284. Byte 5/6:    adress of the string where PDW#2 entries are specified
  285. Byte 7 :    zero
  286. ...
  287.  
  288. or in our example :
  289.  
  290. TXTAB    .HX 40
  291.     .DA PDW1
  292.     .HX 00
  293.     .HX 10
  294.     .DA PDW2
  295.     .HX 00
  296.     .HX 20
  297.     .DA PDW3
  298.     .HX 00
  299. PDW1    .AT "Load            Save            Directory       Format          "
  300. PDW2    .AT "Destroy ATARI   "
  301. PDW3    .AT "Exit to S.A.M.  Boot system     "
  302.  
  303.  
  304. 3) VECTOR (32 bytes for each PDW) :
  305.  
  306. This field contains the start addresses for all the routines represented by
  307. a PDW entry.
  308. You can put 16 entries together in one PDW routine and there are two bytes
  309. reserved for each entry, so this field must have a length of 32*(number of
  310. PDWs) bytes.
  311.  
  312. Byte 0/1 :    start address for routine represented by entry #1
  313. Byte 2/3 :    start address for routine represented by entry #2
  314. .
  315. .
  316. .
  317. Byte 30/31 :    start address for routine represented by entry #16
  318.  
  319. or in our example :
  320.  
  321. VECTOR    .DA LOAD,SAVE,DIR,FORMAT,0,0,0,0
  322.     .DA 0,0,0,0,0,0,0,0
  323.     .DA DESTROY,0,0,0,0,0,0,0
  324.     .DA 0,0,0,0,0,0,0,0
  325.     .DA GOBACK,BOOT,0,0,0,0,0,0
  326.     .DA 0,0,0,0,0,0,0,0
  327.  
  328. LOAD,SAVE,DIR,FORMAT,DESTRY,GOBACK and BOOT are labels and say where all
  329. those routines are located in memory.
  330.  
  331.  
  332. Okay, and here are both routines (CHOOSE and WCHOOSE). Those routines were
  333. published in ATARImagazin 11/88 and were written by Andreas Binner and Harald
  334. Schoenfeld.
  335. The same is to say about most of the other info in this text.
  336. But they wrote it to be public so I hope there is no problem in reprinting
  337. it.
  338.  
  339. CHOOSE    LDA XARR
  340.     LSR
  341.     STA XPOS
  342.     LDA YARR
  343.     LSR
  344.     LSR
  345.     LSR
  346.     STA YPOS
  347.     LDA DTAB
  348.     TAX
  349.     LDY #0
  350. LOOP1    LDA DTAB+1,Y
  351.     CMP XPOS
  352.     BCS NOTHING
  353.     LDA DTAB+2,Y
  354.     CMP XPOS
  355.     BCC NOTHING
  356.     JMP FOUND
  357. NOTHING    INY
  358.     INY
  359.     DEX
  360.     BNE LOOP1
  361. CLOSE    JSR PULLUP
  362. BACK    RTS
  363. FOUND    LDA YPOS
  364.     BNE CLOSE
  365.     LDA DTAB+1,Y
  366.     TAX
  367.     STY PULLN
  368.     STY STORE
  369.     ASL STORE
  370.     LDY STORE
  371.     LDA TXTAB,Y
  372.     LSR
  373.     LSR
  374.     LSR
  375.     LSR
  376.     CLC
  377.     ADC #1
  378.     LDY #1
  379.     JSR PULLDOWN
  380.     LDA STORE
  381.     TAY
  382.     LDA TXTAB,Y
  383.     PHA
  384.     LDA TXTAB+2,Y
  385.     TAX
  386.     LDA TXTAB+1,Y
  387.     TAY
  388.     LDA #1
  389.     STA XPOS
  390.     STA YPOS
  391.     PLA
  392.     JSR PRINT
  393.     RTS
  394.  
  395. This routine looks if there you chose an entry in the menu line and opens it.
  396. Please email me for further explanation.
  397.  
  398. WCHOOSE    LDA COLL
  399.     BNE INPDW
  400.     LDA YARR
  401.     LSR
  402.     LSR
  403.     LSR
  404.     BEQ WCBACK
  405.     JSR PULLUP
  406. WCBACK    RTS
  407.     LDA YARR
  408.     LSR
  409.     LSR
  410.     LSR
  411.     CMP PULLY
  412.     BEQ WCBACK
  413.     BCC WCBACK
  414.     SEC
  415.     SBC PULLY
  416.     SEC
  417.     SBC #1
  418.     ASL
  419.     STA STORE
  420.     LDA PULLN
  421.     ASL
  422.     ASL
  423.     ASL
  424.     ASL
  425.     CLC
  426.     ADC STORE
  427.     TAY
  428.     LDA VECTOR,Y
  429.     STA $CB
  430.     LDA VECTOR+1,Y
  431.     STA $CC
  432.     JMP ($CB)
  433.  
  434. This routine looks if you choose an entry of the open PDW and executes the
  435. correlated routine.
  436.  
  437. Here is another short routine (to go back to S.A.M.) :
  438.  
  439. GOBACK    JSR PULLUP
  440.     LDA #1
  441.     STA DIRFL
  442.     PLA
  443.     PLA
  444.     JMP SAM
  445.  
  446. All other routines should end with an RTS command.
  447.  
  448. I hope this was not too hard to understand...
  449. Questions and suggestions via email to me...
  450.  
  451. --==rossi==--
  452. Oliver Rosenkranz
  453. rossi@cs.tu-berlin.de
  454.  
  455.  
  456.