home *** CD-ROM | disk | FTP | other *** search
/ Falcon 030 Power 2 / F030_POWER2.iso / ST_STE / MAGS / ICTARI09.ARJ / ictari.09 / ICTARI.TXT next >
Text File  |  1994-04-18  |  18KB  |  355 lines

  1.  
  2.  
  3.     ICTARI USER GROUP             ISSUE #9                     April 1994
  4.  
  5.          ___   ______     ___       _________   _________   ___
  6.          \__\  \   __\    \  \__    \______  \  \   _____\  \__\
  7.            ___  \  \       \  __\     _____\  \  \  \         ___
  8.            \  \  \  \       \  \      \  ____  \  \  \        \  \
  9.             \  \  \  \_____  \  \____  \  \__\  \  \  \        \  \
  10.              \  \  \       \  \      \  \        \  \  \        \  \
  11.               \__\  \_______\  \______\  \________\  \__\        \__\
  12.  
  13.                      *   m   a   g   a   z   i   n   e   *
  14.  
  15.     =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16.                        I C T A R I   U S E R   G R O U P
  17.        63 Woolsbridge Road, Ringwood, Hants, BH24 2LX   Tel. 0425-474415
  18.     =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  19.  
  20.                                INDEX FOR ISSUE 9
  21.                                =================
  22.  
  23.     FOLDER                          SUBJECT
  24.     ¯¯¯¯¯¯                          ¯¯¯¯¯¯¯
  25.     ASSEMBLY       Cookie Jar find program and documentation.
  26.                    Cookie Jar find source code.
  27.                    Assembler MACRO tutorial.
  28.                    Two MACRO files for system TOS calls.
  29.                    Twist scroll demo program and source (needs fixing).
  30.                    Mouse problem answered.
  31.  
  32.     C              C Tutorial Chapters 8-14, (see last month also).
  33.                    Program to delete .BAK files and source code.
  34.  
  35.     GFA            Handy tips for GFA programmers.
  36.                    Horizontal scroll routine.
  37.  
  38.     PASCAL         Address book program and source code.
  39.  
  40.     MISC           Atari Explorer Online Programmers Journal  Issue 1.
  41.                    'The Atari Compendium' book review.
  42.                    Pexec TOS call information.
  43.                    Executable file structure information.
  44.                    Index for ICTARI disk magazines issues 1-8.
  45.                    List of current members.
  46.  
  47.                                  ------------
  48.  
  49.     In next months issue of ICTARI (this may change) :-
  50.  
  51.     ASSEMBLY       Complete set of floating point arithmetic routines.
  52.                    Routine to read command line text.
  53.                    The event_multi 'right button' problem solved at last.
  54.  
  55.     C              Boink, a Break-out type game with source code.
  56.                    The event_multi 'right button' problem solved at last.
  57.  
  58.     GFA            Code to read command line on TTP programs.
  59.  
  60.     PASCAL         Pipe monitor.
  61.  
  62.     MISC           Atari Explorer Online Programmers Journal  Issue 2.
  63.                    Various GEM bugs discussed.
  64.                    Program to display active GEM/TOS/BIOS/AES/VDI  calls.
  65.                    The LZW and GIF compression algorithms explained.
  66.  
  67.     For future issues :-
  68.  
  69.     Binary/Decimal/Hex/ASCII conversion routines in machine code.
  70.     Polyline drawing routines in machine code.
  71.     Bezier curve drawing routines.
  72.     Picture decompression routines for IMG, Degas, Tiny, PCX, PAC, etc.
  73.     Picture compression routine for IMG pictures.
  74.     HP DeskJet/LaserJet compression routines (Mode 2 TIFF).
  75.     Using the Xbtimer chip.
  76.     Tutorial for using GEM commands from machine code and C.
  77.     Playing sound samples on non STE machines.
  78.     Picture switching techniques.
  79.     VBL queue information.
  80.     Printer driver code for printing mono/colour images.
  81.     Sprite tutorial and code.
  82.  
  83.     -----------------------------------------------------------------------
  84.                                    EDITORIAL
  85.                                    =========
  86.     ADVERTISEMENTS
  87.     ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  88.     We have started  advertising  the  existence  of  the  group by sending
  89.     letters to ST User and ST Format  magazines,  we shall have to wait and
  90.     see if they publish them and if they generate any response as a result.
  91.     We have also sent letters to 11  Public Domain libraries and have had 2
  92.     letters of support so far.
  93.  
  94.     We have sent letters to  17  Atari  User  Groups around the country and
  95.     have posted a notice on some of the computer network systems.
  96.  
  97.     We have also sent letters  to  40  software authors that have published
  98.     programs in the past and as a  result  have  had 7 new members, so far.
  99.     Several of the new members are  very  well known in the Atari community
  100.     and we would especially like  to  welcome  them  to  the group, see the
  101.     MEMBERS.TXT file for more information.
  102.  
  103.     We have sent an advert to Computer  MicroMart which only costs a stamp.
  104.     Thanks to several members who have  sent  us blank adverts, we shall be
  105.     sending those off during the coming months.
  106.  
  107.     ATARI EXPLORER ONLINE PROGRAMMERS JOURNAL  Issue 1.
  108.     ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  109.     This document file in  the  MISC  folder  is  the  ICTARI equivalent in
  110.     America and contains a wealth  of  programming and related information.
  111.     It covers all languages and so we  have not been able (due to copyright
  112.     requirements) to split it  up  into  the  appropriate  folders. It also
  113.     covers other topics such as source  code  on CD-ROM, for example, so we
  114.     feel it is well worth ALL members printing out the text, but be warned,
  115.     it runs to over 60 pages. It  does, however, have a comprehensive index
  116.     at the beginning so you  can  choose  what  you  want to read. We shall
  117.     publish issue 2 next month and maybe  later  issues if we can get them.
  118.     The file is compressed with STZIP, copy  the AEOPJ1.TOS file to a blank
  119.     disk before running it, the file will automatically uncompress itself.
  120.     -----------------------------------------------------------------------
  121.                                 CORRESPONDENCE
  122.                                 ==============
  123.  
  124.     To ICTARI
  125.     From Nick Bates
  126.  
  127.     RE: GEM TUTORIALS
  128.     This would be an excellent idea, although I'm pretty OK with GEM in  C,
  129.     I  haven't a clue about GEM in 68k.   I tend  to  save  any programs  I
  130.     write that need GEM in C.  I would very much like  to see a tutorial in
  131.     68K for GEM.  Anyone whose struggling  with   GEM and  C,  should  read
  132.     C-Manship complete by  Clayton   Walnum.   It  really  is  good for the
  133.     beginner.
  134.  
  135.     Transferring data between machines is  also  a  good point,  I would be
  136.     interested  if any one has contributed anything about it.  I am writing
  137.     a  chess game and  I  hope  to  be  able  to  have  two machines linked
  138.     together to  play.  I'd   rather  use  the  RS-232  port  though.  I've
  139.     haven't looked into it yet, and probably  a long way from doing so, but
  140.     if any one can help - it would be appreciated.
  141.  
  142.     */ We did read somewhere that the RS-232 hardware and software is a bit
  143.     'buggy', anyone have any detailed info on this ?   ICTARI /*
  144.  
  145.     To *.*
  146.     FROM: Nick Bates
  147.  
  148.     I  need  a  BJ  printer  driver  for  Protext,   but  it's  not  needed
  149.     desperately  any more,  as   I   read  the   manual   (SHOCK)  for  the
  150.     printer,  and  found  that a flip of a dipswitch turned  it  into Epson
  151.     mode. There's a moral to be learned there I think :-)
  152.  
  153.     To: Mike Barnard
  154.     FROM: Nick Bates
  155.  
  156.     I  agree  with your article on comments,  people  should  comment their
  157.     programs more. In future I intend  to  make sure any programs I  submit
  158.     are well commented,  as otherwise  it's  hardly  worth contributing the
  159.     source - if no one can understand it.
  160.  
  161.     Also  thanks  for   the  non-GEM  Mouse  article,   I   found  it  very
  162.     useful in programming my own  routine  for  my  Chess Game. I think you
  163.     deserve  a  greet  in the Credits list -  if  and  when  it's complete.
  164.  
  165.     To: *.*
  166.     FROM: Nick Bates
  167.  
  168.     Everyone  wants  to  make  sure  their  programs  are  compatible  with
  169.     other  machines and  all TOS versions,  does  anyone  have  any general
  170.     rules  to  follow in order   to   ensure  compatibility  - particularly
  171.     with the Falcon ?
  172.  
  173.     To Peter Hibbs
  174.     FROM: Nick Bates
  175.  
  176.     The  article  on  in-line  data  transfer  to   subroutines   was  very
  177.     useful,  and something I didn't quite understand.  Now at least  I have
  178.     a rough idea of what the concept is about.
  179.     -----------------------------------------------------------------------
  180.     To ICTARI
  181.     From Si(gh)
  182.  
  183.     I have decided  to  start  giving  you  library  routines  that  I have
  184.     written, as and when I use them  and/or they are asked for. The problem
  185.     is that all my code is based  on  a  large  macro table. As a result, I
  186.     have decided to give you  the  entire  contents of my include directory
  187.     with this issue. This will allow  people  to assemble my source without
  188.     having to rewrite the macro bits. I will also include runnable programs
  189.     for those who don't want to worry about the ins and outs.
  190.  
  191.     Since the include files will  grow  with  time (especially MACRO_V1), I
  192.     will send updates as and  when  necessary.  These should be copied over
  193.     the old files. I would recommend keeping  the files zipped so that only
  194.     those interested need unzip them.
  195.  
  196.     Basically, as Peter Hibbs  states,  treat  the  macros and libraries as
  197.     black boxes; the contents may change,  but the basic function will stay
  198.     the same.
  199.  
  200.     Note: All my macros have notes  above them describing any oddities that
  201.     I have found with the operating system  while using them and any useful
  202.     equates that I have set up while using them.
  203.  
  204.     Hope it helps someone - please tell me  if  you use it (or if you don't
  205.     want it) as it will then tell me whether or not to bother!
  206.  
  207.     */ Thanks for very  useful  info  in  these MACROs. See ASSEMBLY/MACROS
  208.     folder for more info.  ICTARI /*
  209.  
  210.     The journey router sounds great  in  theory,  but  has anyone given any
  211.     consideration to the actual data it would have to contain and how  long
  212.     it would take to put in ?
  213.  
  214.     On a different note, I have  commented  the mouse routine from the last
  215.     issue  for   Mike   Barnard.   Hope   it's   of   use   to   him.  (See
  216.     ASSEMBLY/MOUSPROB.ANS folder).
  217.  
  218.     I disagree that source code  should  be  commented every seven lines or
  219.     so, although I am well aware  of  the  seven line rule (useful note for
  220.     menus). I do agree that source  is  not  well commented, but if I spent
  221.     time commenting all my source, it would  never get written. I also find
  222.     it harder to wade through  all  the  comments  than to wade through the
  223.     source, but  I  suppose  that  is  probably  me,  as  most  of  my work
  224.     programming tends to involve  modifying  other  people's  code. I think
  225.     that a paragraph of what each module (not necessarily sub-routine) does
  226.     should be sufficient, unless the aim is specifically to teach, in which
  227.     case the program is secondary to the aim.
  228.  
  229.     I have commented your code and  corrected it to work properly; although
  230.     some of my comments may seem picky,  they are generally to get you into
  231.     faster methods of programming as a normal style. As usual, it's do as I
  232.     say, not as I  do!  No  doubt  other  programmers  will  have their own
  233.     distinct view and you will no doubt form your own after looking through
  234.     ours.
  235.  
  236.     */ We agree with Mike that  source code should be adequately documented
  237.     and with Simon that TOO many comments are unnecessary and time wasting.
  238.     This does raise an  interesting  subject  for  programmers: what is the
  239.     best way to write  source  code,  especially  in  assembler.  We have a
  240.     number of ideas on this issue ourselves, here are some examples :-
  241.  
  242.     (a) We like to have only one  RTS instruction in a sub-routine (even if
  243.     it means jumping to it) so if  any  code  is  added to the exit path it
  244.     will be valid whichever way the routine exits.
  245.  
  246.     (b) We usually save and restore  all registers used within library sub-
  247.     routines (except where timing  is  critical)  which avoids accidentally
  248.     using the same register for two different functions.
  249.  
  250.     (c) We avoid jumping from one sub-routine into another which is often a
  251.     recipe for disaster when later amendments are made to one of them.
  252.  
  253.     These examples may be trivial but  they  can  help to avoid the dreaded
  254.     bombs that we seem to see too often.
  255.  
  256.     We would like to invite members (in all languages) to send in their own
  257.     programming tips and techniques and why  they  use  them so that we can
  258.     combine them into  a  document  on  'how  to  write  safe programs' and
  259.     publish it in a later issue. ICTARI /*
  260.     -----------------------------------------------------------------------
  261.     To *.*
  262.     From Paul Laddie [Byteman]
  263.  
  264.     I was wondering if any other members  of  the group have any GFA source
  265.     code to play either Quartet music or soundtracker MODs under interrupt,
  266.     I have a routine which will play Quartet music under interrupt in STOS,
  267.     but I prefer to program in GFA basic as it is more structured.
  268.     -----------------------------------------------------------------------
  269.     To *.*
  270.     From Peter Hibbs
  271.  
  272.     After  the  recommendations  by  Jonathan  (see  MISC  folder)  and  ST
  273.     Applications magazine I have also  purchased The Atari Compendium book.
  274.     As they say it is an excellent  reference book for all things Atari but
  275.     don't expect much in the way of tutorials. It would be a rare book that
  276.     had absolutely NO errors so if  anyone  who  owns this book should find
  277.     any errors perhaps they could  let  us  know  so that other members can
  278.     make the necessary corrections. Incidently  can  anyone explain how the
  279.     footer text 'The Atari Compendium'  on  page  9.4  got printed in lower
  280.     case while the other 799 pages are printed in capitals ?
  281.     -----------------------------------------------------------------------
  282.     To *.*
  283.     From Mike Barnard
  284.  
  285.     Instruction timings! Our CPU's run at 8  Mhz. That means it generates 8
  286.     million timing pulses (cycles) a second.  Or, on a 50hz colour monitor,
  287.     you have 160 thousand cycles to get  all  of your graphics moved if you
  288.     want the maximum frame display rate for your mega game.
  289.  
  290.     Different instructions take different  amounts  of  cycles to run, with
  291.     the addressing modes also varying the  time taken. E.g. Clearing a byte
  292.     or word in a data register  takes  just  4  cycles, a longword takes 6.
  293.     (clr.l d0 - 6 cycles). The trap  command takes 38 cycles and dividing a
  294.     signed word where  the  source  is  an  absolute  long  address takes a
  295.     staggering 170 cycles!
  296.  
  297.     I keep reading about how important  fast  routines  are. But how do you
  298.     know how fast they are? How do  I  know how long each instruction takes
  299.     in each addressing mode? You can't  use  a stopwatch! Then some luck. I
  300.     was in the library and I  asked  the librarian 'Please will you display
  301.     on your pretty little computer  screen  a  list  of all books available
  302.     which refer to Atari, ST or  68000?'.  She  did and I chose, at random,
  303.     'MC68000 Assembly Language Programming',  (second  edition reprinted in
  304.     1993 by Bramer  &  Bramer.  Isbn  number  0-340-54451-1,  Edward Arnold
  305.     publishing, £17.99p).
  306.  
  307.     It's not specific to the ST but it's very educational. And on pages 276
  308.     to 283 there are some beautiful  big,  clear tables telling you all how
  309.     many cycles and how many  memory  bytes a particular instruction takes!
  310.     Bingo. So, now you know. Go to your library and order it, now!
  311.  
  312.     So, you can't / won't / aren't  allowed  in! OK, I'm  good. If you send
  313.     an A4 sized envelope, stamped and   addressed,  I'll  send  you  a copy
  314.     of the tables. But send  more  than  just  the  envelope. Not money you
  315.     fool! Some help. Maybe you  can  explain   IN  PLAIN  ENGLISH  how some
  316.     fast sprite / screen  copying  /  backgrounds  /   scrolling  /  text /
  317.     anything! routines are done. If not,  don't despair.  You'll  still get
  318.     your tables. Like I said, I'm good. (Puuuurrrrrrrr!).
  319.  
  320.     I am, MIC.
  321.     Mike Barnard, 52 Westbourne Avenue, Worthing, West Sussex, BN14 8DF.
  322.     No uninvited callers please and only clean mail. Thanks.
  323.  
  324.     */ See Issue 7 for  some  comprehensive sprite routines using Neochrome
  325.     Master, we are also planning to publish some more code for sprites from
  326.     Nick Bates in later issues hopefully.  ICTARI /*
  327.     -----------------------------------------------------------------------
  328.     To *.*
  329.     From ICTARI
  330.  
  331.     We would like to hear from members about what they would like to see in
  332.     future ICTARI magazines, no guarantees that we can find the information
  333.     but if you don't ask you won't  get  what you want. Also, we still need
  334.     more contributions  from  you  for  future  issues.  We  have  got some
  335.     material which is already in the  public  domain but we would prefer to
  336.     use as much  original  material  as  possible  so  if  you haven't sent
  337.     anything in before perhaps you could have  a go. You can always ring us
  338.     on the number in the header above if you want to discuss any particular
  339.     project or article. If you do  send  any  programs or source code could
  340.     you also PLEASE send a text file  as well explaining what the code does
  341.     and how to use it.
  342.  
  343.     We try to prepare the  disks  about  one  month  in advance so that any
  344.     articles that are submitted will probably not appear for a month or two
  345.     although any requests for help  will  be  put  into  the next issue. It
  346.     would help a lot if you could send  the  disks to us BEFORE the 10th of
  347.     the month so that we don't have a lot of work to do just before we send
  348.     out the disks as it takes some time to prepare the disks, duplicate and
  349.     then post them.
  350.  
  351.     Also any general comments about programming topics or anything else for
  352.     this correspondence section are always interesting to read.
  353.  
  354.                        ---------- End of file ----------
  355.