gba_window.pas 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. (*
  2. gba_window.pas 18/06/2006 4.40.07
  3. ------------------------------------------------------------------------------
  4. This lib is a raw porting of libgba library for gba (you can find it at
  5. http://www.devkitpro.org).
  6. As this is a direct port from c, I'm pretty sure that something could not work
  7. as you expect. I am even more sure that this code could be written better, so
  8. if you think that I have made some mistakes or you have some better
  9. implemented functions, let me know [francky74 (at) gmail (dot) com]
  10. Enjoy!
  11. Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
  12. (http://www.freepascal.org)
  13. Copyright (C) 2006 Francesco Lombardi
  14. This library is free software; you can redistribute it and/or
  15. modify it under the terms of the GNU Lesser General Public
  16. License as published by the Free Software Foundation; either
  17. version 2.1 of the License, or (at your option) any later version.
  18. This library is distributed in the hope that it will be useful,
  19. but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  21. Lesser General Public License for more details.
  22. You should have received a copy of the GNU Lesser General Public
  23. License along with this library; if not, write to the Free Software
  24. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  25. ------------------------------------------------------------------------------
  26. *)
  27. unit gba_window;
  28. {$i def.inc}
  29. interface
  30. uses
  31. gba_types;
  32. const
  33. WIN_0_BG0 = (1 shl 0);
  34. WIN_0_BG1 = (1 shl 1);
  35. WIN_0_BG2 = (1 shl 2);
  36. WIN_0_BG3 = (1 shl 3);
  37. WIN_0_OBJ = (1 shl 4);
  38. WIN_0_SPE = (1 shl 5);
  39. WIN_1_BG0 = (1 shl 8);
  40. WIN_1_BG1 = (1 shl 9);
  41. WIN_1_BG2 = (1 shl 10);
  42. WIN_1_BG3 = (1 shl 11);
  43. WIN_1_OBJ = (1 shl 12);
  44. WIN_1_SPE = (1 shl 13);
  45. function WinRight(x: dword): dword;
  46. function WinLeft(x: dword): dword;
  47. function WinDown(x: dword): dword;
  48. function WinTop(x: dword): dword;
  49. implementation
  50. function WinRight(x: dword): dword;
  51. begin
  52. WinRight := (x shl 0);
  53. end;
  54. function WinLeft(x: dword): dword;
  55. begin
  56. WinLeft := (x shl 8);
  57. end;
  58. function WinDown(x: dword): dword;
  59. begin
  60. WinDown := (x shl 0);
  61. end;
  62. function WinTop(x: dword): dword;
  63. begin
  64. WinTop := (x shl 8);
  65. end;
  66. end.