mikmod.inc 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076
  1. (* MikMod sound library
  2. (c) 1998, 1999, 2000 Miodrag Vallat and others - see file AUTHORS
  3. for complete list.
  4. This library is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of
  7. the License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public
  13. License along with this library; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  15. 02111-1307, USA.
  16. *)
  17. {$ifdef NDS_INTERFACE}
  18. (**** CONST *******************************************************************)
  19. const
  20. LIBMIKMOD_VERSION_MAJOR = 3;
  21. LIBMIKMOD_VERSION_MINOR = 1;
  22. LIBMIKMOD_REVISION = 10;
  23. LIBMIKMOD_VERSION = (
  24. (LIBMIKMOD_VERSION_MAJOR shl 16) or
  25. (LIBMIKMOD_VERSION_MINOR shl 8) or
  26. (LIBMIKMOD_REVISION)
  27. );
  28. SFX_CRITICAL = 1;
  29. SF_16BITS = $0001;
  30. SF_STEREO = $0002;
  31. SF_SIGNED = $0004;
  32. SF_BIG_ENDIAN = $0008;
  33. SF_DELTA = $0010;
  34. SF_ITPACKED = $0020;
  35. SF_FORMATMASK = $003F;
  36. SF_LOOP = $0100;
  37. SF_BIDI = $0200;
  38. SF_REVERSE = $0400;
  39. SF_SUSTAIN = $0800;
  40. SF_PLAYBACKMASK = $0C00;
  41. SF_OWNPAN = $1000;
  42. SF_UST_LOOP = $2000;
  43. SF_EXTRAPLAYBACKMASK = $3000;
  44. PAN_LEFT = 0;
  45. PAN_HALFLEFT = 64;
  46. PAN_CENTER = 128;
  47. PAN_HALFRIGHT = 192;
  48. PAN_RIGHT = 255;
  49. PAN_SURROUND = 512;
  50. INSTNOTES = 120;
  51. ENVPOINTS = 32;
  52. UF_MAXCHAN = 64;
  53. UF_XMPERIODS = $0001;
  54. UF_LINEAR = $0002;
  55. UF_INST = $0004;
  56. UF_NNA = $0008;
  57. UF_S3MSLIDES = $0010;
  58. UF_BGSLIDES = $0020;
  59. UF_HIGHBPM = $0040;
  60. UF_NOWRAP = $0080;
  61. UF_ARPMEM = $0100;
  62. UF_FT2QUIRKS = $0200;
  63. UF_PANNING = $0400;
  64. MUTE_EXCLUSIVE = 32000;
  65. MUTE_INCLUSIVE = 32001;
  66. DMODE_16BITS = $0001;
  67. DMODE_STEREO = $0002;
  68. DMODE_SOFT_SNDFX = $0004;
  69. DMODE_SOFT_MUSIC = $0008;
  70. DMODE_HQMIXER = $0010;
  71. DMODE_SURROUND = $0100;
  72. DMODE_INTERP = $0200;
  73. DMODE_REVERSE = $0400;
  74. OCTAVE = 12;
  75. UF_MAXMACRO = $10;
  76. UF_MAXFILTER = $100;
  77. FILT_CUT = $80;
  78. FILT_RESONANT = $81;
  79. IF_OWNPAN = 1;
  80. IF_PITCHPAN = 2;
  81. EF_ON = 1;
  82. EF_SUSTAIN = 2;
  83. EF_LOOP = 4;
  84. EF_VOLENV = 8;
  85. NNA_CUT = 0;
  86. NNA_CONTINUE = 1;
  87. NNA_OFF = 2;
  88. NNA_FADE = 3;
  89. NNA_MASK = 3;
  90. DCT_OFF = 0;
  91. DCT_NOTE = 1;
  92. DCT_SAMPLE = 2;
  93. DCT_INST = 3;
  94. DCA_CUT = 0;
  95. DCA_OFF = 1;
  96. DCA_FADE = 2;
  97. KEY_KICK = 0;
  98. KEY_OFF = 1;
  99. KEY_FADE = 2;
  100. KEY_KILL = (KEY_OFF or KEY_FADE);
  101. KICK_ABSENT = 0;
  102. KICK_NOTE = 1;
  103. KICK_KEYOFF = 2;
  104. KICK_ENV = 4;
  105. AV_IT = 1;
  106. POS_NONE = (-2);
  107. LAST_PATTERN = word(-1);
  108. S3MIT_OLDSTYLE = 1;
  109. S3MIT_IT = 2;
  110. S3MIT_SCREAM = 4;
  111. MAXSAMPLEHANDLES = 384;
  112. (****** Types *****************************************************************)
  113. type
  114. SBYTE = cschar;
  115. PSBYTE = ^cschar;
  116. UBYTE = cuchar;
  117. PUBYTE = ^cuchar;
  118. SWORD = csshort;
  119. PSWORD = ^csshort;
  120. UWORD = cushort;
  121. PUWORD = ^cushort;
  122. SLONG = csint;
  123. PSLONG = ^csint;
  124. ULONG = cuint;
  125. PULONG = ^cuint;
  126. BOOL = cint;
  127. MikMod_Errors = (
  128. MMERR_OPENING_FILE = 1,
  129. MMERR_OUT_OF_MEMORY,
  130. MMERR_DYNAMIC_LINKING,
  131. MMERR_SAMPLE_TOO_BIG,
  132. MMERR_OUT_OF_HANDLES,
  133. MMERR_UNKNOWN_WAVE_TYPE,
  134. MMERR_LOADING_PATTERN,
  135. MMERR_LOADING_TRACK,
  136. MMERR_LOADING_HEADER,
  137. MMERR_LOADING_SAMPLEINFO,
  138. MMERR_NOT_A_MODULE,
  139. MMERR_NOT_A_STREAM,
  140. MMERR_MED_SYNTHSAMPLES,
  141. MMERR_ITPACK_INVALID_DATA,
  142. MMERR_DETECTING_DEVICE,
  143. MMERR_INVALID_DEVICE,
  144. MMERR_INITIALIZING_MIXER,
  145. MMERR_OPENING_AUDIO,
  146. MMERR_8BIT_ONLY,
  147. MMERR_16BIT_ONLY,
  148. MMERR_STEREO_ONLY,
  149. MMERR_ULAW,
  150. MMERR_NON_BLOCK,
  151. MMERR_AF_AUDIO_PORT,
  152. MMERR_AIX_CONFIG_INIT,
  153. MMERR_AIX_CONFIG_CONTROL,
  154. MMERR_AIX_CONFIG_START,
  155. MMERR_GUS_SETTINGS,
  156. MMERR_GUS_RESET,
  157. MMERR_GUS_TIMER,
  158. MMERR_HP_SETSAMPLESIZE,
  159. MMERR_HP_SETSPEED,
  160. MMERR_HP_CHANNELS,
  161. MMERR_HP_AUDIO_OUTPUT,
  162. MMERR_HP_AUDIO_DESC,
  163. MMERR_HP_BUFFERSIZE,
  164. MMERR_OSS_SETFRAGMENT,
  165. MMERR_OSS_SETSAMPLESIZE,
  166. MMERR_OSS_SETSTEREO,
  167. MMERR_OSS_SETSPEED,
  168. MMERR_SGI_SPEED,
  169. MMERR_SGI_16BIT,
  170. MMERR_SGI_8BIT,
  171. MMERR_SGI_STEREO,
  172. MMERR_SGI_MONO,
  173. MMERR_SUN_INIT,
  174. MMERR_OS2_MIXSETUP,
  175. MMERR_OS2_SEMAPHORE,
  176. MMERR_OS2_TIMER,
  177. MMERR_OS2_THREAD,
  178. MMERR_DS_PRIORITY,
  179. MMERR_DS_BUFFER,
  180. MMERR_DS_FORMAT,
  181. MMERR_DS_NOTIFY,
  182. MMERR_DS_EVENT,
  183. MMERR_DS_THREAD,
  184. MMERR_DS_UPDATE,
  185. MMERR_WINMM_HANDLE,
  186. MMERR_WINMM_ALLOCATED,
  187. MMERR_WINMM_DEVICEID,
  188. MMERR_WINMM_FORMAT,
  189. MMERR_WINMM_UNKNOWN,
  190. MMERR_MAC_SPEED,
  191. MMERR_MAC_START,
  192. MMERR_MAX
  193. );
  194. SAMPLE = packed record
  195. panning: csshort;
  196. speed: culong;
  197. volume: cuchar;
  198. inflags: cushort;
  199. flags: cushort;
  200. length: cuint;
  201. loopstart: cuint;
  202. loopend: cuint;
  203. susbegin: cuint;
  204. susend: cuint;
  205. globvol: cuchar;
  206. vibflags: cuchar;
  207. vibtype: cuchar;
  208. vibsweep: cuchar;
  209. vibdepth: cuchar;
  210. vibrate: cuchar;
  211. samplename: pcchar;
  212. avibpos: cushort;
  213. divfactor: cuchar;
  214. seekpos: cuint;
  215. handle: csshort;
  216. end;
  217. TSample = SAMPLE;
  218. PSample = ^SAMPLE;
  219. ENVPT = packed record
  220. pos: csshort;
  221. val: csshort;
  222. end;
  223. TENVPT = ENVPT;
  224. PENVPT = ^ENVPT;
  225. INSTRUMENT = packed record
  226. insname: pcchar;
  227. flags: cuchar;
  228. samplenumber: array [0..INSTNOTES - 1] of cushort;
  229. samplenote: array [0..INSTNOTES - 1] of cuchar;
  230. nnatype: cuchar;
  231. dca: cuchar;
  232. dct: cuchar;
  233. globvol: cuchar;
  234. volfade: cushort;
  235. panning: csshort;
  236. pitpansep: cuchar;
  237. pitpancenter: cuchar;
  238. rvolvar: cuchar;
  239. rpanvar: cuchar;
  240. volflg: cuchar;
  241. volpts: cuchar;
  242. volsusbeg: cuchar;
  243. volsusend: cuchar;
  244. volbeg: cuchar;
  245. volend: cuchar;
  246. volenv: array [0..ENVPOINTS - 1] of ENVPT;
  247. panflg: cuchar;
  248. panpts: cuchar;
  249. pansusbeg: cuchar;
  250. pansusend: cuchar;
  251. panbeg: cuchar;
  252. panend: cuchar;
  253. panenv: array [0..ENVPOINTS - 1] of ENVPT;
  254. pitflg: cuchar;
  255. pitpts: cuchar;
  256. pitsusbeg: cuchar;
  257. pitsusend: cuchar;
  258. pitbeg: cuchar;
  259. pitend: cuchar;
  260. pitenv: array [0..ENVPOINTS - 1] of ENVPT;
  261. end;
  262. TInstrument = INSTRUMENT;
  263. PInstrument = ^INSTRUMENT;
  264. MP_CHANNEL = packed record
  265. i: PInstrument;
  266. s: PSample;
  267. sample: cuchar;
  268. note: cuchar;
  269. outvolume: csshort;
  270. chanvol: cschar;
  271. fadevol: cushort;
  272. panning: csshort;
  273. kick: cuchar;
  274. period: cushort;
  275. nna: cuchar;
  276. volflg: cuchar;
  277. panflg: cuchar;
  278. pitflg: cuchar;
  279. keyoff: cuchar;
  280. handle: csshort;
  281. notedelay: cuchar;
  282. start: csint;
  283. end;
  284. TMPChannel = MP_CHANNEL;
  285. PMPChannel = ^MP_CHANNEL;
  286. ENVPR = packed record
  287. flg: cuchar;
  288. pts: cuchar;
  289. susbeg: cuchar;
  290. susend: cuchar;
  291. beg: cuchar;
  292. _end: cuchar;
  293. p: csshort;
  294. a: cushort;
  295. b: cushort;
  296. env: PENVPT;
  297. end;
  298. TENVPR = ENVPR;
  299. PENVPR = ^ENVPR;
  300. PMP_VOICE = ^MP_VOICE;
  301. MP_CONTROL = packed record
  302. main: MP_CHANNEL;
  303. slave: PMP_VOICE;
  304. slavechn: cuchar;
  305. muted: cuchar;
  306. ultoffset: cushort;
  307. anote: cuchar;
  308. oldnote: cuchar;
  309. ownper: csshort;
  310. ownvol: csshort;
  311. dca: cuchar;
  312. dct: cuchar;
  313. row: pcuchar;
  314. retrig: cschar;
  315. speed: cuint;
  316. volume: csshort;
  317. tmpvolume: csshort;
  318. tmpperiod: cushort;
  319. wantedperiod: cushort;
  320. arpmem: cuchar;
  321. pansspd: cuchar;
  322. slidespeed: cushort;
  323. portspeed: cushort;
  324. s3mtremor: cuchar;
  325. s3mtronof: cuchar;
  326. s3mvolslide: cuchar;
  327. sliding: cschar;
  328. s3mrtgspeed: cuchar;
  329. s3mrtgslide: cuchar;
  330. glissando: cuchar;
  331. wavecontrol: cuchar;
  332. vibpos: cschar;
  333. vibspd: cuchar;
  334. vibdepth: cuchar;
  335. trmpos: cschar;
  336. trmspd: cuchar;
  337. trmdepth: cuchar;
  338. fslideupspd: cuchar;
  339. fslidednspd: cuchar;
  340. fportupspd: cuchar;
  341. fportdnspd: cuchar;
  342. ffportupspd: cuchar;
  343. ffportdnspd: cuchar;
  344. hioffset: cuint;
  345. soffset: cushort;
  346. sseffect: cuchar;
  347. ssdata: cuchar;
  348. chanvolslide: cuchar;
  349. panbwave: cuchar;
  350. panbpos: cuchar;
  351. panbspd: cschar;
  352. panbdepth: cuchar;
  353. newsamp: cushort;
  354. voleffect: cuchar;
  355. voldata: cuchar;
  356. pat_reppos: csshort;
  357. pat_repcnt: cushort;
  358. end;
  359. TMPControl = MP_CONTROL;
  360. PMPControl = ^MP_CONTROL;
  361. MP_VOICE = packed record
  362. main: MP_CHANNEL;
  363. venv: ENVPR;
  364. penv: ENVPR;
  365. cenv: ENVPR;
  366. avibpos: cushort;
  367. aswppos: cushort;
  368. totalvol: cuint;
  369. mflag: cint;
  370. masterchn: csshort;
  371. masterperiod: cushort;
  372. master: PMPControl;
  373. end;
  374. TMPVoice = MP_VOICE;
  375. PMPVoice = ^MP_VOICE;
  376. ppcuchar = ^pcuchar;
  377. MODULE = packed record
  378. songname: pcchar;
  379. modtype: pcchar;
  380. comment: pcchar;
  381. flags: cushort;
  382. numchn: cuchar;
  383. numvoices: cuchar;
  384. numpos: cushort;
  385. numpat: cushort;
  386. numins: cushort;
  387. numsmp: cushort;
  388. instruments: PInstrument;
  389. samples: PSample;
  390. realchn: cuchar;
  391. totalchn: cuchar;
  392. reppos: cushort;
  393. initspeed: cuchar;
  394. inittempo: cushort;
  395. initvolume: cuchar;
  396. panning: array [0..UF_MAXCHAN - 1] of cushort;
  397. chanvol: array [0..UF_MAXCHAN - 1] of cuchar;
  398. bpm: cushort;
  399. sngspd: cushort;
  400. volume: csshort;
  401. extspd: cint;
  402. panflag: cint;
  403. wrap: cint;
  404. loop: cint;
  405. fadeout: cint;
  406. patpos: cushort;
  407. sngpos: csshort;
  408. sngtime: cuint;
  409. relspd: csshort;
  410. numtrk: cushort;
  411. tracks: ppcuchar;
  412. patterns: pcushort;
  413. pattrows: pcushort;
  414. positions: pcushort;
  415. forbid: cint;
  416. numrow: cushort;
  417. vbtick: cushort;
  418. sngremainder: cushort;
  419. control: PMPControl;
  420. voice: PMPVoice;
  421. globalslide: cuchar;
  422. pat_repcrazy: cuchar;
  423. patbrk: cushort;
  424. patdly: cuchar;
  425. patdly2: cuchar;
  426. posjmp: csshort;
  427. bpmlimit: cushort;
  428. end;
  429. TModule = MODULE;
  430. PModule = ^MODULE;
  431. drvenum1 = (
  432. MD_MUSIC = 0,
  433. MD_SNDFX
  434. );
  435. drvenum2 = (
  436. MD_HARDWARE = 0,
  437. MD_SOFTWARE
  438. );
  439. PMReader = ^MREADER;
  440. TSeek1 = function(value1: PMReader; value2: clong; value3: cint): pcint;
  441. PSeek1 = ^TSeek1;
  442. TTell1 = function(value: PMReader): pclong;
  443. PTell1 = ^TTell1;
  444. TRead = function(value1: PMReader; value2: pointer; value3: cint): pcint;
  445. PRead = ^TRead;
  446. TGet = function(value: PMReader): pcint;
  447. PGet = ^TGet;
  448. TEof = function(value: PMReader): pcint;
  449. PEof = ^TEof;
  450. MREADER = packed record
  451. Seek: TSeek1;
  452. Tell: TTell1;
  453. Read: TRead;
  454. Get: TGet;
  455. Eof: TEof;
  456. end;
  457. PMWriter = ^MWRITER;
  458. TSeek2 = function(value1: PMWriter; value2: clong; value3: cint): pcint;
  459. PSeek2 = ^TSeek2;
  460. TTell2 = function(value: PMWriter): pclong;
  461. PTell2 = ^TTell2;
  462. TWrite = function(value1: PMWriter; value2: pointer; value3: cint): pcint;
  463. PWrite = ^TWrite;
  464. TPut = function(value1: PMWriter; value2: cint): pcint;
  465. PPut = ^TPut;
  466. MWRITER = packed record
  467. Seek: TSeek2;
  468. Tell: TTell2;
  469. Write: TWrite;
  470. Put: TPut;
  471. end;
  472. TMWriter = MWRITER;
  473. PSampLoad = ^SAMPLOAD;
  474. PPSampLoad = ^PSampLoad;
  475. SAMPLOAD = packed record
  476. next: PSampLoad;
  477. length: cuint;
  478. loopstart: cuint;
  479. loopend: cuint;
  480. infmt, outfmt: cushort;
  481. scalefactor: cint;
  482. sample: PSample;
  483. reader: PMReader;
  484. end;
  485. TSampLoad = SAMPLOAD;
  486. TMDCommandLine = procedure(value: pcchar);
  487. PMDCommandLine = ^TMDCommandLine;
  488. TMDIsPresent = function(): cint;
  489. PMDIsPresent = ^TMDIsPresent;
  490. TMDSampleLoad = function (value1: PSAMPLOAD; value2: cint): csshort;
  491. PMDSampleLoad = ^TMDSampleLoad;
  492. TMDSampleUnload = procedure(value: csshort);
  493. PMDSampleUnload = ^TMDSampleUnload;
  494. TMDFreeSampleSpace = function(value: cint): cuint;
  495. PMDFreeSampleSpace = ^TMDFreeSampleSpace;
  496. TMDRealSampleLength = function(value1: cint; value2: PSAMPLE): cuint;
  497. PMDRealSampleLength = ^TMDRealSampleLength;
  498. TMDInit = function(): cint;
  499. PMDInit = ^TMDInit;
  500. TMDExit = procedure();
  501. PMDExit = ^TMDExit;
  502. TMDReset = function(): cint;
  503. PMDReset = ^TMDReset;
  504. TMDSetNumVoices = function(): cint;
  505. PMDSetNumVoices = ^TMDSetNumVoices;
  506. TMDPlayStart = function(): cint;
  507. PMDPlayStart = ^TMDPlayStart;
  508. TMDPlayStop = procedure();
  509. PMDPlayStop = ^TMDPlayStop;
  510. TMDUpdate = procedure();
  511. PMDUpdate = ^TMDUpdate;
  512. TMDPause = procedure();
  513. PMDPause = ^TMDPause;
  514. TMDVoiceSetVolume = procedure(value1: cuchar; value2: cushort);
  515. PMDVoiceSetVolume = ^TMDVoiceSetVolume;
  516. TMDVoiceGetVolume = function(value: cuchar): cushort;
  517. PMDVoiceGetVolume = ^TMDVoiceGetVolume;
  518. TMDVoiceSetFrequency = procedure(value1: cuchar; value2: cuint);
  519. PMDVoiceSetFrequency = ^TMDVoiceSetFrequency;
  520. TMDVoiceGetFrequency = function(value: cuchar): cuint;
  521. PMDVoiceGetFrequency = ^TMDVoiceGetFrequency;
  522. TMDVoiceSetPanning = procedure(value1: cuchar; value2: cuint);
  523. PMDVoiceSetPanning = ^TMDVoiceSetPanning;
  524. TMDVoiceGetPanning = function(value: cuchar): cuint;
  525. PMDVoiceGetPanning = ^TMDVoiceGetPanning;
  526. TMDVoicePlay = procedure(value1: cuchar; value2: csshort; value3, value4, value5, value6: cuint; value7: cushort);
  527. PMDVoicePlay = ^TMDVoicePlay;
  528. TMDVoiceStop = procedure(value: cuchar);
  529. PMDVoiceStop = ^TMDVoiceStop;
  530. TMDVoiceStopped = function(value: cuchar): cint;
  531. PMDVoiceStopped = ^TMDVoiceStopped;
  532. TMDVoiceGetPosition = function(value: cuchar): csint;
  533. PMDVoiceGetPosition = ^TMDVoiceGetPosition;
  534. TMDVoiceRealVolume = function(value: cuchar): cuint;
  535. PMDVoiceRealVolume = ^TMDVoiceRealVolume;
  536. PMDriver = ^MDRIVER;
  537. MDRIVER = packed record
  538. next: PMdriver;
  539. Name: pcchar;
  540. Version: pcchar;
  541. HardVoiceLimit: cuchar;
  542. SoftVoiceLimit: cuchar;
  543. Alias: pcchar;
  544. CommandLine: TMDCommandLine;
  545. IsPresent: TMDIsPresent;
  546. SampleLoad: TMDSampleLoad;
  547. SampleUnload: TMDSampleUnload;
  548. FreeSampleSpace: TMDFreeSampleSpace;
  549. RealSampleLength: TMDRealSampleLength;
  550. Init: TMDInit;
  551. Exit: TMDExit;
  552. Reset: TMDReset;
  553. SetNumVoices: TMDSetNumVoices;
  554. PlayStart: TMDPlayStart;
  555. PlayStop: TMDPlayStop;
  556. Update: TMDUpdate;
  557. Pause: TMDPause;
  558. VoiceSetVolume: TMDVoiceSetVolume;
  559. VoiceGetVolume: TMDVoiceGetVolume;
  560. VoiceSetFrequency: TMDVoiceSetFrequency;
  561. VoiceGetFrequency: TMDVoiceGetFrequency;
  562. VoiceSetPanning: TMDVoiceSetPanning;
  563. VoiceGetPanning: TMDVoiceGetPanning;
  564. VoicePlay: TMDVoicePlay;
  565. VoiceStop: TMDVoiceStop;
  566. VoiceStopped: TMDVoiceStopped;
  567. VoiceGetPosition: TMDVoiceGetPosition;
  568. VoiceRealVolume: TMDVoiceRealVolume;
  569. end;
  570. TMDriver = MDRIVER;
  571. MikMod_player = procedure();
  572. TMikModPlayer = MikMod_player;
  573. MikMod_player_t = ^MikMod_player;
  574. PMikModPlayer = ^MikMod_player;
  575. uni_fx = (
  576. UNI_NOTE = 1,
  577. UNI_INSTRUMENT,
  578. UNI_PTEFFECT0, // arpeggio
  579. UNI_PTEFFECT1, // porta up
  580. UNI_PTEFFECT2, // porta down
  581. UNI_PTEFFECT3, // porta to note
  582. UNI_PTEFFECT4, // vibrato
  583. UNI_PTEFFECT5, // dual effect 3+A
  584. UNI_PTEFFECT6, // dual effect 4+A
  585. UNI_PTEFFECT7, // tremolo
  586. UNI_PTEFFECT8, // pan
  587. UNI_PTEFFECT9, // sample offset
  588. UNI_PTEFFECTA, // volume slide
  589. UNI_PTEFFECTB, // pattern jump
  590. UNI_PTEFFECTC, // set volume
  591. UNI_PTEFFECTD, // pattern break
  592. UNI_PTEFFECTE, // extended effects
  593. UNI_PTEFFECTF, // set speed
  594. UNI_S3MEFFECTA, // set speed
  595. UNI_S3MEFFECTD, // volume slide
  596. UNI_S3MEFFECTE, // porta down
  597. UNI_S3MEFFECTF, // porta up
  598. UNI_S3MEFFECTI, // tremor
  599. UNI_S3MEFFECTQ, // retrig
  600. UNI_S3MEFFECTR, // tremolo
  601. UNI_S3MEFFECTT, // set tempo
  602. UNI_S3MEFFECTU, // fine vibrato
  603. UNI_KEYOFF, // note off
  604. UNI_KEYFADE, // note fade
  605. UNI_VOLEFFECTS, // volume column effects
  606. UNI_XMEFFECT4, // vibrato
  607. UNI_XMEFFECT6, // dual effect 4+A
  608. UNI_XMEFFECTA, // volume slide
  609. UNI_XMEFFECTE1, // fine porta up
  610. UNI_XMEFFECTE2, // fine porta down
  611. UNI_XMEFFECTEA, // fine volume slide up
  612. UNI_XMEFFECTEB, // fine volume slide down
  613. UNI_XMEFFECTG, // set global volume
  614. UNI_XMEFFECTH, // global volume slide
  615. UNI_XMEFFECTL, // set envelope position
  616. UNI_XMEFFECTP, // pan slide
  617. UNI_XMEFFECTX1, // extra fine porta up
  618. UNI_XMEFFECTX2, // extra fine porta down
  619. UNI_ITEFFECTG, // porta to note
  620. UNI_ITEFFECTH, // vibrato
  621. UNI_ITEFFECTI, // tremor (xy not incremented)
  622. UNI_ITEFFECTM, // set channel volume
  623. UNI_ITEFFECTN, // slide / fineslide channel volume
  624. UNI_ITEFFECTP, // slide / fineslide channel panning
  625. UNI_ITEFFECTT, // slide tempo
  626. UNI_ITEFFECTU, // fine vibrato
  627. UNI_ITEFFECTW, // slide / fineslide global volume
  628. UNI_ITEFFECTY, // panbrello
  629. UNI_ITEFFECTZ, // resonant filters
  630. UNI_ITEFFECTS0,
  631. UNI_ULTEFFECT9, // Sample fine offset
  632. UNI_MEDSPEED,
  633. UNI_MEDEFFECTF1, // play note twice
  634. UNI_MEDEFFECTF2, // delay note
  635. UNI_MEDEFFECTF3, // play note three times
  636. UNI_OKTARP, // arpeggio
  637. UNI_LAST
  638. );
  639. extsound_fx = (
  640. SS_GLISSANDO = 1,
  641. SS_FINETUNE,
  642. SS_VIBWAVE,
  643. SS_TREMWAVE,
  644. SS_PANWAVE,
  645. SS_FRAMEDELAY,
  646. SS_S7EFFECTS,
  647. SS_PANNING,
  648. SS_SURROUND,
  649. SS_HIOFFSET,
  650. SS_PATLOOP,
  651. SS_NOTECUT,
  652. SS_NOTEDELAY,
  653. SS_PATDELAY
  654. );
  655. itcol_fx = (
  656. VOL_VOLUME = 1,
  657. VOL_PANNING,
  658. VOL_VOLSLIDE,
  659. VOL_PITCHSLIDEDN,
  660. VOL_PITCHSLIDEUP,
  661. VOL_PORTAMENTO,
  662. VOL_VIBRATO
  663. );
  664. FILTER = packed record
  665. filter, inf: cuchar;
  666. end;
  667. TFilter = FILTER;
  668. PFilter = ^FILTER;
  669. TMLInit = function(): cint;
  670. PMLInit = ^TMLInit;
  671. TMLTest = function(): cint;
  672. PMLTest = ^TMLTest;
  673. TMLLoad = function(value: cint): cint;
  674. PMLLoad = ^TMLLoad;
  675. TMLCleanup = procedure();
  676. PMLCleanup = ^TMLCleanup;
  677. TMLLoadTitle = function(): pcchar;
  678. PMLLoadTitle = ^TMLLoadTitle;
  679. PMLoader = ^MLOADER;
  680. MLOADER = packed record
  681. next: PMLoader;
  682. _type: pcchar;
  683. version: pcchar;
  684. Init: TMLInit;
  685. Test: TMLTest;
  686. Load: TMLLoad;
  687. Cleanup: TMLCleanup;
  688. LoadTitle: TMLLoadTitle;
  689. end;
  690. TMLoader = MLOADER;
  691. MikMod_handler = procedure;
  692. MikMod_handler_t = ^MikMod_handler;
  693. TMikModHandler = MikMod_handler;
  694. PMikModHandler = ^TMikModHandler;
  695. var
  696. _mm_errno : MikMod_Errors;
  697. _mm_critical : cint;
  698. _mm_errorhandler : MikMod_handler_t; cvar; external;
  699. unioperands: array [0.. integer(UNI_LAST) - 1] of cushort; cvar; external;
  700. MikMod_errno: cint; cvar; external;
  701. MikMod_critical: cint; cvar; external;
  702. load_669: MLOADER; cvar; external; (* 669 and Extended-669 (by Tran/Renaissance) *)
  703. load_amf: MLOADER; cvar; external; (* DMP Advanced Module Format (by Otto Chrons) *)
  704. load_dsm: MLOADER; cvar; external; (* DSIK internal module format *)
  705. load_far: MLOADER; cvar; external; (* Farandole Composer (by Daniel Potter) *)
  706. load_gdm: MLOADER; cvar; external; (* General DigiMusic (by Edward Schlunder) *)
  707. load_it: MLOADER; cvar; external; (* Impulse Tracker (by Jeffrey Lim) *)
  708. load_imf: MLOADER; cvar; external; (* Imago Orpheus (by Lutz Roeder) *)
  709. load_med: MLOADER; cvar; external; (* Amiga MED modules (by Teijo Kinnunen) *)
  710. load_m15: MLOADER; cvar; external; (* Soundtracker 15-instrument *)
  711. load_mod: MLOADER; cvar; external; (* Standard 31-instrument Module loader *)
  712. load_mtm: MLOADER; cvar; external; (* Multi-Tracker Module (by Renaissance) *)
  713. load_okt: MLOADER; cvar; external; (* Amiga Oktalyzer *)
  714. load_stm: MLOADER; cvar; external; (* ScreamTracker 2 (by Future Crew) *)
  715. load_stx: MLOADER; cvar; external; (* STMIK 0.2 (by Future Crew) *)
  716. load_s3m: MLOADER; cvar; external; (* ScreamTracker 3 (by Future Crew) *)
  717. load_ult: MLOADER; cvar; external; (* UltraTracker (by MAS) *)
  718. load_uni: MLOADER; cvar; external; (* MikMod and APlayer internal module format *)
  719. load_xm: MLOADER; cvar; external; (* FastTracker 2 (by Triton) *)
  720. md_volume: cuchar; cvar; external; (* global sound volume (0-128) *)
  721. md_musicvolume: cuchar; cvar; external; (* volume of song *)
  722. md_sndfxvolume: cuchar; cvar; external; (* volume of sound effects *)
  723. md_reverb: cuchar; cvar; external; (* 0 = none; 15 = chaos *)
  724. md_pansep: cuchar; cvar; external; (* 0 = mono; 128 == 100% (full left/right) *)
  725. md_device: cushort; cvar; external; (* device *)
  726. md_mixfreq: cushort; cvar; external; (* mixing frequency *)
  727. md_mode: cushort; cvar; external; (* mode. See DMODE_? flags above *)
  728. md_driver: PMDRIVER; cvar; external; (* Current driver in use. *)
  729. drv_nos: MDRIVER; cvar; external; (* no sound *)
  730. drv_nds_sw: MDRIVER; cvar; external; (* Nintendo DS Software driver *)
  731. drv_nds_hw: MDRIVER; cvar; external; (* Nintendo DS Hardware driver *)
  732. {$ifdef ARM9}
  733. var
  734. md_bpm: cushort; cvar;
  735. procedure MikMod9_SendCommand(command: cuint); cdecl; {forward;}external;
  736. function Player_LoadMemory(const buffer: pointer; size: cint; maxchan: cint; curious: cint): PModule; cdecl; external;
  737. {$endif ARM9}
  738. {$ifdef ARM7}
  739. procedure MikMod7_ProcessCommand(command: cuint); cdecl; external;
  740. {$endif ARM7}
  741. function MikMod_GetVersion(): clong; cdecl; external;
  742. function _mm_malloc(value: cint): pointer; cdecl; external;
  743. function _mm_calloc(value1, value2: cint): pointer; cdecl; external;
  744. procedure _mm_free(var p: pointer); inline;
  745. function Player_Init(value: PModule): cint; cdecl; external;
  746. procedure Player_Exit(value: PModule); cdecl; external;
  747. procedure Player_HandleTick(); cdecl; external;
  748. function _mm_new_file_reader(fp: P_FILE): PMReader; cdecl; external;
  749. procedure _mm_delete_file_reader(value: PMReader); cdecl; external;
  750. function _mm_new_file_writer(fp: P_FILE): PMWriter; cdecl; external;
  751. procedure _mm_delete_file_writer(value: PMWriter); cdecl; external;
  752. function _mm_FileExists(fname: pcchar): cint; cdecl; external;
  753. procedure _mm_iobase_setcur(value: PMReader); cdecl; external;
  754. procedure _mm_iobase_revert(); cdecl; external;
  755. function _mm_fopen(value1, value2: pcchar): P_FILE; cdecl; external;
  756. function _mm_fclose(value: P_FILE): cint; cdecl; external;
  757. procedure _mm_write_string(value1: pcchar; value2: PMWriter); cdecl; external;
  758. function _mm_read_string (value1: pcchar; value2: cint; value3: PMReader): cint; cdecl; external;
  759. function _mm_read_M_SWORD(value: PMReader): csshort; cdecl; external;
  760. function _mm_read_I_SWORD(value: PMReader): csshort; cdecl; external;
  761. function _mm_read_M_UWORD(value: PMReader): cushort; cdecl; external;
  762. function _mm_read_I_UWORD(value: PMReader): cushort; cdecl; external;
  763. function _mm_read_M_SLONG(value: PMReader): csint; cdecl; external;
  764. function _mm_read_I_SLONG(value: PMReader): csint; cdecl; external;
  765. function _mm_read_M_ULONG(value: PMReader): cuint; cdecl; external;
  766. function _mm_read_I_ULONG(value: PMReader): cuint; cdecl; external;
  767. function _mm_read_M_SWORDS(value1: pcsshort; value2: cint; value3: PMReader): cint; cdecl; external;
  768. function _mm_read_I_SWORDS(value1: pcsshort; value2: cint; value3: PMReader): cint; cdecl; external;
  769. function _mm_read_M_UWORDS(value1: pcushort; value2: cint; value3: PMReader): cint; cdecl; external;
  770. function _mm_read_I_UWORDS(value1: pcushort; value2: cint; value3: PMReader): cint; cdecl; external;
  771. function _mm_read_M_SLONGS(value1: pcsint; value2: cint; value3: PMReader): cint; cdecl; external;
  772. function _mm_read_I_SLONGS(value1: pcsint; value2: cint; value3: PMReader): cint; cdecl; external;
  773. function _mm_read_M_ULONGS(value1: pcuint; value2: cint; value3: PMReader): cint; cdecl; external;
  774. function _mm_read_I_ULONGS(value1: pcuint; value2: cint; value3: PMReader): cint; cdecl; external;
  775. procedure _mm_write_M_SWORD(value1: csshort; value2: PMWriter); cdecl; external;
  776. procedure _mm_write_I_SWORD(value1: csshort; value2: PMWriter); cdecl; external;
  777. procedure _mm_write_M_UWORD(value1: cushort; value2: PMWriter); cdecl; external;
  778. procedure _mm_write_I_UWORD(value1: cushort; value2: PMWriter); cdecl; external;
  779. procedure _mm_write_M_SLONG(value1: csint; value2: PMWriter); cdecl; external;
  780. procedure _mm_write_I_SLONG(value1: csint; value2: PMWriter); cdecl; external;
  781. procedure _mm_write_M_ULONG(value1: cuint; value2: PMWriter); cdecl; external;
  782. procedure _mm_write_I_ULONG(value1: cuint; value2: PMWriter); cdecl; external;
  783. procedure _mm_write_M_SWORDS(value1: pcsshort; value2: cint; value3: PMWriter); cdecl; external;
  784. procedure _mm_write_I_SWORDS(value1: pcsshort; value2: cint; value3: PMWriter); cdecl; external;
  785. procedure _mm_write_M_UWORDS(value1: pcushort; value2: cint; value3: PMWriter); cdecl; external;
  786. procedure _mm_write_I_UWORDS(value1: pcushort; value2: cint; value3: PMWriter); cdecl; external;
  787. procedure _mm_write_M_SLONGS(value1: pcsint; value2: cint; value3: PMWriter); cdecl; external;
  788. procedure _mm_write_I_SLONGS(value1: pcsint; value2: cint; value3: PMWriter); cdecl; external;
  789. procedure _mm_write_M_ULONGS(value1: pcuint; value2: cint; value3: PMWriter); cdecl; external;
  790. procedure _mm_write_I_ULONGS(value1: pcuint; value2: cint; value3: PMWriter); cdecl; external;
  791. function MikMod_strerror(value: cint): pcchar; cdecl; external;
  792. function MikMod_RegisterErrorHandler(value: MikMod_handler_t): MikMod_handler_t; cdecl; external;
  793. procedure MikMod_RegisterAllDrivers(); cdecl; external;
  794. function MikMod_InfoDriver(): pcchar; cdecl; external;
  795. procedure MikMod_RegisterDriver(value: PMDriver); cdecl; external;
  796. function MikMod_DriverFromAlias(value: pcint): cint; cdecl; external;
  797. function MikMod_Init(value: string): cint; cdecl; external;
  798. procedure MikMod_Exit(); cdecl; external;
  799. function MikMod_Reset(value: pcint): cint; cdecl; external;
  800. function MikMod_SetNumVoices(value1, value2: cint): cint; cdecl; external;
  801. function MikMod_Active(): cint; cdecl; external;
  802. function MikMod_EnableOutput(): cint; cdecl; external;
  803. procedure MikMod_DisableOutput(); cdecl; external;
  804. procedure MikMod_Update(); cdecl; external;
  805. function MikMod_InitThreads(): cint; cdecl; external;
  806. procedure MikMod_Lock(); cdecl; external;
  807. procedure MikMod_Unlock(); cdecl; external;
  808. function Sample_Load(value: pcchar): PSAMPLE; cdecl; external;
  809. function Sample_LoadFP(value: P_FILE): PSAMPLE; cdecl; external;
  810. function Sample_LoadGeneric(value: PMREADER): PSAMPLE; cdecl; external;
  811. procedure Sample_Free(value: PSAMPLE); cdecl; external;
  812. function Sample_Play(value1: PSAMPLE; value2: cuint; value3: cuchar): cschar; cdecl; external;
  813. procedure Voice_SetVolume(value1: cschar; value2: cushort); cdecl; external;
  814. function Voice_GetVolume(value: cschar): cushort; cdecl; external;
  815. procedure Voice_SetFrequency(value1: cschar; value2: cuint); cdecl; external;
  816. function Voice_GetFrequency(value: cschar): cuint; cdecl; external;
  817. procedure Voice_SetPanning(value1: cschar; value2: cuint); cdecl; external;
  818. function Voice_GetPanning(value: cschar): cuint; cdecl; external;
  819. procedure Voice_Play(value1: cschar; value2: PSAMPLE; value3: cuint); cdecl; external;
  820. procedure Voice_Stop(value: cschar); cdecl; external;
  821. function Voice_Stopped(value: cschar): cint; cdecl; external;
  822. function Voice_GetPosition(value: cschar): csint; cdecl; external;
  823. function Voice_RealVolume(value: cschar): cuint; cdecl; external;
  824. function MikMod_InfoLoader(): pcchar; cdecl; external;
  825. procedure MikMod_RegisterAllLoaders(); cdecl; external;
  826. procedure MikMod_RegisterLoader(value: PMLOADER); cdecl; external;
  827. function Player_Load(value1: pcchar; value2: cint; value3: cint): PMODULE; cdecl; external;
  828. function Player_LoadFP(value1: P_FILE; value2: cint; value3: cint): PMODULE; cdecl; external;
  829. function Player_LoadGeneric(value1: PMREADER; value2: cint; value3: cint): PMODULE; cdecl; external;
  830. function Player_LoadTitle(value: pcchar): pcchar; cdecl; external;
  831. function Player_LoadTitleFP(value: P_FILE): pcchar; cdecl; external;
  832. procedure Player_Free(value: PMODULE); cdecl; external;
  833. procedure Player_Start(value: PMODULE); cdecl; external;
  834. function Player_Active(): cint; cdecl; external;
  835. procedure Player_Stop(); cdecl; external;
  836. procedure Player_TogglePause(); cdecl; external;
  837. function Player_Paused(): cint; cdecl; external;
  838. procedure Player_NextPosition(); cdecl; external;
  839. procedure Player_PrevPosition(); cdecl; external;
  840. procedure Player_SetPosition(value: cushort); cdecl; external;
  841. function Player_Muted(value: cuchar): cint; cdecl; external;
  842. procedure Player_SetVolume(value: csshort); cdecl; external;
  843. function Player_GetModule(): PMODULE; cdecl; external;
  844. procedure Player_SetSpeed(value: cushort); cdecl; external;
  845. procedure Player_SetTempo(value: cushort); cdecl; external;
  846. procedure Player_Unmute(value: csint; args: array of const); cdecl; external;
  847. procedure Player_Mute(value: csint; args: array of const); cdecl; external;
  848. procedure Player_ToggleMute(value: csint; args: array of const); cdecl; external;
  849. function Player_GetChannelVoice(value: cuchar): cint; cdecl; external;
  850. function Player_GetChannelPeriod(value: cuchar): cushort; cdecl; external;
  851. function MikMod_RegisterPlayer(value: MikMod_player_t): MikMod_player_t; cdecl; external;
  852. function VC_Init(): cint; cdecl; external;
  853. procedure VC_Exit(); cdecl; external;
  854. function VC_SetNumVoices(): cint; cdecl; external;
  855. function VC_SampleSpace(value: cint): cuint; cdecl; external;
  856. function VC_SampleLength(value1: cint; value2: PSAMPLE): cuint; cdecl; external;
  857. function VC_PlayStart(): cint; cdecl; external;
  858. procedure VC_PlayStop(); cdecl; external;
  859. function VC_SampleLoad(value1: PSAMPLOAD; value2: cint): csshort; cdecl; external;
  860. procedure VC_SampleUnload(value: csshort); cdecl; external;
  861. function VC_WriteBytes(value1: pcschar; value2: cuint): cuint; cdecl; external;
  862. function VC_SilenceBytes(value1: pcschar; value2: cuint): cuint; cdecl; external;
  863. procedure VC_VoiceSetVolume(value1: cuchar; value2: cushort); cdecl; external;
  864. function VC_VoiceGetVolume(value: cuchar): cushort; cdecl; external;
  865. procedure VC_VoiceSetFrequency(value1: cuchar; value2: cuint); cdecl; external;
  866. function VC_VoiceGetFrequency(value: cuchar): cuint; cdecl; external;
  867. procedure VC_VoiceSetPanning(value1: cuchar; value2: cuint); cdecl; external;
  868. function VC_VoiceGetPanning(value: cuchar): cuint; cdecl; external;
  869. procedure VC_VoicePlay(value1: cuchar; value2: csshort; value3, value4, value5, value6: cuint; value7: cushort); cdecl; external;
  870. procedure VC_VoiceStop(value: cuchar); cdecl; external;
  871. function VC_VoiceStopped(value: cuchar): cint; cdecl; external;
  872. function VC_VoiceGetPosition(value: cuchar): csint; cdecl; external;
  873. function VC_VoiceRealVolume(value: cuchar): cuint; cdecl; external;
  874. (****** NDS part **************************************************************)
  875. const
  876. NDS_HW_MAXSAMPLES = 128;
  877. NDS_HW_MAXVOICES = 16;
  878. NDS_HW_CHANGE_START = (1 shl 0);
  879. NDS_HW_CHANGE_STOP = (1 shl 1);
  880. NDS_HW_CHANGE_VOLUME = (1 shl 2);
  881. NDS_HW_CHANGE_FREQUENCY = (1 shl 3);
  882. NDS_HW_CHANGE_PANNING = (1 shl 4);
  883. type
  884. NDS_SW_IPC = packed record
  885. buffer: pcschar;
  886. prevTimer: cint;
  887. writeCursor: cint;
  888. readCursor: cint;
  889. bufferSize: cint;
  890. sampleRate: cint;
  891. format: cint;
  892. playing: cint;
  893. end;
  894. NDS_HW_VOICE = packed record
  895. handle: csshort;
  896. start: cuint;
  897. length: cuint;
  898. loopstart: cuint;
  899. loopend: cuint;
  900. flags: cushort;
  901. volume: cushort;
  902. frequency: cuint;
  903. panning: cuint;
  904. playing: cint;
  905. changes: cuchar;
  906. end;
  907. NDS_HW_IPC = packed record
  908. samples: array [0..NDS_HW_MAXSAMPLES - 1] of pointer;
  909. voices: array [0..NDS_HW_MAXVOICES - 1] of NDS_HW_VOICE;
  910. end;
  911. NDS_COMMAND = (
  912. NDS_SW_CMD_INIT = 1,
  913. NDS_SW_CMD_START,
  914. NDS_SW_CMD_UPDATE,
  915. NDS_SW_CMD_STOP,
  916. NDS_SW_CMD_EXIT,
  917. NDS_HW_CMD_INIT,
  918. NDS_HW_CMD_EXIT,
  919. NDS_HW_CMD_PLAY_START,
  920. NDS_HW_CMD_PLAY_STOP,
  921. NDS_HW_CMD_RESET,
  922. NDS_HW_CMD_VOICE_UPDATE
  923. );
  924. {$endif NDS_INTERFACE}
  925. {$ifdef NDS_IMPLEMENTATION}
  926. {$ifdef ARM9}
  927. //procedure MikMod9_SendCommand(command: cuint); cdecl; forward;
  928. {$endif ARM9}
  929. procedure _mm_free(var p: pointer); inline;
  930. begin
  931. if p <> nil then
  932. FreeMem(p);
  933. p := nil;
  934. end;
  935. {$endif NDS_IMPLEMENTATION}