libetc.pas 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // (C) Copyright 1993/1994 Sony Corporation,Tokyo,Japan. All Rights Reserved
  2. // libetc.h: Pad Interface
  3. unit libetc;
  4. interface
  5. var
  6. PadIdentifier: longint; external;
  7. // PAD I/O (SIO Pad)
  8. const
  9. PADLup = 1 shl 12;
  10. PADLdown = 1 shl 14;
  11. PADLleft = 1 shl 15;
  12. PADLright = 1 shl 13;
  13. PADRup = 1 shl 4;
  14. PADRdown = 1 shl 6;
  15. PADRleft = 1 shl 7;
  16. PADRright = 1 shl 5;
  17. PADi = 1 shl 9;
  18. PADj = 1 shl 10;
  19. PADk = 1 shl 8;
  20. PADl = 1 shl 3;
  21. PADm = 1 shl 1;
  22. PADn = 1 shl 2;
  23. PADo = 1 shl 0;
  24. PADh = 1 shl 11;
  25. PADL1 = PADn;
  26. PADL2 = PADo;
  27. PADR1 = PADl;
  28. PADR2 = PADm;
  29. PADstart = PADh;
  30. PADselect = PADk;
  31. MOUSEleft = 1 shl 3;
  32. MOUSEright = 1 shl 2;
  33. // PAD utility macro: _PAD(x,y)
  34. // x: controller ID (0 or 1)
  35. // y: PAD assign macro
  36. //
  37. // Example: _PAD(0,PADstart) ... PADstart of controller 1
  38. // _PAD(1,PADLup) ... PADLup of controller 2
  39. function _PAD(x, y: longint): longint;
  40. // scratch pad address 0x1f800000 - 0x1f800400 */
  41. function getScratchAddr(offset: dword): dword;
  42. // Video Mode: NTSC/PAL
  43. const
  44. MODE_NTSC = 0;
  45. MODE_PAL = 1;
  46. function CheckCallback: longint; stdcall; external;
  47. procedure PadInit(mode: longint); stdcall; external;
  48. function ResetCallback: longint; stdcall; external;
  49. function RestartCallback: longint; stdcall; external;
  50. function StopCallback: longint; stdcall; external;
  51. function VSync(mode: longint): longint; stdcall; external;
  52. function VSyncCallback(f: pointer): longint; stdcall; external;
  53. function GetVideoMode: longint; stdcall; external;
  54. function SetVideoMode(mode: longint): longint; stdcall; external;
  55. function PadRead(id: longint): dword; stdcall; external;
  56. procedure PadStop; stdcall; external;
  57. implementation
  58. function _PAD(x, y: longint): longint;
  59. begin
  60. _PAD:= y shl x shl 4;
  61. end;
  62. function getScratchAddr(offset: dword): dword;
  63. begin
  64. getScratchAddr:= $1f800000+(offset*4);
  65. end;
  66. begin
  67. end.