home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #2 / amigaacscoverdisc1998-021998.iso / games / doom / adoom / src / amiga_notes.txt < prev    next >
Text File  |  1998-01-08  |  13KB  |  278 lines

  1. ========================================================================
  2. v0.5  8 Jan 98
  3. ------------------------------------------------------------------------
  4. Added music code in amiga_music.s based on Joseph Fenton .MUS player.
  5. Changed amiga_sound.s to use only 2 channels for sound effects when
  6. music is enabled, and 4 channels when music is disabled.  Added
  7. MIDI_Instruments and MIDI_Instruments.s to archive.  MIDI_Instruments.s
  8. isn't actually used, but it's helpful for understanding the instrument
  9. format.
  10.  
  11. ------------------------------------------------------------------------
  12. Added Aki Laukkanen's latest 68040 and 68060-optimised column and span
  13. renderers in amiga_draw.s.  Modified r_main.c and r_draw.h to handle
  14. different DrawColumn_040(), DrawColumn_060(), DrawSpan_040() and
  15. DrawSpan_060().  Aki sent me some more fast C2P and MMU routines but I
  16. haven't got those working yet.
  17.  
  18. ------------------------------------------------------------------------
  19. The call to BestModeID() in amiga_video.c had an unterminated taglist.
  20. Fixed.
  21.  
  22. ------------------------------------------------------------------------
  23. Added Aki's 68060 versions of FixedMul() and FixedDiv() in amiga_fixed.s.
  24. 68060 FixedDiv uses FPU.  If there is no FPU, fall back to 68040 version.
  25. Added code to select appropriate routines in amiga_main.c.
  26. Changed FixedMul() definitions in m_fixed.h to look like this:
  27. extern fixed_t (*FixedMul)    (fixed_t a, fixed_t b);
  28. extern fixed_t (*FixedDiv)    (fixed_t a, fixed_t b);
  29. fixed_t FixedMul_040    (fixed_t a, fixed_t b);
  30. fixed_t FixedMul_060    (fixed_t a, fixed_t b);
  31. fixed_t FixedDiv_040    (fixed_t a, fixed_t b);
  32. fixed_t FixedDiv_060fpu    (fixed_t a, fixed_t b);
  33. /* fixed_t FixedDiv2    (fixed_t a, fixed_t b); */
  34.  
  35. ------------------------------------------------------------------------
  36. Added code to amiga_video.c to check version numbers before trying to
  37. call BestModeID() and put up a screenmode requester.  Explicitly
  38. declared LowLevelBase so it doesn't try and autoopen lowlevel.library.
  39.  
  40. ------------------------------------------------------------------------
  41. Fixed I_WaitVBL() in amiga_video.c to call WaitTOF().  It's only
  42. called on exit to delay long enough to hear the final sound effect.
  43.  
  44. ========================================================================
  45. v0.4
  46. ------------------------------------------------------------------------
  47. Gamma correction wasn't working in ECS mode.  Fixed in I_Palette()
  48. in amiga_video.c.
  49.  
  50. ------------------------------------------------------------------------
  51. I think I finally found the cause of the 80000003 crash on exit.  It
  52. was caused by 2 missing commas in the initialisation strings for
  53. endmsg[] in dstrings.c following the strings: "go ahead and leave. see
  54. if i care." and "you're lucky i don't smack\nyou for thinking about
  55. leaving.".  Fixed.
  56.  
  57. ------------------------------------------------------------------------
  58. Added 68020/30 optimised C2P routine in c2p_020.s.  Use blitter for
  59. final passes which means double-buffering is required to eliminate
  60. otherwise severe flicker.  Implemented double-buffering for all planar
  61. modes in amiga_video.c.
  62.  
  63. ------------------------------------------------------------------------
  64. Found that the last QBlit() pass finished while the main program was
  65. in the middle of 3D rendering.  This meant the ChangeScreenBuffer()
  66. call was delayed until the end of rendering.  The program felt very
  67. sluggish, even though the frame-rate was higher than before because
  68. there was a much longer delay between pressing a key and seeing the
  69. result happen on the screen.  To solve this I created a new subtask
  70. which simply calls ChangeScreenBuffer() in a loop when signalled from
  71. the QBlit() cleanup function.  This way the main engine is interrupted
  72. to call ChangeScreenBuffer() at the earliest opportunity.  Extensive
  73. changes are in amiga_video.c.
  74.  
  75. ------------------------------------------------------------------------
  76. Gabry (ggreco@iol.it) emailed me some CD32 joypad handling code.  I
  77. included it in amiga_video.c (disabled by default) but I can't test
  78. it.  To enable it, use the -joypad option or JOYPAD tooltype.
  79.  
  80. ------------------------------------------------------------------------
  81. Several people sent me faster replacements for R_DrawColumn() and
  82. R_DrawSpan() in amiga_draw.s, but so far only one of them worked
  83. right.
  84.  
  85. ========================================================================
  86. v0.3
  87. ------------------------------------------------------------------------
  88. Low detail code doesn't work, so disabled detail level toggle in
  89. m_menu.c.  Previously setting low detail and then resizing screen
  90. corrupted graphics.
  91.  
  92. ------------------------------------------------------------------------
  93. Added ClearPointer() call before CloseWindow() in amiga_video.c.
  94. Let's see if that fixes the crash on exit.  Hmm, seems OK after about
  95. a dozen runs.  Perhaps it was a bug in CyberGraphX.  ... nope, just
  96. got another 80000003 crash on exit  :(
  97.  
  98. ------------------------------------------------------------------------
  99. Added code to get ProgramName in amiga_main.c.  Added definition of
  100. ProgramName in m_args.h and m_args.c.
  101.  
  102. ------------------------------------------------------------------------
  103. Allocated space for myargv[] in amiga_main.c and copy argv[] across.
  104. Parse icon tooltypes and convert to additional entries in myargv[]
  105. and myargc.
  106.  
  107. ------------------------------------------------------------------------
  108. Added -screenmode option to set ScreenMode in amiga_video.c
  109.  
  110. ------------------------------------------------------------------------
  111. Added -forcedemo option in g_game.c to force demos to play even if
  112. the version number doesn't match.
  113.  
  114. ------------------------------------------------------------------------
  115. Changed handling of $HOME in d_main.c to append a '/' if it doesn't
  116. already end in a '/' or a ':'.
  117.  
  118. ------------------------------------------------------------------------
  119. Added trailing slashes to definitions of DEVMAPS and DEVDATA in
  120. dstrings.h.
  121. #define DEVMAPS "devmaps/"
  122. #define DEVDATA "devdata/"
  123.  
  124. ========================================================================
  125. v0.2   1 Jan 1998
  126. ------------------------------------------------------------------------
  127. Changed zone management code to allocate between 2Mb and 6Mb instead
  128. of always 6Mb.  ADoom should now work on Amigas with less memory.
  129. Check result of allocation.  Previous version crashed if 6Mb malloc
  130. failed.
  131.  
  132. ------------------------------------------------------------------------
  133. Changed handling of HOME environment variable in d_main.c
  134.  
  135. ------------------------------------------------------------------------
  136. The Amiga doesn't have F11 and F12 keys.  Changed amiga_video.c to map
  137. the '[' and ']' keys to F11 and F12.  Now gamma correction works.
  138. Also fixed keypad '+'.
  139.  
  140. ------------------------------------------------------------------------
  141. Added joystick code using gameport device in amiga_video.c.  Changed
  142. m_misc.c to enable usejoystick.
  143.  
  144. ------------------------------------------------------------------------
  145. Added AmiTCP networking support by writing a new version of
  146. amiga_net.c based on i_net.c for Linux.  Successfully worked to a PC
  147. running Linux with DOOM compiled from the released DOOM sources.
  148. Performance was really bad, with lots of jerking, even on ethernet.
  149. Tried improving performance by making sends non-blocking as well as
  150. recvs.  AmiTCP 4.3 appears to return errno==EINVAL instead of
  151. errno=EWOULDBLOCK for non-blocking recvfrom() and non-blocking
  152. sendto() --- seems pretty weird to me, or have I done something wrong?
  153.  
  154. ========================================================================
  155. v0.1  30 Dec 97
  156. ------------------------------------------------------------------------
  157. Open audio.device on 4 channels and play sound effects in
  158. amiga_sound.c.  Cache up to 12 sound effects in chipmem at a time.
  159. All other sound effects are cached in fastmem.  Audio period is still
  160. not calculated correctly from pitch.  Separation (balance) is ignored,
  161. so 3D sound effects are not right.  Changed s_sound.c to pass channel
  162. number (cnum) to I_StartSound().  Changed m_misc.c to set 4 channels
  163. instead of 3.
  164.  
  165. ------------------------------------------------------------------------
  166. Deleted calls to I_UpdateSound() and I_SubmitSound() in d_main.c
  167.  
  168. ------------------------------------------------------------------------
  169. Stripped 68040-optimised AGA and ECS(EHB) C2P routines out of Flick
  170. v1.5 and linked them into amiga_video.c.  Changed "dirty_list"
  171. mechanism to a comparison buffer instead.  Added amiga_median.c for
  172. calculating best EHB palette and 8-bit -> 6-bit colour xlate table.
  173. Changed EHB C2P routine to handle colour translate table (probably not
  174. entirely efficiently).  These routines are not quite state-of-the-art
  175. (e.g, old merge macro) but they are not bad either.  Linked in 68020-
  176. and Akiko-optimised routines too, but they are not called yet.
  177.  
  178. ------------------------------------------------------------------------
  179. Made a minor optimisation speedup to R_DrawColumn().
  180.  
  181. ========================================================================
  182. v0.0  28 Dec 97
  183. ------------------------------------------------------------------------
  184. Wrote amiga_main.c, amiga_system, amiga_sound.c, amiga_video.c,
  185. amiga_net.c and smakefile to replace i_main.c, i_system, i_sound.c,
  186. i_video.c, i_net.c and Makefile respectively.  The amiga_sound and
  187. amiga_net routines are dummies.
  188.  
  189. ------------------------------------------------------------------------
  190. Amiga is big-endian.  Compiled with DEFINE=__BIG_ENDIAN__.  It looks
  191. like the code hasn't been tested with __BIG_ENDIAN__ for a while.  The
  192. test in m_swap.c for whether swap routines should be included was
  193. around the wrong way.  SwapSHORT() returned an int instead of an
  194. unsigned short.
  195.  
  196. ------------------------------------------------------------------------
  197. Fixed point arithmetic routines in m_fixed.c used (long long) 64-bit
  198. datatype not available in SAS/C.  Replaced with assembly routines in
  199. amiga_fixed.s.  Added check for divide by 0 in FixedDiv() because
  200. Amiga crashes on divide by 0.
  201.  
  202. ------------------------------------------------------------------------
  203. The Unix function alloca() was called from r_data.c, w_wad.c and some
  204. other files.  I replaced with calls to malloc() and added calls to
  205. free() where each routine returns.
  206.  
  207. ------------------------------------------------------------------------
  208. Changed the cache routines in w_wad.c to use the more efficient
  209. fopen(), fread(), fseek(), fclose() instead of open(), read(),
  210. lseek(), close().  Changed handles from (int) to (FILE *) everywhere
  211. including lumpinfo_t structure in w_wad.h.  Fixed the filelength()
  212. function to align stat structure on 4-byte boundary.  Used SAS/C
  213. fileno() function to get file number from (FILE *).
  214.  
  215. ------------------------------------------------------------------------
  216. In d_main.c, changed the handling of slashes and double-dots in
  217. filenames to Amiga conventions.
  218.  
  219. ------------------------------------------------------------------------
  220. Moved definition of RANGECHECK from doomdef.h to smakefile.  Disabled
  221. SNDSERV and SNDINTR in doomdef.h.
  222.  
  223. ------------------------------------------------------------------------
  224. SAS/C 6.58 appeared to generate bad code for the line:
  225.  
  226.     offsetangle = abs(rw_normalangle-rw_angle1);
  227.  
  228. in r_segs.c, resulting in corrupted graphics.  This took me hours to
  229. track down.  Putting printf() instructions before and after, the code
  230. calulated abs(1073741824-1927746431)=1073741824 instead of the correct
  231. answer of 854004607.  As far as I could see, it was using the stdlib.h
  232. definition of abs(), which looks fine.  As a workaround, I changed
  233. abs() to iabs() (SAS/C function) throughout in all sources.
  234.  
  235. On 5 Jan 98, Michael van Elst <mlelstv@serpens.swb.de> offered the
  236. following explanation:
  237.  
  238. >It doesn't. It is an artefact of ANSI C. rw_normalangle is defined
  239. >as unsigned, rw_angle1 is defined as int. The result of the difference
  240. >is therefore unsigned. You need something like:
  241. >
  242. >    offsetangle = abs((int)rw_normalangle - (int)rw_angle1);
  243. >or  offsetangle = abs((long)rw_normalangle - (long)rw_angle1);
  244. >
  245. >and make sure that rw_normalangle fits into the positive int or
  246. >long values.
  247. >[...]
  248. >gcc probably doesn't use the macro but an abs(int) function. You
  249. >get the same with SAS/C if you #undef abs.
  250.  
  251. ------------------------------------------------------------------------
  252. Got READ enforcer hits in p_enemy.c at the line:
  253.  
  254.         ld = spechit[numspechit];
  255.  
  256. Crashed badly shortly afterwards if Enforcer was not running.  As far
  257. as I can tell, the variable numspechit should be in the range 0..7.
  258. Somehow numspechit gets the value 149551680 (0x8e9fa40).  Without
  259. really knowing what I was doing, I attempted to fix the problem by
  260. changing the line:
  261.  
  262.     if (ld->special)
  263.  
  264. in p_map.c to:
  265.  
  266.     if (ld->special && numspechit < MAXSPECIALCROSS)
  267.  
  268. So far it seems to work.
  269.  
  270. ------------------------------------------------------------------------
  271. Disassembled R_DrawColumn() and R_DrawSpan() with OMD, created
  272. amiga_draw.s and hand-optimised a bit.
  273.  
  274. ------------------------------------------------------------------------
  275. Program still often crashes on exit   :(
  276.  
  277. ------------------------------------------------------------------------
  278.