Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.46 KB | None | 0 0
  1. ; ======================================================================================================================================
  2. ; 68000 Macros
  3. ; ======================================================================================================================================
  4. ; --------------------------------------------------------------------------------------------------------------------------------------
  5. ; Generate a string for the header
  6. ; --------------------------------------------------------------------------------------------------------------------------------------
  7. header_str_no = 0
  8. GEN_HEADER_STRING macro
  9. .string_\#header_str_no\:
  10. .string equs \1
  11. ; Cap the string if needed
  12. if strlen("\.string")>\2 ; Check if the string is too long
  13. .string2 substr 1, \2, "\.string" ; Only get the first $10 bytes of the name
  14. else ; If it's not too long
  15. .string2 equs "\.string" ; Don't do anything to it
  16. endif
  17.  
  18. ; Print the string and fill in remaining space
  19. dc.b "\.string2" ; Print the string
  20. leftover = \2-strlen("\.string2") ; Check if there is space to fill
  21. if leftover>0 ; ''
  22. while leftover>0 ; If so, fill the rest with spaces
  23. dc.b " " ; ''
  24. leftover = leftover-1 ; ''
  25. endw ; ''
  26. endif ; ''
  27.  
  28. ; Increment header string counter
  29. header_str_no = header_str_no+1
  30.  
  31. endm
  32. ; --------------------------------------------------------------------------------------------------------------------------------------
  33. ; Generate the copyright date for the header
  34. ; --------------------------------------------------------------------------------------------------------------------------------------
  35. header_date_no = 0
  36. GEN_COPYRIGHT_DATE macro
  37. .copyright_\#header_date_no\:
  38. ; Get the month
  39. if _month=1 ; January
  40. .var_month equs "JAN" ; ''
  41. elseif _month=2 ; February
  42. .var_month equs "FEB" ; ''
  43. elseif _month=3 ; March
  44. .var_month equs "MAR" ; ''
  45. elseif _month=4 ; April
  46. .var_month equs "APR" ; ''
  47. elseif _month=5 ; May
  48. .var_month equs "MAY" ; ''
  49. elseif _month=6 ; June
  50. .var_month equs "JUN" ; ''
  51. elseif _month=7 ; July
  52. .var_month equs "JUL" ; ''
  53. elseif _month=8 ; August
  54. .var_month equs "AUG" ; ''
  55. elseif _month=9 ; Spetember
  56. .var_month equs "SEP" ; ''
  57. elseif _month=10 ; October
  58. .var_month equs "OCT" ; ''
  59. elseif _month=11 ; November
  60. .var_month equs "NOV" ; ''
  61. elseif _month=12 ; December
  62. .var_month equs "DEC" ; ''
  63. endif
  64.  
  65. ; Get the year
  66. .var_year = _year+1900 ; Get the actual year
  67. while .var_year>9999 ; But keep the year within 0-9999 (if it goes past 9999, wrap back to 0)
  68. .var_year = .var_year-10000 ; ''
  69. endw ; ''
  70. if .var_year<10 ; If the year < 10
  71. .var_year2 equs "000\#.var_year" ; Add 3 0s before the year
  72. elseif .var_year<100 ; If the year < 100
  73. .var_year2 equs "00\#.var_year" ; Add 2 0s before the year
  74. elseif .var_year<1000 ; If the year < 1000
  75. .var_year2 equs "0\#.var_year" ; Add 1 0 before the year
  76. else ; Else, add no 0s
  77. .var_year2 equs "\#.var_year" ; ''
  78. endif
  79.  
  80. ; Print the name
  81. dc.b "(C)"
  82. GEN_HEADER_STRING "\COPYRIGHT_NAME", 4
  83.  
  84. ; Output the rest of the copyright info
  85. dc.b " \.var_month",".","\.var_year2"
  86.  
  87. ; Increment header copyright counter
  88. header_date_no = header_date_no+1
  89.  
  90. endm
  91. ; --------------------------------------------------------------------------------------------------------------------------------------
  92. ; Generate the game version for the header
  93. ; --------------------------------------------------------------------------------------------------------------------------------------
  94. header_ver_no = 0
  95. GEN_GAME_VERSION macro
  96. .version_\#header_ver_no\:
  97. ; Fix the month
  98. if _month<10 ; If the month if before October
  99. .var_vermonth equs "0\#_month" ; Add a 0 before it
  100. else ; If not, don't add the 0
  101. .var_vermonth equs "\#_month" ; ''
  102. endif ; ''
  103.  
  104. ; Fix the day
  105. if _day<10 ; If the day if before the 10th
  106. .var_verdayequs "0\#_day" ; Add a 0 before it
  107. else ; If not, don't add the 0
  108. .var_verday equs "\#_day" ; ''
  109. endif ; ''
  110.  
  111. ; Fix the year
  112. .var_veryear = _year ; Get the year
  113. while .var_veryear>99 ; While the year > 99
  114. .var_veryear = .var_veryear-100 ; Decrement until it's under 100
  115. endw ; ''
  116. if .var_veryear<10 ; If the year is less than 10
  117. .var_veryear2 equs "0\#.var_veryear" ; Add a 0 before it
  118. else ; If not, don't add the 0
  119. .var_veryear2 equs "\#.var_veryear" ; ''
  120. endif
  121.  
  122. ; Fix the revision number
  123. .var_verrev = REVISION_NUMBER ; Get the revision number
  124. while .var_verrev>99 ; While the revision number > 99
  125. .var_verrev = .var_verrev-100 ; Decrement until it's under 100
  126. endw ; ''
  127. if .var_verrev<10 ; If the revision number is less than 10
  128. .var_verrev2 equs "0\#.var_verrev" ; Add a 0 before it
  129. else ; If not, don't add the 0
  130. .var_verrev2 equs "\#.var_verrev" ; ''
  131. endif ; ''
  132.  
  133. ; Fix the weekday
  134. .var_verweekday equs "0\#_weekday" ; Get the weekday
  135.  
  136. ; Output the game version
  137. dc.b "GM \.var_verweekday","\.var_verday","\.var_vermonth","\.var_veryear2","-","\.var_verrev2"
  138.  
  139. ; Increment header version counter
  140. header_ver_no = header_ver_no+1
  141.  
  142. endm
  143. ; ======================================================================================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement