home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 1 / amigaformatcd01.iso / demos / secal / ext / ext.inc next >
Encoding:
Text File  |  1996-04-30  |  12.5 KB  |  686 lines

  1. /******************************************************************************\
  2. **  $VER: inc/secalext/ext.inc 0.89                                           **
  3. **  Secal Release 0.89                                                        **
  4. **  Secal extension interface definitions                                     **
  5. **  Copyright (c) 1996 Tibor Kulcsar & Jozsef Makrai (TDS Development)        **
  6. \******************************************************************************/
  7.  
  8.  
  9. import x_vblankcode as x_VBlankCode:ulong;
  10. import x_vblankcnt as x_VBlankCnt:ulong;
  11.  
  12.  
  13. /******************************************************************************\
  14. ****                                A U D I O                               ****
  15. \******************************************************************************/
  16.  
  17.  
  18. struct x_mus is
  19.     link:ulong;                                # PRIVATE
  20.  
  21.     chanmask:uword;
  22.     volume:uword;
  23.  
  24.     stopreq:uword;
  25.  
  26.     smps:ulong;
  27.     songendpos:word;
  28.     pos0,patt0:ulong;
  29.  
  30.     chts:ulong;
  31.  
  32.     musictime:ulong;
  33.     speed,counter:word;
  34.     songpos,patpos:word;
  35.  
  36.     dmatemp:word;
  37.  
  38.     patbrk,posjmp:byte;
  39.     newpatpos:word;
  40.  
  41.     pattdel:word;
  42.  
  43.     musfile:ulong;
  44. ;
  45.  
  46.  
  47. /******************************************************************************\
  48. ****                             G R A P H I C S                            ****
  49. \******************************************************************************/
  50.  
  51.  
  52. struct x_scr is
  53.     link:ulong;                                # PRIVATE
  54.  
  55.     screen:ulong;
  56.     bmps:ulong;
  57.     activebmp:ulong;
  58.     viewport:ulong;
  59.     rastport:ulong;
  60.     bitmap:ulong;
  61.     width,height:word;
  62.     depth:word;
  63.     rowwidth,rowdiff:word;
  64. ;
  65.  
  66.  
  67. struct x_bmp is
  68.     link:ulong;                                # PRIVATE
  69.  
  70.     next:ulong;
  71.     bitmap:ulong;
  72.     width,height:word;
  73.     depth:word;
  74.     planes:ulong;
  75.     rowwidth,rowdiff:word;
  76. ;
  77.  
  78.  
  79. struct x_ani is
  80.     link:ulong;                                # PRIVATE
  81.  
  82.     width,height:word;
  83.     depth:word;
  84.     numframes:word;
  85.     afris:ulong;
  86.     numcmaps:word;
  87.     colormode:word;
  88.     colordata:ulong;
  89.     numcolors:word;
  90.     camg:ulong;
  91.     looping:word;
  92.     frame:word;
  93.  
  94.     anifile:ulong;
  95. ;
  96.  
  97.  
  98. struct x_afri is
  99.     planedata[8]:ulong;
  100.     colordata:ulong;
  101.     numcolors:word;
  102.     duration:word;
  103. ;
  104.  
  105.  
  106. struct x_spr is
  107.     next:ulong;
  108.     prev:ulong;
  109.  
  110.     group:ulong;
  111.     userdata:ulong;
  112.  
  113.     on:word;
  114.     x,y:word;
  115.  
  116.     width,height:word;
  117.     gfx0,msk0:ulong;
  118.     fduration,numframes:word;
  119.     cx,cy,cw,ch:word;
  120.     rowdiff,fullheight,gfxsize,msksize:word;
  121.  
  122.     sortweight:word;
  123.  
  124.     count,frame,cycle:word;
  125.     gfx,msk:ulong;
  126.     mskt:ulong;
  127.  
  128.     mskbuf:ulong;
  129.  
  130.     res0ptr:ulong;
  131.     res0x,res0y:word;
  132.     res0w,res0h:word;
  133.     res0buf:ulong;
  134.     res1ptr:ulong;
  135.     res1x,res1y:word;
  136.     res1w,res1h:word;
  137.     res1buf:ulong;
  138. ;
  139.  
  140.  
  141. struct x_sgrp is
  142.     link:ulong;                                # PRIVATE
  143.  
  144.     sprlist,sprlast:ulong;
  145.     sprarray:ulong;
  146.     sprcount:word;
  147.     flags:uword;
  148.     depth:word;
  149.  
  150.     sprsmem:ulong;
  151. ;
  152.  
  153. def XSF_BGCLEAR=$1;
  154. def XSF_BGIMAGE=$2;
  155. def XSF_BGSAVE=$4;
  156.  
  157. def XSF_MPLANEMASK=$100;
  158. def XSF_NODBLBUF=$200;
  159.  
  160.  
  161.  
  162. struct x_sgfx is
  163.     width,height:word;
  164.     gfx:ulong;
  165.     fduration,numframes:word;
  166.     cx,cy,cw,ch:word;
  167.  
  168.     msk:ulong;
  169.     rowdiff,fullheight,gfxsize,msksize:uword;
  170. ;
  171.  
  172.  
  173. /******************************************************************************\
  174. \******************************************************************************/
  175.  
  176.  
  177. pattern x_Init is                                    # D0=SUCCESS
  178. call x_init;
  179. endp;                                                            # X_INIT
  180.  
  181.  
  182.  
  183. pattern x_Done is
  184. call x_done;
  185. endp;                                                            # X_DONE
  186.  
  187.  
  188. #*******************************************************************************
  189.  
  190.  
  191. pattern x_AudioStart(_chanmask) is                # D0=SUCCESS
  192. d0:=_chanmask;
  193. call x_audiostart;
  194. endp;                                                            # X_AUDIOSTART
  195.  
  196.  
  197.  
  198. pattern x_Mus_New(_modul,_chanmask) is                # A0=MUSIC
  199. safe a0:=_modul; d0:=_chanmask;;
  200. call x_mus_new;
  201. endp;                                                            # X_MUS_NEW
  202.  
  203.  
  204.  
  205. pattern x_Mus_Load(_filename,_chanmask) is            # A0=MUSIC
  206. safe a0:=_filename; d0:=_chanmask;;
  207. call x_mus_load;
  208. endp;                                                            # X_MUS_LOAD
  209.  
  210.  
  211.  
  212. pattern x_Mus_Dispose(_mus) is
  213. a0:=_mus;
  214. call x_mus_dispose;
  215. endp;                                                            # X_MUS_DISPOSE
  216.  
  217.  
  218.  
  219. pattern x_Mus_Play(_mus,_pos) is
  220. safe a0:=_mus; d0:=_pos;;
  221. call x_mus_play;
  222. endp;                                                            # X_MUS_PLAY
  223.  
  224.  
  225.  
  226. pattern x_Mus_Stop(_mus) is
  227. a0:=_mus;
  228. call x_mus_stop;
  229. endp;                                                            # X_MUS_STOP
  230.  
  231.  
  232.  
  233. pattern x_Mus_Continue(_mus) is
  234. a0:=_mus;
  235. call x_mus_continue;
  236. endp;                                                            # X_MUS_CONTINUE
  237.  
  238.  
  239.  
  240. pattern x_Mus_Modify(_mus,_pos,_volume) is
  241. safe a0:=_mus; d0:=_pos; d1:=_volume;;
  242. call x_mus_modify;
  243. endp;                                                            # X_MUS_MODIFY
  244.  
  245.  
  246.  
  247. pattern x_PlaySound(_start,_length,_repstart,_replen,_channel,_period,_volume) is
  248. push d2\d3\d4;
  249.  
  250. safe
  251.     a0:=_start; d0.l:=_length; a1:=_repstart; d1.l:=_replen;
  252.     d2:=_channel; d3:=_period; d4:=_volume;
  253. ;
  254. call x_playsound;
  255.  
  256. pop d2\d3\d4;
  257. endp;                                                            # X_PLAYSOUND
  258.  
  259.  
  260.  
  261. pattern x_StopSound(_channel) is
  262. d0:=_channel;
  263. call x_stopsound;
  264. endp;                                                            # X_STOPSOUND
  265.  
  266.  
  267.  
  268. pattern x_ModifySound(_channel,_period,_volume) is
  269. push d2;
  270.  
  271. safe d0:=_channel; d1:=_period; d2:=_volume;;
  272. call x_modifysound;
  273.  
  274. pop d2;
  275. endp;                                                            # X_MODIFYSOUND
  276.  
  277.  
  278.  
  279. pattern x_PlaySoundQ(_pri,_start,_length,_repstart,_replen,
  280.     _channel,_period,_volume) is
  281. push d2\d3\d4\d5;
  282.  
  283. safe
  284.     d0:=_pri; a0:=_start; d1.l:=_length; a1:=_repstart; d2.l:=_replen;
  285.     d3:=_channel; d4:=_period; d5:=_volume;
  286. ;
  287. call x_playsoundq;
  288.  
  289. pop d2\d3\d4\d5;
  290. endp;                                                            # X_PLAYSOUNDQ
  291.  
  292.  
  293.  
  294. pattern x_SetFilter(_state) is
  295. d0:=_state;
  296. call x_setfilter;
  297. endp;                                                            # X_SETFILTER
  298.  
  299.  
  300. #*******************************************************************************
  301.  
  302.  
  303. #                                                                    D0=SUCCESS
  304.  
  305. pattern x_GraphicsStart is
  306. call x_graphicsstart;
  307. endp;                                                            # X_GRAPHICSSTART
  308.  
  309.  
  310.  
  311. pattern x_Scr_Open(_mode,_width,_height,_depth,_title,_colors,_taglist) is
  312. #                                                                    A0=SCR
  313. push d2\d3\a2;
  314.  
  315. safe
  316.     d0.l:=_mode; d1:=_width; d2:=_height; d3:=_depth; a0:=_title;
  317.     a1:=_colors; a2:=_taglist;
  318. ;
  319. call x_scr_open;
  320.  
  321. pop d2\d3\a2;
  322. endp;                                                            # X_SCR_OPEN
  323.  
  324.  
  325.  
  326. pattern x_Scr_Close(_scr) is
  327. a0:=_scr;
  328. call x_scr_close;
  329. endp;                                                            # X_SCR_CLOSE
  330.  
  331.  
  332.  
  333. pattern x_Scr_AddBmp(_scr) is                    # D0=SUCCESS
  334. a0:=_scr;
  335. call x_scr_addbmp;
  336. endp;                                                            # X_SCR_ADDBMP
  337.  
  338.  
  339.  
  340. pattern x_Scr_ActivateBmp(_scr,_index,_xoffset,_yoffset) is
  341. safe a0:=_scr; a1.w:=_index; d0:=_xoffset; d1:=_yoffset;;
  342. call x_scr_activatebmp;
  343. endp;                                                            # X_SCR_ACTIVATEBMP
  344.  
  345.  
  346.  
  347. pattern x_Scr_GetBmp(_scr,_index) is                # A0=X_BMP
  348. safe a0:=_scr; d0:=_index;;
  349. call x_scr_getbmp;
  350. endp;                                                            # X_SCR_GETBMP
  351.  
  352.  
  353.  
  354. pattern x_Scr_LoadRGB8(_scr,_colors,_start,_count) is
  355. safe a0:=_scr; a1:=_colors; d0:=_start; d1:=_count;;
  356. call x_scr_loadrgb8;
  357. endp;                                                            # X_SCR_LOADRGB8
  358.  
  359.  
  360.  
  361. pattern x_RGB8Intensity(_source,_count,_dest,_intensity,_target) is
  362. push d2;
  363.  
  364. safe
  365.     a0:=_source; d0:=_count; a1:=_dest;
  366.     d1:=_intensity; d2.l:=_target;
  367. ;
  368. call x_rgb8intensity;
  369.  
  370. pop d2;
  371. endp;                                                            # X_RGB8INTENSITY
  372.  
  373.  
  374.  
  375. pattern x_Bmp_Alloc(_width,_height,_depth) is            # A0=X_BMP
  376. safe d0:=_width; d1:=_height; a0:=_depth;;
  377. call x_bmp_alloc;
  378. endp;                                                            # X_BMP_ALLOC
  379.  
  380.  
  381.  
  382. pattern x_Bmp_Free(_bmp) is
  383. a0:=_bmp;
  384. call x_bmp_free;
  385. endp;                                                            # X_BMP_FREE
  386.  
  387.  
  388.  
  389. pattern x_Ani_New(_animdata,_looping) is                # A0=X_ANI, A1=RBG8, D0=NUMCOLORS
  390. safe a0:=_animdata; d0:=_looping;;
  391. call x_ani_new;
  392. endp;                                                            # X_ANI_NEW
  393.  
  394.  
  395.  
  396. pattern x_Ani_Load(_filename,_looping) is                # A0=X_ANI, A1=RBG8, D0=NUMCOLORS
  397. safe a0:=_filename; d0:=_looping;;
  398. call x_ani_load;
  399. endp;                                                            # X_ANI_LOAD
  400.  
  401.  
  402.  
  403. pattern x_Ani_Dispose(_ani) is
  404. a0:=_ani;
  405. call x_ani_dispose;
  406. endp;                                                            # X_ANI_DISPOSE
  407.  
  408.  
  409.  
  410. pattern x_Ani_DoFrame(_ani,_bmp,_x,_y,_scr) is            # D0=DURATION
  411. push a2;
  412.  
  413. safe a0:=_ani; a1:=_bmp; d0:=_x; d1:=_y; a2:=_scr;;
  414. call x_ani_doframe;
  415.  
  416. pop a2;
  417. endp;                                                            # X_ANI_DOFRAME
  418.  
  419.  
  420.  
  421. pattern x_Spr_NewGrp(_sprarray,_sprcnt,_flags,_depth) is    # A0=X_SGRP, 0
  422. safe a0:=_sprarray; d0:=_sprcnt; d1:=_flags; a1.w:=_depth;;
  423. call x_spr_newgrp;
  424. endp;                                                            # X_SPR_NEWGRP
  425.  
  426.  
  427.  
  428. pattern x_Spr_DisposeGrp(_sgrp) is
  429. a0:=_sgrp;
  430. call x_spr_disposegrp;
  431. endp;                                                            # X_SPR_DISPOSEGRP
  432.  
  433.  
  434.  
  435. pattern x_Spr_Draw(_sgrp,_destbmp,_xoffset,_yoffset) is
  436. safe a0:=_sgrp; a1:=_destbmp; d0:=_xoffset; d1:=_yoffset;;
  437. call x_spr_draw;
  438. endp;                                                            # X_SPR_DRAW
  439.  
  440.  
  441.  
  442. pattern x_Spr_Restore(_sgrp,_destbmp,_bgnd,_bgndwidth) is
  443. safe a0:=_sgrp; a1:=_destbmp; d0.l:=_bgnd; d1:=_bgndwidth;;
  444. call x_spr_restore;
  445. endp;                                                            # X_SPR_RESTORE
  446.  
  447.  
  448.  
  449. pattern x_Spr_PrepGfx(_sgfxarray,_sgrp,_count) is        # D0=SUCCESS
  450. safe a0:=_sgfxarray; a1:=_sgrp; d0:=_count;;
  451. call x_spr_prepgfx;
  452. endp;                                                            # X_SPR_PREPGFX
  453.  
  454.  
  455.  
  456. pattern x_Spr_UnPrepGfx(_sgfxarray,_count) is
  457. safe a0:=_sgfxarray; d0:=_count;;
  458. call x_spr_unprepgfx;
  459. endp;                                                            # X_SPR_UNPREPGFX
  460.  
  461.  
  462.  
  463. pattern x_Spr_ChngGfx(_sgfx,_spr,_nextframe) is
  464. safe a0:=_sgfx; a1:=_spr; d0:=_nextframe;;
  465. call x_spr_chnggfx;
  466. endp;                                                            # X_SPR_CHNGGFX
  467.  
  468.  
  469.  
  470. pattern x_Spr_CollChk(_mode,_spr1,_spr2) is            # D0=COLLISSION
  471. safe d0:=_mode; a0:=_spr1; a1:=_spr2;;
  472. call x_spr_collchk;
  473. endp;                                                            # X_SPR_COLLCHK
  474.  
  475.  
  476.  
  477. pattern x_Spr_Sort(_sgrp,_customsort) is
  478. safe a0:=_sgrp; d0:=_customsort;;
  479. call x_spr_sort;
  480. endp;                                                            # X_SPR_SORT
  481.  
  482.  
  483.  
  484. pattern x_Spr_CutMsk(_spr,_data,_x,_y,_width,_height) is
  485. push d2\d3;
  486. safe a0:=_spr; a1:=_data; d0:=_x; d1:=_y; d2:=_width; d3:=_height;;
  487. call x_spr_cutmsk;
  488. pop d2\d3;
  489. endp;                                                            # X_SPR_CUTMSK
  490.  
  491.  
  492.  
  493. pattern x_Spr_GrpCutMsk(_sgrp,_data,_x,_y,_width,_height) is
  494. push d2\d3;
  495. safe a0:=_sgrp; a1:=_data; d0:=_x; d1:=_y; d2:=_width; d3:=_height;;
  496. call x_spr_grpcutmsk;
  497. pop d2\d3;
  498. endp;                                                            # X_SPR_GRPCUTMSK
  499.  
  500.  
  501.  
  502. pattern x_Spr_AddBgBuf(_spr,_size) is                # D0=SUCCESS
  503. safe a0:=_spr; d0.l:=_size;;
  504. call x_spr_addbgbuf;
  505. endp;                                                            # X_SPR_ADDBGBUF
  506.  
  507.  
  508.  
  509. pattern x_Spr_GrpAddBgBuf(_sgrp) is                # D0=SUCCESS
  510. a0:=_sgrp;
  511. call x_spr_grpaddbgbuf;
  512. endp;                                                            # X_SPR_GRPADDBGBUF
  513.  
  514.  
  515.  
  516. pattern x_Spr_AddMskBuf(_spr,_size) is                # D0=SUCCESS
  517. safe a0:=_spr; d0.l:=_size;;
  518. call x_spr_addmskbuf;
  519. endp;                                                            # X_SPR_ADDMSKBUF
  520.  
  521.  
  522.  
  523. pattern x_Spr_GrpAddMskBuf(_sgrp) is                # D0=SUCCESS
  524. a0:=_sgrp;
  525. call x_spr_grpaddmskbuf;
  526. endp;                                                            # X_SPR_GRPADDMSKBUF
  527.  
  528.  
  529.  
  530. pattern x_MakeMask(_source,_dest,_width,_height,_depth,_mplane) is
  531. push d2\d3;
  532. safe a0:=_source; a1:=_dest; d0:=_width; d1:=_height; d2:=_depth; d3:=_mplane;;
  533. call x_makemask;
  534. pop d2\d3;
  535. endp;                                                            # X_MAKEMASK
  536.  
  537.  
  538.  
  539. pattern x_ClrBlit(_dst,_dstw,_width,_height) is
  540. push d2;
  541.  
  542. safe a0:=_dst; d0:=_dstw; d1:=_width; d2:=_height;;
  543. call x_clrblit;
  544.  
  545. pop d2;
  546. endp;                                                            # X_CLRBLIT
  547.  
  548.  
  549.  
  550. pattern x_MoveBlit(_src,_srcw,_dst,_dstw,_width,_height) is
  551. push d2\d3;
  552.  
  553. safe
  554.     a0:=_src; d0:=_srcw; a1:=_dst; d1:=_dstw;
  555.     d2:=_width; d3:=_height;
  556. ;
  557. call x_moveblit;
  558.  
  559. pop d2\d3;
  560. endp;                                                            # X_MOVEBLIT
  561.  
  562.  
  563. #*******************************************************************************
  564.  
  565.  
  566. pattern x_Randomize is
  567. call x_randomize;
  568. endp;                                                            # X_RANDOMIZE
  569.  
  570.  
  571.  
  572. pattern x_Rnd is                                                # D0=RANDOM
  573. call x_rnd;
  574. endp;                                                            # X_RND
  575.  
  576.  
  577. #-------------------------------------------------------------------------------
  578.  
  579.  
  580. pattern x_LoadFile(_filename,_memflags) is        # A0=LOADED FILE, D0.L=SIZE
  581. safe a0:=_filename; d0.l:=_memflags;;
  582. call x_loadfile;
  583. endp;                                                            # X_LOADFILE
  584.  
  585.  
  586.  
  587. pattern x_UnLoadFile(_loadedfile) is
  588. a0:=_loadedfile;
  589. call x_unloadfile;
  590. endp;                                                            # X_UNLOADFILE
  591.  
  592.  
  593. #-------------------------------------------------------------------------------
  594.  
  595.  
  596. pattern x_SetTaskPri(_task,_pri) is                # D0=OLD PRI
  597. safe a0:=_task; d0:=_pri;;
  598. call x_settaskpri;
  599. endp;                                                            # X_SETTASKPRI
  600.  
  601.  
  602.  
  603. pattern x_RevertTaskPri is
  604. call x_reverttaskpri;
  605. endp;                                                            # X_REVERTTASKPRI
  606.  
  607.  
  608.  
  609. pattern x_EasyRequest(_window,_titletxt,_bodytxt,_gadgettxt) is # D0=NUM
  610. safe a0:=_window; a1:=_titletxt; d0.l:=_bodytxt; d1.l:=_gadgettxt;;
  611. call x_easyrequest;
  612. endp;                                                            # X_EASYREQUEST
  613.  
  614.  
  615.  
  616. pattern x_DisplayBeep(_scr) is
  617. a0:=_scr;
  618. call x_displaybeep;
  619. endp;                                                            #X_DISPLAYBEEP
  620.  
  621.  
  622.  
  623. pattern x_Delay(_ticks) is
  624. d0.l:=_ticks;
  625. call x_delay;
  626. endp;                                                            # X_DELAY
  627.  
  628.  
  629.  
  630. pattern x_OwnBlitter is
  631. call x_ownblitter;
  632. endp;                                                            # X_OWNBLITTER
  633.  
  634.  
  635.  
  636. pattern x_DisownBlitter is
  637. call x_disownblitter;
  638. endp;                                                            # X_DISOWNBLITTER
  639.  
  640.  
  641.  
  642. pattern x_WaitBlit is
  643. call x_waitblit;
  644. endp;                                                            # X_WAITBLIT
  645.  
  646.  
  647.  
  648. pattern x_WaitTOF is
  649. call x_waittof;
  650. endp;                                                            # X_WAITTOF
  651.  
  652.  
  653.  
  654. pattern x_VBeamPos is                            # D0.L=BEAMPOS
  655. call x_vbeampos;
  656. endp;                                                            # X_VBEAMPOS
  657.  
  658.  
  659.  
  660. pattern x_WBenchToFront is                    # D0=SUCCESS
  661. call x_wbenchtofront;
  662. endp;                                                            # X_WBENCHTOFRONT
  663.  
  664.  
  665.  
  666. pattern x_WBenchToBack is                    # D0=SUCCESS
  667. call x_wbenchtoback;
  668. endp;                                                            # X_WBENCHTOBACK
  669.  
  670.  
  671.  
  672. pattern x_OpenWorkbench is                    # D0=SUCCESS
  673. call x_openworkbench;
  674. endp;                                                            # X_OPENWORKBENCH
  675.  
  676.  
  677.  
  678. pattern x_CloseWorkbench is                    # D0=SUCCESS
  679. call x_closeworkbench;
  680. endp;                                                            # X_CLOSEWORKBENCH
  681.  
  682.  
  683. /******************************************************************************\
  684. \******************************************************************************/
  685.  
  686.