home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 211 < prev    next >
Encoding:
Text File  |  1996-08-05  |  3.3 KB  |  65 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: netnews.upenn.edu!dsinc!scala!darren
  3. From: darren@scala.scala.com ("Darren M. Greenwald")
  4. Subject: Re: QBlit() waits for blitter to finish... ??
  5. Message-ID: <1996Jan4.162704.4250@scala.scala.com>
  6. Date: Thu, 4 Jan 1996 16:27:04 GMT
  7. References: <4cb2kv$4ku@news.rwth-aachen.de> <1996Jan3.194458.9030@scala.scala.com> <4cet65$jpg@serpens.rhein.de>
  8. Organization: US Research and Development - Scala Inc.
  9.  
  10. In article <4cet65$jpg@serpens.rhein.de> mlelstv@serpens.rhein.de (Michael van Elst) writes:
  11. >darren@scala.scala.com ("Darren M. Greenwald") writes:
  12. >
  13. >>or at least set a flag that the blit is done.  Note though that for
  14. >>small to medium blits it could be that the everything is done fast
  15. >>enough that QBlit() returns after the blit is done.
  16. >
  17. >Seems that AmigaOS2.0 has some problems though.
  18. >
  19. >With AmigaOS3.1 on A3000 the QBlit() function returns after about 120
  20. >microseconds for the first QBlit() and after 60 microseconds for a
  21. >QBlit() that just adds the node to the queue.
  22. >
  23. >With AmigaOS2.0 the first QBlit() returns when the blit is done (which
  24. >in that case was after 4.5 milliseconds).
  25. >
  26.  
  27. Well, I will let you in on an interesting story.  I ended up entirely
  28. rewriting QBlit/QBSBlit and the blitter interrupt code near the very
  29. end of the KS 3.x project.  This is not the kind of thing you normally
  30. rewrite near the end of a project :)  The previous code, and what is
  31. in KS 1.3 through 2.x was so convoluted, so strange, that it had long
  32. since passed the point of anybody understanding what was suppose to
  33. be going on in there.  
  34.  
  35. The actual problem though was there was a race condition in the hardware
  36. that would result in trashed blits, trashed sprites, blitter lockups,
  37. and some other nasty problems in some of the new video modes that
  38. 3.x supported.  RoboCity (a long used demo) showed these problems,
  39. but even prior to 3.x there where occasional problems with QBlit and
  40. QBSBlit that resulted in RoboCity not undrawing parts of the animation
  41. correctly.  The code was fixed multiple times prior to KS 3.x; supposedly
  42. fixing the redraw bugs in RoboCity, but the problem was really never
  43. fixed, just made slightly better (or worse maybe).
  44.  
  45. Now that I think about it you are correct.  This was just one of
  46. many bugs I found in the QBlit subsystem prior to the rewrite.  In fact,
  47. one of the tests I went through after fixing it is to prove that
  48. trackdisk.device (one of the few pieces of code that does use
  49. QBlit()) was not adversely affected by fixing this bug.  To this day
  50. though, I expect there is at least one game out there that was
  51. broken by fixing this behavior.  The most obvious problem is that
  52. if a game unintentionally relied on synchronous behavior, asynchronous
  53. behavior (even though that is the way the function is documented)
  54. opens up a huge window for race conditions.  For programmers that
  55. write their code correctly to use the cleanup routine, no problem,
  56. other than the code may run more efficiently under 3.x than under
  57. 2.x.  For programmers that do not use the cleanup routine and rely
  58. on timing and good luck... it comes down to timing and good luck :)
  59.  
  60. -- 
  61. -----------------------------------------------------------
  62. Darren M. Greenwald         | Scala Inc. R&D            /
  63. Senior Systems Engineer     | darren@scala.com         o
  64. -----------------------------------------------------------
  65.