gba_bios.pas 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. (*
  2. gba_bios.pas 18/06/2006 4.17.48
  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_bios;
  28. {$i def.inc}
  29. interface
  30. uses
  31. gba_types;
  32. procedure SoftReset();cdecl; external;
  33. procedure RegisterRamReset(flags: dword); cdecl; external;
  34. procedure Halt(); cdecl; external;
  35. procedure Stop(); cdecl; external;
  36. procedure IntrWait(flagClear, irq: dword); cdecl; external;
  37. procedure VBlankIntrWait(); cdecl; external;
  38. function Divi(numerator, denominator: longint): longint; cdecl; external;
  39. function DiviArm(denominator, numerator: longint): longint; cdecl; external;
  40. function Sqrt(value: dword): dword; cdecl; external;
  41. function ArcTan(ang: smallint): smallint; cdecl; external;
  42. function ArcTan2(x, y: smallint): word; cdecl; external;
  43. procedure CpuSet(source, dest: pointer; mode: dword); cdecl; external;
  44. procedure CpuFastSet(source, dest: pointer; mode: dword); cdecl; external;
  45. procedure ObjAffineSet(source: PObjAffineSource; dest: pointer; num: longint; offset: longint); cdecl; external;
  46. procedure BgAffineSet(source: PBGAffineSource; dest: PBGAffineDest; num: longint); cdecl; external;
  47. procedure BitUnPack(source: pointer; dest: pointer; _bup: PBUP); cdecl; external;
  48. procedure LZ77UnCompWram(source, dest: pointer); cdecl; external;
  49. procedure LZ77UnCompVram(source, dest: pointer); cdecl; external;
  50. procedure HuffUnComp(source, dest: pointer); cdecl; external;
  51. procedure RLUnCompWram(source, dest: pointer); cdecl; external;
  52. procedure RLUnCompVram(source, dest: pointer); cdecl; external;
  53. procedure Diff8bitUnFilterWram(source, dest: pointer); cdecl; external;
  54. procedure Diff8bitUnFilterVram(source, dest: pointer); cdecl; external;
  55. procedure Diff16bitUnFilter(source, dest: pointer); cdecl; external;
  56. function MultiBoot(mb: PMultiBootParam; mode: dword): integer; cdecl; external;
  57. procedure SoundBias(); cdecl; external;
  58. procedure SoundDriverInit(); cdecl; external;
  59. procedure SoundDriverMode(mode: dword); cdecl; external;
  60. procedure SoundDriverMain(); cdecl; external;
  61. procedure SoundDriverVSync(); cdecl; external;
  62. procedure SoundChannelClear(); cdecl; external;
  63. procedure MidiKey2Freq(); cdecl; external;
  64. procedure SoundDriverVSyncOff(); cdecl; external;
  65. procedure SoundDriverVSyncOn(); cdecl; external;
  66. implementation
  67. {$l bios_asm.o}
  68. end.