Browse Source

* fixed properties

git-svn-id: trunk@13312 -
florian 16 years ago
parent
commit
c21d5765ac
13 changed files with 1303 additions and 1302 deletions
  1. 13 12
      .gitattributes
  2. 234 234
      rtl/nds/Makefile.fpc
  3. 48 48
      rtl/nds/classes.pp
  4. 263 263
      rtl/nds/dos.pp
  5. 19 19
      rtl/nds/ndsbios.inc
  6. 21 21
      rtl/nds/ndsbiosh.inc
  7. 47 47
      rtl/nds/sysdir.inc
  8. 179 179
      rtl/nds/sysfile.inc
  9. 16 16
      rtl/nds/sysos.inc
  10. 29 29
      rtl/nds/sysosh.inc
  11. 284 284
      rtl/nds/sysutils.pp
  12. 112 112
      rtl/nds/tthread.inc
  13. 38 38
      rtl/nds/varutils.pp

+ 13 - 12
.gitattributes

@@ -6019,26 +6019,27 @@ rtl/morphos/varutils.pp svneol=native#text/plain
 rtl/morphos/video.pp svneol=native#text/plain
 rtl/morphos/video.pp svneol=native#text/plain
 rtl/morphos/videodata.inc svneol=native#text/plain
 rtl/morphos/videodata.inc svneol=native#text/plain
 rtl/nds/Makefile svneol=native#text/plain
 rtl/nds/Makefile svneol=native#text/plain
-rtl/nds/Makefile.fpc -text
-rtl/nds/classes.pp -text
+rtl/nds/Makefile.fpc svneol=native#text/plain
+rtl/nds/classes.pp svneol=native#text/plain
 rtl/nds/cprt07.as svneol=native#text/plain
 rtl/nds/cprt07.as svneol=native#text/plain
 rtl/nds/cprt09.as svneol=native#text/plain
 rtl/nds/cprt09.as svneol=native#text/plain
-rtl/nds/dos.pp -text
+rtl/nds/dos.pp svneol=native#text/plain
 rtl/nds/nds.inc svneol=native#text/plain
 rtl/nds/nds.inc svneol=native#text/plain
-rtl/nds/ndsbios.inc -text
-rtl/nds/ndsbiosh.inc -text
+rtl/nds/ndsbios.inc svneol=native#text/plain
+rtl/nds/ndsbiosh.inc svneol=native#text/plain
 rtl/nds/ndsh.inc svneol=native#text/plain
 rtl/nds/ndsh.inc svneol=native#text/plain
 rtl/nds/prt07.as svneol=native#text/plain
 rtl/nds/prt07.as svneol=native#text/plain
 rtl/nds/prt09.as svneol=native#text/plain
 rtl/nds/prt09.as svneol=native#text/plain
-rtl/nds/sysdir.inc -text
-rtl/nds/sysfile.inc -text
+rtl/nds/sysdir.inc svneol=native#text/plain
+rtl/nds/sysfile.inc svneol=native#text/plain
 rtl/nds/sysheap.inc svneol=native#text/x-pascal
 rtl/nds/sysheap.inc svneol=native#text/x-pascal
-rtl/nds/sysos.inc -text
-rtl/nds/sysosh.inc -text
+rtl/nds/sysos.inc svneol=native#text/plain
+rtl/nds/sysosh.inc svneol=native#text/plain
+rtl/nds/system.pp svneol=native#text/plain
 rtl/nds/systhrd.inc svneol=native#text/plain
 rtl/nds/systhrd.inc svneol=native#text/plain
-rtl/nds/sysutils.pp -text
-rtl/nds/tthread.inc -text
-rtl/nds/varutils.pp -text
+rtl/nds/sysutils.pp svneol=native#text/plain
+rtl/nds/tthread.inc svneol=native#text/plain
+rtl/nds/varutils.pp svneol=native#text/plain
 rtl/netbsd/Makefile svneol=native#text/plain
 rtl/netbsd/Makefile svneol=native#text/plain
 rtl/netbsd/Makefile.fpc svneol=native#text/plain
 rtl/netbsd/Makefile.fpc svneol=native#text/plain
 rtl/netbsd/errno.inc svneol=native#text/plain
 rtl/netbsd/errno.inc svneol=native#text/plain

+ 234 - 234
rtl/nds/Makefile.fpc

@@ -1,234 +1,234 @@
-#
-#   Makefile.fpc for Free Pascal NDS RTL
-#
-
-[package]
-main=rtl
-
-[target]
-loaders=prt07 prt09 cprt07 cprt09
-units=$(SYSTEMUNIT) objpas macpas strings \
-#      dos \
-      sysutils \
-      classes math typinfo varutils fmtbcd ctypes \
-      charset ucomplex getopts matrix \
-      variants types rtlconsts sysconst dateutil lineinfo fgl \
-#      exec timer doslib utility hardware inputevent graphics layers \
-# these can be moved to packages later
-#      clipboard datatypes asl ahi tinygl get9 muihelper \
-#rsts=math rtlconsts varutils typinfo variants classes sysconst dateutil fpmkunit
-#implicitunits=exeinfo
-
-[require]
-nortl=y
-
-[install]
-fpcpackage=y
-
-[default]
-fpcdir=../..
-target=nds
-cpu=arm
-
-[compiler]
-includedir=$(INC) $(PROCINC)
-sourcedir=$(INC) $(PROCINC) $(COMMON)
-
-
-[prerules]
-RTL=..
-INC=$(RTL)/inc
-COMMON=$(RTL)/common
-PROCINC=$(RTL)/$(CPU_TARGET)
-UNITPREFIX=rtl
-SYSTEMUNIT=system
-
-# Use new feature from 1.0.5 version
-# that generates release PPU files
-# which will not be recompiled
-ifdef RELEASE
-override FPCOPT+=-Ur
-endif
-
-# Paths
-OBJPASDIR=$(RTL)/objpas
-GRAPHDIR=$(INC)/graph
-
-[rules]
-.NOTPARALLEL:
-# Get the system independent include file names.
-# This will set the following variables :
-# SYSINCNAMES
-include $(INC)/makefile.inc
-SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
-
-# Get the processor dependent include file names.
-# This will set the following variables :
-# CPUINCNAMES
-include $(PROCINC)/makefile.cpu
-SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
-
-# Put system unit dependencies together.
-SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
-
-
-#
-# Loaders
-#
-
-prt07$(OEXT) : prt07.as
-        $(AS) $(ASTARGET) -o $(UNITTARGETDIRPREFIX)prt07$(OEXT) prt07.as
-
-prt09$(OEXT) : prt09.as
-        $(AS) $(ASTARGET) -o $(UNITTARGETDIRPREFIX)prt09$(OEXT) prt09.as
-
-cprt07$(OEXT) : cprt07.as
-        $(AS) $(ASTARGET) -o $(UNITTARGETDIRPREFIX)cprt07$(OEXT) cprt07.as
-
-cprt09$(OEXT) : cprt09.as
-        $(AS) $(ASTARGET) -o $(UNITTARGETDIRPREFIX)cprt09$(OEXT) cprt09.as
-
-#
-# Base Units (System, strings, os-dependent-base-unit)
-#
-
-$(SYSTEMUNIT)$(PPUEXT) : $(SYSTEMUNIT).pp $(SYSDEPS) $(INC)/softfpu.pp
-        $(COMPILER) -Us -Sg $(SYSTEMUNIT).pp $(REDIR)
-
-objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
-        $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp $(REDIR)
-
-strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc \
-                   $(PROCINC)/strings.inc $(PROCINC)/stringss.inc \
-                   $(SYSTEMUNIT)$(PPUEXT)
-
-#
-# System Dependent Units
-#
-
-#ports$(PPUEXT) : ports.pas objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
-
-#doscalls$(PPUEXT) : doscalls.pas strings$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
-
-#
-# TP7 Compatible RTL Units
-#
-
-dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
-               $(SYSTEMUNIT)$(PPUEXT)
-
-#crt$(PPUEXT) : crt.pas $(INC)/textrec.inc $(SYSTEMUNIT)$(PPUEXT)
-
-objects$(PPUEXT) : $(INC)/objects.pp dos$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
-
-#printer$(PPUEXT) : printer.pas $(INC)/textrec.inc $(SYSTEMUNIT)$(PPUEXT)
-
-#graph$(PPUEXT) : graph.pp
-
-#
-# Delphi Compatible Units
-#
-
-sysutils$(PPUEXT) : sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
-                    objpas$(PPUEXT) dos$(PPUEXT) sysconst$(PPUEXT)
-        $(COMPILER) -Fi$(OBJPASDIR)/sysutils sysutils.pp
-
-classes$(PPUEXT) : classes.pp $(wildcard $(OBJPASDIR)/classes/*.inc) \
-                   sysutils$(PPUEXT) typinfo$(PPUEXT) rtlconsts$(PPUEXT) types$(PPUEXT) \
-                   fgl$(PPUEXT)
-        $(COMPILER) -Fi$(OBJPASDIR)/classes classes.pp
-
-typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
-        $(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp $(REDIR)
-
-math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
-        $(COMPILER) $(OBJPASDIR)/math.pp $(REDIR)
-
-varutils$(PPUEXT) : $(OBJPASDIR)/cvarutil.inc $(OBJPASDIR)/varutils.inc \
-                    $(OBJPASDIR)/varutilh.inc varutils.pp
-        $(COMPILER) -I$(OBJPASDIR) varutils.pp $(REDIR)
-
-fmtbcd$(PPUEXT) : $(OBJPASDIR)/fmtbcd.pp objpas$(PPUEXT) sysutils$(PPUEXT) variants$(PPUEXT) classes$(PPUEXT) system$(PPUEXT)
-        $(COMPILER) $(OBJPASDIR)/fmtbcd.pp
-        
-types$(PPUEXT) : $(OBJPASDIR/types.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
-        $(COMPILER) $(OBJPASDIR)/types.pp
-
-rtlconsts$(PPUEXT) : $(OBJPASDIR)/rtlconsts.pp
-        $(COMPILER) $(OBJPASDIR)/rtlconsts.pp
-
-sysconst$(PPUEXT) : $(OBJPASDIR)/sysconst.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
-        $(COMPILER) $(OBJPASDIR)/sysconst.pp
-
-fgl$(PPUEXT): $(OBJPASDIR)/fgl.pp objpas$(PPUEXT) types$(PPUEXT) system$(PPUEXT) sysutils$(PPUEXT) 
-        $(COMPILER) -Sg $(OBJPASDIR)/fgl.pp $(REDIR)
-
-dateutil$(PPUEXT) : $(OBJPASDIR)/dateutil.pp
-        $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/dateutil.pp
-
-#
-# Mac Pascal Model
-#
-
-macpas$(PPUEXT) : $(INC)/macpas.pp objpas$(PPUEXT) math$(PPUEXT)
-        $(COMPILER) $(INC)/macpas.pp $(REDIR)
-
-#
-# Other system-independent RTL Units
-#
-
-ucomplex$(PPUEXT): $(INC)/ucomplex.pp math$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
-
-getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMUNIT)$(PPUEXT)
-
-heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
-        $(COMPILER) -Sg $(INC)/heaptrc.pp $(REDIR)
-
-lineinfo$(PPUEXT) : $(INC)/lineinfo.pp $(SYSTEMUNIT)$(PPUEXT)
-#lnfodwrf$(PPUEXT) : $(INC)/lnfodwrf.pp $(SYSTEMUNIT)$(PPUEXT)
-
-charset$(PPUEXT) : $(INC)/charset.pp $(SYSTEMUNIT)$(PPUEXT)
-
-#
-# Other system-dependent RTL Units
-#
-
-exec$(PPUEXT)    : exec.pp execf.inc execd.inc
-
-timer$(PPUEXT)   : timer.pp timerd.inc timerf.inc
-
-utility$(PPUEXT) : utility.pp exec$(PPUEXT) utilf.inc utild1.inc utild2.inc
-
-doslib$(PPUEXT)  : doslib.pp exec$(PPUEXT) timer$(PPUEXT) doslibd.inc doslibf.inc
-
-hardware$(PPUEXT): hardware.pas exec$(PPUEXT)
-
-inputevent$(PPUEXT): inputevent.pas exec$(PPUEXT) timer$(PPUEXT) utility$(PPUEXT)
-
-graphics$(PPUEXT): graphics.pas exec$(PPUEXT) utility$(PPUEXT) hardware$(PPUEXT)
-
-layers$(PPUEXT)  : layers.pas exec$(PPUEXT) graphics$(PPUEXT) utility$(PPUEXT)
-
-intuition$(PPUEXT): intuition.pas exec$(PPUEXT) graphics$(PPUEXT) utility$(PPUEXT) \
-                    inputevent$(PPUEXT) timer$(PPUEXT) layers$(PPUEXT)
-
-aboxlib$(PPUEXT): aboxlib.pas
-
-clipboard$(PPUEXT): clipboard.pas exec$(PPUEXT)
-
-datatype$(PPUEXT): datatypes.pas exec$(PPUEXT) doslib$(PPUEXT) intuition$(PPUEXT) \
-                   utility$(PPUEXT) graphics$(PPUEXT)
-
-asl$(PPUEXT): asl.pas exec$(PPUEXT) graphics$(PPUEXT) utility$(PPUEXT)
-
-ahi$(PPUEXT): ahi.pas exec$(PPUEXT) utility$(PPUEXT)
-
-mui$(PPUEXT): mui.pas exec$(PPUEXT) utility$(PPUEXT) intuition$(PPUEXT) graphics$(PPUEXT)
-
-tinygl$(PPUEXT): tinygl.pp exec$(PPUEXT)
-
-get9$(PPUEXT): get9.pas exec$(PPUEXT)
-
-muihelper$(PPUEXT): muihelper.pas intuition$(PPUEXT) mui$(PPUEXT) doslib$(PPUEXT) utility$(PPUEXT)
-
-ctypes$(PPUEXT) :  $(INC)/ctypes.pp $(SYSTEMUNIT)$(PPUEXT)
+#
+#   Makefile.fpc for Free Pascal NDS RTL
+#
+
+[package]
+main=rtl
+
+[target]
+loaders=prt07 prt09 cprt07 cprt09
+units=$(SYSTEMUNIT) objpas macpas strings \
+#      dos \
+      sysutils \
+      classes math typinfo varutils fmtbcd ctypes \
+      charset ucomplex getopts matrix \
+      variants types rtlconsts sysconst dateutil lineinfo fgl \
+#      exec timer doslib utility hardware inputevent graphics layers \
+# these can be moved to packages later
+#      clipboard datatypes asl ahi tinygl get9 muihelper \
+#rsts=math rtlconsts varutils typinfo variants classes sysconst dateutil fpmkunit
+#implicitunits=exeinfo
+
+[require]
+nortl=y
+
+[install]
+fpcpackage=y
+
+[default]
+fpcdir=../..
+target=nds
+cpu=arm
+
+[compiler]
+includedir=$(INC) $(PROCINC)
+sourcedir=$(INC) $(PROCINC) $(COMMON)
+
+
+[prerules]
+RTL=..
+INC=$(RTL)/inc
+COMMON=$(RTL)/common
+PROCINC=$(RTL)/$(CPU_TARGET)
+UNITPREFIX=rtl
+SYSTEMUNIT=system
+
+# Use new feature from 1.0.5 version
+# that generates release PPU files
+# which will not be recompiled
+ifdef RELEASE
+override FPCOPT+=-Ur
+endif
+
+# Paths
+OBJPASDIR=$(RTL)/objpas
+GRAPHDIR=$(INC)/graph
+
+[rules]
+.NOTPARALLEL:
+# Get the system independent include file names.
+# This will set the following variables :
+# SYSINCNAMES
+include $(INC)/makefile.inc
+SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
+
+# Get the processor dependent include file names.
+# This will set the following variables :
+# CPUINCNAMES
+include $(PROCINC)/makefile.cpu
+SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
+
+# Put system unit dependencies together.
+SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
+
+
+#
+# Loaders
+#
+
+prt07$(OEXT) : prt07.as
+        $(AS) $(ASTARGET) -o $(UNITTARGETDIRPREFIX)prt07$(OEXT) prt07.as
+
+prt09$(OEXT) : prt09.as
+        $(AS) $(ASTARGET) -o $(UNITTARGETDIRPREFIX)prt09$(OEXT) prt09.as
+
+cprt07$(OEXT) : cprt07.as
+        $(AS) $(ASTARGET) -o $(UNITTARGETDIRPREFIX)cprt07$(OEXT) cprt07.as
+
+cprt09$(OEXT) : cprt09.as
+        $(AS) $(ASTARGET) -o $(UNITTARGETDIRPREFIX)cprt09$(OEXT) cprt09.as
+
+#
+# Base Units (System, strings, os-dependent-base-unit)
+#
+
+$(SYSTEMUNIT)$(PPUEXT) : $(SYSTEMUNIT).pp $(SYSDEPS) $(INC)/softfpu.pp
+        $(COMPILER) -Us -Sg $(SYSTEMUNIT).pp $(REDIR)
+
+objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
+        $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp $(REDIR)
+
+strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc \
+                   $(PROCINC)/strings.inc $(PROCINC)/stringss.inc \
+                   $(SYSTEMUNIT)$(PPUEXT)
+
+#
+# System Dependent Units
+#
+
+#ports$(PPUEXT) : ports.pas objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+
+#doscalls$(PPUEXT) : doscalls.pas strings$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+
+#
+# TP7 Compatible RTL Units
+#
+
+dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
+               $(SYSTEMUNIT)$(PPUEXT)
+
+#crt$(PPUEXT) : crt.pas $(INC)/textrec.inc $(SYSTEMUNIT)$(PPUEXT)
+
+objects$(PPUEXT) : $(INC)/objects.pp dos$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+
+#printer$(PPUEXT) : printer.pas $(INC)/textrec.inc $(SYSTEMUNIT)$(PPUEXT)
+
+#graph$(PPUEXT) : graph.pp
+
+#
+# Delphi Compatible Units
+#
+
+sysutils$(PPUEXT) : sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
+                    objpas$(PPUEXT) dos$(PPUEXT) sysconst$(PPUEXT)
+        $(COMPILER) -Fi$(OBJPASDIR)/sysutils sysutils.pp
+
+classes$(PPUEXT) : classes.pp $(wildcard $(OBJPASDIR)/classes/*.inc) \
+                   sysutils$(PPUEXT) typinfo$(PPUEXT) rtlconsts$(PPUEXT) types$(PPUEXT) \
+                   fgl$(PPUEXT)
+        $(COMPILER) -Fi$(OBJPASDIR)/classes classes.pp
+
+typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
+        $(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp $(REDIR)
+
+math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
+        $(COMPILER) $(OBJPASDIR)/math.pp $(REDIR)
+
+varutils$(PPUEXT) : $(OBJPASDIR)/cvarutil.inc $(OBJPASDIR)/varutils.inc \
+                    $(OBJPASDIR)/varutilh.inc varutils.pp
+        $(COMPILER) -I$(OBJPASDIR) varutils.pp $(REDIR)
+
+fmtbcd$(PPUEXT) : $(OBJPASDIR)/fmtbcd.pp objpas$(PPUEXT) sysutils$(PPUEXT) variants$(PPUEXT) classes$(PPUEXT) system$(PPUEXT)
+        $(COMPILER) $(OBJPASDIR)/fmtbcd.pp
+        
+types$(PPUEXT) : $(OBJPASDIR/types.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+        $(COMPILER) $(OBJPASDIR)/types.pp
+
+rtlconsts$(PPUEXT) : $(OBJPASDIR)/rtlconsts.pp
+        $(COMPILER) $(OBJPASDIR)/rtlconsts.pp
+
+sysconst$(PPUEXT) : $(OBJPASDIR)/sysconst.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+        $(COMPILER) $(OBJPASDIR)/sysconst.pp
+
+fgl$(PPUEXT): $(OBJPASDIR)/fgl.pp objpas$(PPUEXT) types$(PPUEXT) system$(PPUEXT) sysutils$(PPUEXT) 
+        $(COMPILER) -Sg $(OBJPASDIR)/fgl.pp $(REDIR)
+
+dateutil$(PPUEXT) : $(OBJPASDIR)/dateutil.pp
+        $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/dateutil.pp
+
+#
+# Mac Pascal Model
+#
+
+macpas$(PPUEXT) : $(INC)/macpas.pp objpas$(PPUEXT) math$(PPUEXT)
+        $(COMPILER) $(INC)/macpas.pp $(REDIR)
+
+#
+# Other system-independent RTL Units
+#
+
+ucomplex$(PPUEXT): $(INC)/ucomplex.pp math$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+
+getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMUNIT)$(PPUEXT)
+
+heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
+        $(COMPILER) -Sg $(INC)/heaptrc.pp $(REDIR)
+
+lineinfo$(PPUEXT) : $(INC)/lineinfo.pp $(SYSTEMUNIT)$(PPUEXT)
+#lnfodwrf$(PPUEXT) : $(INC)/lnfodwrf.pp $(SYSTEMUNIT)$(PPUEXT)
+
+charset$(PPUEXT) : $(INC)/charset.pp $(SYSTEMUNIT)$(PPUEXT)
+
+#
+# Other system-dependent RTL Units
+#
+
+exec$(PPUEXT)    : exec.pp execf.inc execd.inc
+
+timer$(PPUEXT)   : timer.pp timerd.inc timerf.inc
+
+utility$(PPUEXT) : utility.pp exec$(PPUEXT) utilf.inc utild1.inc utild2.inc
+
+doslib$(PPUEXT)  : doslib.pp exec$(PPUEXT) timer$(PPUEXT) doslibd.inc doslibf.inc
+
+hardware$(PPUEXT): hardware.pas exec$(PPUEXT)
+
+inputevent$(PPUEXT): inputevent.pas exec$(PPUEXT) timer$(PPUEXT) utility$(PPUEXT)
+
+graphics$(PPUEXT): graphics.pas exec$(PPUEXT) utility$(PPUEXT) hardware$(PPUEXT)
+
+layers$(PPUEXT)  : layers.pas exec$(PPUEXT) graphics$(PPUEXT) utility$(PPUEXT)
+
+intuition$(PPUEXT): intuition.pas exec$(PPUEXT) graphics$(PPUEXT) utility$(PPUEXT) \
+                    inputevent$(PPUEXT) timer$(PPUEXT) layers$(PPUEXT)
+
+aboxlib$(PPUEXT): aboxlib.pas
+
+clipboard$(PPUEXT): clipboard.pas exec$(PPUEXT)
+
+datatype$(PPUEXT): datatypes.pas exec$(PPUEXT) doslib$(PPUEXT) intuition$(PPUEXT) \
+                   utility$(PPUEXT) graphics$(PPUEXT)
+
+asl$(PPUEXT): asl.pas exec$(PPUEXT) graphics$(PPUEXT) utility$(PPUEXT)
+
+ahi$(PPUEXT): ahi.pas exec$(PPUEXT) utility$(PPUEXT)
+
+mui$(PPUEXT): mui.pas exec$(PPUEXT) utility$(PPUEXT) intuition$(PPUEXT) graphics$(PPUEXT)
+
+tinygl$(PPUEXT): tinygl.pp exec$(PPUEXT)
+
+get9$(PPUEXT): get9.pas exec$(PPUEXT)
+
+muihelper$(PPUEXT): muihelper.pas intuition$(PPUEXT) mui$(PPUEXT) doslib$(PPUEXT) utility$(PPUEXT)
+
+ctypes$(PPUEXT) :  $(INC)/ctypes.pp $(SYSTEMUNIT)$(PPUEXT)

+ 48 - 48
rtl/nds/classes.pp

@@ -1,48 +1,48 @@
-{
-    This file is part of the Free Component Library (FCL)
-    Copyright (c) 1999-2002 by the Free Pascal development team
-
-    Classes unit for Nintendo DS
-    Copyright (c) 2006 by Francesco Lombardi
-    
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- **********************************************************************}
-
-{$mode objfpc}
-
-unit Classes;
-
-interface
-
-uses
-  sysutils,
-  rtlconsts,
-  types,
-{$ifdef FPC_TESTGENERICS}
-  fgl,
-{$endif}
-  typinfo;
-
-{$i classesh.inc}
-
-
-implementation
-
-
-{ OS - independent class implementations are in /inc directory. }
-{$i classes.inc}
-
-
-initialization
-  CommonInit;
-
-finalization
-  CommonCleanup;
-
-end.
+{
+    This file is part of the Free Component Library (FCL)
+    Copyright (c) 1999-2002 by the Free Pascal development team
+
+    Classes unit for Nintendo DS
+    Copyright (c) 2006 by Francesco Lombardi
+    
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{$mode objfpc}
+
+unit Classes;
+
+interface
+
+uses
+  sysutils,
+  rtlconsts,
+  types,
+{$ifdef FPC_TESTGENERICS}
+  fgl,
+{$endif}
+  typinfo;
+
+{$i classesh.inc}
+
+
+implementation
+
+
+{ OS - independent class implementations are in /inc directory. }
+{$i classes.inc}
+
+
+initialization
+  CommonInit;
+
+finalization
+  CommonCleanup;
+
+end.

+ 263 - 263
rtl/nds/dos.pp

@@ -1,263 +1,263 @@
-{
-    This file is part of the Free Pascal run time library.
-    Copyright (c) 2004 by Karoly Balogh for Genesi S.a.r.l.
-
-    Heavily based on the Commodore Amiga/m68k RTL by Nils Sjoholm and
-    Carl Eric Codere
-
-    MorphOS port was done on a free Pegasos II/G4 machine
-    provided by Genesi S.a.r.l. <www.genesi.lu>
-    
-    This unit is based on the MorphOS one and is adapted for Nintendo DS
-    simply by stripping out all stuff inside funcs and procs. 
-    Copyright (c) 2006 by Francesco Lombardi
-    
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- **********************************************************************}
-
-unit Dos;
-
-interface
-
-{$MODE objfpc}
-
-type
-  SearchRec = Packed Record
-	AnchorPtr : Pointer;    { Pointer to the Anchorpath structure }
-	Fill: Array[1..15] of Byte; {future use}
-    {End of replacement for fill}
-    Attr : BYTE;        {attribute of found file}
-    Time : LongInt;     {last modify date of found file}
-    Size : LongInt;     {file size of found file}
-    Name : String[255]; {name of found file}
-  End;
-
-{$I dosh.inc}
-
-implementation
-
-{$I dos.inc}
-
-{******************************************************************************
-                           --- Internal routines ---
-******************************************************************************}
-
-function dosLock(const name: String; accessmode: Longint) : LongInt;
-begin
-  result := -1;
-end;
-
-function IsLeapYear(Source : Word) : Boolean;
-begin
-  result := false;
-end;
-
-function dosSetProtection(const name: string; mask:longint): Boolean;
-begin
-  result := false;
-end;
-
-function dosSetFileDate(name: string): Boolean;
-begin
-  result := false;
-end;
-
-
-{******************************************************************************
-                        --- Info / Date / Time ---
-******************************************************************************}
-
-function DosVersion: Word;
-begin
-  result := 0;
-end;
-
-procedure NewList ();
-begin
-end;
-
-function CreateExtIO (size: Longint): integer;
-begin
-  result := -1;
-end;
-
-procedure DeleteExtIO ();
-begin
-end;
-
-function Createport(name : PChar; pri : longint): integer;
-begin
-  result := -1;
-end;
-
-procedure DeletePort ();
-begin
-end;
-
-
-function Create_Timer(theUnit : longint) : integer;
-begin
-  result := -1;
-end;
-
-Procedure Delete_Timer();
-begin
-end;
-
-function set_new_time(secs, micro : longint): longint;
-begin
-  result := -1;
-end;
-
-function get_sys_time(): longint;
-begin
-  result := -1;
-end;
-
-procedure GetDate(Var Year, Month, MDay, WDay: Word);
-begin
-end;
-
-procedure SetDate(Year, Month, Day: Word);
-begin
-end;
-
-procedure GetTime(Var Hour, Minute, Second, Sec100: Word);
-begin
-end;
-
-
-Procedure SetTime(Hour, Minute, Second, Sec100: Word);
-begin
-end;
-
-
-
-{******************************************************************************
-                               --- Exec ---
-******************************************************************************}
-procedure Exec(const Path: PathStr; const ComLine: ComStr);
-begin
-end;
-
-
-{******************************************************************************
-                               --- Disk ---
-******************************************************************************}
-
-Function DiskFree(Drive: Byte): int64;
-Begin
-  result := -1;
-end;
-
-
-
-Function DiskSize(Drive: Byte): int64;
-Begin
-  result := -1;
-end;
-
-
-procedure FindFirst(const Path: PathStr; Attr: Word; Var f: SearchRec);
-begin
-end;
-
-
-procedure FindNext(Var f: SearchRec);
-begin
-end;
-
-procedure FindClose(Var f: SearchRec);
-begin
-end;
-
-
-{******************************************************************************
-                               --- File ---
-******************************************************************************}
-
-
-function FSearch(path: PathStr; dirlist: String) : PathStr;
-begin
-  result := '';
-end;
-
-
-Procedure getftime (var f; var time : longint);
-begin
-end;
-
-
-Procedure setftime(var f; time : longint);
-Begin
-End;
-
-procedure getfattr(var f; var attr : word);
-begin
-End;
-
-
-procedure setfattr(var f; attr : word);
-begin
-end;
-
-
-{******************************************************************************
-                             --- Environment ---
-******************************************************************************}
-
-function getpathstring: string;
-begin
-  result := '';
-end;
-
-
-function EnvCount: Longint;
-begin
-  result := -1;
-end;
-
-
-function EnvStr(Index: LongInt): String;
-begin
-  result := '';
-end;
-
-
-
-function GetEnv(envvar : String): String;
-begin
-  result := '';
-end;
-
-
-procedure AddDevice(str : String);
-begin
-end;
-
-function MakeDeviceName(str : pchar): string;
-begin
-  result := '';
-end;
-
-function IsInDeviceList(str : string): boolean;
-begin
-  result := false;
-end;
-
-procedure ReadInDevices;
-begin
-end;
-
-begin
-//  DosError:=0;
-//  numberofdevices := 0;
-//  StrOfPaths := '';
-//  ReadInDevices;
-end.
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2004 by Karoly Balogh for Genesi S.a.r.l.
+
+    Heavily based on the Commodore Amiga/m68k RTL by Nils Sjoholm and
+    Carl Eric Codere
+
+    MorphOS port was done on a free Pegasos II/G4 machine
+    provided by Genesi S.a.r.l. <www.genesi.lu>
+    
+    This unit is based on the MorphOS one and is adapted for Nintendo DS
+    simply by stripping out all stuff inside funcs and procs. 
+    Copyright (c) 2006 by Francesco Lombardi
+    
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+unit Dos;
+
+interface
+
+{$MODE objfpc}
+
+type
+  SearchRec = Packed Record
+	AnchorPtr : Pointer;    { Pointer to the Anchorpath structure }
+	Fill: Array[1..15] of Byte; {future use}
+    {End of replacement for fill}
+    Attr : BYTE;        {attribute of found file}
+    Time : LongInt;     {last modify date of found file}
+    Size : LongInt;     {file size of found file}
+    Name : String[255]; {name of found file}
+  End;
+
+{$I dosh.inc}
+
+implementation
+
+{$I dos.inc}
+
+{******************************************************************************
+                           --- Internal routines ---
+******************************************************************************}
+
+function dosLock(const name: String; accessmode: Longint) : LongInt;
+begin
+  result := -1;
+end;
+
+function IsLeapYear(Source : Word) : Boolean;
+begin
+  result := false;
+end;
+
+function dosSetProtection(const name: string; mask:longint): Boolean;
+begin
+  result := false;
+end;
+
+function dosSetFileDate(name: string): Boolean;
+begin
+  result := false;
+end;
+
+
+{******************************************************************************
+                        --- Info / Date / Time ---
+******************************************************************************}
+
+function DosVersion: Word;
+begin
+  result := 0;
+end;
+
+procedure NewList ();
+begin
+end;
+
+function CreateExtIO (size: Longint): integer;
+begin
+  result := -1;
+end;
+
+procedure DeleteExtIO ();
+begin
+end;
+
+function Createport(name : PChar; pri : longint): integer;
+begin
+  result := -1;
+end;
+
+procedure DeletePort ();
+begin
+end;
+
+
+function Create_Timer(theUnit : longint) : integer;
+begin
+  result := -1;
+end;
+
+Procedure Delete_Timer();
+begin
+end;
+
+function set_new_time(secs, micro : longint): longint;
+begin
+  result := -1;
+end;
+
+function get_sys_time(): longint;
+begin
+  result := -1;
+end;
+
+procedure GetDate(Var Year, Month, MDay, WDay: Word);
+begin
+end;
+
+procedure SetDate(Year, Month, Day: Word);
+begin
+end;
+
+procedure GetTime(Var Hour, Minute, Second, Sec100: Word);
+begin
+end;
+
+
+Procedure SetTime(Hour, Minute, Second, Sec100: Word);
+begin
+end;
+
+
+
+{******************************************************************************
+                               --- Exec ---
+******************************************************************************}
+procedure Exec(const Path: PathStr; const ComLine: ComStr);
+begin
+end;
+
+
+{******************************************************************************
+                               --- Disk ---
+******************************************************************************}
+
+Function DiskFree(Drive: Byte): int64;
+Begin
+  result := -1;
+end;
+
+
+
+Function DiskSize(Drive: Byte): int64;
+Begin
+  result := -1;
+end;
+
+
+procedure FindFirst(const Path: PathStr; Attr: Word; Var f: SearchRec);
+begin
+end;
+
+
+procedure FindNext(Var f: SearchRec);
+begin
+end;
+
+procedure FindClose(Var f: SearchRec);
+begin
+end;
+
+
+{******************************************************************************
+                               --- File ---
+******************************************************************************}
+
+
+function FSearch(path: PathStr; dirlist: String) : PathStr;
+begin
+  result := '';
+end;
+
+
+Procedure getftime (var f; var time : longint);
+begin
+end;
+
+
+Procedure setftime(var f; time : longint);
+Begin
+End;
+
+procedure getfattr(var f; var attr : word);
+begin
+End;
+
+
+procedure setfattr(var f; attr : word);
+begin
+end;
+
+
+{******************************************************************************
+                             --- Environment ---
+******************************************************************************}
+
+function getpathstring: string;
+begin
+  result := '';
+end;
+
+
+function EnvCount: Longint;
+begin
+  result := -1;
+end;
+
+
+function EnvStr(Index: LongInt): String;
+begin
+  result := '';
+end;
+
+
+
+function GetEnv(envvar : String): String;
+begin
+  result := '';
+end;
+
+
+procedure AddDevice(str : String);
+begin
+end;
+
+function MakeDeviceName(str : pchar): string;
+begin
+  result := '';
+end;
+
+function IsInDeviceList(str : string): boolean;
+begin
+  result := false;
+end;
+
+procedure ReadInDevices;
+begin
+end;
+
+begin
+//  DosError:=0;
+//  numberofdevices := 0;
+//  StrOfPaths := '';
+//  ReadInDevices;
+end.

+ 19 - 19
rtl/nds/ndsbios.inc

@@ -1,19 +1,19 @@
-{
-    This file is part of the Free Component Library (FCL)
-    Copyright (c) 1999-2002 by the Free Pascal development team
-
-    BIOS functions unit for Nintendo DS
-    Copyright (c) 2006 by Francesco Lombardi
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- *****************************************************************************}
-
-{*****************************************************************************
-                              NDS Bios Functions
-*****************************************************************************}
+{
+    This file is part of the Free Component Library (FCL)
+    Copyright (c) 1999-2002 by the Free Pascal development team
+
+    BIOS functions unit for Nintendo DS
+    Copyright (c) 2006 by Francesco Lombardi
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ *****************************************************************************}
+
+{*****************************************************************************
+                              NDS Bios Functions
+*****************************************************************************}

+ 21 - 21
rtl/nds/ndsbiosh.inc

@@ -1,21 +1,21 @@
-{
-    This file is part of the Free Component Library (FCL)
-    Copyright (c) 1999-2002 by the Free Pascal development team
-
-    BIOS functions unit for Nintendo DS
-    Copyright (c) 2006 by Francesco Lombardi
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- *****************************************************************************}
-
-{*****************************************************************************
-                              NDS Bios Functions
-*****************************************************************************}
-{ FPC funcs replaced by NDS BIOS ones }
-
+{
+    This file is part of the Free Component Library (FCL)
+    Copyright (c) 1999-2002 by the Free Pascal development team
+
+    BIOS functions unit for Nintendo DS
+    Copyright (c) 2006 by Francesco Lombardi
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ *****************************************************************************}
+
+{*****************************************************************************
+                              NDS Bios Functions
+*****************************************************************************}
+{ FPC funcs replaced by NDS BIOS ones }
+

+ 47 - 47
rtl/nds/sysdir.inc

@@ -1,47 +1,47 @@
-{
-    This file is part of the Free Pascal run time library.
-    Copyright (c) 2006 by Free Pascal development team
-
-    Low level directory functions
-    Nintendo DS does not have any drive, so no directory handling is needed.
-    Copyright (c) 2006 by Francesco Lombardi
-    
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- **********************************************************************}
-
-
-{*****************************************************************************
-                           Directory Handling
-*****************************************************************************}
-procedure mkdir(const s: string);[IOCheck];
-begin
-  if FileIODevice.DirIO.DoMkdir <> nil then
-    FileIODevice.DirIO.DoMkdir(s);
-end;
-
-procedure rmdir(const s: string);[IOCheck];
-begin
-  if FileIODevice.DirIO.DoRmdir <> nil then
-    FileIODevice.DirIO.DoRmdir(s);
-end;
-
-procedure chdir(const s: string);[IOCheck];
-begin
-  if FileIODevice.DirIO.DoChdir <> nil then
-    FileIODevice.DirIO.DoChdir(s);
-end;
-
-procedure GetDir(DriveNr: byte; var Dir: ShortString);
-begin
-  if FileIODevice.DirIO.DoGetdir <> nil then
-    FileIODevice.DirIO.DoGetdir(DriveNr, Dir);
-end;
-
-
-
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2006 by Free Pascal development team
+
+    Low level directory functions
+    Nintendo DS does not have any drive, so no directory handling is needed.
+    Copyright (c) 2006 by Francesco Lombardi
+    
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+
+{*****************************************************************************
+                           Directory Handling
+*****************************************************************************}
+procedure mkdir(const s: string);[IOCheck];
+begin
+  if FileIODevice.DirIO.DoMkdir <> nil then
+    FileIODevice.DirIO.DoMkdir(s);
+end;
+
+procedure rmdir(const s: string);[IOCheck];
+begin
+  if FileIODevice.DirIO.DoRmdir <> nil then
+    FileIODevice.DirIO.DoRmdir(s);
+end;
+
+procedure chdir(const s: string);[IOCheck];
+begin
+  if FileIODevice.DirIO.DoChdir <> nil then
+    FileIODevice.DirIO.DoChdir(s);
+end;
+
+procedure GetDir(DriveNr: byte; var Dir: ShortString);
+begin
+  if FileIODevice.DirIO.DoGetdir <> nil then
+    FileIODevice.DirIO.DoGetdir(DriveNr, Dir);
+end;
+
+
+

+ 179 - 179
rtl/nds/sysfile.inc

@@ -1,179 +1,179 @@
-{
-    This file is part of the Free Pascal run time library.
-    Copyright (c) 2005 by Free Pascal development team
-
-    Low level file functions
-    Nintendo DS does not have any drive, so no file handling is needed.
-    Copyright (c) 2006 by Francesco Lombardi
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- **********************************************************************}
-
-
-
-{****************************************************************************
-                        Low level File Routines
-               All these functions can set InOutRes on errors
-****************************************************************************}
-
-{ close a file from the handle value }
-procedure do_close(handle: THandle);
-begin
-  if FileIODevice.FileIO.DoClose <> nil then
-    FileIODevice.FileIO.DoClose(handle);
-  //_fclose (_PFILE(pointer(handle))^);
-end;
-
-procedure do_erase(p: pchar);
-begin
-  if FileIODevice.FileIO.DoErase <> nil then
-    FileIODevice.FileIO.DoErase(p);
-//  _unlink(p);
-end;
-
-procedure do_rename(p1, p2: pchar);
-begin
-//  _rename(p1, p2);
-  if FileIODevice.FileIO.DoRename <> nil then
-    FileIODevice.FileIO.DoRename(p1, p2);
-end;
-
-function do_write(h: THandle; addr: pointer; len: longint) : longint;
-begin
-//  result := _fwrite(addr, 1, len, _PFILE(pointer(h))^);
-  if FileIODevice.FileIO.DoWrite <> nil then
-    result :=  FileIODevice.FileIO.DoWrite(h, addr, len);
-end;
-
-function do_read(h: THandle; addr: pointer; len: longint) : longint;
-begin
-//  result := _fread(addr, 1, len, _PFILE(pointer(h))^);
-  if FileIODevice.FileIO.DoRead <> nil then
-    result := FileIODevice.FileIO.DoRead(h, addr, len);
-end;
-
-function do_filepos(handle: THandle): longint;
-begin
-//  result := _ftell(_PFILE(pointer(handle))^);
-  if FileIODevice.FileIO.DoFilePos <> nil then
-    result := FileIODevice.FileIO.DoFilePos(handle);
-end;
-
-procedure do_seek(handle: THandle; pos: longint);
-begin
-  //_fseek(_PFILE(pointer(handle))^, pos, SEEK_SET);
-  if FileIODevice.FileIO.DoSeek <> nil then
-    FileIODevice.FileIO.DoSeek(handle, pos);
-end;
-
-function do_seekend(handle: THandle): longint;
-begin
-//  result := _fseek(_PFILE(pointer(handle))^, 0, SEEK_END);
-  if FileIODevice.FileIO.DoSeekend <> nil then
-    result := FileIODevice.FileIO.DoSeekend(handle);
-end;
-
-function do_filesize(handle: THandle): longint;
-begin
-//  result := -1;
-  if FileIODevice.FileIO.DoFilesize <> nil then
-    result := FileIODevice.FileIO.DoFilesize(handle);
-end;
-
-{ truncate at a given position }
-procedure do_truncate(handle: THandle; pos: longint);
-begin
-//  _ftruncate(_fileno(_PFILE(pointer(handle))^), pos);
-  if FileIODevice.FileIO.DoTruncate <> nil then
-    FileIODevice.FileIO.DoTruncate(handle, pos);
-end;
-
-procedure do_open(var f; p: pchar; flags: longint);
-begin
-(*
-{ close first if opened }
-  if ((flags and $10000) = 0) then
-   begin
-     case FileRec(f).mode of
-      fminput,fmoutput,fminout : Do_Close(FileRec(f).Handle);
-      fmclosed : ;
-     else
-      begin
-//        inoutres:=102; {not assigned}
-        exit;
-      end;
-     end;
-   end;
-{ reset file Handle }
-  FileRec(f).Handle:=UnusedHandle;
-
-{ We do the conversion of filemodes here, concentrated on 1 place }
-  case (flags and 3) of
-   0 : begin
-         oflags := 'rb'#0;
-         filerec(f).mode := fminput;
-       end;
-   1 : begin
-         if (flags and $1000)=$1000 then
-           oflags := 'w+b' else
-           oflags := 'wb';
-         filerec(f).mode := fmoutput;
-       end;
-   2 : begin
-         if (flags and $1000)=$1000 then
-           oflags := 'w+' else
-           oflags := 'r+';
-         filerec(f).mode := fminout;
-       end;
-  end;
-  {if (flags and $1000)=$1000 then
-   oflags:=oflags or (O_CREAT or O_TRUNC)
-  else
-   if (flags and $100)=$100 then
-    oflags:=oflags or (O_APPEND);}
-
-{ empty name is special }
-  if p[0]=#0 then
-  begin
-    case FileRec(f).mode of
-      fminput: FileRec(f).Handle:=StdInputHandle;
-      fminout, { this is set by rewrite }
-      fmoutput: FileRec(f).Handle:=StdOutputHandle;
-      fmappend:
-      begin
-        FileRec(f).Handle:=StdOutputHandle;
-        FileRec(f).mode:=fmoutput; {fool fmappend}
-      end;
-    end;
-    exit;
-  end;
-
-{ real open call }
-  FileRec(f).Handle := longint(fopen(p, @oflags[1]));//_open(p,oflags,438);
-  // errno does not seem to be set on succsess ??
-{
-  if FileRec(f).Handle = 0 then
-    Errno2Inoutres
-  else
-    InOutRes := 0;
-}
-*)
-//  FileRec(f).Handle := THandle (_fopen(p, @oflags[1]));
-  if FileIODevice.FileIO.DoOpen <> nil then
-    FileIODevice.FileIO.DoOpen(f, p, flags);
-end;
-
-function do_isdevice(handle: THandle): boolean;
-begin
-//  result :=  (_isatty(_fileno(_PFILE(pointer(handle))^)) > 0);
-  if FileIODevice.FileIO.DoIsdevice <> nil then
-    result := FileIODevice.FileIO.DoIsdevice(handle);
-end;
-
-
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2005 by Free Pascal development team
+
+    Low level file functions
+    Nintendo DS does not have any drive, so no file handling is needed.
+    Copyright (c) 2006 by Francesco Lombardi
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+
+
+{****************************************************************************
+                        Low level File Routines
+               All these functions can set InOutRes on errors
+****************************************************************************}
+
+{ close a file from the handle value }
+procedure do_close(handle: THandle);
+begin
+  if FileIODevice.FileIO.DoClose <> nil then
+    FileIODevice.FileIO.DoClose(handle);
+  //_fclose (_PFILE(pointer(handle))^);
+end;
+
+procedure do_erase(p: pchar);
+begin
+  if FileIODevice.FileIO.DoErase <> nil then
+    FileIODevice.FileIO.DoErase(p);
+//  _unlink(p);
+end;
+
+procedure do_rename(p1, p2: pchar);
+begin
+//  _rename(p1, p2);
+  if FileIODevice.FileIO.DoRename <> nil then
+    FileIODevice.FileIO.DoRename(p1, p2);
+end;
+
+function do_write(h: THandle; addr: pointer; len: longint) : longint;
+begin
+//  result := _fwrite(addr, 1, len, _PFILE(pointer(h))^);
+  if FileIODevice.FileIO.DoWrite <> nil then
+    result :=  FileIODevice.FileIO.DoWrite(h, addr, len);
+end;
+
+function do_read(h: THandle; addr: pointer; len: longint) : longint;
+begin
+//  result := _fread(addr, 1, len, _PFILE(pointer(h))^);
+  if FileIODevice.FileIO.DoRead <> nil then
+    result := FileIODevice.FileIO.DoRead(h, addr, len);
+end;
+
+function do_filepos(handle: THandle): longint;
+begin
+//  result := _ftell(_PFILE(pointer(handle))^);
+  if FileIODevice.FileIO.DoFilePos <> nil then
+    result := FileIODevice.FileIO.DoFilePos(handle);
+end;
+
+procedure do_seek(handle: THandle; pos: longint);
+begin
+  //_fseek(_PFILE(pointer(handle))^, pos, SEEK_SET);
+  if FileIODevice.FileIO.DoSeek <> nil then
+    FileIODevice.FileIO.DoSeek(handle, pos);
+end;
+
+function do_seekend(handle: THandle): longint;
+begin
+//  result := _fseek(_PFILE(pointer(handle))^, 0, SEEK_END);
+  if FileIODevice.FileIO.DoSeekend <> nil then
+    result := FileIODevice.FileIO.DoSeekend(handle);
+end;
+
+function do_filesize(handle: THandle): longint;
+begin
+//  result := -1;
+  if FileIODevice.FileIO.DoFilesize <> nil then
+    result := FileIODevice.FileIO.DoFilesize(handle);
+end;
+
+{ truncate at a given position }
+procedure do_truncate(handle: THandle; pos: longint);
+begin
+//  _ftruncate(_fileno(_PFILE(pointer(handle))^), pos);
+  if FileIODevice.FileIO.DoTruncate <> nil then
+    FileIODevice.FileIO.DoTruncate(handle, pos);
+end;
+
+procedure do_open(var f; p: pchar; flags: longint);
+begin
+(*
+{ close first if opened }
+  if ((flags and $10000) = 0) then
+   begin
+     case FileRec(f).mode of
+      fminput,fmoutput,fminout : Do_Close(FileRec(f).Handle);
+      fmclosed : ;
+     else
+      begin
+//        inoutres:=102; {not assigned}
+        exit;
+      end;
+     end;
+   end;
+{ reset file Handle }
+  FileRec(f).Handle:=UnusedHandle;
+
+{ We do the conversion of filemodes here, concentrated on 1 place }
+  case (flags and 3) of
+   0 : begin
+         oflags := 'rb'#0;
+         filerec(f).mode := fminput;
+       end;
+   1 : begin
+         if (flags and $1000)=$1000 then
+           oflags := 'w+b' else
+           oflags := 'wb';
+         filerec(f).mode := fmoutput;
+       end;
+   2 : begin
+         if (flags and $1000)=$1000 then
+           oflags := 'w+' else
+           oflags := 'r+';
+         filerec(f).mode := fminout;
+       end;
+  end;
+  {if (flags and $1000)=$1000 then
+   oflags:=oflags or (O_CREAT or O_TRUNC)
+  else
+   if (flags and $100)=$100 then
+    oflags:=oflags or (O_APPEND);}
+
+{ empty name is special }
+  if p[0]=#0 then
+  begin
+    case FileRec(f).mode of
+      fminput: FileRec(f).Handle:=StdInputHandle;
+      fminout, { this is set by rewrite }
+      fmoutput: FileRec(f).Handle:=StdOutputHandle;
+      fmappend:
+      begin
+        FileRec(f).Handle:=StdOutputHandle;
+        FileRec(f).mode:=fmoutput; {fool fmappend}
+      end;
+    end;
+    exit;
+  end;
+
+{ real open call }
+  FileRec(f).Handle := longint(fopen(p, @oflags[1]));//_open(p,oflags,438);
+  // errno does not seem to be set on succsess ??
+{
+  if FileRec(f).Handle = 0 then
+    Errno2Inoutres
+  else
+    InOutRes := 0;
+}
+*)
+//  FileRec(f).Handle := THandle (_fopen(p, @oflags[1]));
+  if FileIODevice.FileIO.DoOpen <> nil then
+    FileIODevice.FileIO.DoOpen(f, p, flags);
+end;
+
+function do_isdevice(handle: THandle): boolean;
+begin
+//  result :=  (_isatty(_fileno(_PFILE(pointer(handle))^)) > 0);
+  if FileIODevice.FileIO.DoIsdevice <> nil then
+    result := FileIODevice.FileIO.DoIsdevice(handle);
+end;
+
+

+ 16 - 16
rtl/nds/sysos.inc

@@ -1,16 +1,16 @@
-{
-    This file is part of the Free Pascal run time library.
-    Copyright (c) 2001 by Free Pascal development team
-
-    This file implements all the base types and limits required
-    for a minimal POSIX compliant subset required to port the compiler
-    to a new OS.
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- **********************************************************************}
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2001 by Free Pascal development team
+
+    This file implements all the base types and limits required
+    for a minimal POSIX compliant subset required to port the compiler
+    to a new OS.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}

+ 29 - 29
rtl/nds/sysosh.inc

@@ -1,29 +1,29 @@
-{
-    This file is part of the Free Pascal run time library.
-    Copyright (c) 2001 by Free Pascal development team
-
-    This file implements all the base types and limits required
-    for a minimal POSIX compliant subset required to port the compiler
-    to a new OS.
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- **********************************************************************}
-
-{Platform specific information}
-type
-  THandle = Longint;
-  TThreadID = THandle;
-  
-  PRTLCriticalSection = ^TRTLCriticalSection;
-  TRTLCriticalSection = record
-   Locked: boolean
-  end;
-
-
-
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2001 by Free Pascal development team
+
+    This file implements all the base types and limits required
+    for a minimal POSIX compliant subset required to port the compiler
+    to a new OS.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{Platform specific information}
+type
+  THandle = Longint;
+  TThreadID = THandle;
+  
+  PRTLCriticalSection = ^TRTLCriticalSection;
+  TRTLCriticalSection = record
+   Locked: boolean
+  end;
+
+
+

+ 284 - 284
rtl/nds/sysutils.pp

@@ -1,284 +1,284 @@
-{
-
-    This file is part of the Free Pascal run time library.
-    Copyright (c) 2004 by Karoly Balogh
-
-    Sysutils unit for Nintendo DS.
-    This unit is based on the MorphOS one and is adapted for Nintendo DS
-    simply by stripping out all stuff inside funcs and procs. 
-    Copyright (c) 2006 by Francesco Lombardi
-
-    Based on Amiga version by Carl Eric Codere, and other
-    parts of the RTL
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- **********************************************************************}
-
-unit sysutils;
-
-interface
-
-{$MODE objfpc}
-{ force ansistrings }
-{$H+}
-
-{ Include platform independent interface part }
-{$i sysutilh.inc}
-
-
-implementation
-
-uses 
-  dos, sysconst;
-
-{ Include platform independent implementation part }
-{$i sysutils.inc}
-
-
-{****************************************************************************
-                              File Functions
-****************************************************************************}
-function FileOpen(const FileName: string; Mode: Integer): LongInt;
-begin
-  result := -1;
-end;
-
-
-function FileGetDate(Handle: LongInt) : LongInt;
-begin
-  result := -1;
-end;
-
-
-function FileSetDate(Handle, Age: LongInt) : LongInt;
-begin
-  result := -1;
-end;
-
-
-function FileCreate(const FileName: string) : LongInt;
-begin
-  result := -1;
-end;
-
-
-function FileCreate(const FileName: string; Mode: integer): LongInt;
-begin
-  result := -1;
-end;
-
-
-function FileRead(Handle: LongInt; var Buffer; Count: LongInt): LongInt;
-begin
-  result := -1;
-end;
-
-
-function FileWrite(Handle: LongInt; const Buffer; Count: LongInt): LongInt;
-begin
-  result := -1;
-end;
-
-
-function FileSeek(Handle, FOffset, Origin: LongInt) : LongInt;
-begin
-  result := -1;
-end;
-
-function FileSeek(Handle: LongInt; FOffset: Int64; Origin: Longint): Int64;
-begin
-  result := -1;
-end;
-
-
-procedure FileClose(Handle: LongInt);
-begin
-end;
-
-
-function FileTruncate(Handle: THandle; Size: Int64): Boolean;
-begin
-  result := false;
-end;
-
-
-function DeleteFile(const FileName: string) : Boolean;
-begin
-  result := false;
-end;
-
-
-function RenameFile(const OldName, NewName: string): Boolean;
-begin
-  result := false;
-end;
-
-
-(****** end of non portable routines ******)
-
-
-Function FileAge (Const FileName : String): Longint;
-begin
-  result := -1;
-end;
-
-
-Function FileExists (Const FileName : String) : Boolean;
-Begin
-  result := false;
-end;
-
-
-
-Function FindFirst (Const Path : String; Attr : Longint; Out Rslt : TSearchRec) : Longint;
-begin
-  result := -1;
-end;
-
-
-Function FindNext (Var Rslt : TSearchRec) : Longint;
-begin
-  result := -1;
-end;
-
-Procedure FindClose (Var F : TSearchrec);
-begin
-end;
-
-Function FileGetAttr (Const FileName : String) : Longint;
-begin
-  result := -1;
-end;
-
-
-Function FileSetAttr (Const Filename : String; Attr: longint) : Longint;
-begin
-  result := -1;
-end;
-
-
-
-{****************************************************************************
-                              Disk Functions
-****************************************************************************}
-
-Procedure AddDisk(const path:string);
-begin
-
-end;
-
-
-
-Function DiskFree(Drive: Byte): int64;
-Begin
-  result := -1;
-End;
-
-
-Function DiskSize(Drive: Byte): int64;
-Begin
-  result := -1;
-End;
-
-
-Function GetCurrentDir : String;
-begin
-  result := '';
-end;
-
-
-Function SetCurrentDir (Const NewDir : String) : Boolean;
-begin
-  result := false;
-end;
-
-
-Function CreateDir (Const NewDir : String) : Boolean;
-begin
-  result := false;
-end;
-
-
-Function RemoveDir (Const Dir : String) : Boolean;
-begin
-  result := false;
-end;
-
-
-function DirectoryExists(const Directory: string): Boolean;
-begin
-  result := false;
-end;
-
-
-
-{****************************************************************************
-                              Misc Functions
-****************************************************************************}
-
-procedure Beep;
-begin
-end;
-
-
-{****************************************************************************
-                              Locale Functions
-****************************************************************************}
-
-Procedure GetLocalTime(var SystemTime: TSystemTime);
-begin
-end ;
-
-
-function SysErrorMessage(ErrorCode: Integer): String;
-begin
-{  Result:=StrError(ErrorCode);}
-  result := '';
-end;
-
-{****************************************************************************
-                              OS utility functions
-****************************************************************************}
-
-Function GetEnvironmentVariable(Const EnvVar : String) : String;
-begin
-  result := '';
-end;
-
-Function GetEnvironmentVariableCount : Integer;
-begin
-  result := -1;
-end;
-
-Function GetEnvironmentString(Index : Integer) : String;
-begin
-  result := '';
-end;
-
-function ExecuteProcess (const Path: AnsiString; const ComLine: AnsiString): integer;
-begin
-  result := -1;
-end;
-
-function ExecuteProcess (const Path: AnsiString;
-                                  const ComLine: array of AnsiString): integer;
-begin
-  result := -1;
-end;
-
-
-{****************************************************************************
-                              Initialization code
-****************************************************************************}
-
-Initialization
-  InitExceptions;
-Finalization
-  DoneExceptions;
-end.
+{
+
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2004 by Karoly Balogh
+
+    Sysutils unit for Nintendo DS.
+    This unit is based on the MorphOS one and is adapted for Nintendo DS
+    simply by stripping out all stuff inside funcs and procs. 
+    Copyright (c) 2006 by Francesco Lombardi
+
+    Based on Amiga version by Carl Eric Codere, and other
+    parts of the RTL
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+unit sysutils;
+
+interface
+
+{$MODE objfpc}
+{ force ansistrings }
+{$H+}
+
+{ Include platform independent interface part }
+{$i sysutilh.inc}
+
+
+implementation
+
+uses 
+  dos, sysconst;
+
+{ Include platform independent implementation part }
+{$i sysutils.inc}
+
+
+{****************************************************************************
+                              File Functions
+****************************************************************************}
+function FileOpen(const FileName: string; Mode: Integer): LongInt;
+begin
+  result := -1;
+end;
+
+
+function FileGetDate(Handle: LongInt) : LongInt;
+begin
+  result := -1;
+end;
+
+
+function FileSetDate(Handle, Age: LongInt) : LongInt;
+begin
+  result := -1;
+end;
+
+
+function FileCreate(const FileName: string) : LongInt;
+begin
+  result := -1;
+end;
+
+
+function FileCreate(const FileName: string; Mode: integer): LongInt;
+begin
+  result := -1;
+end;
+
+
+function FileRead(Handle: LongInt; var Buffer; Count: LongInt): LongInt;
+begin
+  result := -1;
+end;
+
+
+function FileWrite(Handle: LongInt; const Buffer; Count: LongInt): LongInt;
+begin
+  result := -1;
+end;
+
+
+function FileSeek(Handle, FOffset, Origin: LongInt) : LongInt;
+begin
+  result := -1;
+end;
+
+function FileSeek(Handle: LongInt; FOffset: Int64; Origin: Longint): Int64;
+begin
+  result := -1;
+end;
+
+
+procedure FileClose(Handle: LongInt);
+begin
+end;
+
+
+function FileTruncate(Handle: THandle; Size: Int64): Boolean;
+begin
+  result := false;
+end;
+
+
+function DeleteFile(const FileName: string) : Boolean;
+begin
+  result := false;
+end;
+
+
+function RenameFile(const OldName, NewName: string): Boolean;
+begin
+  result := false;
+end;
+
+
+(****** end of non portable routines ******)
+
+
+Function FileAge (Const FileName : String): Longint;
+begin
+  result := -1;
+end;
+
+
+Function FileExists (Const FileName : String) : Boolean;
+Begin
+  result := false;
+end;
+
+
+
+Function FindFirst (Const Path : String; Attr : Longint; Out Rslt : TSearchRec) : Longint;
+begin
+  result := -1;
+end;
+
+
+Function FindNext (Var Rslt : TSearchRec) : Longint;
+begin
+  result := -1;
+end;
+
+Procedure FindClose (Var F : TSearchrec);
+begin
+end;
+
+Function FileGetAttr (Const FileName : String) : Longint;
+begin
+  result := -1;
+end;
+
+
+Function FileSetAttr (Const Filename : String; Attr: longint) : Longint;
+begin
+  result := -1;
+end;
+
+
+
+{****************************************************************************
+                              Disk Functions
+****************************************************************************}
+
+Procedure AddDisk(const path:string);
+begin
+
+end;
+
+
+
+Function DiskFree(Drive: Byte): int64;
+Begin
+  result := -1;
+End;
+
+
+Function DiskSize(Drive: Byte): int64;
+Begin
+  result := -1;
+End;
+
+
+Function GetCurrentDir : String;
+begin
+  result := '';
+end;
+
+
+Function SetCurrentDir (Const NewDir : String) : Boolean;
+begin
+  result := false;
+end;
+
+
+Function CreateDir (Const NewDir : String) : Boolean;
+begin
+  result := false;
+end;
+
+
+Function RemoveDir (Const Dir : String) : Boolean;
+begin
+  result := false;
+end;
+
+
+function DirectoryExists(const Directory: string): Boolean;
+begin
+  result := false;
+end;
+
+
+
+{****************************************************************************
+                              Misc Functions
+****************************************************************************}
+
+procedure Beep;
+begin
+end;
+
+
+{****************************************************************************
+                              Locale Functions
+****************************************************************************}
+
+Procedure GetLocalTime(var SystemTime: TSystemTime);
+begin
+end ;
+
+
+function SysErrorMessage(ErrorCode: Integer): String;
+begin
+{  Result:=StrError(ErrorCode);}
+  result := '';
+end;
+
+{****************************************************************************
+                              OS utility functions
+****************************************************************************}
+
+Function GetEnvironmentVariable(Const EnvVar : String) : String;
+begin
+  result := '';
+end;
+
+Function GetEnvironmentVariableCount : Integer;
+begin
+  result := -1;
+end;
+
+Function GetEnvironmentString(Index : Integer) : String;
+begin
+  result := '';
+end;
+
+function ExecuteProcess (const Path: AnsiString; const ComLine: AnsiString): integer;
+begin
+  result := -1;
+end;
+
+function ExecuteProcess (const Path: AnsiString;
+                                  const ComLine: array of AnsiString): integer;
+begin
+  result := -1;
+end;
+
+
+{****************************************************************************
+                              Initialization code
+****************************************************************************}
+
+Initialization
+  InitExceptions;
+Finalization
+  DoneExceptions;
+end.

+ 112 - 112
rtl/nds/tthread.inc

@@ -1,112 +1,112 @@
-{
-    This file is part of the Free Component Library (FCL)
-    Copyright (c) 1999-2002 by the Free Pascal development team
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- **********************************************************************}
-
-{****************************************************************************}
-{*                             TThread                                      *}
-{****************************************************************************}
-
-{$WARNING This file is only a stub, and will not work!}
-
-const
- ThreadCount: longint = 0;
-
-(* Implementation of exported functions *)
-
-procedure AddThread (T: TThread);
-begin
- Inc (ThreadCount);
-end;
-
-
-procedure RemoveThread (T: TThread);
-begin
- Dec (ThreadCount);
-end;
-
-
-procedure TThread.CallOnTerminate;
-begin
- FOnTerminate (Self);
-end;
-
-
-function TThread.GetPriority: TThreadPriority;
-begin
-  result := tpNormal;
-end;
-
-
-procedure TThread.SetPriority(Value: TThreadPriority);
-begin
-
-end;
-
-
-procedure TThread.SetSuspended(Value: Boolean);
-begin
- if Value <> FSuspended then
- begin
-  if Value then Suspend else Resume;
- end;
-end;
-
-
-procedure TThread.DoTerminate;
-begin
- if Assigned (FOnTerminate) then Synchronize (@CallOnTerminate);
-end;
-
-
-constructor TThread.Create(CreateSuspended: Boolean;
-                           const StackSize: SizeUInt = DefaultStackSize);
-var
-  Flags: cardinal;
-begin
-  inherited Create;
-  AddThread (Self);
-end;
-
-
-destructor TThread.Destroy;
-begin
- if not FFinished and not Suspended then
- begin
-  Terminate;
-  WaitFor;
- end;
-end;
-
-procedure TThread.Resume;
-begin
-
-end;
-
-
-procedure TThread.Suspend;
-begin
-
-end;
-
-
-procedure TThread.Terminate;
-begin
- FTerminated := true;
-end;
-
-
-function TThread.WaitFor: Integer;
-begin
-  result := -1;
-end;
-
-
+{
+    This file is part of the Free Component Library (FCL)
+    Copyright (c) 1999-2002 by the Free Pascal development team
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{****************************************************************************}
+{*                             TThread                                      *}
+{****************************************************************************}
+
+{$WARNING This file is only a stub, and will not work!}
+
+const
+ ThreadCount: longint = 0;
+
+(* Implementation of exported functions *)
+
+procedure AddThread (T: TThread);
+begin
+ Inc (ThreadCount);
+end;
+
+
+procedure RemoveThread (T: TThread);
+begin
+ Dec (ThreadCount);
+end;
+
+
+procedure TThread.CallOnTerminate;
+begin
+ FOnTerminate (Self);
+end;
+
+
+function TThread.GetPriority: TThreadPriority;
+begin
+  result := tpNormal;
+end;
+
+
+procedure TThread.SetPriority(Value: TThreadPriority);
+begin
+
+end;
+
+
+procedure TThread.SetSuspended(Value: Boolean);
+begin
+ if Value <> FSuspended then
+ begin
+  if Value then Suspend else Resume;
+ end;
+end;
+
+
+procedure TThread.DoTerminate;
+begin
+ if Assigned (FOnTerminate) then Synchronize (@CallOnTerminate);
+end;
+
+
+constructor TThread.Create(CreateSuspended: Boolean;
+                           const StackSize: SizeUInt = DefaultStackSize);
+var
+  Flags: cardinal;
+begin
+  inherited Create;
+  AddThread (Self);
+end;
+
+
+destructor TThread.Destroy;
+begin
+ if not FFinished and not Suspended then
+ begin
+  Terminate;
+  WaitFor;
+ end;
+end;
+
+procedure TThread.Resume;
+begin
+
+end;
+
+
+procedure TThread.Suspend;
+begin
+
+end;
+
+
+procedure TThread.Terminate;
+begin
+ FTerminated := true;
+end;
+
+
+function TThread.WaitFor: Integer;
+begin
+  result := -1;
+end;
+
+

+ 38 - 38
rtl/nds/varutils.pp

@@ -1,38 +1,38 @@
-{
-    This file is part of the Free Pascal run time library.
-    Copyright (c) 1999-2000 by the Free Pascal development team
-
-    Interface and OS-dependent part of variant support
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- **********************************************************************}
-
-{$MODE ObjFPC}
-
-Unit varutils;
-
-Interface
-
-Uses sysutils;
-
-// Read definitions.
-
-{$i varutilh.inc}
-
-Implementation
-
-// Code common to all platforms.
-
-{$i cvarutil.inc}
-
-// Code common to non-win32 platforms.
-
-{$i varutils.inc}
-
-end.
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by the Free Pascal development team
+
+    Interface and OS-dependent part of variant support
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{$MODE ObjFPC}
+
+Unit varutils;
+
+Interface
+
+Uses sysutils;
+
+// Read definitions.
+
+{$i varutilh.inc}
+
+Implementation
+
+// Code common to all platforms.
+
+{$i cvarutil.inc}
+
+// Code common to non-win32 platforms.
+
+{$i varutils.inc}
+
+end.