2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
8 #include "battclock_intern.h"
10 static int rtas_call(const char *method
, int nargs
, int nret
, void *output
, ...);
12 #include <proto/battclock.h>
13 #include <proto/utility.h>
14 #include <proto/rtas.h>
15 #include <proto/exec.h>
16 #include <utility/date.h>
19 /* See rom/battclock/writebattclock.c for documentation */
21 AROS_LH1(void, WriteBattClock
,
22 AROS_LHA(ULONG
, time
, D0
),
23 APTR
*, BattClockBase
, 3, Battclock
)
27 struct ClockData date
;
30 Amiga2Date(time
, &date
);
32 rtas_call("set-time-of-day", 7, 1, NULL
, (ULONG
)date
.year
, (ULONG
)date
.month
, (ULONG
)date
.mday
, (ULONG
)date
.hour
, (ULONG
)date
.min
, (ULONG
)date
.sec
, 0);
35 } /* WriteBattClock */
37 static int rtas_call(const char *method
, int nargs
, int nret
, void *output
, ...)
40 void *RTASBase
= OpenResource("rtas.resource");
43 va_start(args
, output
);
44 retval
= RTASCall(method
, nargs
, nret
, output
, args
);