%.o: %.s
@$(AS) -o $@ $(AFLAGS) $<
+%.o: %.c
+ @$(CC) $(CFLAGS) $<
+ @$(AS) -g -o $@ $(AFLAGS) $(*).s
S_OBJS = ctype.o \
callroutine.o \
mainloop.o \
panic.o \
tobasic.o \
- setdevice.o \
- systime.o
+ setdevice.o
-all: $(S_OBJS)
+C_OBJS = systime.o
+
+all: $(C_OBJS) $(S_OBJS)
clean:
- @rm -f *.~ $(S_OBJS) core
+ @rm -f *.~ $(C_OBJS:.o=.s) $(C_OBJS) $(S_OBJS) core
--- /dev/null
+
+/*
+ * systime.c
+ *
+ * Maciej 'YTM/Elysium' Witkowiak, 22.11.2002
+ */
+
+#include <time.h>
+#include <geos.h>
+
+time_t _systime(void) {
+
+struct tm currentTime;
+
+ currentTime.tm_sec = system_date.s_seconds;
+ currentTime.tm_min = system_date.s_minutes;
+ currentTime.tm_hour = system_date.s_hour;
+ currentTime.tm_mday = system_date.s_day;
+ currentTime.tm_mon = system_date.s_month;
+ currentTime.tm_year = system_date.s_year;
+ if (system_date.s_year < 87) {
+ currentTime.tm_year+=100;
+ }
+ currentTime.tm_isdst = -1;
+
+ return mktime(¤tTime);
+
+}
+
+++ /dev/null
-;
-; Ullrich von Bassewitz, 12.11.2002
-;
-; time_t _systime (void);
-; /* Similar to time(), but:
-; * - Is not ISO C
-; * - Does not take the additional pointer
-; * - Does not set errno when returning -1
-; */
-;
-
- .export __systime
-
- .importzp sreg
-
-.code
-
-.proc __systime
-
- lda #$FF
- tax
- sta sreg
- sta sreg+1
- rts ; Return -1
-
-.endproc
-
-