Commit Graph

150 Commits

Author SHA1 Message Date
nickysn
0c2e8db579 + enabled compilation of unit charset for i8086-msdos
git-svn-id: trunk@25669 -
2013-10-05 23:55:34 +00:00
nickysn
1bea98995b * regenerated fpcmake makefiles after r25642
git-svn-id: trunk@25644 -
2013-10-05 10:11:27 +00:00
nickysn
8f8bd8b12d - rm the unnecessary jnz instruction before the rep stosb in the i8086-msdos startup code, because the rep prefix checks for cx=0 and skips the stosb instruction anyway
git-svn-id: trunk@25638 -
2013-10-04 13:36:24 +00:00
nickysn
608a449c4a + added a 'cld' before the first string x86 instruction in the i8086-msdos startup code
git-svn-id: trunk@25635 -
2013-10-04 11:18:47 +00:00
nickysn
e2903ded95 + added CGA snow checking to the WriteChar routine of the CRT unit for i8086-msdos; scrolling and clreol still produces snow
git-svn-id: trunk@25527 -
2013-09-21 13:40:21 +00:00
nickysn
408f53fbda + detect whether CGA snow checking is required and initialize the CheckSnow variable accordingly
git-svn-id: trunk@25491 -
2013-09-16 00:01:36 +00:00
nickysn
d2c2193505 + 83/84-key keyboard support added to unit keyboard for i8086-msdos
git-svn-id: trunk@25490 -
2013-09-15 19:53:24 +00:00
nickysn
034f9c6b71 + added and implemented unit keyboard for i8086-msdos, based on the go32v2 version of the unit
git-svn-id: trunk@25489 -
2013-09-15 17:48:35 +00:00
nickysn
5c1fb7b009 * Crt.CursorOff fixed after r25483; the correct value of CX is 2000h, not 200h
git-svn-id: trunk@25487 -
2013-09-14 15:39:07 +00:00
nickysn
19d6d202cd * Crt.CursorOn and CursorBig: use CX values that are CGA compatible, which makes them CGA/EGA/VGA compatible, because EGA/VGA bioses emulate CGA cursor values; as a side effect this also makes these functions work properly under EGA/VGA's 43- and 50-line text modes
git-svn-id: trunk@25484 -
2013-09-14 13:28:40 +00:00
nickysn
e60c3ee740 * Crt.CursorOff: use CX=bash200, instead of CX= for making the cursor invisible; this is the correct value, according to the BIOS documentation I've found and it is also the value used by the go32v2 video unit
git-svn-id: trunk@25483 -
2013-09-14 12:58:38 +00:00
nickysn
7e6092c4f2 * ScreenWidth and ScreenHeight changed to word; several other types also changed to 16-bit and added typecasts to avoid 32-bit calculations due to mixing signed and unsigned 16-bit ints
git-svn-id: trunk@25477 -
2013-09-13 08:31:53 +00:00
nickysn
70937d93c1 * WinMinX, WinMinY, WinMaxX and WinMaxY helper functions replaced with absolute packed records overlaid on top of WindMin and WindMax for faster access
git-svn-id: trunk@25474 -
2013-09-12 23:39:56 +00:00
nickysn
6ef912a7a0 * GetScreenCursor (and all places where it's called) var parameters changed to smallint, which is more optimal on i8086
git-svn-id: trunk@25455 -
2013-09-11 14:51:59 +00:00
nickysn
771301d7db * SetScreenCursor parameters changed to smallint, which is more optimal on i8086
git-svn-id: trunk@25454 -
2013-09-11 14:40:26 +00:00
nickysn
987e759e20 * WinMinX, WinMinY, WinMaxX and WinMaxY helper functions changed to return 0 based result, which results in slightly more optimal code in a lot of places
git-svn-id: trunk@25453 -
2013-09-11 14:18:30 +00:00
nickysn
e7cbd41670 - rm redundant double initialization of regs.cx from Crt.CursorOn
git-svn-id: trunk@25446 -
2013-09-10 15:27:06 +00:00
nickysn
76cbda0983 + 83/84-key keyboard support added to unit crt
git-svn-id: trunk@25445 -
2013-09-09 20:55:08 +00:00
nickysn
766b7745bd * counter variable in CrtWrite changed to SmallInt in order to generate more efficient code on the 16-bit i8086
git-svn-id: trunk@25444 -
2013-09-09 12:29:13 +00:00
nickysn
5ffca2e66f * CrtOpen, CrtClose, CrtRead, CrtWrite and CrtReturn changed to procedures, instead of functions
git-svn-id: trunk@25442 -
2013-09-08 21:22:40 +00:00
Jonas Maebe
de56f909d5 * synchronized with trunk up to and including r25430
git-svn-id: branches/cpstrrtl@25431 -
2013-09-06 10:09:26 +00:00
nickysn
e342c11085 + introduced a private type TCodePtrList, which is the specialization
TFPGList<CodePointer> on archs/memory models where CodePointer is different
  than Pointer. On archs/memory models where CodePointer = Pointer, TCodePtrList
  is simply an alias of TList and the fgl unit isn't pulled in.
* the type of FindGlobalComponentList changed to TCodePtrList and the typecasts
  from TFindGlobalComponent (procvar type) to Pointer changed to CodePointer.
  This fixes compilation of unit classes in the i8086 medium memory model.

git-svn-id: trunk@25357 -
2013-08-23 19:25:51 +00:00
Jonas Maebe
af3f12f60c * rawbytestring/unicodestring versions of findfirst/findnext/findclose
o these routines are now generic wrappers in filutil.inc, and call
     the platform-dependent internalfindfirst/next/close routines
   o on unix, the fnmatch routine got proper support for UTF-8 matching
     (e.g., it won't match a partial UTF-8 code point to a "?" wildcard)
   o for NativeNT, a similar (untested) UTF-16 version has been added
  + test for the above
  * rawbytestring/unicodestring versions of fileage

git-svn-id: branches/cpstrrtl@25302 -
2013-08-19 22:04:25 +00:00
Jonas Maebe
8d1090269e * synchronised with trunk r25259
git-svn-id: branches/cpstrrtl@25267 -
2013-08-16 11:33:44 +00:00
florian
b29591ffd3 * fix msdos rtl makefile for newer makes
git-svn-id: trunk@25240 -
2013-08-11 16:12:43 +00:00
Jonas Maebe
29132f45b7 * synchronised with trunk up to r25167 (fixes glib compilation via r25164,
and occasional crashes in executeprocess on libc platforms via r25167)

git-svn-id: branches/cpstrrtl@25169 -
2013-07-24 14:24:49 +00:00
Jonas Maebe
df6a2dce00 + unicodestring support for assign/erase/rename
+ codepage support for textrec/filerec and the above routines
  * textrec/filerec now store the filename by default using widechar. It is
    possible to switch back to ansichars using the FPC_ANSI_TEXTFILEREC define.
    In that case, from now on the filename will always be stored in
    DefaultFileSystemEncoding
  * fixed potential buffer overflows and non-null-terminated file names in
    textrec/filerec
  + dodirseparators(pwidechar), changed the dodirseparators(pchar/pwidechar)
    parameters into var-parameters and gave those routines an extra parameter
    that indicates whether the p(wide)char can be changed in place if
    necessary or whether a copy must be made first (avoids us having to make
    all strings always unique everywhere, because they might be changed on
    some platforms via a pchar)
  * do_open/do_erase/do_rename got extra boolean parameters indicating whether
    the passed pchars point to data that can be freely changed (to pass on to
    dodirseparators() if applicable)
  * objects.pp: force assign(pchar) to be called, because
    assign(array[0..255]) cannot choose between pchar and rawbytestring
    versions (and removing the pchar version means that assign(pchar) will
    be mapped to assign(shortstring) in {$h-})
  * fixed up some routines in other units that depend on the format of
    the textrec/filerec.name field

git-svn-id: branches/cpstrrtl@25137 -
2013-07-19 16:30:51 +00:00
Jonas Maebe
155aafc255 * moved SYSUTILS_HAS_ANSISTR/UNICODESTR_FILEUTIL_IMPL define to interface
so declarations can also depend on it and similar defines (not yet the
    case)
  + added SYSUTILS_HAS_ANSISTR_ENVVAR_IMPL/SYSUTILS_HAS_UNICODESTR_ENVVAR_IMPL
    to indicate whether the platform-dependent part of the unit provides
    an ansistring/unicodestring interface to get environment variables
  + Windows version of getenvironmentvariable(unicodestring)
  + generic ansistring/unicodestring versions of GetEnvironmentVariable()
    in case the platform doesn't provide them
  * result of GetEnvironmentString() is ansistring/unicodestring depending
    on the state of the FPC_RTL_UNICODE define

git-svn-id: branches/cpstrrtl@25116 -
2013-07-16 14:16:34 +00:00
Jonas Maebe
eeb98a0c0f - removed platform-specific implementations of GetCurrentDir, SetCurrentDir,
CreateDir and RemoveDir, and implemented a generic one (based on the OS/2
    version) in the shared sysutils code (so that the filesystem code page
    support for the system unit routines can be reused)
  * include both ansistring and unicodestring versions of the above routines,
    and of ForceDirectories. Exception: GetCurrentDir, which cannot be
    overloaded based on function result and whose return type currently
    dependends on the FPC_UNICODE_RTL define

git-svn-id: branches/cpstrrtl@25113 -
2013-07-16 14:15:55 +00:00
Jonas Maebe
26b2149ced * converted the following sysutils routines to unicodestring and
rawbytestring: FileExists, DirectoryExists, FileSetDate, FileGetAttr,
    FileSetAttr, DeleteFile, RenameFile, FileSearch, ExeSearch,
    FileIsReadOnly

git-svn-id: branches/cpstrrtl@25078 -
2013-07-09 19:01:45 +00:00
Jonas Maebe
60365489e2 * converted fileopen/filecreate interface to RawByteString for
msdos/embedded, but do not perform any code page conversions
    (size limits prevent widestring manager on msdos, and the
     embedded routines are empty)

git-svn-id: branches/cpstrrtl@25076 -
2013-07-09 19:01:36 +00:00
Jonas Maebe
d66d15aad3 + added mkdir/chdir/rmdir(rawbytestring) and (unicodestring) to the system unit
* renamed platform-specific pchar versions of those rouines to do_*() and
    changed them to either rawbytestring or unicodestring depending on the
    FPCRTL_FILESYSTEM_SINGLE_BYTE_API/FPCRTL_FILESYSTEM_TWO_BYTE_API setting
  * implemented generic shortstring versions of those routines on top of either
    rawbytestring or unicodestring depending on the API-kind (in case of the
    embedded target, if ansistring are not supported they will map directly
    to shortstring routines instead)
  * all platform-specific *dir() routines with rawbytestring parameters now
    receive their parameters in DefaultFileSystemCodePage
  - removed no longer required ansistring variants from the objpas unit
  - removed no longer required FPC_SYS_MKDIR etc aliases
  * factored out empty string and inoutres<>0 checks from platform-specific
    *dir() routines to generic ones
  o platform-specific notes:
   o amiga/morphos: check new pathconv(rawbytestring) function
   o macos TODO: convert PathArgToFSSpec (and the routines it calls) to
     rawbytestring
   o nativent: added SysUnicodeStringToNtStr() function
   o wii: convert dirio callbacks to use rawbytestring to avoid conversion
  + test for unicode mk/ch/rm/getdir()

git-svn-id: branches/cpstrrtl@25048 -
2013-07-04 22:28:37 +00:00
Jonas Maebe
893a9a57c6 * missing getdir -> do_getdir rename for r24993
git-svn-id: branches/cpstrrtl@25046 -
2013-07-04 22:28:27 +00:00
nickysn
3505ba4ee6 + added CPU detection code in the msdos rtl startup in order to properly initialize the Test8086 variable
git-svn-id: trunk@25034 -
2013-07-03 15:43:01 +00:00
Jonas Maebe
62ee16278b * changed getdir(ansistring):ansistring to
getdir(rawbytestring):rawbytestring so it can accept strings in any
    encoding and cleanly return results in DefaultRTLFileSystemCodePage
  + getdir(unicodestring):unicodestring
  * renamed the getdir implementation of all platforms except for embedded-
    without-ansistring-support to do_getdir(), and depending on the
    FPCRTL_FILESYSTEM_SINGLE_BYTE_API/FPCRTL_FILESYSTEM_TWO_BYTE_API define
    changed its shortstring parameter to ansistring or unicodestring. The
    do_getdir(rawbytestring) routine should just set the code page of the
    return value to DefaultFileSystemCodePage without conversion (not
    DefaultRTLFileSystemCodePage with conversion, that conversion is performed
    in getdir if necessary; this avoids double conversions in case
    getdir(unicodestring) is called)
  + generic getdir(shortstring) for platforms supporting either ansistrings or widestrings
  o platform maintainers:
   o OS/2: adjust code to supports paths > 255 characters if those are supported
   o Wii: adjust used callback to use rawbytestring to support paths > 255 characters and
     avoid shortstring->rawbytestring conversion overhead
   o Windows: GetCurrentDirectoryW is now always used (to prevent data loss)

git-svn-id: branches/cpstrrtl@24993 -
2013-06-27 21:37:47 +00:00
Jonas Maebe
da7a67bc74 + FPCRTL_FILESYSTEM_SINGLE_BYTE_API define that is set for targets where we
use a single byte API for file system operations
  + FPCRTL_FILESYSTEM_TWO_BYTE_API define that is set for targets where we
    use a single byte API for file system operations
   o in principle, both can be set if both are supprted and implemented in
     the RTL in order to minimise conversions depending on the scenario

git-svn-id: branches/cpstrrtl@24991 -
2013-06-27 21:37:39 +00:00
Jonas Maebe
eae1cd6cca * msdos target was added after the cpstrrtl branch was created; no special
defines

git-svn-id: branches/cpstrrtl@24914 -
2013-06-18 10:57:49 +00:00
nickysn
5d4ebf0dca + added extra_param_offset constant for accessing parameters in asm routines with nostackframe
git-svn-id: trunk@24873 -
2013-06-11 21:08:43 +00:00
nickysn
b74af9fda0 * declare the text segment with class=code on i8086-msdos
git-svn-id: trunk@24830 -
2013-06-09 12:13:52 +00:00
nickysn
cd5255c147 + added startup code for the medium memory model
git-svn-id: trunk@24820 -
2013-06-08 22:41:43 +00:00
nickysn
54ec2f4b4b * makefiles updated after the msdos loader changes
git-svn-id: trunk@24810 -
2013-06-05 16:43:56 +00:00
nickysn
e28852d07d * prt0 startup code file for small model renamed to prt0s
git-svn-id: trunk@24809 -
2013-06-05 16:41:39 +00:00
nickysn
c124283a36 * msdos startup code for tiny and small memory models moved to a shared nasm include file to avoid code duplication
git-svn-id: trunk@24808 -
2013-06-05 16:38:01 +00:00
nickysn
4cd26988ad + added prt0t.o (loader for i8086-msdos tiny memory model) to the makefiles
git-svn-id: trunk@24801 -
2013-06-03 21:11:45 +00:00
nickysn
b409d600ee + implemented the tiny memory model for i8086-msdos; we now produce working dos .com files as well
git-svn-id: trunk@24793 -
2013-06-02 23:02:10 +00:00
nickysn
c867fb14dd + implemented dos.exec on i8086-msdos
git-svn-id: trunk@24774 -
2013-06-02 13:42:29 +00:00
nickysn
40630a7cde * slight accuracy improvement in crt.delay for i8086-msdos
git-svn-id: trunk@24749 -
2013-06-01 19:23:25 +00:00
nickysn
4b3c67c51a + implemented dos.Keep for i8086-msdos; simple dos TSRs now work
git-svn-id: trunk@24730 -
2013-06-01 16:42:56 +00:00
nickysn
3953eed6b3 + added and implemented unit ports for i8086-msdos
git-svn-id: trunk@24722 -
2013-06-01 14:44:49 +00:00
nickysn
896d2f2bd5 + implemented dos.GetIntVec and SetIntVec for i8086-msdos
git-svn-id: trunk@24720 -
2013-06-01 14:32:03 +00:00