2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
7 #include "battclock_intern.h"
9 #include <utility/date.h>
10 #include <proto/utility.h>
12 #include <proto/battclock.h>
14 /* See rom/battclock/writebattclock.c for documentation */
16 AROS_LH1(void, WriteBattClock
,
17 AROS_LHA(ULONG
, time
, D0
),
18 struct BattClockBase
*, BattClockBase
, 3, Battclock
)
22 volatile UBYTE
*p
= BattClockBase
->clockptr
;
23 struct UtilityBase
*UtilityBase
= BattClockBase
->UtilityBase
;
29 Amiga2Date(time
, &cd
);
30 stopclock(BattClockBase
);
32 putbcd(p
, reg
, cd
.sec
);
33 putbcd(p
, reg
+ 2, cd
.min
);
34 putbcd(p
, reg
+ 4, cd
.hour
);
35 if (BattClockBase
->clocktype
== MSM6242B
)
39 putbcd(p
, reg
, cd
.mday
);
40 putbcd(p
, reg
+ 2, cd
.month
);
41 putbcd(p
, reg
+ 4, cd
.year
- 1900);
42 startclock(BattClockBase
);
46 } /* WriteBattClock */