home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / amiga / programm / 17960 < prev    next >
Encoding:
Text File  |  1992-12-30  |  4.9 KB  |  120 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sample.eng.ohio-state.edu!purdue!news.cs.indiana.edu!nstn.ns.ca!psinntp!psinntp!viper!news
  3. From: brett@visix.com (Brett Bourbin)
  4. Subject: Re: Going to the metal
  5. Sender: news@visix.com
  6. Message-ID: <C02zt1.J21@visix.com>
  7. Date: Wed, 30 Dec 1992 16:43:49 GMT
  8. Reply-To: brett@visix.com
  9. References: <lk1di9INNrsa@exodus.Eng.Sun.COM>
  10. Organization: Visix Software, Reston, Virginia
  11. Lines: 107
  12.  
  13. In article <lk1di9INNrsa@exodus.Eng.Sun.COM> cmcmanis@pepper.Eng.Sun.COM  
  14. (Chuck McManis) writes:
  15. [interesting article deleted]
  16.  
  17. Chuck talks about development time differences in coding "to the metal"  
  18. and using the OS. While his example of reading the joystick port is  
  19. effective (although not using the correct processor 8^) ), there are  
  20. things that go into creating a game the seems to be ignored by most people  
  21. in these newsgroups (since most are NOT using a low-end Amiga with minimum  
  22. resources).
  23.  
  24. When writing a game, the first thing you must do is identify who your  
  25. customer is going to be. Many people here think that should be EVERY Amiga  
  26. owner, which would be really nice, but sometimes, not realistic. With this  
  27. in mind, when I write games, I first think about the majority of Amigas.  
  28. This happens to be 68000-based 512K machines, with 1M machines starting to  
  29. make its way to the top. So now I have a "target" machine to develop for.
  30.  
  31. The first thing I did when starting to write games is I learned the OS. I  
  32. did things with graphics and exec and input and gameport OS calls. Know  
  33. what, it was too slow to take on what was being done on other machines and  
  34. other games on the Amiga (the competition). I guess I might add the type  
  35. of games I write are 3D perspective, arcade-type action titles (not  
  36. everyones "cup of tee").
  37.  
  38. So what I did next (and I will try to give some pointers here, so this  
  39. article has some validity) was create a new OS. This OS takes over at boot  
  40. time and gives me a basically empty machine. A quick list of some of the  
  41. functions my OS has are:
  42.     Kernel manager
  43.         revectoring kernel functions
  44.         timing
  45.         vertical blank processing and hooks
  46.         processor cache manipulation
  47.     Display manager
  48.         can create an build "Views" like the AmigaOS
  49.         color control (fading and such)
  50.         can create special Copper tricks
  51.         double-buffering
  52.     Event manager
  53.         handles mouse, joystick and keyboard inputs
  54.     Process manager
  55.         handles multiple process for "multi-tasking"
  56.     Object manager
  57.         maintains image objects
  58.         handles animation language programs
  59.         efficient use of Blitter for sprites
  60.     Memory manager
  61.         clearing memory
  62.         filling memory
  63.         drawing lines and plotting points
  64.         scaling, shearing and rotation image memory
  65.     Math manager
  66.         handles trig functions
  67.         matrix operations
  68.         random numbers
  69.     Debug manager
  70.         revectors processor exceptions
  71.         serial debugging between target->host
  72.     Disk manager
  73.         handles floppy disk reads and writes
  74.     etc...
  75. All of this fits in 8K of code (excluding buffers and images), is written  
  76. in assembly and can be assembled for different 68K-based machines. It also  
  77. uses the whole memory map for its use (remember there is no AmigaOS  
  78. running at this point).
  79.  
  80. So how does it get started? During the boot process:
  81.     allocs a section of CHIP memory for the kernel
  82.     reads the tracks that have the kernel into this memory
  83.     extracts what type of machine we are on
  84.         gets ExecBase->AttnFlags
  85.         gets VBR
  86.         figures out how much and type of memory
  87.     opens graphics library
  88.     loads NULL View
  89.     waits a few frames
  90.     shuts down the AmigaOS
  91.     saves all the info gathered in kernel memory
  92.     clears caches if needed
  93.     jumps to kernel
  94.     relocates kernel to its home and initializes
  95.  
  96. Yes, I have already passed the point of no return (almost). I also have a  
  97. boot loader that works from my harddrive that will do all the same things  
  98. that the bootblock loader does and save state so it can restore on exit.
  99.  
  100. Now all of this was not "easy" but it does go down to the metal. It also  
  101. works on all the machines I have tested from 68000 to 68040s and A500 to  
  102. A3000s. All my games (application code) is written to my gameOS (kernel)  
  103. and is reused. I paid the development cost once. The application is free  
  104. to use the extra memory for its own caching (disk tracks, images, sounds,  
  105. etc.)
  106.  
  107. I am very sorry that C= is not releasing info on the AGA chip set, since I  
  108. would add support in the kernel for it.
  109.  
  110. So, as you see, going to the metal may not be always easier, but it does  
  111. allow writing a game that will work almost as good on a A500 as on a A3000  
  112. with extended resources. This is the MAIN reason why I wrote my kernel as  
  113. the hardware level and not the AmigaOS level (along with being able to  
  114. write for SEGA machines).
  115.  
  116. --             _  _    _      _
  117. Brett Bourbin        (_ |_ | /__ | |(_  4431 Lehigh Road, Suite 151
  118.   brett@visix.com    __)|_ |_\_/ \_/__) College Park, Maryland 20740
  119.   ..uupsi!visix!brett          LIMITED       703.758.2733
  120.