Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ======================================================================================================================================
- ; 68000 Macros
- ; ======================================================================================================================================
- ; --------------------------------------------------------------------------------------------------------------------------------------
- ; Generate a string for the header
- ; --------------------------------------------------------------------------------------------------------------------------------------
- GEN_HEADER_STRING macro string, limit
- ; Get the string
- var_string equs \string
- ; Chop off any data that goes past the limit
- if strlen(\string)>\limit ; Is the the string is too long?
- var_string substr 1, \limit, \string ; If so, chop off the data that goes past the limit
- endif
- ; Print the string and fill in remaining space
- dc.b "\var_string" ; Print the string
- if \limit-strlen("\var_string")>0 ; Is there space left to fill?
- dcb.b \limit-strlen("\var_string"), " " ; If so, fill in the rest of the space with spaces
- endif
- endm
- ; --------------------------------------------------------------------------------------------------------------------------------------
- ; Generate a number in a string for the header
- ; --------------------------------------------------------------------------------------------------------------------------------------
- GEN_HEADER_NUMBER macro number, limit
- var_number = number
- dcb.b limit-strlen("\#var_number"),"0" ; Print the beginning 0s
- dc.b "\#var_number" ; Print the actual number
- endm
- ; --------------------------------------------------------------------------------------------------------------------------------------
- ; Generate the copyright date for the header
- ; --------------------------------------------------------------------------------------------------------------------------------------
- GEN_COPYRIGHT_DATE macro
- ; Get the month
- var_month substr 1+((_month-1)*3), 3+((_month-1)*3), "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"
- ; Print the copyright info
- dc.b "(C)" ; "(C)"
- GEN_HEADER_STRING "\COPYRIGHT_NAME", 4 ; Copyright name
- dc.b " \var_month","." ; Month and "."
- GEN_HEADER_NUMBER (_year+1900)%10000, 4 ; Year
- endm
- ; --------------------------------------------------------------------------------------------------------------------------------------
- ; Generate the game version for the header
- ; --------------------------------------------------------------------------------------------------------------------------------------
- GEN_GAME_VERSION macro
- ; Output the game version
- dc.b "GM " ; "GM"
- GEN_HEADER_NUMBER _weekday, 2 ; Weekday
- GEN_HEADER_NUMBER _day, 2 ; Day
- GEN_HEADER_NUMBER _month, 2 ; Month
- GEN_HEADER_NUMBER _year%100, 2 ; Year
- dc.b "-" ; "-"
- GEN_HEADER_NUMBER REVISION_NUMBER%100, 2 ; Revision
- endm
- ; ======================================================================================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement