postest.inc 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. (*
  2. $Id: postest.inc 25 2007-12-10 21:06:46Z p4p3r0 $
  3. ------------------------------------------------------------------------------
  4. Copyright (C) 2007
  5. Michael Noland (joat)
  6. Jason Rogers (dovoto)
  7. Dave Murphy (WinterMute)
  8. This software is provided 'as-is', without any express or implied
  9. warranty. In no event will the authors be held liable for any
  10. damages arising from the use of this software.
  11. Permission is granted to anyone to use this software for any
  12. purpose, including commercial applications, and to alter it and
  13. redistribute it freely, subject to the following restrictions:
  14. 1. The origin of this software must not be misrepresented; you
  15. must not claim that you wrote the original software. If you use
  16. this software in a product, an acknowledgment in the product
  17. documentation would be appreciated but is not required.
  18. 2. Altered source versions must be plainly marked as such, and
  19. must not be misrepresented as being the original software.
  20. 3. This notice may not be removed or altered from any source
  21. distribution.
  22. ------------------------------------------------------------------------------
  23. Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
  24. (http://www.freepascal.org)
  25. Copyright (C) 2007 Francesco Lombardi
  26. Check http://sourceforge.net/projects/libndsfpc for updates
  27. ------------------------------------------------------------------------------
  28. $Log$
  29. *)
  30. {$ifdef NDS_IMPLEMENTATION}
  31. function PosTestBusy(): cbool; inline;
  32. begin
  33. PosTestBusy := (GFX_STATUS^ and (1 shl 0)) <> 0;
  34. end;
  35. procedure PosTest_Asynch(x, y, z: v16); inline;
  36. begin
  37. GFX_POS_TEST^ := VERTEX_PACK(x, y);
  38. GFX_POS_TEST^ := z;
  39. end;
  40. procedure PosTest(x, y, z: v16); inline;
  41. begin
  42. PosTest_Asynch(x, y, z);
  43. while PosTestBusy() do;
  44. end;
  45. function PosTestWresult(): cint32; inline;
  46. begin
  47. PosTestWresult := GFX_POS_RESULT[3];
  48. end;
  49. function PosTestXresult(): cint32; inline;
  50. begin
  51. PosTestXresult := GFX_POS_RESULT[0];
  52. end;
  53. function PosTestYresult(): cint32; inline;
  54. begin
  55. PosTestYresult := GFX_POS_RESULT[1];
  56. end;
  57. function PosTestZresult(): cint32; inline;
  58. begin
  59. PosTestZresult := GFX_POS_RESULT[2];
  60. end;
  61. {$endif NDS_IMPLEMENTATION}
  62. {$ifdef NDS_INTERFACE}
  63. function PosTestBusy(): cbool; inline;
  64. procedure PosTest_Asynch(x, y, z: v16); inline;
  65. procedure PosTest(x, y, z: v16); inline;
  66. function PosTestWresult(): cint32; inline;
  67. function PosTestXresult(): cint32; inline;
  68. function PosTestYresult(): cint32; inline;
  69. function PosTestZresult(): cint32; inline;
  70. {$endif NDS_INTERFACE}