background.inc 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. (*
  2. $Id: background.inc 25 2007-12-10 21:06:46Z p4p3r0 $
  3. ------------------------------------------------------------------------------
  4. Copyright (C) 2005
  5. Jason Rogers (dovoto)
  6. Dave Murphy (WinterMute)
  7. This software is provided 'as-is', without any express or implied
  8. warranty. In no event will the authors be held liable for any
  9. damages arising from the use of this software.
  10. Permission is granted to anyone to use this software for any
  11. purpose, including commercial applications, and to alter it and
  12. redistribute it freely, subject to the following restrictions:
  13. 1. The origin of this software must not be misrepresented; you
  14. must not claim that you wrote the original software. If you use
  15. this software in a product, an acknowledgment in the product
  16. documentation would be appreciated but is not required.
  17. 2. Altered source versions must be plainly marked as such, and
  18. must not be misrepresented as being the original software.
  19. 3. This notice may not be removed or altered from any source
  20. distribution.
  21. ------------------------------------------------------------------------------
  22. Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
  23. (http://www.freepascal.org)
  24. Copyright (C) 2006 Francesco Lombardi
  25. Check http://sourceforge.net/projects/libndsfpc for updates
  26. ------------------------------------------------------------------------------
  27. $Log$
  28. *)
  29. // Background control defines
  30. {$ifdef NDS_INTERFACE}
  31. // BGxCNT defines ///
  32. const
  33. BG_MOSAIC_ENABLE = $40;
  34. BG_COLOR_256 = $80;
  35. BG_COLOR_16 = $00;
  36. {$endif NDS_INTERFACE}
  37. {$ifdef NDS_IMPLEMENTATION}
  38. function CHAR_BASE_BLOCK(n: cint): cint; inline;
  39. begin
  40. CHAR_BASE_BLOCK := (n * $4000)+ $06000000;
  41. end;
  42. function CHAR_BASE_BLOCK_SUB(n: cint): cint; inline;
  43. begin
  44. CHAR_BASE_BLOCK_SUB := (n * $4000)+ $06200000;
  45. end;
  46. function SCREEN_BASE_BLOCK(n: cint): cint; inline;
  47. begin
  48. SCREEN_BASE_BLOCK := (n * $800) + $06000000;
  49. end;
  50. function SCREEN_BASE_BLOCK_SUB(n: cint): cint; inline;
  51. begin
  52. SCREEN_BASE_BLOCK_SUB := (n * $800) + $06200000;
  53. end;
  54. {$endif NDS_IMPLEMENTATION}
  55. {$ifdef NDS_INTERFACE}
  56. const
  57. CHAR_SHIFT = 2;
  58. SCREEN_SHIFT = 8;
  59. TEXTBG_SIZE_256x256 = $0;
  60. TEXTBG_SIZE_256x512 = $8000;
  61. TEXTBG_SIZE_512x256 = $4000;
  62. TEXTBG_SIZE_512x512 = $C000;
  63. ROTBG_SIZE_128x128 = $0;
  64. ROTBG_SIZE_256x256 = $4000;
  65. ROTBG_SIZE_512x512 = $8000;
  66. ROTBG_SIZE_1024x1024 = $C000;
  67. WRAPAROUND = $1;
  68. {$endif NDS_INTERFACE}
  69. {$ifdef NDS_INTERFACE}
  70. function CHAR_BASE_BLOCK(n: cint): cint; inline;
  71. function CHAR_BASE_BLOCK_SUB(n: cint): cint; inline;
  72. function SCREEN_BASE_BLOCK(n: cint): cint; inline;
  73. function SCREEN_BASE_BLOCK_SUB(n: cint): cint; inline;
  74. {$endif NDS_INTERFACE}