From: ol.sc Date: Sat, 4 Feb 2012 20:58:15 +0000 (+0000) Subject: Moved the 'system' files from 'geos-cbm' to 'geos-common' which are believed to work... X-Git-Tag: V2.13.3~19 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e6d886750b05ffca290c94b81f3b92fe6bd73286;p=cc65 Moved the 'system' files from 'geos-cbm' to 'geos-common' which are believed to work as-is on Apple GEOS too. git-svn-id: svn://svn.cc65.org/cc65/trunk@5446 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/geos-cbm/system/Makefile b/libsrc/geos-cbm/system/Makefile index e479f7788..a1a4c4371 100644 --- a/libsrc/geos-cbm/system/Makefile +++ b/libsrc/geos-cbm/system/Makefile @@ -5,18 +5,8 @@ #-------------------------------------------------------------------------- # Object files -C_OBJS += systime.o - S_OBJS += ctype.o \ - callroutine.o \ - enterdesktop.o \ - firstinit.o \ get_ostype.o \ - getrandom.o \ - getserialnumber.o \ initdoneio.o \ - mainloop.o \ - panic.o \ tobasic.o \ - setdevice.o \ - sysuname.o + setdevice.o \ No newline at end of file diff --git a/libsrc/geos-cbm/system/callroutine.s b/libsrc/geos-cbm/system/callroutine.s deleted file mode 100644 index db160b25e..000000000 --- a/libsrc/geos-cbm/system/callroutine.s +++ /dev/null @@ -1,13 +0,0 @@ - -; -; Maciej 'YTM/Alliance' Witkowiak -; -; 21.12.99 - -; void CallRoutine (myRoutine); - - .export _CallRoutine - - .include "jumptab.inc" - -_CallRoutine = CallRoutine \ No newline at end of file diff --git a/libsrc/geos-cbm/system/enterdesktop.s b/libsrc/geos-cbm/system/enterdesktop.s deleted file mode 100644 index 00ca175e8..000000000 --- a/libsrc/geos-cbm/system/enterdesktop.s +++ /dev/null @@ -1,15 +0,0 @@ - -; -; Maciej 'YTM/Elysium' Witkowiak -; -; 30.10.99, 17.04.2003 - -; void EnterDeskTop (void); - - .import _exit - .export _EnterDeskTop - -_EnterDeskTop: - lda #0 - tax - jmp _exit diff --git a/libsrc/geos-cbm/system/firstinit.s b/libsrc/geos-cbm/system/firstinit.s deleted file mode 100644 index ef1008d45..000000000 --- a/libsrc/geos-cbm/system/firstinit.s +++ /dev/null @@ -1,13 +0,0 @@ - -; -; Maciej 'YTM/Alliance' Witkowiak -; -; 30.10.99 - -; void FirstInit (void); - - .export _FirstInit - - .include "jumptab.inc" - -_FirstInit = FirstInit \ No newline at end of file diff --git a/libsrc/geos-cbm/system/getrandom.s b/libsrc/geos-cbm/system/getrandom.s deleted file mode 100644 index 35e3f82de..000000000 --- a/libsrc/geos-cbm/system/getrandom.s +++ /dev/null @@ -1,16 +0,0 @@ - -; -; Maciej 'YTM/Elysium' Witkowiak -; -; 30.10.1999, 2.1.2003 - -; char GetRandom (void); - - .export _GetRandom - - .include "jumptab.inc" - -_GetRandom: - jsr GetRandom - ldx #0 - rts diff --git a/libsrc/geos-cbm/system/getserialnumber.s b/libsrc/geos-cbm/system/getserialnumber.s deleted file mode 100644 index 1838da63d..000000000 --- a/libsrc/geos-cbm/system/getserialnumber.s +++ /dev/null @@ -1,19 +0,0 @@ - -; -; Maciej 'YTM/Alliance' Witkowiak -; -; 30.10.99 - -; int GetSerialNumber (void); - - .export _GetSerialNumber - - .include "jumptab.inc" - .include "geossym.inc" - -_GetSerialNumber: - - jsr GetSerialNumber - lda r0L - ldx r0H - rts diff --git a/libsrc/geos-cbm/system/mainloop.s b/libsrc/geos-cbm/system/mainloop.s deleted file mode 100644 index 81873fe88..000000000 --- a/libsrc/geos-cbm/system/mainloop.s +++ /dev/null @@ -1,13 +0,0 @@ - -; -; Maciej 'YTM/Elysium' Witkowiak -; -; 30.10.1999, 10.01.2003 - -; void MainLoop (void); - - .export _MainLoop - - .include "jumptab.inc" - -_MainLoop = MainLoop diff --git a/libsrc/geos-cbm/system/panic.s b/libsrc/geos-cbm/system/panic.s deleted file mode 100644 index 2be7eedd9..000000000 --- a/libsrc/geos-cbm/system/panic.s +++ /dev/null @@ -1,13 +0,0 @@ - -; -; Maciej 'YTM/Alliance' Witkowiak -; -; 30.10.99 - -; void Panic (void); - - .export _Panic - - .include "jumptab.inc" - -_Panic = Panic \ No newline at end of file diff --git a/libsrc/geos-cbm/system/systime.c b/libsrc/geos-cbm/system/systime.c deleted file mode 100644 index b3d4ab11f..000000000 --- a/libsrc/geos-cbm/system/systime.c +++ /dev/null @@ -1,34 +0,0 @@ - -/* - * systime.c - * - * Maciej 'YTM/Elysium' Witkowiak, 22.11.2002 - */ - -#include -#include - -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); - -} - -clock_t clock(void) { - - return _systime(); - -} diff --git a/libsrc/geos-cbm/system/sysuname.s b/libsrc/geos-cbm/system/sysuname.s deleted file mode 100644 index c0cd91410..000000000 --- a/libsrc/geos-cbm/system/sysuname.s +++ /dev/null @@ -1,39 +0,0 @@ -; -; Ullrich von Bassewitz, 2003-08-12 -; -; unsigned char __fastcall__ _sysuname (struct utsname* buf); -; - - .export __sysuname, utsdata - - .import utscopy - - __sysuname = utscopy - -;-------------------------------------------------------------------------- -; Data. We define a fixed utsname struct here and just copy it. - -.rodata - -utsdata: - ; sysname - .asciiz "cc65" - - ; nodename - .asciiz "" - - ; release - .byte ((.VERSION >> 8) & $0F) + '0' - .byte '.' - .byte ((.VERSION >> 4) & $0F) + '0' - .byte $00 - - ; version - .byte (.VERSION & $0F) + '0' - .byte $00 - - ; machine - .asciiz "GEOS" - - - diff --git a/libsrc/geos-common/Makefile b/libsrc/geos-common/Makefile index 7bdc9a4bf..253cf6edf 100644 --- a/libsrc/geos-common/Makefile +++ b/libsrc/geos-common/Makefile @@ -36,7 +36,8 @@ DIRS = dlgbox \ menuicon \ mousesprite \ process \ - runtime + runtime \ + system #-------------------------------------------------------------------------- # Directives diff --git a/libsrc/geos-common/system/Makefile b/libsrc/geos-common/system/Makefile new file mode 100644 index 000000000..9de6c6ecb --- /dev/null +++ b/libsrc/geos-common/system/Makefile @@ -0,0 +1,17 @@ +# +# makefile for CC65 runtime library +# + +#-------------------------------------------------------------------------- +# Object files + +C_OBJS += systime.o + +S_OBJS += callroutine.o \ + enterdesktop.o \ + firstinit.o \ + getrandom.o \ + getserialnumber.o \ + mainloop.o \ + panic.o \ + sysuname.o diff --git a/libsrc/geos-common/system/callroutine.s b/libsrc/geos-common/system/callroutine.s new file mode 100644 index 000000000..db160b25e --- /dev/null +++ b/libsrc/geos-common/system/callroutine.s @@ -0,0 +1,13 @@ + +; +; Maciej 'YTM/Alliance' Witkowiak +; +; 21.12.99 + +; void CallRoutine (myRoutine); + + .export _CallRoutine + + .include "jumptab.inc" + +_CallRoutine = CallRoutine \ No newline at end of file diff --git a/libsrc/geos-common/system/enterdesktop.s b/libsrc/geos-common/system/enterdesktop.s new file mode 100644 index 000000000..00ca175e8 --- /dev/null +++ b/libsrc/geos-common/system/enterdesktop.s @@ -0,0 +1,15 @@ + +; +; Maciej 'YTM/Elysium' Witkowiak +; +; 30.10.99, 17.04.2003 + +; void EnterDeskTop (void); + + .import _exit + .export _EnterDeskTop + +_EnterDeskTop: + lda #0 + tax + jmp _exit diff --git a/libsrc/geos-common/system/firstinit.s b/libsrc/geos-common/system/firstinit.s new file mode 100644 index 000000000..ef1008d45 --- /dev/null +++ b/libsrc/geos-common/system/firstinit.s @@ -0,0 +1,13 @@ + +; +; Maciej 'YTM/Alliance' Witkowiak +; +; 30.10.99 + +; void FirstInit (void); + + .export _FirstInit + + .include "jumptab.inc" + +_FirstInit = FirstInit \ No newline at end of file diff --git a/libsrc/geos-common/system/getrandom.s b/libsrc/geos-common/system/getrandom.s new file mode 100644 index 000000000..35e3f82de --- /dev/null +++ b/libsrc/geos-common/system/getrandom.s @@ -0,0 +1,16 @@ + +; +; Maciej 'YTM/Elysium' Witkowiak +; +; 30.10.1999, 2.1.2003 + +; char GetRandom (void); + + .export _GetRandom + + .include "jumptab.inc" + +_GetRandom: + jsr GetRandom + ldx #0 + rts diff --git a/libsrc/geos-common/system/getserialnumber.s b/libsrc/geos-common/system/getserialnumber.s new file mode 100644 index 000000000..1838da63d --- /dev/null +++ b/libsrc/geos-common/system/getserialnumber.s @@ -0,0 +1,19 @@ + +; +; Maciej 'YTM/Alliance' Witkowiak +; +; 30.10.99 + +; int GetSerialNumber (void); + + .export _GetSerialNumber + + .include "jumptab.inc" + .include "geossym.inc" + +_GetSerialNumber: + + jsr GetSerialNumber + lda r0L + ldx r0H + rts diff --git a/libsrc/geos-common/system/mainloop.s b/libsrc/geos-common/system/mainloop.s new file mode 100644 index 000000000..81873fe88 --- /dev/null +++ b/libsrc/geos-common/system/mainloop.s @@ -0,0 +1,13 @@ + +; +; Maciej 'YTM/Elysium' Witkowiak +; +; 30.10.1999, 10.01.2003 + +; void MainLoop (void); + + .export _MainLoop + + .include "jumptab.inc" + +_MainLoop = MainLoop diff --git a/libsrc/geos-common/system/panic.s b/libsrc/geos-common/system/panic.s new file mode 100644 index 000000000..2be7eedd9 --- /dev/null +++ b/libsrc/geos-common/system/panic.s @@ -0,0 +1,13 @@ + +; +; Maciej 'YTM/Alliance' Witkowiak +; +; 30.10.99 + +; void Panic (void); + + .export _Panic + + .include "jumptab.inc" + +_Panic = Panic \ No newline at end of file diff --git a/libsrc/geos-common/system/systime.c b/libsrc/geos-common/system/systime.c new file mode 100644 index 000000000..b3d4ab11f --- /dev/null +++ b/libsrc/geos-common/system/systime.c @@ -0,0 +1,34 @@ + +/* + * systime.c + * + * Maciej 'YTM/Elysium' Witkowiak, 22.11.2002 + */ + +#include +#include + +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); + +} + +clock_t clock(void) { + + return _systime(); + +} diff --git a/libsrc/geos-common/system/sysuname.s b/libsrc/geos-common/system/sysuname.s new file mode 100644 index 000000000..c0cd91410 --- /dev/null +++ b/libsrc/geos-common/system/sysuname.s @@ -0,0 +1,39 @@ +; +; Ullrich von Bassewitz, 2003-08-12 +; +; unsigned char __fastcall__ _sysuname (struct utsname* buf); +; + + .export __sysuname, utsdata + + .import utscopy + + __sysuname = utscopy + +;-------------------------------------------------------------------------- +; Data. We define a fixed utsname struct here and just copy it. + +.rodata + +utsdata: + ; sysname + .asciiz "cc65" + + ; nodename + .asciiz "" + + ; release + .byte ((.VERSION >> 8) & $0F) + '0' + .byte '.' + .byte ((.VERSION >> 4) & $0F) + '0' + .byte $00 + + ; version + .byte (.VERSION & $0F) + '0' + .byte $00 + + ; machine + .asciiz "GEOS" + + +