Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. ; ======================================================================================================================================
  2. ; 68000 Macros
  3. ; ======================================================================================================================================
  4. ; --------------------------------------------------------------------------------------------------------------------------------------
  5. ; Generate a string for the header
  6. ; --------------------------------------------------------------------------------------------------------------------------------------
  7. GEN_HEADER_STRING macro string, limit
  8. ; Get the string
  9. var_string equs \string
  10.  
  11. ; Chop off any data that goes past the limit
  12. if strlen(\string)>\limit ; Is the the string is too long?
  13. var_string substr 1, \limit, \string ; If so, chop off the data that goes past the limit
  14. endif
  15.  
  16. ; Print the string and fill in remaining space
  17. dc.b "\var_string" ; Print the string
  18. if \limit-strlen("\var_string")>0 ; Is there space left to fill?
  19. dcb.b \limit-strlen("\var_string"), " " ; If so, fill in the rest of the space with spaces
  20. endif
  21.  
  22. endm
  23. ; --------------------------------------------------------------------------------------------------------------------------------------
  24. ; Generate a number in a string for the header
  25. ; --------------------------------------------------------------------------------------------------------------------------------------
  26. GEN_HEADER_NUMBER macro number, limit
  27. var_number = number
  28. dcb.b limit-strlen("\#var_number"),"0" ; Print the beginning 0s
  29. dc.b "\#var_number" ; Print the actual number
  30. endm
  31. ; --------------------------------------------------------------------------------------------------------------------------------------
  32. ; Generate the copyright date for the header
  33. ; --------------------------------------------------------------------------------------------------------------------------------------
  34. GEN_COPYRIGHT_DATE macro
  35. ; Get the month
  36. var_month substr 1+((_month-1)*3), 3+((_month-1)*3), "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"
  37.  
  38. ; Print the copyright info
  39. dc.b "(C)" ; "(C)"
  40. GEN_HEADER_STRING "\COPYRIGHT_NAME", 4 ; Copyright name
  41. dc.b " \var_month","." ; Month and "."
  42. GEN_HEADER_NUMBER (_year+1900)%10000, 4 ; Year
  43.  
  44. endm
  45. ; --------------------------------------------------------------------------------------------------------------------------------------
  46. ; Generate the game version for the header
  47. ; --------------------------------------------------------------------------------------------------------------------------------------
  48. GEN_GAME_VERSION macro
  49. ; Output the game version
  50. dc.b "GM " ; "GM"
  51. GEN_HEADER_NUMBER _weekday, 2 ; Weekday
  52. GEN_HEADER_NUMBER _day, 2 ; Day
  53. GEN_HEADER_NUMBER _month, 2 ; Month
  54. GEN_HEADER_NUMBER _year%100, 2 ; Year
  55. dc.b "-" ; "-"
  56. GEN_HEADER_NUMBER REVISION_NUMBER%100, 2 ; Revision
  57.  
  58. endm
  59. ; ======================================================================================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement