]> git.sur5r.net Git - cc65/commitdiff
New uname function
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 12 Aug 2003 17:24:02 +0000 (17:24 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 12 Aug 2003 17:24:02 +0000 (17:24 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@2286 b7a2c559-68d2-44c3-8de9-860c34a00d81

28 files changed:
libsrc/apple2/Makefile
libsrc/apple2/sysuname.s [new file with mode: 0644]
libsrc/atari/Makefile
libsrc/atari/sysuname.s [new file with mode: 0644]
libsrc/atmos/Makefile
libsrc/atmos/sysuname.s [new file with mode: 0644]
libsrc/c128/Makefile
libsrc/c128/sysuname.s [new file with mode: 0644]
libsrc/c16/Makefile
libsrc/c16/sysuname.s [new file with mode: 0644]
libsrc/c64/Makefile
libsrc/c64/sysuname.s [new file with mode: 0644]
libsrc/cbm510/Makefile
libsrc/cbm510/sysuname.s [new file with mode: 0644]
libsrc/cbm610/Makefile
libsrc/cbm610/sysuname.s [new file with mode: 0644]
libsrc/common/Makefile
libsrc/common/utscopy.s [new file with mode: 0644]
libsrc/geos/system/Makefile
libsrc/geos/system/sysuname.s [new file with mode: 0644]
libsrc/nes/Makefile
libsrc/nes/sysuname.s [new file with mode: 0644]
libsrc/pet/Makefile
libsrc/pet/sysuname.s [new file with mode: 0644]
libsrc/plus4/Makefile
libsrc/plus4/sysuname.s [new file with mode: 0644]
libsrc/vic20/Makefile
libsrc/vic20/sysuname.s [new file with mode: 0644]

index 51d05f67d6142431737d6302f00a56c163813914..ccbe19f158b623ef59ce68de0a2fd69004e02cf7 100644 (file)
@@ -45,6 +45,7 @@ OBJS= _scrsize.o      \
        read.o          \
        revers.o        \
         systime.o       \
+        sysuname.o      \
        where.o         \
        write.o
 
diff --git a/libsrc/apple2/sysuname.s b/libsrc/apple2/sysuname.s
new file mode 100644 (file)
index 0000000..cd41eac
--- /dev/null
@@ -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         "Apple ]["
+
+
+
index dc95243210b063b7c867d1d01d9866e5ee81f886..1b8647825ba9df9d42f3e00228d883eefcdde7ec 100644 (file)
@@ -30,59 +30,60 @@ ATARIDEFS = -DNUMDRVS=4 -DUCASE_FILENAME=1
 #--------------------------------------------------------------------------
 # Object files
 
-OBJS = _scrsize.o   \
-       break.o      \
-       cclear.o     \
-       cgetc.o      \
-       chline.o     \
-       clock.o      \
-       close.o      \
-       clrscr.o     \
-       color.o      \
-       cputc.o      \
-       crt0.o       \
-       ctype.o      \
-       cvline.o     \
-       dio_cts.o    \
-       dio_stc.o    \
-       diopncls.o   \
-       dioread.o    \
-       diowrite.o   \
-       diowritev.o  \
-       fdtable.o    \
-       getargs.o    \
-       getfd.o      \
-       gotox.o      \
-       gotoy.o      \
-       gotoxy.o     \
-       graphics.o   \
-       graphuse.o   \
-       joy_stddrv.o \
-       kbhit.o      \
-       lseek.o      \
-       mouse.o      \
-       mul40.o      \
-       open.o       \
-       oserrlist.o  \
-       oserror.o    \
-       ostype.o     \
-       randomize.o  \
-       read.o       \
-       readjoy.o    \
-       remove.o     \
-       revers.o     \
-       rs232.o      \
-       rwcommon.o   \
-       savevec.o    \
-       scroll.o     \
-       setcolor.o   \
-       siocall.o    \
-        systime.o    \
-       tvtype.o     \
-       ucase_fn.o   \
-       wherex.o     \
-       wherey.o     \
-       write.o
+OBJS =         _scrsize.o      \
+               break.o         \
+               cclear.o        \
+               cgetc.o         \
+               chline.o        \
+               clock.o         \
+               close.o         \
+               clrscr.o        \
+               color.o         \
+               cputc.o         \
+               crt0.o          \
+               ctype.o         \
+               cvline.o        \
+               dio_cts.o       \
+               dio_stc.o       \
+               diopncls.o      \
+               dioread.o       \
+               diowrite.o      \
+               diowritev.o     \
+               fdtable.o       \
+               getargs.o       \
+               getfd.o         \
+               gotox.o         \
+               gotoy.o         \
+               gotoxy.o        \
+               graphics.o      \
+               graphuse.o      \
+               joy_stddrv.o    \
+               kbhit.o         \
+               lseek.o         \
+               mouse.o         \
+               mul40.o         \
+               open.o          \
+               oserrlist.o     \
+               oserror.o       \
+               ostype.o        \
+               randomize.o     \
+               read.o          \
+               readjoy.o       \
+               remove.o        \
+               revers.o        \
+               rs232.o         \
+               rwcommon.o      \
+               savevec.o       \
+               scroll.o        \
+               setcolor.o      \
+               siocall.o       \
+        systime.o       \
+               tvtype.o        \
+        sysuname.o      \
+               ucase_fn.o      \
+               wherex.o        \
+               wherey.o        \
+               write.o
 
 
 #--------------------------------------------------------------------------
diff --git a/libsrc/atari/sysuname.s b/libsrc/atari/sysuname.s
new file mode 100644 (file)
index 0000000..25a891a
--- /dev/null
@@ -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         "Atari"
+
+
+
index 55a57c860f7f1c83b95d8c2c1f116915fa472c76..7dbd82e93f7c2639c3acb39bc8ebaf69f3762551 100644 (file)
@@ -38,6 +38,7 @@ S_OBJS  =       _scrsize.o      \
                 mainargs.o      \
                 revers.o        \
                 systime.o       \
+                sysuname.o      \
                 wherex.o        \
                 wherey.o        \
                 write.o
diff --git a/libsrc/atmos/sysuname.s b/libsrc/atmos/sysuname.s
new file mode 100644 (file)
index 0000000..85fba97
--- /dev/null
@@ -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         "Oric Atmos"
+
+
+
index ee074146943888386c0110c28fc59aa7693e92af..a9cdeb4cd64fb33a9d21361785ef8bdfd216fe01 100644 (file)
@@ -46,6 +46,7 @@ OBJS =        _scrsize.o              \
         revers.o               \
        rs232.o                 \
        slow.o                  \
+        sysuname.o              \
        tgi_mode_table.o        \
        toggle_videomode.o
 
diff --git a/libsrc/c128/sysuname.s b/libsrc/c128/sysuname.s
new file mode 100644 (file)
index 0000000..55fe5ba
--- /dev/null
@@ -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         "Commodore 128"
+
+
+
index 45645c96d466a2ef23bd7a41c3be5f32d435c237..06e5182331ad08967e668e574c6e60a1d8dd6597 100644 (file)
@@ -40,7 +40,8 @@ OBJS =        _scrsize.o      \
         kernal.o        \
         mainargs.o      \
         randomize.o     \
-        revers.o
+        revers.o        \
+        sysuname.o
 
 #--------------------------------------------------------------------------
 # Drivers
diff --git a/libsrc/c16/sysuname.s b/libsrc/c16/sysuname.s
new file mode 100644 (file)
index 0000000..c44ab6a
--- /dev/null
@@ -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         "Commodore 16"
+
+
+
index 5e8d1bcfe716e1cfbfe24d62b3eb2bf247df1976..5d8eeea5f3adb6ec3b79aed95d8f7df995148c26 100644 (file)
@@ -44,6 +44,7 @@ OBJS =        _scrsize.o              \
         randomize.o             \
         revers.o                \
                rs232.o                 \
+        sysuname.o              \
         tgi_mode_table.o
 
 #--------------------------------------------------------------------------
diff --git a/libsrc/c64/sysuname.s b/libsrc/c64/sysuname.s
new file mode 100644 (file)
index 0000000..15546bf
--- /dev/null
@@ -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         "Commodore 64"
+
+
+         
index 4609aeb6a509b9bb151dd21c3553ae7f69acfd59..1a6b412c3e8420cb2d993a36b124d58b03aa71ee 100644 (file)
@@ -55,6 +55,7 @@ OBJS =        _scrsize.o      \
         randomize.o     \
        revers.o        \
        rs232.o         \
+        sysuname.o      \
        tgi_mode_table.o
 
 #--------------------------------------------------------------------------
diff --git a/libsrc/cbm510/sysuname.s b/libsrc/cbm510/sysuname.s
new file mode 100644 (file)
index 0000000..24d4dc0
--- /dev/null
@@ -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         "Commodore 510"
+
+
+
index 6856f764ad55ea8dc55c22e9668407ab46c89b83..cc810d19c67f5ddc3d252b3bd6737ba065572644 100644 (file)
@@ -42,7 +42,8 @@ OBJS =        _scrsize.o      \
        pokesys.o       \
         randomize.o     \
        revers.o        \
-       rs232.o
+       rs232.o         \
+        sysuname.o
 
 #--------------------------------------------------------------------------
 # Drivers
diff --git a/libsrc/cbm610/sysuname.s b/libsrc/cbm610/sysuname.s
new file mode 100644 (file)
index 0000000..984cb93
--- /dev/null
@@ -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         "Commodore 610"
+
+
+
index f4cee0cc1566a88be0bf44c53c7448d9d67b1d29..f316b40277cdf135dc49ea973a53ea673a0ddd34 100644 (file)
@@ -146,6 +146,7 @@ S_OBJS =    _cwd.o          \
                toupper.o       \
                 uname.o         \
                 unlink.o        \
+                utscopy.o       \
                vfprintf.o      \
                vprintf.o       \
                vsprintf.o      \
diff --git a/libsrc/common/utscopy.s b/libsrc/common/utscopy.s
new file mode 100644 (file)
index 0000000..adf8a00
--- /dev/null
@@ -0,0 +1,67 @@
+;
+; Ullrich von Bassewitz, 2003-08-12
+;
+; This module contains a utility function for the machine dependent parts
+; of uname (__sysuname): It copies a packed struct utsname (just the strings
+; without padding) into a struct utsname. The source of the data is an
+; external symbol named "utsdata", the target is passed in a/x.
+; The function is written so that it is a direct replacement for __sysuname
+; for systems where utsdata is fixed. It may also be called via jump or
+; subroutine on systems where utsdata must be changed at runtime.
+;
+
+        .export         utscopy
+
+        .import         utsdata
+        .importzp       ptr1, tmp1
+
+        .include        "utsname.inc"
+
+
+
+;--------------------------------------------------------------------------
+; Data.
+
+.rodata
+
+; Table with offsets into struct utsname
+fieldoffs:
+        .byte   utsname_sysname
+        .byte   utsname_nodename
+        .byte   utsname_release
+        .byte   utsname_version
+        .byte   utsname_machine
+
+;--------------------------------------------------------------------------
+
+.code
+
+.proc   utscopy
+
+        sta     ptr1
+        stx     ptr1+1          ; Save buf
+
+        ldx     #0
+        stx     tmp1            ; Field number
+
+next:   ldy     tmp1
+        cpy     #utsname_fieldcount
+        beq     done
+        inc     tmp1            ; Bump field counter
+        lda     fieldoffs,y     ; Get next field offset
+        tay                     ; Field offset -> y
+
+loop:   lda     utsdata,x
+        sta     (ptr1),y
+        inx                     ; Next char in utsdata
+        cmp     #$00            ; Check for end of string
+        beq     next            ; Jump for next field
+        iny                     ; Next char in utsname struct
+        bne     loop            ; Copy string
+
+done:   lda     #$00            ; Always successful
+        rts
+
+.endproc
+
+
index 6c4fddc5c93c65c35c7d668945bd1523947b5403..e4bbceaf1de6625609159b50a9ad4866bd66c3ec 100644 (file)
@@ -22,7 +22,8 @@ S_OBJS  =       ctype.o                 \
                 mainloop.o              \
                 panic.o                 \
                 tobasic.o               \
-                setdevice.o
+                setdevice.o             \
+                sysuname.o
 
 C_OBJS =       systime.o
 
diff --git a/libsrc/geos/system/sysuname.s b/libsrc/geos/system/sysuname.s
new file mode 100644 (file)
index 0000000..c0cd914
--- /dev/null
@@ -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"
+
+
+
index e5148d51796bbc6625b52d78081f8a5d2dd30988..81a54a1e8d5d319f68687b5e5d282054cdc7314e 100644 (file)
@@ -39,6 +39,7 @@ S_OBJS  =       _scrsize.o      \
                 randomize.o     \
                 revers.o        \
                 setcursor.o     \
+                sysuname.o      \
                 waitvblank.o    \
                 wherex.o        \
                 wherey.o
diff --git a/libsrc/nes/sysuname.s b/libsrc/nes/sysuname.s
new file mode 100644 (file)
index 0000000..2606d1a
--- /dev/null
@@ -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         "NES"
+
+                            
+
index a09bde862baca2ed6e29a4ee64686c6d970aa405..67f52e37e9dc337d57b744d4c9d4d4b33b5b2d5a 100644 (file)
@@ -40,7 +40,8 @@ OBJS =        _scrsize.o      \
         ksetnam.o       \
         mainargs.o      \
         randomize.o    \
-       revers.o
+       revers.o        \
+        sysuname.o
 
 #--------------------------------------------------------------------------
 # Targets
diff --git a/libsrc/pet/sysuname.s b/libsrc/pet/sysuname.s
new file mode 100644 (file)
index 0000000..59174d8
--- /dev/null
@@ -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         "Commodore PET"
+
+
+
index e453c9e4b5a96570609d041ade8a1b9a6dce91a8..21ced76c3465408cc7147bcaf326011b79b90061 100644 (file)
@@ -63,6 +63,7 @@ OBJS =        _scrsize.o      \
         mainargs.o      \
         randomize.o     \
         revers.o        \
+        sysuname.o      \
        tgi_mode_table.o
 
 #--------------------------------------------------------------------------
diff --git a/libsrc/plus4/sysuname.s b/libsrc/plus4/sysuname.s
new file mode 100644 (file)
index 0000000..332daae
--- /dev/null
@@ -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         "Commodore Plus/4"
+
+
+
index 1be2fae722b11ca75530bfb72b619ebe7cd76137..fe6743572bd6bc3423f1c4fe87f55c283004e900 100644 (file)
@@ -40,7 +40,8 @@ OBJS =        _scrsize.o      \
         kplot.o         \
         mainargs.o      \
         randomize.o     \
-       revers.o
+       revers.o        \
+        sysuname.o      
 
 #--------------------------------------------------------------------------
 # Drivers
diff --git a/libsrc/vic20/sysuname.s b/libsrc/vic20/sysuname.s
new file mode 100644 (file)
index 0000000..18d5db9
--- /dev/null
@@ -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         "Commodore VIC20"
+
+
+