home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 25 / GNOME_DEMO.iso / amiga / music / ays-t127.lzx / THX-Replayer.doc < prev    next >
Text File  |  2019-02-11  |  5KB  |  126 lines

  1. ;-------------------T-----------T-----------------T---------T---------------
  2.  
  3. ;=============================================================================
  4. ;=============================================================================
  5. ;===================== t h x - s o u n d   s y s t e m =======================
  6. ;=============================================================================
  7. ;================= b i n a r y - r e p l a y e r   d o c u ===================
  8. ;=============================================================================
  9. ;=============================================================================
  10. ;========================= v e r s i o n   1 . 2 7 ===========================
  11. ;=============================================================================
  12. ;=============================================================================
  13.  
  14. - replaycode its self hasn't changed very much - now you can use level 1 cia
  15. - been working on 68000 version, but couldn't test if 68000 version still
  16. - has some odd addressing in it as i didn't bring my a500 to the party 6 here!
  17. - sorry folx, again if u need one WRITE ME!
  18.  
  19. How to use the replayer in my own productions ??
  20.  - Here we go (take a look at the example source!)
  21.  
  22. 1. Include the "THX-Offsets.I" file
  23. 2. Include the "THX-Replayer.BIN" file (100% pc-relative) <needn't be chip>
  24. 3. Call the following procedures as described:
  25.    for example: jsr thxReplayer+thxInitCIA
  26.                 jsr thxReplayer+thxInitPlayer
  27.                 jsr thxReplayer+thxInitModule (or BSR if in the same section!)
  28. 4. To access e.g. the volume etc. (the thx_p... variables as seen in the
  29.    "THX-Offsets.I" file), proceed like this: (access them by byte!)
  30.  
  31. ;---- thxGetSubsongs
  32. ;thxGetSubsongs movem.l     a6,-(sp)
  33. ;               move.l      thxReplayer+thxBSS_P(pc),a6  ;get ptr to
  34. ;               moveq       #0,d0                        ;players public
  35. ;               move.b      thx_pSubsongs(a6),d0         ;memory
  36. ;               movem.l     (sp)+,a6                     ;and get nr. of
  37. ;               RTS                                      ;subsongs from there
  38.  
  39.    You may then also set the thx_pPlaying flag to non-0 if the immediate play
  40.    value was set to non-zero in thxInitSubSong or you may set the volume, get
  41.    your external timing (if you read out the ext. timing value, be sure to
  42.    clear the BYTE after reading it!) or see if the song has reached its end.
  43.  
  44. 5. That's it, now some technical information!
  45.  
  46.  
  47.  
  48. ;            ----==== a Little Function-Overview ====----
  49.  
  50.  
  51.  
  52. ;---- thxInitCIA
  53. ;
  54. ; Inputs: a0: pointer to your cia-interrupt (return with RTS please!)
  55. ;         d0: 0 for system-friendly level 1 i think (called by exec.cause)
  56. ;             others are NOT YET included!
  57. ;
  58. ; Output: d0:  0 for success
  59.               -1 for error (so don't call thxKillCIA then later!)
  60. ;
  61. : Function: will try to get one of amiga's cia-interrupts (system-method!)
  62. ;           non-system hard-core code will follow in the next version or
  63. ;           contact me for that if you need it (anyway, everybody has a
  64. ;           cia-irq routine, right?!
  65.  
  66.  
  67. ;---- thxInitPlayer
  68. ;
  69. ; Inputs: a0: pointer to 7854 bytes of public (fast) memory
  70. ;         a1: pointer to 2560 bytes of explicit chip memory
  71. ;      or a null-pointer (sub.l a0,a0 and/or sub.l a1,a1) for auto-allocation!
  72. ;
  73. ; Output: None yet, as everybody should have 10kb of free memory ?
  74. ;         Own checks wouldn't help, as the memory is already written when
  75. ;         this function returns!
  76. ;
  77. : Function: Will precalc the few waveforms and (if a0/a1 = 0) allocate
  78. ;           player's memory-blocks (auto-allocation is recommended!)
  79.  
  80.  
  81. ;---- thxInitModule
  82. ;
  83. ; Inputs: a0: pointer to a THX-Module
  84. ;
  85. ; Output: d0: non-zero (-1) for failure, zero (0) for no error!
  86. ;
  87. ; Function: Initializes the THX-Module given
  88.  
  89.  
  90. ;---- thxInitSubSong
  91. ;
  92. ; Inputs: d0: subsong number (0 means main tune, 1 means first subsong etc.)
  93. ;         d1: immediate play (zero means immediately play when thxInterrupt is
  94. ;                             called, non-zero means wait until thx_pPlaying
  95. ;                             flag is set to non-zero) normally use 0 here!
  96. ;
  97. ; Function: Initializes the subsong given
  98.  
  99.  
  100. ;---- thxInterrupt
  101. ;
  102. ; Function: Plays 1/50 of a second, so you'll have to call it every 1/50 sec.!
  103. ;           If possible, use cia (not thxInitCIA, as it's not yet implemented)
  104.  
  105.  
  106. ;---- thxStopSong
  107. ;
  108. ; Function: Stops the current playing song.
  109.  
  110.  
  111. ;---- thxKillPlayer
  112. ;
  113. ; Function: Shuts down the audio-channels and deallocates the two memory
  114. ;           blocks as long as they were allocated by thxInitPlayer itsself!
  115.  
  116.  
  117. ;---- thxKillCIA
  118. ;
  119. ; Function: Removes the cia-interrupt from system, call only if you're
  120. ;           sure it was initialized correctly!! (thxInitCIA returns 0/-1)
  121.  
  122.  
  123.  
  124.  
  125. ; Take a look at the example source!!      - dexter/abyss! signing off!
  126.