home *** CD-ROM | disk | FTP | other *** search
/ Home Edutainment Collection 4: Games & Extensions / Aztech-HomeEdutainmentCollection-Vol4-3DGamesExtensions.iso / dhacked / dehack3.bas < prev    next >
BASIC Source File  |  1994-06-14  |  4KB  |  96 lines

  1. ' DEHACK - Doom Exe HACK
  2. ' by Matt Fell (matt.burnett@acebbs.com)
  3. ' written 3/5/94, last revised 6/13/94
  4. '
  5. ' DEHACK 3 - The FRAME TABLE
  6. '
  7. ' These crude programs extract information from the DOOM.EXE or DOOM.WAD
  8. ' files and store it into a TXT file, suitable for perusing or printing.
  9. ' If you want to print the results, you might have to reformat it. Please
  10. ' don't waste reams of paper. Thanks.
  11. ' All of these only work on the 1.2 registered doom.exe, because I use
  12. ' simple byte offset numbers, not search strings.
  13. '
  14. ' IMPORTANT: If you don't like typing pathnames, modify the next section,
  15. ' un-comment it, and remove or comment-out the input section.
  16.  
  17. ' infile$ = "c:\doom\doom.exe"
  18. ' outfile$ = "c:\-\doom\12\dehack3.txt"
  19.  
  20. CLS
  21. PRINT "Enter the full pathname to your DOOM.EXE file, then the full pathname"
  22. PRINT "to where you want the textfile to be (in an already existing directory)"
  23. PRINT "e.g. 'c:\doom\doom.exe' and 'c:\doom\txt\dehack3.txt'"
  24. PRINT "Note: modify the program with built-in pathnames, and skip this!"
  25. PRINT
  26. INPUT infile$
  27. INPUT outfile$
  28.  
  29. OPEN infile$ FOR BINARY AS 1
  30. OPEN outfile$ FOR OUTPUT AS 2
  31.  
  32. PRINT #2, "The 'Frame Table' contained in DOOM.EXE version 1.2 2-17-94"
  33. PRINT #2, "List-making program was written by Matt Fell (matt.burnett@acebbs.com)"
  34. PRINT #2, "=========================================================================="
  35. PRINT #2, "Note that the first column/index # is not actually in the table, all the"
  36. PRINT #2, "records have a constant length (28 bytes), so they are found by a"
  37. PRINT #2, "calculation, not a bunch of pointers."
  38. PRINT #2, "The columns are: (4 and 5 are 2-byte integers, the others are 4-byte)"
  39. PRINT #2, "  0. Frame number (used in THING TABLE)"
  40. PRINT #2, "  1. Sprite number. 0 is TROO (imp), ..., 104 is SMRT (small red torch)"
  41. PRINT #2, "  2. Sprite sub-type number. An example sequence is SMRT, it goes from"
  42. PRINT #2, "     frame 508, which is '104:0', to frame 511, which is '104:3'. 0"
  43. PRINT #2, "     corresponds to 'A' in the fifth spot in a sprite's entryname in"  
  44. PRINT #2, "     DOOM.WAD, likewise 1 is B, 2 is C, etc. So 104:3 is 'SMRTD0'"  
  45. PRINT #2, "     Also, if bit 15 is set (I indicate this with a * symbol), then it"
  46. PRINT #2, "     means the frame is drawn using colormap 0, i.e. it ignores the"
  47. PRINT #2, "     light levels, for that glow-in-the-dark effect"
  48. PRINT #2, "  3. Duration, how long this frame stays until displaying the next one."
  49. PRINT #2, "     -1 means forever."
  50. PRINT #2, "  4. ?"
  51. PRINT #2, "  5. ?"
  52. PRINT #2, "  6. Next frame # for continuing animation sequences. Note that many"
  53. PRINT #2, "     return to their first frame, creating endless loops. I think that"
  54. PRINT #2, "     a next frame of 0 means 'no next frame', not frame # 0."
  55. PRINT #2, "  7. always 0"
  56. PRINT #2, "  8. always 0"
  57. PRINT #2, ""
  58. PRINT #2, "Yes, the terminology is sloppy. Too many possible meanings for 'frame'."
  59. PRINT #2, "I welcome any suggestions for improvement."
  60. PRINT #2, "=========================================================================="
  61.  
  62. pointer& = 555945               ' this is for 1.2 doom
  63.  
  64. FOR i& = 0 TO 511
  65. PRINT #2, USING "####"; i&;
  66. PRINT #2, " ";
  67. FOR j% = 0 TO 24 STEP 4
  68.         GET #1, pointer& + i& * 28 + j%, num&
  69.                
  70.         SELECT CASE j%
  71.         CASE 4
  72.                 IF (num& > 32767) AND (num& < 65536) THEN
  73.                         num& = (num& - 32768)
  74.                         sep$ = "*"
  75.                 ELSE
  76.                         sep$ = " "
  77.                 END IF
  78.                 PRINT #2, USING "####"; num&;
  79.                 PRINT #2, sep$;
  80.         CASE 12
  81.                 PRINT #2, USING "####"; (num& AND 255);
  82.                 PRINT #2, " ";
  83.                 PRINT #2, USING "####"; INT(num& / 256);
  84.                 PRINT #2, " ";
  85.         CASE ELSE
  86.                 PRINT #2, USING "####"; num&;
  87.                 PRINT #2, " ";
  88.         END SELECT
  89.                
  90. NEXT j%
  91. PRINT #2, " "
  92. NEXT i&
  93.  
  94. END
  95.  
  96.