Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ======================================================================================================================================
- ; 68000 Macros
- ; ======================================================================================================================================
- ; --------------------------------------------------------------------------------------------------------------------------------------
- ; Generate a string for the header
- ; --------------------------------------------------------------------------------------------------------------------------------------
- header_str_no = 0
- GEN_HEADER_STRING macro
- .string_\#header_str_no\:
- .string equs \1
- ; Cap the string if needed
- if strlen("\.string")>\2 ; Check if the string is too long
- .string2 substr 1, \2, "\.string" ; Only get the first $10 bytes of the name
- else ; If it's not too long
- .string2 equs "\.string" ; Don't do anything to it
- endif
- ; Print the string and fill in remaining space
- dc.b "\.string2" ; Print the string
- leftover = \2-strlen("\.string2") ; Check if there is space to fill
- if leftover>0 ; ''
- while leftover>0 ; If so, fill the rest with spaces
- dc.b " " ; ''
- leftover = leftover-1 ; ''
- endw ; ''
- endif ; ''
- ; Increment header string counter
- header_str_no = header_str_no+1
- endm
- ; --------------------------------------------------------------------------------------------------------------------------------------
- ; Generate the copyright date for the header
- ; --------------------------------------------------------------------------------------------------------------------------------------
- header_date_no = 0
- GEN_COPYRIGHT_DATE macro
- .copyright_\#header_date_no\:
- ; Get the month
- if _month=1 ; January
- .var_month equs "JAN" ; ''
- elseif _month=2 ; February
- .var_month equs "FEB" ; ''
- elseif _month=3 ; March
- .var_month equs "MAR" ; ''
- elseif _month=4 ; April
- .var_month equs "APR" ; ''
- elseif _month=5 ; May
- .var_month equs "MAY" ; ''
- elseif _month=6 ; June
- .var_month equs "JUN" ; ''
- elseif _month=7 ; July
- .var_month equs "JUL" ; ''
- elseif _month=8 ; August
- .var_month equs "AUG" ; ''
- elseif _month=9 ; Spetember
- .var_month equs "SEP" ; ''
- elseif _month=10 ; October
- .var_month equs "OCT" ; ''
- elseif _month=11 ; November
- .var_month equs "NOV" ; ''
- elseif _month=12 ; December
- .var_month equs "DEC" ; ''
- endif
- ; Get the year
- .var_year = _year+1900 ; Get the actual year
- while .var_year>9999 ; But keep the year within 0-9999 (if it goes past 9999, wrap back to 0)
- .var_year = .var_year-10000 ; ''
- endw ; ''
- if .var_year<10 ; If the year < 10
- .var_year2 equs "000\#.var_year" ; Add 3 0s before the year
- elseif .var_year<100 ; If the year < 100
- .var_year2 equs "00\#.var_year" ; Add 2 0s before the year
- elseif .var_year<1000 ; If the year < 1000
- .var_year2 equs "0\#.var_year" ; Add 1 0 before the year
- else ; Else, add no 0s
- .var_year2 equs "\#.var_year" ; ''
- endif
- ; Print the name
- dc.b "(C)"
- GEN_HEADER_STRING "\COPYRIGHT_NAME", 4
- ; Output the rest of the copyright info
- dc.b " \.var_month",".","\.var_year2"
- ; Increment header copyright counter
- header_date_no = header_date_no+1
- endm
- ; --------------------------------------------------------------------------------------------------------------------------------------
- ; Generate the game version for the header
- ; --------------------------------------------------------------------------------------------------------------------------------------
- header_ver_no = 0
- GEN_GAME_VERSION macro
- .version_\#header_ver_no\:
- ; Fix the month
- if _month<10 ; If the month if before October
- .var_vermonth equs "0\#_month" ; Add a 0 before it
- else ; If not, don't add the 0
- .var_vermonth equs "\#_month" ; ''
- endif ; ''
- ; Fix the day
- if _day<10 ; If the day if before the 10th
- .var_verdayequs "0\#_day" ; Add a 0 before it
- else ; If not, don't add the 0
- .var_verday equs "\#_day" ; ''
- endif ; ''
- ; Fix the year
- .var_veryear = _year ; Get the year
- while .var_veryear>99 ; While the year > 99
- .var_veryear = .var_veryear-100 ; Decrement until it's under 100
- endw ; ''
- if .var_veryear<10 ; If the year is less than 10
- .var_veryear2 equs "0\#.var_veryear" ; Add a 0 before it
- else ; If not, don't add the 0
- .var_veryear2 equs "\#.var_veryear" ; ''
- endif
- ; Fix the revision number
- .var_verrev = REVISION_NUMBER ; Get the revision number
- while .var_verrev>99 ; While the revision number > 99
- .var_verrev = .var_verrev-100 ; Decrement until it's under 100
- endw ; ''
- if .var_verrev<10 ; If the revision number is less than 10
- .var_verrev2 equs "0\#.var_verrev" ; Add a 0 before it
- else ; If not, don't add the 0
- .var_verrev2 equs "\#.var_verrev" ; ''
- endif ; ''
- ; Fix the weekday
- .var_verweekday equs "0\#_weekday" ; Get the weekday
- ; Output the game version
- dc.b "GM \.var_verweekday","\.var_verday","\.var_vermonth","\.var_veryear2","-","\.var_verrev2"
- ; Increment header version counter
- header_ver_no = header_ver_no+1
- endm
- ; ======================================================================================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement