Properly report dates in the year 2000 and beyond with the __DATE__ macro.

This should now work properly through the end of the year 2155, i.e. the limit of what the ReadTimeHex format can represent.
This commit is contained in:
Stephen Heumann 2016-11-15 00:23:24 -06:00
parent af48935d43
commit 1994e7e353

View File

@ -602,8 +602,20 @@ SetDateTime private
sta time+2 sta time+2
pla set the year pla set the year
xba xba
and #$00FF
ldy #19
yearloop sec
sbc #100
bmi yeardone
iny
bra yearloop
yeardone clc
adc #100
jsr convert jsr convert
sta date+11 sta date+11
tya
jsr convert
sta date+9
lda 1,S set the day lda 1,S set the day
inc A inc A
jsr convert jsr convert
@ -624,7 +636,7 @@ SetDateTime private
rtl rtl
month dc c'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec' month dc c'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'
date dc i'12',c'mmm dd 19yy',i1'0' date dc i'12',c'mmm dd YYyy',i1'0'
time dc i'9',c'hh:mm:ss',i1'0' time dc i'9',c'hh:mm:ss',i1'0'
convert and #$00FF convert and #$00FF