home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / utility / patch / db_bcon / db_bcon.txt < prev    next >
Text File  |  1994-02-18  |  11KB  |  239 lines

  1.                                  DB_BCON
  2.                              ****************
  3.                              ONLY for TOS 4.1
  4.                              ****************
  5.  
  6.      A replacement for the console device in TOS4.1's Bconout routine.
  7.  
  8.      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9.  
  10.       Why replace TOS's BCONOUT routines, you ask? The answer is very
  11.      simple. TOS 4.01 (often called 4.1) has three very annoying bugs- 
  12.      nothing terrible, mind you, but it does fail to emulate the very
  13.      same VT52 codes that all other STs, STes and TTs have been quietly
  14.      performing for all these years.
  15.      
  16.       Although one can easily live with these VT52 bugs, Murphy's Law
  17.      dictates that the one program you need in an emergency will demand
  18.      that the VT52 emulation is bug-free. 
  19.       This bconout replacement extends the compatibility of the Falcon
  20.      and thereby reduces the "doesn't work on the Falcon" list.
  21.  
  22.  
  23.       
  24.                      "DANGER, WILL ROBINSON, DANGER"
  25.                                                     Robby the robot
  26.  
  27.       While this program does its best to cure the VT52 emulation
  28.      problems, it must access the TOS ROMs directly for one single
  29.      ROM address. This address cannot be found with any reliability
  30.      anywhere else; the inherent bconout routines themselves get this
  31.      address directly from ROM.
  32.       Normally, I would never distribute a ROM-specific program. Such
  33.      programs have obvious shortcomings, namely: as soon as the ROMs
  34.      are changed, the program becomes obsolete. Secondly, such programs
  35.      are not of any use on any other ROM version.
  36.  
  37.       This bug-fix is for TOS 4.01 (Falcon TOS) only. There are already
  38.      two (and maybe three) later versions of TOS4. I have not had the 
  39.      opportunity of investigating these later versions but do suspect
  40.      that the bugs have been squashed by now. The trouble is, what about
  41.      us TOS 4.01 users? Are we destined to live forever with these bugs?
  42.      No. Here's the fix.
  43.  
  44.                 "And remember... be careful out there."
  45.                                                    Sgt. Phil Esterhouse
  46.  
  47.  
  48.      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  49.  
  50.                          Wanted Dead or Alive
  51.                           (preferably dead)
  52.  
  53.  
  54.       Ok, Ok. Just what are these bugs?
  55.       
  56.       1)  LINE WRAP bug.
  57.           Although the codes for line wrap do work, TOS doesn't do
  58.           it right. Well, more accurately, TOS forgets that it did
  59.           it immediately after it does it (sort of like short-term
  60.           memory loss). The result is a column of characters that
  61.           scroll down the left side of the display. Even if you've
  62.           had a speed-reading course, those characters go by just
  63.           to dang-blasted fast to make any sense of.
  64.  
  65.       2)  CURSOR SAVE bug.     (Esc j  Esc k)
  66.           These are a pair of functions to save the current cursor
  67.           position (Esc j), and to restore the position (Esc k).
  68.           Restore (Esc k) works just fine and dandy. Problem is...
  69.           the Save function (Esc j) does not! The result is that
  70.           the cursor is always restored to location 0,0 or the
  71.           home position. TOS saves the cursor position to the
  72.           wrong place and then it forgets where it saved it.
  73.           
  74.       3)  Color Change bug.    (Esc b  Esc c)
  75.           These just plain didn't work, period! Neither the back-
  76.           ground nor the foreground color can be changed.
  77.           
  78.           
  79.      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  80.  
  81.                       "So what's the cure, doctor?"
  82.  
  83.           DB_BCON is a TSR that replaces the console device driver
  84.        in the bcon_out routines. It does this completely leagally
  85.        (save for the previously mentioned ROM access).
  86.  
  87.           It places its own address in the bconout_vec in low 
  88.        memory using the standard XBRA vector replacement protocol.
  89.        From that point on, it's installed. All three bugs are gone!
  90.        
  91.        It does NOT:
  92.        
  93.                   o  Check for rom type.
  94.                   o  Check for MultiTos
  95.                   o  Check for other bconout replacements.
  96.                   o  Cure any problems that may exist in
  97.                      the "RAW Console" driver portion of TOS4.
  98.                    
  99.        It DOES:
  100.                   *  Fix all aforementioned bugs.
  101.                   *  Check for machine type.
  102.                   *  Leave a cookie in the cookie jar (DBbc).
  103.                   *  Follow common-sense programming logic...
  104.                       (no secret tricks or toys)
  105.                   *  Use an internal pointer for con_state,
  106.                       normally located in low memory. This
  107.                       prevents HiSoft's AMON or MON from
  108.                       resetting the new bconout driver.
  109.                   *  Use XBRA protocol for vector replacement.
  110.                   *  Add 4 additional codes:
  111.                          Esc s   SAVE COLORS    (both fwg&bkg)
  112.                          Esc r   RESTORE COLORS (both fwg&bkg)         
  113.                          Esc z   RESET colors to B/W
  114.                          Esc X   SET X position (similar to Esc Y
  115.                                  but only one argument, X, is used)
  116.  
  117.  
  118.      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  119.       - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  120.      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  121.  
  122.                               Installation
  123.  
  124.  
  125.      DB_BCON can be installed either from the desktop or placed in
  126.      the AUTO folder and run automatically at powerup.
  127.      During its initialization, it will look for a file by the name
  128.      of db_bcon.DEF and if found will 'show' that file to the screen.
  129.      This allows you to set TOS's colors at powerup... if you so
  130.      desire.  (note: if run from the AUTO folder, DB_BCON.DEF must
  131.      reside in the root of your boot drive.)
  132.  
  133.      DB_BCON checks to see if it's already been installed and if so
  134.      will not keep a second copy of itself in memory. It will, however,
  135.      read the DB_BCON.DEF file as usual and then exit without a trace.
  136.      
  137.      DB_BCON _can_ install a second version of itself... if there's
  138.      a need to. Hold down the <Ctrl> key when DB_BCON starts up.
  139.      
  140.  
  141.      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  142.       - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  143.      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  144.  
  145.  
  146.  
  147.     This code is not guaranteed for any other versions of TOS... it's
  148.     not even guaranteed for TOS4.1 so "use with caution".
  149.  
  150.  
  151.  
  152.  02/14/94
  153. (with love)
  154. Bye: Dr. Bob
  155.  
  156.    -----------------------------------------------------------------
  157.                    "Can you show me what it does?"
  158.  
  159.    SAMP_???.QQQ   Three sample ascii text files are included; one
  160.    for 16/256 color resolutions of 640x480, one for 320x200 and
  161.    for True Color 320x480.
  162.    
  163.    They contain imbedded escape sequences to demonstrate the color
  164.    functions, cursor save functions and the wrap function. 
  165.  
  166.    SHOW them from the desktop *before* installing DB_BCON to see how
  167.    plain they look and how the last example of line wrap scrolls the
  168.    display.
  169.    
  170.    ("SHOW", you know... double-click on the file at the desktop and
  171.      then select SHOW from the alert box... see, I knew you knew)
  172.  
  173.     THEN install DB_BCON and show them again.  This time you'll be 
  174.    amazed! Colors galore, cursor save works and line wrap doesn't scroll
  175.    on every single character. Spiffy!
  176.    
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.    -----------------------------------------------------------------
  184.  
  185.     Digressing Notes:     (so indulge me a little bit ;-)
  186.     
  187.     
  188.      What started this whole project was a spreadsheet called "Logistix"
  189.     from Grafox in England. It's copyrighted 1985 and 1986.
  190.      Yeah yeah, I know. Who would expect such and old program to be
  191.     Falcon-compatible.  Well, it is... almost.
  192.      Everything runs along just fine except that the cursor is invisible.
  193.     All cell calculation, macros, file saving and loading etc. etc. etc.
  194.     work without a hitch. You just can't see the cursor (thank goodness
  195.     that the cell location is referenced on the status line).
  196.     
  197.      Conversations on GEnie also mentioned the inability of the Falcon
  198.     to change the text colors with VT52 codes. Although I had never had
  199.     reason to use these VT52 commands in any application, I WANTED them.
  200.     There _SUPPOSED_ to be there.
  201.     
  202.      Add to that the annoying wrap error on long text lines and it just
  203.     became too much. I've got Atari's newest computer and hell if it's
  204.     going to balk on me now!
  205.     
  206.      So out comes my favorite debugger, HiSoft's MON built into DevPac.
  207.     I traced the BIOS trap and located the proper bconout routine (the
  208.     console driver portion) and sat down to what I thought would be 
  209.     some intensive exploratory surgery (software-wise).
  210.      The major portion of time was spent tracking all the little sub-
  211.     routines called by the console driver. This was completed, oddly
  212.     enough, in a single afternoon. (I must be getting better at this;-)
  213.     
  214.      What is curious is that all three bugs exist in that one small
  215.     section of code. One is beyond doubt just a typo-error in the source
  216.     code; the cursor-save function saves the x and y coordinates to the
  217.     mouse pointer coordinates instead of the alpha cursor coordinates.
  218.      The others are rather simple too. Line wrap increments the X coord-
  219.     inate properly but when it decides that the line has to be wrapped,
  220.     it mistakenly saves the Y coordinate instead of X (this too looks to
  221.     have been a typo in the source code).
  222.      Color changes were a bit trickier because of a few new 'undocumented'
  223.     memory references and a puzzling piece of code that checks to see
  224.     if there is MORE THAN 16 planes in the current resolution (I suppose
  225.     that is so any future video resolutions will have an equal share of 
  226.     bugs in rom <grin>. Actually, one can't be sure of this bug's origin.
  227.     it may have been a typo {BLE instead of BLT} or it could have been
  228.     a programming error ...or... who knows for sure).
  229.  
  230.  
  231.  
  232.     
  233.             Any questions may be directed to W.PARKS3 on GEnie    
  234.                                             (W. David Parks)
  235.  
  236.  
  237. 02/16/94        
  238. Bye(again): Dr. Bob
  239.