gados.c 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /****************************************************************************
  2. *
  3. * SciTech Nucleus Graphics Architecture
  4. *
  5. * Copyright (C) 1991-1998 SciTech Software, Inc.
  6. * All rights reserved.
  7. *
  8. * ======================================================================
  9. * |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
  10. * | |
  11. * |This copyrighted computer code contains proprietary technology |
  12. * |owned by SciTech Software, Inc., located at 505 Wall Street, |
  13. * |Chico, CA 95928 USA (http://www.scitechsoft.com). |
  14. * | |
  15. * |The contents of this file are subject to the SciTech Nucleus |
  16. * |License; you may *not* use this file or related software except in |
  17. * |compliance with the License. You may obtain a copy of the License |
  18. * |at http://www.scitechsoft.com/nucleus-license.txt |
  19. * | |
  20. * |Software distributed under the License is distributed on an |
  21. * |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or |
  22. * |implied. See the License for the specific language governing |
  23. * |rights and limitations under the License. |
  24. * | |
  25. * |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
  26. * ======================================================================
  27. *
  28. * Language: ANSI C
  29. * Environment: MSDOS
  30. *
  31. * Description: OS specific Nucleus Graphics Architecture services for
  32. * the MSDOS operating system.
  33. *
  34. ****************************************************************************/
  35. #include "pm_help.h"
  36. #include "pmapi.h"
  37. #include <stdio.h>
  38. #include <stdlib.h>
  39. #include <string.h>
  40. /*-------------------------- Implementation -------------------------------*/
  41. /****************************************************************************
  42. PARAMETERS:
  43. path - Local path to the Nucleus driver files.
  44. REMARKS:
  45. This function is used by the application program to override the location
  46. of the Nucleus driver files that are loaded. Normally the loader code
  47. will look in the system Nucleus directories first, then in the 'drivers'
  48. directory relative to the current working directory, and finally relative
  49. to the MGL_ROOT environment variable.
  50. ****************************************************************************/
  51. void NAPI GA_setLocalPath(
  52. const char *path)
  53. {
  54. PM_setLocalBPDPath(path);
  55. }
  56. /****************************************************************************
  57. RETURNS:
  58. Pointer to the system wide PM library imports, or the internal version if none
  59. REMARKS:
  60. Nothing to do here for DOS. Basically since DOS has no system wide shared
  61. library mechanism we are essentially screwed if the binary API changes.
  62. By default for 32-bit DOS apps the local Nucleus drivers should always be
  63. used in preference to the system wide Nucleus drivers.
  64. ****************************************************************************/
  65. PM_imports * NAPI GA_getSystemPMImports(void)
  66. {
  67. return &_PM_imports;
  68. }
  69. /****************************************************************************
  70. REMARKS:
  71. Nothing special for this OS.
  72. ****************************************************************************/
  73. ibool NAPI GA_getSharedExports(
  74. GA_exports *gaExp,
  75. ibool shared)
  76. {
  77. (void)gaExp;
  78. (void)shared;
  79. return false;
  80. }
  81. #if !defined(TEST_HARNESS) && !defined(VBETEST)
  82. /****************************************************************************
  83. REMARKS:
  84. Nothing special for this OS
  85. ****************************************************************************/
  86. ibool NAPI GA_queryFunctions(
  87. GA_devCtx *dc,
  88. N_uint32 id,
  89. void _FAR_ *funcs)
  90. {
  91. return __GA_exports.GA_queryFunctions(dc,id,funcs);
  92. }
  93. /****************************************************************************
  94. REMARKS:
  95. Nothing special for this OS
  96. ****************************************************************************/
  97. ibool NAPI REF2D_queryFunctions(
  98. REF2D_driver *ref2d,
  99. N_uint32 id,
  100. void _FAR_ *funcs)
  101. {
  102. return __GA_exports.REF2D_queryFunctions(ref2d,id,funcs);
  103. }
  104. #endif
  105. /****************************************************************************
  106. REMARKS:
  107. This function initialises the high precision timing functions for the DOS
  108. Nucleus loader library.
  109. ****************************************************************************/
  110. ibool NAPI GA_TimerInit(void)
  111. {
  112. if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0)
  113. return true;
  114. return false;
  115. }
  116. /****************************************************************************
  117. REMARKS:
  118. This function reads the high resolution timer.
  119. ****************************************************************************/
  120. void NAPI GA_TimerRead(
  121. GA_largeInteger *value)
  122. {
  123. _GA_readTimeStamp(value);
  124. }