Home » Archimedes archive » Acorn User » AU 1994-06.adf » !QTM_Music » !QTMTrack/Docs/SWIs
!QTMTrack/Docs/SWIs
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Archimedes archive » Acorn User » AU 1994-06.adf » !QTM_Music |
Filename: | !QTMTrack/Docs/SWIs |
Read OK: | ✔ |
File size: | 4420 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
SWI help file for QTM (Queue The Music) � 1993/4 Phoenix/Quantum -------------------------------------------------------------------------- The QTM player v1.00 uses an Acorn allocated SWI chunk, number - &47E40 SWI "QTM_Load" &47E40 ---------------------------------------------------------------------------- On entry: R0 = pointer to filename = 0 to 'load' a pre-loaded song from a memory address R1 = 0 to load song to the RMA = >0 to load to this address On exit : - V flag set if there is not enought space in the RMA or file not found If R0 points to a filename when this SWI is called, it will attempt to load the specified song module into the RMA or to the memory location given in R1. If R0 contains 0 on entry, then QTM will attempt to initialise the song pointed to by R1. You should only load songs into 'User' (non-RMA) memory if your program is single-tasking (eg. game, demo, etc.) - QTM will almost certainly crash if it tries to access a song loaded into user memory when the desktop is active... SWI "QTM_Start" &47E41 ---------------------------------------------------------------------------- On entry: - On exit : - V flag set if no song is loaded This SWI will start the current tune playing if it has been paused or stopped. SWI "QTM_Stop" &47E42 ---------------------------------------------------------------------------- On entry: - On exit : - V flag set if no song is loaded This SWI will stop the current tune playing, and reset all the internal variables, including the position counters - which it sets to 0. SWI "QTM_Pause" &47E43 ---------------------------------------------------------------------------- On entry: - On exit : - V flag set if no song is loaded This has the same effect as SWI "QTM_Stop", although it doesn't reset the variables, so when the tune is re-started, it will continue from the same position. SWI "QTM_Clear" &47E44 ---------------------------------------------------------------------------- On entry: R0 = -1 to convert samples back to signed linear format = <>-1 don't convert samples On exit : - No error is reported if there is not a song loaded. This SWI will stop the tune playing, and release the memory used for the song (if it was loaded into RMA). The tune can't be restarted after this command, unless it is reloaded (from user memory, or disc etc.) using the SWI "QTM_Load". The current song can only be reloaded from user (not QTMs) memory after a SWI"QTM_Clear" if the samples have been converted back to signed linear format (form the logarithmic format that there were converted to when the song was loaded). This can be done by setting R0 to -1 before calling QTM_Clear. See QTM_Load for information on (re)loading a song that is already stored in memory. SWI "QTM_Info" &47E45 ---------------------------------------------------------------------------- On entry: - On exit : R0 = pointer to track name (length 20 bytes, 0 terminated) R1 = pointer to author name (length 22 bytes, 0 terminated) or 0 if author name could not be found R2 = tune type (0-3): 0 - 15 inst Sound Tracker compatible 1 - 31 inst Sound Tracker compatible 2 - 31 inst ProTracker 3 - 31 inst, 4 channel Startrekker R3 = number of channels (currently only 4 channels) R4 = file length (in bytes) R5 = garbage data size (-ve if data missing) R6 = address where song is loaded V flag set if no song is loaded This SWI returns general information about the current track loaded in QTM. It also uses an 'intelligent author detector' routine, to search through the sample names (usually used by authors, to store their name or group) to see if it can find anything that ressembles a name. If it does, then it returns a pointer to the name, in R1, otherwise it returns with R1=0. QTM can currently only cope with 4 channel songs, but future versions should be able to handle a lot more... SWI "QTM_Pos" &47E46 ---------------------------------------------------------------------------- On entry: R0 = new sequence position (0-127) or -1 to read current position R1 = new event position (0-63) or -1 to read On exit : R0 = previous sequence position (0-127) R1 = previous event position (0-63) V flag set if no song is loaded or the event/position number is out of range. This SWI can be used to read or alter the current sequence or event position in the current song. SWI "QTM_EffectControl" &47E47 ---------------------------------------------------------------------------- On entry: R0 = effect number (&0-&F,&E0-&EF - (for 'E' effects)) R1 = new state of effect (0-off/1-on) On exit : R0 = previous effect state word (&0-&F) 1 bit per effect, 16 bits R1 = previous effect state word (&E0-&EF) " " V flag set if the effect number was out of range This SWI can be used to change the state of any effect (as seen by the QTM effect handlers). Disabling effects will stop QTM taking any action over them eg. Disabling effect &F will not allow speed/tempo changes to take place, and the song may sound too fast or slow. Once re-enabled, the effect(s) will be run as usual again. The contents of R0 and R1 on exit are a copy of the effect words used by QTM - each has 16 bits used, each bit representing the state of that effect 0-off, 1-on. R0 contains the flags for the normal effects (&0-&F), R1 contains the flags for the 'E' effects (&E0-&EF). SWI "QTM_Volume" &47E48 ---------------------------------------------------------------------------- On entry: R0 = new overall volume (0-64) or -1 to read current volume On exit : R0 = previous volume (0-64) V flag set if volume is out of range This SWI allows you set the overall output volume from the QTM sound handlers. The volume is in a linear form (0-64) - as used for volumes in song modules. Gradual fades can be gererated using this SWI. SWI "QTM_SetSampleSpeed" &47E49 ---------------------------------------------------------------------------- On entry: R0 = new sample speed (16-100uS) or -1 to read current speed On exit : R0 = previous sample speed (16-100uS) V flag set if sample speed is out of range This SWI lets you set the time between sample outputs (ie. sample quality) to a value between 16us and 100us. Smaller speed values give better sample quality, but also use more processor time, and slow the computer down more. The default speed is 32uS. SWI "QTM_DMABuffer" &47E4A ---------------------------------------------------------------------------- On entry: - On exit : R0 = address of last used DMA sound buffer. By using this SWI, it would be possible to implement sound output oscilloscopes, or volume activated (real) VU bars. The data in the DMA buffer is stored as: [c1],[c2],[c3],[c0],[c1],[c2]...etc, 1 byte for each channel. The DMA buffer size used by QTM is 208*<num of channels> long. See PRMs for more info. The address returned in R0 will only be accurate if there is a song playing while it is called. If a song has not been played before this is called, then R0 will return zeroed. SWI "QTM_RemoveChannel" &47E4B ---------------------------------------------------------------------------- On entry: R0 = channel number to remove (1-8) On exit : R0 = previous state of that channel: 0 = already removed 1 = QTM channel V flag set if channel number is out of range This SWI will remove the given channel from the QTM song routine. This would then allow you to play samples through this channel (eg. for games etc.) without them being interrupted if the song is playing. SWI "QTM_RestoreChannel" &47E4C ---------------------------------------------------------------------------- On entry: R0 = channel number to restore (1-8) On exit : R0 = previous state of that channel: 0 = previously removed 1 = already a QTM channel V flag set if channel number is out of range This SWI will restore the given channel for use by the QTM player if it has previously been removed using SWI "QTM_RemoveChannel". SWI "QTM_Stereo" &47E4D ---------------------------------------------------------------------------- On entry: R0 = channel number to alter, or 0 for pre-programmed settings If R0 = 1-4 then R1 = stereo position -127 (left) to 127 (right) or -128 to read current position If R0 = 0 then R1 = 0 - default stereo position (see below) = 1 - Amiga stereo position = 2 - centred (no stereo) = 3 - full left = 4 - full right On exit : R0 is preserved If R0 = 1-4 then R1 = previous stereo position If R0 = 0 then R1 is corrupted This SWI allows the stereo positions for each channel to be altered indipendently, or all together. If R0=1-4 on entry, then R1 must be either a valid stereo position (-127 to 127) or -128 to read the previous position. If R0=0 on entry, then R1 must be in the range 0-4 (settings described above) to alter all the channels to one of these pre-programmed values. The default stereo settings are: Channel: 1 Position: -79 (left) Channel: 2 Position: 79 (right) Channel: 3 Position: 47 (slightly right) Channel: 4 Position: -47 (slightly left) SWI "QTM_SongLength" &47E4E ---------------------------------------------------------------------------- On entry: - On exit : R0 = number of sequences in current song R1 = number of patterns in the song V flag set if no song is loaded This SWI allows you to read the number of patterns and sequences in the current song. SWI "QTM_ReadSequenceTable" &47E4F ---------------------------------------------------------------------------- On entry: R0 = sequence number to read (0-127) On exit : R0 = pattern number stored at that position V flag set if no song is loaded This SWI enables you to read the pattern to be played at a given position in the current song's sequence table. SWI "QTM_VUBarControl" &47E50 ---------------------------------------------------------------------------- On entry: R0 = 0 to switch the VU bar controllers off = 1 to set the VU bar controller to use 'fake' VU bars = 2 to set the VU bar controller to use 'effect' VU bars = 3 to set the VU bar controller to use 'real' VU bars = -1 to read current setting R1 = new VU gravity, or -1 to read On exit : R0 = previous VU controller state R1 = previous VU bar gravity This SWI allows control of the highly accurate VU bar routine contained in the QTM module. The default settings for the VU bar routine are: gravity = 2 (lines per 50th of a second) and the VU bar controller off. SWI "QTM_ReadVULevels" &47E51 ---------------------------------------------------------------------------- On entry: R0 = Channel number (1-4) or 0 for all channels On exit : If R0 = 1-4 on entry, then R0 = VU bar height for the channel specified in r0 (0-64) If R0 = 0 on entry, then R0 = word containing 1 byte per channel of all the 4 channel's VU bar heights (0-64, each byte) This SWI lets you read the current VU levels of the QTM VU bar handler. This call should only be used if the VU bar handler has been enabled using the "QTM_VUBarControl" SWI. SWI "QTM_ReadSampleTable" &47E52 ---------------------------------------------------------------------------- On entry: R0 = sample number (1-31) On exit : R0 = pointer to 22 byte block (not terminated) containing sample name R1 = sample length (in bytes) R2 = repeat offset (bytes from start of sample) R3 = repeat length (in bytes) R4 = default volume (0-64) R5 = fine tuning byte (signed 4 bit number eg. 8=-8, 15=-1) R6 = address of raw sample data (logarithmic format) V flag set if no song is loaded or if sample number is out of the range 1-31 This SWI allows you to read information on any of the 31 samples which are usually available in Sound Tracker song modules. If an attempt is made to read the sample data of a sample number over 15 when an older 15 inst song module is loaded, QTM will return zero in R1-R6, and R0 will point to a 0 byte. SWI "QTM_ReadSpeed" &47E53 ---------------------------------------------------------------------------- On entry: - On exit : R0 = current song speed (1-31) (or 0 if song is not playing) R1 = current song CIA tempo setting (32-255) R2 = speed counter value (1-<speed-1>) This SWI returns information on the current speed and counter settings of the current song. The speed vaule (R0) is the number of times the song controller has to be called, before it plays then next note - the default is 6 times. The CIA tempo setting controls how fast the song controller is called, the default is 50 times a second = tempo 125. The speed counter (R2) varies from 1 to (speed-1), it is decremented once every time the song controller is called, until it reaches 0, when the next note is played and the counter is reset to the speed-1. SWI "QTM_PlaySample" &47E54 ---------------------------------------------------------------------------- On entry: R0 = channel number (1-4) R1 = note number (1-36) (1='C-1', 2='C#1'... 36='B#3') R2 = sample number (1-31) On exit : R0-R2 preserved An error is generated if any of the registers contain illegal values. This SWI allows you to play any of the 31 (or 15) samples in the currently loaded song on any of the 4 available channels. A sample can be played at any time while the song is loaded, although if the song is currently playing, then the sample may be cut short. Playing a non-existant sample, (or a sample above 15, if the song is a 15 inst module) will result in nothing being played. SWI "QTM_SongStatus" &47E55 ---------------------------------------------------------------------------- On entry: - On exit : R0 = song status flags: on off | | bit 0 = song loaded no song loaded 1 = loaded to RMA user addr load 2 = playing stopped/paused This SWI allows you to read the current status of the QTM song controller. No error is generated if there is no song loaded. SWI "QTM_ReadPlayingTime" &47E56 ---------------------------------------------------------------------------- On entry: - On exit : R0 = total playing time so far (seconds) R1 = time since last SWI QTM_Start (seconds) R2 = total playing time of the whole song (seconds) V flag set if no song is loaded This SWI allows you to read the 2 QTM song timers, and the total time of a song. The contents of R0 and R1 on exit are calculated from the internal 100Hz timer - but the contents of R2 rely on a special 100% accurate, song length calculation routine... The QTM-Ultra-mega-time-worker-outer is the first song time calculation routine on the Arc, and the only routine on any computer which can accurately work out times correctly with effects such as 'CIA' tempos, pattern loops and pattern delays. The routine works by scanning through all the song's patterns, in the correct order - calculating the time of each event as it goes, and taking into account and speed/tempo/loop or delay settings that may be in use. When this SWI is called for the first time after loading a song, the total length will be worked out using the special routine. On later calls to this SWI (while the same song is loaded), the total length will not be re-calculated, but the orignal calculation will used, to save time.
00000000 53 57 49 20 68 65 6c 70 20 66 69 6c 65 20 66 6f |SWI help file fo| 00000010 72 20 51 54 4d 20 28 51 75 65 75 65 20 54 68 65 |r QTM (Queue The| 00000020 20 4d 75 73 69 63 29 20 20 20 20 20 20 20 20 20 | Music) | 00000030 20 20 a9 20 31 39 39 33 2f 34 20 50 68 6f 65 6e | . 1993/4 Phoen| 00000040 69 78 2f 51 75 61 6e 74 75 6d 0a 2d 2d 2d 2d 2d |ix/Quantum.-----| 00000050 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00000090 2d 2d 2d 2d 2d 0a 0a 20 20 54 68 65 20 51 54 4d |-----.. The QTM| 000000a0 20 70 6c 61 79 65 72 20 76 31 2e 30 30 20 75 73 | player v1.00 us| 000000b0 65 73 20 61 6e 20 41 63 6f 72 6e 20 61 6c 6c 6f |es an Acorn allo| 000000c0 63 61 74 65 64 20 53 57 49 20 63 68 75 6e 6b 2c |cated SWI chunk,| 000000d0 20 6e 75 6d 62 65 72 20 2d 20 26 34 37 45 34 30 | number - &47E40| 000000e0 0a 0a 0a 53 57 49 20 22 51 54 4d 5f 4c 6f 61 64 |...SWI "QTM_Load| 000000f0 22 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |" | 00000100 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000120 20 20 20 20 20 20 20 20 20 26 34 37 45 34 30 0a | &47E40.| 00000130 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00000170 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 4f 6e |------------..On| 00000180 20 65 6e 74 72 79 3a 20 20 52 30 20 3d 20 70 6f | entry: R0 = po| 00000190 69 6e 74 65 72 20 74 6f 20 66 69 6c 65 6e 61 6d |inter to filenam| 000001a0 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |e. | 000001b0 3d 20 30 20 74 6f 20 27 6c 6f 61 64 27 20 61 20 |= 0 to 'load' a | 000001c0 70 72 65 2d 6c 6f 61 64 65 64 20 73 6f 6e 67 20 |pre-loaded song | 000001d0 66 72 6f 6d 20 61 20 6d 65 6d 6f 72 79 20 61 64 |from a memory ad| 000001e0 64 72 65 73 73 0a 20 20 20 20 20 20 20 20 20 20 |dress. | 000001f0 20 52 31 20 3d 20 30 20 74 6f 20 6c 6f 61 64 20 | R1 = 0 to load | 00000200 73 6f 6e 67 20 74 6f 20 74 68 65 20 52 4d 41 0a |song to the RMA.| 00000210 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3d 20 | = | 00000220 3e 30 20 74 6f 20 6c 6f 61 64 20 74 6f 20 74 68 |>0 to load to th| 00000230 69 73 20 61 64 64 72 65 73 73 0a 0a 4f 6e 20 65 |is address..On e| 00000240 78 69 74 20 3a 20 20 2d 0a 0a 56 20 66 6c 61 67 |xit : -..V flag| 00000250 20 73 65 74 20 69 66 20 74 68 65 72 65 20 69 73 | set if there is| 00000260 20 6e 6f 74 20 65 6e 6f 75 67 68 74 20 73 70 61 | not enought spa| 00000270 63 65 20 69 6e 20 74 68 65 20 52 4d 41 20 6f 72 |ce in the RMA or| 00000280 20 66 69 6c 65 20 6e 6f 74 20 66 6f 75 6e 64 0a | file not found.| 00000290 0a 49 66 20 52 30 20 70 6f 69 6e 74 73 20 74 6f |.If R0 points to| 000002a0 20 61 20 66 69 6c 65 6e 61 6d 65 20 77 68 65 6e | a filename when| 000002b0 20 74 68 69 73 20 53 57 49 20 69 73 20 63 61 6c | this SWI is cal| 000002c0 6c 65 64 2c 20 69 74 20 77 69 6c 6c 20 61 74 74 |led, it will att| 000002d0 65 6d 70 74 20 74 6f 20 6c 6f 61 64 0a 74 68 65 |empt to load.the| 000002e0 20 73 70 65 63 69 66 69 65 64 20 73 6f 6e 67 20 | specified song | 000002f0 6d 6f 64 75 6c 65 20 69 6e 74 6f 20 74 68 65 20 |module into the | 00000300 52 4d 41 20 6f 72 20 74 6f 20 74 68 65 20 6d 65 |RMA or to the me| 00000310 6d 6f 72 79 20 6c 6f 63 61 74 69 6f 6e 20 67 69 |mory location gi| 00000320 76 65 6e 20 69 6e 0a 52 31 2e 20 49 66 20 52 30 |ven in.R1. If R0| 00000330 20 63 6f 6e 74 61 69 6e 73 20 30 20 6f 6e 20 65 | contains 0 on e| 00000340 6e 74 72 79 2c 20 74 68 65 6e 20 51 54 4d 20 77 |ntry, then QTM w| 00000350 69 6c 6c 20 61 74 74 65 6d 70 74 20 74 6f 20 69 |ill attempt to i| 00000360 6e 69 74 69 61 6c 69 73 65 20 74 68 65 20 73 6f |nitialise the so| 00000370 6e 67 0a 70 6f 69 6e 74 65 64 20 74 6f 20 62 79 |ng.pointed to by| 00000380 20 52 31 2e 0a 59 6f 75 20 73 68 6f 75 6c 64 20 | R1..You should | 00000390 6f 6e 6c 79 20 6c 6f 61 64 20 73 6f 6e 67 73 20 |only load songs | 000003a0 69 6e 74 6f 20 27 55 73 65 72 27 20 28 6e 6f 6e |into 'User' (non| 000003b0 2d 52 4d 41 29 20 6d 65 6d 6f 72 79 20 69 66 20 |-RMA) memory if | 000003c0 79 6f 75 72 20 70 72 6f 67 72 61 6d 20 69 73 0a |your program is.| 000003d0 73 69 6e 67 6c 65 2d 74 61 73 6b 69 6e 67 20 28 |single-tasking (| 000003e0 65 67 2e 20 67 61 6d 65 2c 20 64 65 6d 6f 2c 20 |eg. game, demo, | 000003f0 65 74 63 2e 29 20 2d 20 51 54 4d 20 77 69 6c 6c |etc.) - QTM will| 00000400 20 61 6c 6d 6f 73 74 20 63 65 72 74 61 69 6e 6c | almost certainl| 00000410 79 20 63 72 61 73 68 20 69 66 20 69 74 20 74 72 |y crash if it tr| 00000420 69 65 73 0a 74 6f 20 61 63 63 65 73 73 20 61 20 |ies.to access a | 00000430 73 6f 6e 67 20 6c 6f 61 64 65 64 20 69 6e 74 6f |song loaded into| 00000440 20 75 73 65 72 20 6d 65 6d 6f 72 79 20 77 68 65 | user memory whe| 00000450 6e 20 74 68 65 20 64 65 73 6b 74 6f 70 20 69 73 |n the desktop is| 00000460 20 61 63 74 69 76 65 2e 2e 2e 0a 0a 0a 0a 53 57 | active.......SW| 00000470 49 20 22 51 54 4d 5f 53 74 61 72 74 22 20 20 20 |I "QTM_Start" | 00000480 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 000004b0 20 20 20 20 26 34 37 45 34 31 0a 2d 2d 2d 2d 2d | &47E41.-----| 000004c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00000500 2d 2d 2d 2d 2d 2d 2d 0a 0a 4f 6e 20 65 6e 74 72 |-------..On entr| 00000510 79 3a 20 20 2d 0a 0a 4f 6e 20 65 78 69 74 20 3a |y: -..On exit :| 00000520 20 20 2d 0a 0a 56 20 66 6c 61 67 20 73 65 74 20 | -..V flag set | 00000530 69 66 20 6e 6f 20 73 6f 6e 67 20 69 73 20 6c 6f |if no song is lo| 00000540 61 64 65 64 0a 0a 54 68 69 73 20 53 57 49 20 77 |aded..This SWI w| 00000550 69 6c 6c 20 73 74 61 72 74 20 74 68 65 20 63 75 |ill start the cu| 00000560 72 72 65 6e 74 20 74 75 6e 65 20 70 6c 61 79 69 |rrent tune playi| 00000570 6e 67 20 69 66 20 69 74 20 68 61 73 20 62 65 65 |ng if it has bee| 00000580 6e 20 70 61 75 73 65 64 20 6f 72 0a 73 74 6f 70 |n paused or.stop| 00000590 70 65 64 2e 0a 0a 0a 0a 53 57 49 20 22 51 54 4d |ped.....SWI "QTM| 000005a0 5f 53 74 6f 70 22 20 20 20 20 20 20 20 20 20 20 |_Stop" | 000005b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 000005d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 26 34 | &4| 000005e0 37 45 34 32 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |7E42.-----------| 000005f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00000630 2d 0a 0a 4f 6e 20 65 6e 74 72 79 3a 20 20 2d 0a |-..On entry: -.| 00000640 0a 4f 6e 20 65 78 69 74 20 3a 20 20 2d 0a 0a 56 |.On exit : -..V| 00000650 20 66 6c 61 67 20 73 65 74 20 69 66 20 6e 6f 20 | flag set if no | 00000660 73 6f 6e 67 20 69 73 20 6c 6f 61 64 65 64 0a 0a |song is loaded..| 00000670 54 68 69 73 20 53 57 49 20 77 69 6c 6c 20 73 74 |This SWI will st| 00000680 6f 70 20 74 68 65 20 63 75 72 72 65 6e 74 20 74 |op the current t| 00000690 75 6e 65 20 70 6c 61 79 69 6e 67 2c 20 61 6e 64 |une playing, and| 000006a0 20 72 65 73 65 74 20 61 6c 6c 20 74 68 65 20 69 | reset all the i| 000006b0 6e 74 65 72 6e 61 6c 0a 76 61 72 69 61 62 6c 65 |nternal.variable| 000006c0 73 2c 20 69 6e 63 6c 75 64 69 6e 67 20 74 68 65 |s, including the| 000006d0 20 70 6f 73 69 74 69 6f 6e 20 63 6f 75 6e 74 65 | position counte| 000006e0 72 73 20 2d 20 77 68 69 63 68 20 69 74 20 73 65 |rs - which it se| 000006f0 74 73 20 74 6f 20 30 2e 0a 0a 0a 0a 53 57 49 20 |ts to 0.....SWI | 00000700 22 51 54 4d 5f 50 61 75 73 65 22 20 20 20 20 20 |"QTM_Pause" | 00000710 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000740 20 20 26 34 37 45 34 33 0a 2d 2d 2d 2d 2d 2d 2d | &47E43.-------| 00000750 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00000790 2d 2d 2d 2d 2d 0a 0a 4f 6e 20 65 6e 74 72 79 3a |-----..On entry:| 000007a0 20 20 2d 0a 0a 4f 6e 20 65 78 69 74 20 3a 20 20 | -..On exit : | 000007b0 2d 0a 0a 56 20 66 6c 61 67 20 73 65 74 20 69 66 |-..V flag set if| 000007c0 20 6e 6f 20 73 6f 6e 67 20 69 73 20 6c 6f 61 64 | no song is load| 000007d0 65 64 0a 0a 54 68 69 73 20 68 61 73 20 74 68 65 |ed..This has the| 000007e0 20 73 61 6d 65 20 65 66 66 65 63 74 20 61 73 20 | same effect as | 000007f0 53 57 49 20 22 51 54 4d 5f 53 74 6f 70 22 2c 20 |SWI "QTM_Stop", | 00000800 61 6c 74 68 6f 75 67 68 20 69 74 20 64 6f 65 73 |although it does| 00000810 6e 27 74 20 72 65 73 65 74 20 74 68 65 0a 76 61 |n't reset the.va| 00000820 72 69 61 62 6c 65 73 2c 20 73 6f 20 77 68 65 6e |riables, so when| 00000830 20 74 68 65 20 74 75 6e 65 20 69 73 20 72 65 2d | the tune is re-| 00000840 73 74 61 72 74 65 64 2c 20 69 74 20 77 69 6c 6c |started, it will| 00000850 20 63 6f 6e 74 69 6e 75 65 20 66 72 6f 6d 20 74 | continue from t| 00000860 68 65 20 73 61 6d 65 0a 70 6f 73 69 74 69 6f 6e |he same.position| 00000870 2e 0a 0a 0a 0a 53 57 49 20 22 51 54 4d 5f 43 6c |.....SWI "QTM_Cl| 00000880 65 61 72 22 20 20 20 20 20 20 20 20 20 20 20 20 |ear" | 00000890 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 000008b0 20 20 20 20 20 20 20 20 20 20 20 26 34 37 45 34 | &47E4| 000008c0 34 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |4.--------------| 000008d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00000900 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a |--------------..| 00000910 4f 6e 20 65 6e 74 72 79 3a 20 20 52 30 20 3d 20 |On entry: R0 = | 00000920 2d 31 20 74 6f 20 63 6f 6e 76 65 72 74 20 73 61 |-1 to convert sa| 00000930 6d 70 6c 65 73 20 62 61 63 6b 20 74 6f 20 73 69 |mples back to si| 00000940 67 6e 65 64 20 6c 69 6e 65 61 72 20 66 6f 72 6d |gned linear form| 00000950 61 74 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 |at. | 00000960 20 3d 20 3c 3e 2d 31 20 64 6f 6e 27 74 20 63 6f | = <>-1 don't co| 00000970 6e 76 65 72 74 20 73 61 6d 70 6c 65 73 0a 0a 4f |nvert samples..O| 00000980 6e 20 65 78 69 74 20 3a 20 20 2d 0a 0a 4e 6f 20 |n exit : -..No | 00000990 65 72 72 6f 72 20 69 73 20 72 65 70 6f 72 74 65 |error is reporte| 000009a0 64 20 69 66 20 74 68 65 72 65 20 69 73 20 6e 6f |d if there is no| 000009b0 74 20 61 20 73 6f 6e 67 20 6c 6f 61 64 65 64 2e |t a song loaded.| 000009c0 0a 0a 54 68 69 73 20 53 57 49 20 77 69 6c 6c 20 |..This SWI will | 000009d0 73 74 6f 70 20 74 68 65 20 74 75 6e 65 20 70 6c |stop the tune pl| 000009e0 61 79 69 6e 67 2c 20 61 6e 64 20 72 65 6c 65 61 |aying, and relea| 000009f0 73 65 20 74 68 65 20 6d 65 6d 6f 72 79 20 75 73 |se the memory us| 00000a00 65 64 20 66 6f 72 20 74 68 65 0a 73 6f 6e 67 20 |ed for the.song | 00000a10 28 69 66 20 69 74 20 77 61 73 20 6c 6f 61 64 65 |(if it was loade| 00000a20 64 20 69 6e 74 6f 20 52 4d 41 29 2e 20 54 68 65 |d into RMA). The| 00000a30 20 74 75 6e 65 20 63 61 6e 27 74 20 62 65 20 72 | tune can't be r| 00000a40 65 73 74 61 72 74 65 64 20 61 66 74 65 72 20 74 |estarted after t| 00000a50 68 69 73 0a 63 6f 6d 6d 61 6e 64 2c 20 75 6e 6c |his.command, unl| 00000a60 65 73 73 20 69 74 20 69 73 20 72 65 6c 6f 61 64 |ess it is reload| 00000a70 65 64 20 28 66 72 6f 6d 20 75 73 65 72 20 6d 65 |ed (from user me| 00000a80 6d 6f 72 79 2c 20 6f 72 20 64 69 73 63 20 65 74 |mory, or disc et| 00000a90 63 2e 29 20 75 73 69 6e 67 20 74 68 65 20 53 57 |c.) using the SW| 00000aa0 49 0a 22 51 54 4d 5f 4c 6f 61 64 22 2e 0a 0a 54 |I."QTM_Load"...T| 00000ab0 68 65 20 63 75 72 72 65 6e 74 20 73 6f 6e 67 20 |he current song | 00000ac0 63 61 6e 20 6f 6e 6c 79 20 62 65 20 72 65 6c 6f |can only be relo| 00000ad0 61 64 65 64 20 66 72 6f 6d 20 75 73 65 72 20 28 |aded from user (| 00000ae0 6e 6f 74 20 51 54 4d 73 29 20 6d 65 6d 6f 72 79 |not QTMs) memory| 00000af0 20 61 66 74 65 72 20 61 0a 53 57 49 22 51 54 4d | after a.SWI"QTM| 00000b00 5f 43 6c 65 61 72 22 20 69 66 20 74 68 65 20 73 |_Clear" if the s| 00000b10 61 6d 70 6c 65 73 20 68 61 76 65 20 62 65 65 6e |amples have been| 00000b20 20 63 6f 6e 76 65 72 74 65 64 20 62 61 63 6b 20 | converted back | 00000b30 74 6f 20 73 69 67 6e 65 64 20 6c 69 6e 65 61 72 |to signed linear| 00000b40 0a 66 6f 72 6d 61 74 20 28 66 6f 72 6d 20 74 68 |.format (form th| 00000b50 65 20 6c 6f 67 61 72 69 74 68 6d 69 63 20 66 6f |e logarithmic fo| 00000b60 72 6d 61 74 20 74 68 61 74 20 74 68 65 72 65 20 |rmat that there | 00000b70 77 65 72 65 20 63 6f 6e 76 65 72 74 65 64 20 74 |were converted t| 00000b80 6f 20 77 68 65 6e 20 74 68 65 0a 73 6f 6e 67 20 |o when the.song | 00000b90 77 61 73 20 6c 6f 61 64 65 64 29 2e 20 54 68 69 |was loaded). Thi| 00000ba0 73 20 63 61 6e 20 62 65 20 64 6f 6e 65 20 62 79 |s can be done by| 00000bb0 20 73 65 74 74 69 6e 67 20 52 30 20 74 6f 20 2d | setting R0 to -| 00000bc0 31 20 62 65 66 6f 72 65 20 63 61 6c 6c 69 6e 67 |1 before calling| 00000bd0 0a 51 54 4d 5f 43 6c 65 61 72 2e 20 53 65 65 20 |.QTM_Clear. See | 00000be0 51 54 4d 5f 4c 6f 61 64 20 66 6f 72 20 69 6e 66 |QTM_Load for inf| 00000bf0 6f 72 6d 61 74 69 6f 6e 20 6f 6e 20 28 72 65 29 |ormation on (re)| 00000c00 6c 6f 61 64 69 6e 67 20 61 20 73 6f 6e 67 20 74 |loading a song t| 00000c10 68 61 74 20 69 73 20 61 6c 72 65 61 64 79 0a 73 |hat is already.s| 00000c20 74 6f 72 65 64 20 69 6e 20 6d 65 6d 6f 72 79 2e |tored in memory.| 00000c30 0a 0a 0a 0a 53 57 49 20 22 51 54 4d 5f 49 6e 66 |....SWI "QTM_Inf| 00000c40 6f 22 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |o" | 00000c50 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00000c70 20 20 20 20 20 20 20 20 20 20 26 34 37 45 34 35 | &47E45| 00000c80 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |.---------------| 00000c90 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00000cc0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 4f |-------------..O| 00000cd0 6e 20 65 6e 74 72 79 3a 20 20 2d 0a 0a 4f 6e 20 |n entry: -..On | 00000ce0 65 78 69 74 20 3a 20 20 52 30 20 3d 20 70 6f 69 |exit : R0 = poi| 00000cf0 6e 74 65 72 20 74 6f 20 74 72 61 63 6b 20 6e 61 |nter to track na| 00000d00 6d 65 20 28 6c 65 6e 67 74 68 20 32 30 20 62 79 |me (length 20 by| 00000d10 74 65 73 2c 20 30 20 74 65 72 6d 69 6e 61 74 65 |tes, 0 terminate| 00000d20 64 29 0a 20 20 20 20 20 20 20 20 20 20 20 52 31 |d). R1| 00000d30 20 3d 20 70 6f 69 6e 74 65 72 20 74 6f 20 61 75 | = pointer to au| 00000d40 74 68 6f 72 20 6e 61 6d 65 20 28 6c 65 6e 67 74 |thor name (lengt| 00000d50 68 20 32 32 20 62 79 74 65 73 2c 20 30 20 74 65 |h 22 bytes, 0 te| 00000d60 72 6d 69 6e 61 74 65 64 29 0a 20 20 20 20 20 20 |rminated). | 00000d70 20 20 20 20 20 20 20 20 20 20 6f 72 20 30 20 69 | or 0 i| 00000d80 66 20 61 75 74 68 6f 72 20 6e 61 6d 65 20 63 6f |f author name co| 00000d90 75 6c 64 20 6e 6f 74 20 62 65 20 66 6f 75 6e 64 |uld not be found| 00000da0 0a 20 20 20 20 20 20 20 20 20 20 20 52 32 20 3d |. R2 =| 00000db0 20 74 75 6e 65 20 74 79 70 65 20 28 30 2d 33 29 | tune type (0-3)| 00000dc0 3a 20 30 20 2d 20 31 35 20 69 6e 73 74 20 53 6f |: 0 - 15 inst So| 00000dd0 75 6e 64 20 54 72 61 63 6b 65 72 20 63 6f 6d 70 |und Tracker comp| 00000de0 61 74 69 62 6c 65 0a 20 20 20 20 20 20 20 20 20 |atible. | 00000df0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000e00 20 20 20 20 20 20 20 20 31 20 2d 20 33 31 20 69 | 1 - 31 i| 00000e10 6e 73 74 20 53 6f 75 6e 64 20 54 72 61 63 6b 65 |nst Sound Tracke| 00000e20 72 20 63 6f 6d 70 61 74 69 62 6c 65 0a 20 20 20 |r compatible. | 00000e30 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000e40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 32 20 | 2 | 00000e50 2d 20 33 31 20 69 6e 73 74 20 50 72 6f 54 72 61 |- 31 inst ProTra| 00000e60 63 6b 65 72 0a 20 20 20 20 20 20 20 20 20 20 20 |cker. | 00000e70 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000e80 20 20 20 20 20 20 33 20 2d 20 33 31 20 69 6e 73 | 3 - 31 ins| 00000e90 74 2c 20 34 20 63 68 61 6e 6e 65 6c 20 53 74 61 |t, 4 channel Sta| 00000ea0 72 74 72 65 6b 6b 65 72 0a 20 20 20 20 20 20 20 |rtrekker. | 00000eb0 20 20 20 20 52 33 20 3d 20 6e 75 6d 62 65 72 20 | R3 = number | 00000ec0 6f 66 20 63 68 61 6e 6e 65 6c 73 20 28 63 75 72 |of channels (cur| 00000ed0 72 65 6e 74 6c 79 20 6f 6e 6c 79 20 34 20 63 68 |rently only 4 ch| 00000ee0 61 6e 6e 65 6c 73 29 0a 20 20 20 20 20 20 20 20 |annels). | 00000ef0 20 20 20 52 34 20 3d 20 66 69 6c 65 20 6c 65 6e | R4 = file len| 00000f00 67 74 68 20 28 69 6e 20 62 79 74 65 73 29 0a 20 |gth (in bytes). | 00000f10 20 20 20 20 20 20 20 20 20 20 52 35 20 3d 20 67 | R5 = g| 00000f20 61 72 62 61 67 65 20 64 61 74 61 20 73 69 7a 65 |arbage data size| 00000f30 20 28 2d 76 65 20 69 66 20 64 61 74 61 20 6d 69 | (-ve if data mi| 00000f40 73 73 69 6e 67 29 0a 20 20 20 20 20 20 20 20 20 |ssing). | 00000f50 20 20 52 36 20 3d 20 61 64 64 72 65 73 73 20 77 | R6 = address w| 00000f60 68 65 72 65 20 73 6f 6e 67 20 69 73 20 6c 6f 61 |here song is loa| 00000f70 64 65 64 0a 0a 56 20 66 6c 61 67 20 73 65 74 20 |ded..V flag set | 00000f80 69 66 20 6e 6f 20 73 6f 6e 67 20 69 73 20 6c 6f |if no song is lo| 00000f90 61 64 65 64 0a 0a 54 68 69 73 20 53 57 49 20 72 |aded..This SWI r| 00000fa0 65 74 75 72 6e 73 20 67 65 6e 65 72 61 6c 20 69 |eturns general i| 00000fb0 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 62 6f 75 74 |nformation about| 00000fc0 20 74 68 65 20 63 75 72 72 65 6e 74 20 74 72 61 | the current tra| 00000fd0 63 6b 20 6c 6f 61 64 65 64 20 69 6e 20 51 54 4d |ck loaded in QTM| 00000fe0 2e 0a 0a 49 74 20 61 6c 73 6f 20 75 73 65 73 20 |...It also uses | 00000ff0 61 6e 20 27 69 6e 74 65 6c 6c 69 67 65 6e 74 20 |an 'intelligent | 00001000 61 75 74 68 6f 72 20 64 65 74 65 63 74 6f 72 27 |author detector'| 00001010 20 72 6f 75 74 69 6e 65 2c 20 74 6f 20 73 65 61 | routine, to sea| 00001020 72 63 68 20 74 68 72 6f 75 67 68 20 74 68 65 0a |rch through the.| 00001030 73 61 6d 70 6c 65 20 6e 61 6d 65 73 20 28 75 73 |sample names (us| 00001040 75 61 6c 6c 79 20 75 73 65 64 20 62 79 20 61 75 |ually used by au| 00001050 74 68 6f 72 73 2c 20 74 6f 20 73 74 6f 72 65 20 |thors, to store | 00001060 74 68 65 69 72 20 6e 61 6d 65 20 6f 72 20 67 72 |their name or gr| 00001070 6f 75 70 29 20 74 6f 20 73 65 65 0a 69 66 20 69 |oup) to see.if i| 00001080 74 20 63 61 6e 20 66 69 6e 64 20 61 6e 79 74 68 |t can find anyth| 00001090 69 6e 67 20 74 68 61 74 20 72 65 73 73 65 6d 62 |ing that ressemb| 000010a0 6c 65 73 20 61 20 6e 61 6d 65 2e 20 49 66 20 69 |les a name. If i| 000010b0 74 20 64 6f 65 73 2c 20 74 68 65 6e 20 69 74 20 |t does, then it | 000010c0 72 65 74 75 72 6e 73 0a 61 20 70 6f 69 6e 74 65 |returns.a pointe| 000010d0 72 20 74 6f 20 74 68 65 20 6e 61 6d 65 2c 20 69 |r to the name, i| 000010e0 6e 20 52 31 2c 20 6f 74 68 65 72 77 69 73 65 20 |n R1, otherwise | 000010f0 69 74 20 72 65 74 75 72 6e 73 20 77 69 74 68 20 |it returns with | 00001100 52 31 3d 30 2e 0a 0a 51 54 4d 20 63 61 6e 20 63 |R1=0...QTM can c| 00001110 75 72 72 65 6e 74 6c 79 20 6f 6e 6c 79 20 63 6f |urrently only co| 00001120 70 65 20 77 69 74 68 20 34 20 63 68 61 6e 6e 65 |pe with 4 channe| 00001130 6c 20 73 6f 6e 67 73 2c 20 62 75 74 20 66 75 74 |l songs, but fut| 00001140 75 72 65 20 76 65 72 73 69 6f 6e 73 20 73 68 6f |ure versions sho| 00001150 75 6c 64 0a 62 65 20 61 62 6c 65 20 74 6f 20 68 |uld.be able to h| 00001160 61 6e 64 6c 65 20 61 20 6c 6f 74 20 6d 6f 72 65 |andle a lot more| 00001170 2e 2e 2e 0a 0a 0a 0a 53 57 49 20 22 51 54 4d 5f |.......SWI "QTM_| 00001180 50 6f 73 22 20 20 20 20 20 20 20 20 20 20 20 20 |Pos" | 00001190 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 000011b0 20 20 20 20 20 20 20 20 20 20 20 20 20 26 34 37 | &47| 000011c0 45 34 36 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |E46.------------| 000011d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00001210 0a 0a 4f 6e 20 65 6e 74 72 79 3a 20 20 52 30 20 |..On entry: R0 | 00001220 3d 20 6e 65 77 20 73 65 71 75 65 6e 63 65 20 70 |= new sequence p| 00001230 6f 73 69 74 69 6f 6e 20 28 30 2d 31 32 37 29 20 |osition (0-127) | 00001240 6f 72 20 2d 31 20 74 6f 20 72 65 61 64 20 63 75 |or -1 to read cu| 00001250 72 72 65 6e 74 20 70 6f 73 69 74 69 6f 6e 0a 20 |rrent position. | 00001260 20 20 20 20 20 20 20 20 20 20 52 31 20 3d 20 6e | R1 = n| 00001270 65 77 20 65 76 65 6e 74 20 70 6f 73 69 74 69 6f |ew event positio| 00001280 6e 20 28 30 2d 36 33 29 20 6f 72 20 2d 31 20 74 |n (0-63) or -1 t| 00001290 6f 20 72 65 61 64 0a 0a 4f 6e 20 65 78 69 74 20 |o read..On exit | 000012a0 3a 20 20 52 30 20 3d 20 70 72 65 76 69 6f 75 73 |: R0 = previous| 000012b0 20 73 65 71 75 65 6e 63 65 20 70 6f 73 69 74 69 | sequence positi| 000012c0 6f 6e 20 28 30 2d 31 32 37 29 0a 20 20 20 20 20 |on (0-127). | 000012d0 20 20 20 20 20 20 52 31 20 3d 20 70 72 65 76 69 | R1 = previ| 000012e0 6f 75 73 20 65 76 65 6e 74 20 70 6f 73 69 74 69 |ous event positi| 000012f0 6f 6e 20 28 30 2d 36 33 29 0a 0a 0a 56 20 66 6c |on (0-63)...V fl| 00001300 61 67 20 73 65 74 20 69 66 20 6e 6f 20 73 6f 6e |ag set if no son| 00001310 67 20 69 73 20 6c 6f 61 64 65 64 20 6f 72 20 74 |g is loaded or t| 00001320 68 65 20 65 76 65 6e 74 2f 70 6f 73 69 74 69 6f |he event/positio| 00001330 6e 20 6e 75 6d 62 65 72 20 69 73 20 6f 75 74 20 |n number is out | 00001340 6f 66 0a 72 61 6e 67 65 2e 0a 0a 54 68 69 73 20 |of.range...This | 00001350 53 57 49 20 63 61 6e 20 62 65 20 75 73 65 64 20 |SWI can be used | 00001360 74 6f 20 72 65 61 64 20 6f 72 20 61 6c 74 65 72 |to read or alter| 00001370 20 74 68 65 20 63 75 72 72 65 6e 74 20 73 65 71 | the current seq| 00001380 75 65 6e 63 65 20 6f 72 20 65 76 65 6e 74 20 70 |uence or event p| 00001390 6f 73 69 74 69 6f 6e 0a 69 6e 20 74 68 65 20 63 |osition.in the c| 000013a0 75 72 72 65 6e 74 20 73 6f 6e 67 2e 0a 0a 0a 0a |urrent song.....| 000013b0 53 57 49 20 22 51 54 4d 5f 45 66 66 65 63 74 43 |SWI "QTM_EffectC| 000013c0 6f 6e 74 72 6f 6c 22 20 20 20 20 20 20 20 20 20 |ontrol" | 000013d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 000013f0 20 20 20 20 20 20 26 34 37 45 34 37 0a 2d 2d 2d | &47E47.---| 00001400 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00001440 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 4f 6e 20 65 6e |---------..On en| 00001450 74 72 79 3a 20 52 30 20 3d 20 65 66 66 65 63 74 |try: R0 = effect| 00001460 20 6e 75 6d 62 65 72 20 28 26 30 2d 26 46 2c 26 | number (&0-&F,&| 00001470 45 30 2d 26 45 46 20 2d 20 28 66 6f 72 20 27 45 |E0-&EF - (for 'E| 00001480 27 20 65 66 66 65 63 74 73 29 29 0a 20 20 20 20 |' effects)). | 00001490 20 20 20 20 20 20 52 31 20 3d 20 6e 65 77 20 73 | R1 = new s| 000014a0 74 61 74 65 20 6f 66 20 65 66 66 65 63 74 20 28 |tate of effect (| 000014b0 30 2d 6f 66 66 2f 31 2d 6f 6e 29 0a 0a 4f 6e 20 |0-off/1-on)..On | 000014c0 65 78 69 74 20 3a 20 52 30 20 3d 20 70 72 65 76 |exit : R0 = prev| 000014d0 69 6f 75 73 20 65 66 66 65 63 74 20 73 74 61 74 |ious effect stat| 000014e0 65 20 77 6f 72 64 20 28 26 30 2d 26 46 29 20 31 |e word (&0-&F) 1| 000014f0 20 62 69 74 20 70 65 72 20 65 66 66 65 63 74 2c | bit per effect,| 00001500 20 31 36 20 62 69 74 73 0a 20 20 20 20 20 20 20 | 16 bits. | 00001510 20 20 20 52 31 20 3d 20 70 72 65 76 69 6f 75 73 | R1 = previous| 00001520 20 65 66 66 65 63 74 20 73 74 61 74 65 20 77 6f | effect state wo| 00001530 72 64 20 28 26 45 30 2d 26 45 46 29 20 20 20 20 |rd (&E0-&EF) | 00001540 20 20 22 20 20 20 20 20 20 20 20 20 20 20 20 22 | " "| 00001550 0a 0a 56 20 66 6c 61 67 20 73 65 74 20 69 66 20 |..V flag set if | 00001560 74 68 65 20 65 66 66 65 63 74 20 6e 75 6d 62 65 |the effect numbe| 00001570 72 20 77 61 73 20 6f 75 74 20 6f 66 20 72 61 6e |r was out of ran| 00001580 67 65 0a 0a 54 68 69 73 20 53 57 49 20 63 61 6e |ge..This SWI can| 00001590 20 62 65 20 75 73 65 64 20 74 6f 20 63 68 61 6e | be used to chan| 000015a0 67 65 20 74 68 65 20 73 74 61 74 65 20 6f 66 20 |ge the state of | 000015b0 61 6e 79 20 65 66 66 65 63 74 20 28 61 73 20 73 |any effect (as s| 000015c0 65 65 6e 20 62 79 20 74 68 65 20 51 54 4d 0a 65 |een by the QTM.e| 000015d0 66 66 65 63 74 20 68 61 6e 64 6c 65 72 73 29 2e |ffect handlers).| 000015e0 20 44 69 73 61 62 6c 69 6e 67 20 65 66 66 65 63 | Disabling effec| 000015f0 74 73 20 77 69 6c 6c 20 73 74 6f 70 20 51 54 4d |ts will stop QTM| 00001600 20 74 61 6b 69 6e 67 20 61 6e 79 20 61 63 74 69 | taking any acti| 00001610 6f 6e 20 6f 76 65 72 0a 74 68 65 6d 20 65 67 2e |on over.them eg.| 00001620 20 44 69 73 61 62 6c 69 6e 67 20 65 66 66 65 63 | Disabling effec| 00001630 74 20 26 46 20 77 69 6c 6c 20 6e 6f 74 20 61 6c |t &F will not al| 00001640 6c 6f 77 20 73 70 65 65 64 2f 74 65 6d 70 6f 20 |low speed/tempo | 00001650 63 68 61 6e 67 65 73 20 74 6f 20 74 61 6b 65 0a |changes to take.| 00001660 70 6c 61 63 65 2c 20 61 6e 64 20 74 68 65 20 73 |place, and the s| 00001670 6f 6e 67 20 6d 61 79 20 73 6f 75 6e 64 20 74 6f |ong may sound to| 00001680 6f 20 66 61 73 74 20 6f 72 20 73 6c 6f 77 2e 0a |o fast or slow..| 00001690 20 4f 6e 63 65 20 72 65 2d 65 6e 61 62 6c 65 64 | Once re-enabled| 000016a0 2c 20 74 68 65 20 65 66 66 65 63 74 28 73 29 20 |, the effect(s) | 000016b0 77 69 6c 6c 20 62 65 20 72 75 6e 20 61 73 20 75 |will be run as u| 000016c0 73 75 61 6c 20 61 67 61 69 6e 2e 0a 0a 54 68 65 |sual again...The| 000016d0 20 63 6f 6e 74 65 6e 74 73 20 6f 66 20 52 30 20 | contents of R0 | 000016e0 61 6e 64 20 52 31 20 6f 6e 20 65 78 69 74 20 61 |and R1 on exit a| 000016f0 72 65 20 61 20 63 6f 70 79 20 6f 66 20 74 68 65 |re a copy of the| 00001700 20 65 66 66 65 63 74 20 77 6f 72 64 73 20 75 73 | effect words us| 00001710 65 64 20 62 79 20 51 54 4d 0a 2d 20 65 61 63 68 |ed by QTM.- each| 00001720 20 68 61 73 20 31 36 20 62 69 74 73 20 75 73 65 | has 16 bits use| 00001730 64 2c 20 65 61 63 68 20 62 69 74 20 72 65 70 72 |d, each bit repr| 00001740 65 73 65 6e 74 69 6e 67 20 74 68 65 20 73 74 61 |esenting the sta| 00001750 74 65 20 6f 66 20 74 68 61 74 20 65 66 66 65 63 |te of that effec| 00001760 74 0a 30 2d 6f 66 66 2c 20 31 2d 6f 6e 2e 20 52 |t.0-off, 1-on. R| 00001770 30 20 63 6f 6e 74 61 69 6e 73 20 74 68 65 20 66 |0 contains the f| 00001780 6c 61 67 73 20 66 6f 72 20 74 68 65 20 6e 6f 72 |lags for the nor| 00001790 6d 61 6c 20 65 66 66 65 63 74 73 20 28 26 30 2d |mal effects (&0-| 000017a0 26 46 29 2c 20 52 31 0a 63 6f 6e 74 61 69 6e 73 |&F), R1.contains| 000017b0 20 74 68 65 20 66 6c 61 67 73 20 66 6f 72 20 74 | the flags for t| 000017c0 68 65 20 27 45 27 20 65 66 66 65 63 74 73 20 28 |he 'E' effects (| 000017d0 26 45 30 2d 26 45 46 29 2e 0a 0a 0a 0a 53 57 49 |&E0-&EF).....SWI| 000017e0 20 22 51 54 4d 5f 56 6f 6c 75 6d 65 22 20 20 20 | "QTM_Volume" | 000017f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00001820 20 20 20 26 34 37 45 34 38 0a 2d 2d 2d 2d 2d 2d | &47E48.------| 00001830 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00001870 2d 2d 2d 2d 2d 2d 0a 0a 4f 6e 20 65 6e 74 72 79 |------..On entry| 00001880 3a 20 52 30 20 3d 20 6e 65 77 20 6f 76 65 72 61 |: R0 = new overa| 00001890 6c 6c 20 76 6f 6c 75 6d 65 20 28 30 2d 36 34 29 |ll volume (0-64)| 000018a0 20 6f 72 20 2d 31 20 74 6f 20 72 65 61 64 20 63 | or -1 to read c| 000018b0 75 72 72 65 6e 74 20 76 6f 6c 75 6d 65 0a 0a 4f |urrent volume..O| 000018c0 6e 20 65 78 69 74 20 3a 20 52 30 20 3d 20 70 72 |n exit : R0 = pr| 000018d0 65 76 69 6f 75 73 20 76 6f 6c 75 6d 65 20 28 30 |evious volume (0| 000018e0 2d 36 34 29 0a 0a 56 20 66 6c 61 67 20 73 65 74 |-64)..V flag set| 000018f0 20 69 66 20 76 6f 6c 75 6d 65 20 69 73 20 6f 75 | if volume is ou| 00001900 74 20 6f 66 20 72 61 6e 67 65 0a 0a 54 68 69 73 |t of range..This| 00001910 20 53 57 49 20 61 6c 6c 6f 77 73 20 79 6f 75 20 | SWI allows you | 00001920 73 65 74 20 74 68 65 20 6f 76 65 72 61 6c 6c 20 |set the overall | 00001930 6f 75 74 70 75 74 20 76 6f 6c 75 6d 65 20 66 72 |output volume fr| 00001940 6f 6d 20 74 68 65 20 51 54 4d 20 73 6f 75 6e 64 |om the QTM sound| 00001950 0a 68 61 6e 64 6c 65 72 73 2e 20 54 68 65 20 76 |.handlers. The v| 00001960 6f 6c 75 6d 65 20 69 73 20 69 6e 20 61 20 6c 69 |olume is in a li| 00001970 6e 65 61 72 20 66 6f 72 6d 20 28 30 2d 36 34 29 |near form (0-64)| 00001980 20 2d 20 61 73 20 75 73 65 64 20 66 6f 72 20 76 | - as used for v| 00001990 6f 6c 75 6d 65 73 20 69 6e 0a 73 6f 6e 67 20 6d |olumes in.song m| 000019a0 6f 64 75 6c 65 73 2e 20 47 72 61 64 75 61 6c 20 |odules. Gradual | 000019b0 66 61 64 65 73 20 63 61 6e 20 62 65 20 67 65 72 |fades can be ger| 000019c0 65 72 61 74 65 64 20 75 73 69 6e 67 20 74 68 69 |erated using thi| 000019d0 73 20 53 57 49 2e 0a 0a 0a 0a 53 57 49 20 22 51 |s SWI.....SWI "Q| 000019e0 54 4d 5f 53 65 74 53 61 6d 70 6c 65 53 70 65 65 |TM_SetSampleSpee| 000019f0 64 22 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |d" | 00001a00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00001a20 26 34 37 45 34 39 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d |&47E49.---------| 00001a30 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00001a70 2d 2d 2d 0a 0a 4f 6e 20 65 6e 74 72 79 3a 20 52 |---..On entry: R| 00001a80 30 20 3d 20 6e 65 77 20 73 61 6d 70 6c 65 20 73 |0 = new sample s| 00001a90 70 65 65 64 20 28 31 36 2d 31 30 30 75 53 29 20 |peed (16-100uS) | 00001aa0 6f 72 20 2d 31 20 74 6f 20 72 65 61 64 20 63 75 |or -1 to read cu| 00001ab0 72 72 65 6e 74 20 73 70 65 65 64 0a 0a 4f 6e 20 |rrent speed..On | 00001ac0 65 78 69 74 20 3a 20 52 30 20 3d 20 70 72 65 76 |exit : R0 = prev| 00001ad0 69 6f 75 73 20 73 61 6d 70 6c 65 20 73 70 65 65 |ious sample spee| 00001ae0 64 20 28 31 36 2d 31 30 30 75 53 29 0a 0a 56 20 |d (16-100uS)..V | 00001af0 66 6c 61 67 20 73 65 74 20 69 66 20 73 61 6d 70 |flag set if samp| 00001b00 6c 65 20 73 70 65 65 64 20 69 73 20 6f 75 74 20 |le speed is out | 00001b10 6f 66 20 72 61 6e 67 65 0a 0a 54 68 69 73 20 53 |of range..This S| 00001b20 57 49 20 6c 65 74 73 20 79 6f 75 20 73 65 74 20 |WI lets you set | 00001b30 74 68 65 20 74 69 6d 65 20 62 65 74 77 65 65 6e |the time between| 00001b40 20 73 61 6d 70 6c 65 20 6f 75 74 70 75 74 73 20 | sample outputs | 00001b50 28 69 65 2e 20 73 61 6d 70 6c 65 20 71 75 61 6c |(ie. sample qual| 00001b60 69 74 79 29 20 74 6f 0a 61 20 76 61 6c 75 65 20 |ity) to.a value | 00001b70 62 65 74 77 65 65 6e 20 31 36 75 73 20 61 6e 64 |between 16us and| 00001b80 20 31 30 30 75 73 2e 20 53 6d 61 6c 6c 65 72 20 | 100us. Smaller | 00001b90 73 70 65 65 64 20 76 61 6c 75 65 73 20 67 69 76 |speed values giv| 00001ba0 65 20 62 65 74 74 65 72 20 73 61 6d 70 6c 65 0a |e better sample.| 00001bb0 71 75 61 6c 69 74 79 2c 20 62 75 74 20 61 6c 73 |quality, but als| 00001bc0 6f 20 75 73 65 20 6d 6f 72 65 20 70 72 6f 63 65 |o use more proce| 00001bd0 73 73 6f 72 20 74 69 6d 65 2c 20 61 6e 64 20 73 |ssor time, and s| 00001be0 6c 6f 77 20 74 68 65 20 63 6f 6d 70 75 74 65 72 |low the computer| 00001bf0 20 64 6f 77 6e 20 6d 6f 72 65 2e 0a 54 68 65 20 | down more..The | 00001c00 64 65 66 61 75 6c 74 20 73 70 65 65 64 20 69 73 |default speed is| 00001c10 20 33 32 75 53 2e 0a 0a 0a 0a 53 57 49 20 22 51 | 32uS.....SWI "Q| 00001c20 54 4d 5f 44 4d 41 42 75 66 66 65 72 22 20 20 20 |TM_DMABuffer" | 00001c30 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00001c60 26 34 37 45 34 41 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d |&47E4A.---------| 00001c70 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00001cb0 2d 2d 2d 0a 0a 4f 6e 20 65 6e 74 72 79 3a 20 2d |---..On entry: -| 00001cc0 0a 0a 4f 6e 20 65 78 69 74 20 3a 20 52 30 20 3d |..On exit : R0 =| 00001cd0 20 61 64 64 72 65 73 73 20 6f 66 20 6c 61 73 74 | address of last| 00001ce0 20 75 73 65 64 20 44 4d 41 20 73 6f 75 6e 64 20 | used DMA sound | 00001cf0 62 75 66 66 65 72 2e 0a 0a 42 79 20 75 73 69 6e |buffer...By usin| 00001d00 67 20 74 68 69 73 20 53 57 49 2c 20 69 74 20 77 |g this SWI, it w| 00001d10 6f 75 6c 64 20 62 65 20 70 6f 73 73 69 62 6c 65 |ould be possible| 00001d20 20 74 6f 20 69 6d 70 6c 65 6d 65 6e 74 20 73 6f | to implement so| 00001d30 75 6e 64 20 6f 75 74 70 75 74 0a 6f 73 63 69 6c |und output.oscil| 00001d40 6c 6f 73 63 6f 70 65 73 2c 20 6f 72 20 76 6f 6c |loscopes, or vol| 00001d50 75 6d 65 20 61 63 74 69 76 61 74 65 64 20 28 72 |ume activated (r| 00001d60 65 61 6c 29 20 56 55 20 62 61 72 73 2e 20 54 68 |eal) VU bars. Th| 00001d70 65 20 64 61 74 61 20 69 6e 20 74 68 65 20 44 4d |e data in the DM| 00001d80 41 0a 62 75 66 66 65 72 20 69 73 20 73 74 6f 72 |A.buffer is stor| 00001d90 65 64 20 61 73 3a 20 5b 63 31 5d 2c 5b 63 32 5d |ed as: [c1],[c2]| 00001da0 2c 5b 63 33 5d 2c 5b 63 30 5d 2c 5b 63 31 5d 2c |,[c3],[c0],[c1],| 00001db0 5b 63 32 5d 2e 2e 2e 65 74 63 2c 20 31 20 62 79 |[c2]...etc, 1 by| 00001dc0 74 65 20 66 6f 72 20 65 61 63 68 0a 63 68 61 6e |te for each.chan| 00001dd0 6e 65 6c 2e 20 54 68 65 20 44 4d 41 20 62 75 66 |nel. The DMA buf| 00001de0 66 65 72 20 73 69 7a 65 20 75 73 65 64 20 62 79 |fer size used by| 00001df0 20 51 54 4d 20 69 73 20 32 30 38 2a 3c 6e 75 6d | QTM is 208*<num| 00001e00 20 6f 66 20 63 68 61 6e 6e 65 6c 73 3e 20 6c 6f | of channels> lo| 00001e10 6e 67 2e 20 53 65 65 0a 50 52 4d 73 20 66 6f 72 |ng. See.PRMs for| 00001e20 20 6d 6f 72 65 20 69 6e 66 6f 2e 0a 20 54 68 65 | more info.. The| 00001e30 20 61 64 64 72 65 73 73 20 72 65 74 75 72 6e 65 | address returne| 00001e40 64 20 69 6e 20 52 30 20 77 69 6c 6c 20 6f 6e 6c |d in R0 will onl| 00001e50 79 20 62 65 20 61 63 63 75 72 61 74 65 20 69 66 |y be accurate if| 00001e60 20 74 68 65 72 65 20 69 73 20 61 20 73 6f 6e 67 | there is a song| 00001e70 20 70 6c 61 79 69 6e 67 0a 77 68 69 6c 65 20 69 | playing.while i| 00001e80 74 20 69 73 20 63 61 6c 6c 65 64 2e 20 49 66 20 |t is called. If | 00001e90 61 20 73 6f 6e 67 20 68 61 73 20 6e 6f 74 20 62 |a song has not b| 00001ea0 65 65 6e 20 70 6c 61 79 65 64 20 62 65 66 6f 72 |een played befor| 00001eb0 65 20 74 68 69 73 20 69 73 20 63 61 6c 6c 65 64 |e this is called| 00001ec0 2c 20 74 68 65 6e 0a 52 30 20 77 69 6c 6c 20 72 |, then.R0 will r| 00001ed0 65 74 75 72 6e 20 7a 65 72 6f 65 64 2e 0a 0a 0a |eturn zeroed....| 00001ee0 0a 53 57 49 20 22 51 54 4d 5f 52 65 6d 6f 76 65 |.SWI "QTM_Remove| 00001ef0 43 68 61 6e 6e 65 6c 22 20 20 20 20 20 20 20 20 |Channel" | 00001f00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00001f20 20 20 20 20 20 20 20 26 34 37 45 34 42 0a 2d 2d | &47E4B.--| 00001f30 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00001f70 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 4f 6e 20 65 |----------..On e| 00001f80 6e 74 72 79 3a 20 52 30 20 3d 20 63 68 61 6e 6e |ntry: R0 = chann| 00001f90 65 6c 20 6e 75 6d 62 65 72 20 74 6f 20 72 65 6d |el number to rem| 00001fa0 6f 76 65 20 28 31 2d 38 29 0a 0a 4f 6e 20 65 78 |ove (1-8)..On ex| 00001fb0 69 74 20 3a 20 52 30 20 3d 20 70 72 65 76 69 6f |it : R0 = previo| 00001fc0 75 73 20 73 74 61 74 65 20 6f 66 20 74 68 61 74 |us state of that| 00001fd0 20 63 68 61 6e 6e 65 6c 3a 20 30 20 3d 20 61 6c | channel: 0 = al| 00001fe0 72 65 61 64 79 20 72 65 6d 6f 76 65 64 0a 20 20 |ready removed. | 00001ff0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00002010 20 20 20 20 20 20 20 20 20 20 20 20 20 31 20 3d | 1 =| 00002020 20 51 54 4d 20 63 68 61 6e 6e 65 6c 0a 0a 56 20 | QTM channel..V | 00002030 66 6c 61 67 20 73 65 74 20 69 66 20 63 68 61 6e |flag set if chan| 00002040 6e 65 6c 20 6e 75 6d 62 65 72 20 69 73 20 6f 75 |nel number is ou| 00002050 74 20 6f 66 20 72 61 6e 67 65 0a 0a 54 68 69 73 |t of range..This| 00002060 20 53 57 49 20 77 69 6c 6c 20 72 65 6d 6f 76 65 | SWI will remove| 00002070 20 74 68 65 20 67 69 76 65 6e 20 63 68 61 6e 6e | the given chann| 00002080 65 6c 20 66 72 6f 6d 20 74 68 65 20 51 54 4d 20 |el from the QTM | 00002090 73 6f 6e 67 20 72 6f 75 74 69 6e 65 2e 20 54 68 |song routine. Th| 000020a0 69 73 20 77 6f 75 6c 64 0a 74 68 65 6e 20 61 6c |is would.then al| 000020b0 6c 6f 77 20 79 6f 75 20 74 6f 20 70 6c 61 79 20 |low you to play | 000020c0 73 61 6d 70 6c 65 73 20 74 68 72 6f 75 67 68 20 |samples through | 000020d0 74 68 69 73 20 63 68 61 6e 6e 65 6c 20 28 65 67 |this channel (eg| 000020e0 2e 20 66 6f 72 20 67 61 6d 65 73 20 65 74 63 2e |. for games etc.| 000020f0 29 0a 77 69 74 68 6f 75 74 20 74 68 65 6d 20 62 |).without them b| 00002100 65 69 6e 67 20 69 6e 74 65 72 72 75 70 74 65 64 |eing interrupted| 00002110 20 69 66 20 74 68 65 20 73 6f 6e 67 20 69 73 20 | if the song is | 00002120 70 6c 61 79 69 6e 67 2e 0a 0a 0a 53 57 49 20 22 |playing....SWI "| 00002130 51 54 4d 5f 52 65 73 74 6f 72 65 43 68 61 6e 6e |QTM_RestoreChann| 00002140 65 6c 22 20 20 20 20 20 20 20 20 20 20 20 20 20 |el" | 00002150 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00002170 20 26 34 37 45 34 43 0a 2d 2d 2d 2d 2d 2d 2d 2d | &47E4C.--------| 00002180 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 000021c0 2d 2d 2d 2d 0a 0a 4f 6e 20 65 6e 74 72 79 3a 20 |----..On entry: | 000021d0 52 30 20 3d 20 63 68 61 6e 6e 65 6c 20 6e 75 6d |R0 = channel num| 000021e0 62 65 72 20 74 6f 20 72 65 73 74 6f 72 65 20 28 |ber to restore (| 000021f0 31 2d 38 29 0a 0a 4f 6e 20 65 78 69 74 20 3a 20 |1-8)..On exit : | 00002200 52 30 20 3d 20 70 72 65 76 69 6f 75 73 20 73 74 |R0 = previous st| 00002210 61 74 65 20 6f 66 20 74 68 61 74 20 63 68 61 6e |ate of that chan| 00002220 6e 65 6c 3a 20 30 20 3d 20 70 72 65 76 69 6f 75 |nel: 0 = previou| 00002230 73 6c 79 20 72 65 6d 6f 76 65 64 0a 20 20 20 20 |sly removed. | 00002240 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00002260 20 20 20 20 20 20 20 20 20 20 20 31 20 3d 20 61 | 1 = a| 00002270 6c 72 65 61 64 79 20 61 20 51 54 4d 20 63 68 61 |lready a QTM cha| 00002280 6e 6e 65 6c 0a 0a 56 20 66 6c 61 67 20 73 65 74 |nnel..V flag set| 00002290 20 69 66 20 63 68 61 6e 6e 65 6c 20 6e 75 6d 62 | if channel numb| 000022a0 65 72 20 69 73 20 6f 75 74 20 6f 66 20 72 61 6e |er is out of ran| 000022b0 67 65 0a 0a 54 68 69 73 20 53 57 49 20 77 69 6c |ge..This SWI wil| 000022c0 6c 20 72 65 73 74 6f 72 65 20 74 68 65 20 67 69 |l restore the gi| 000022d0 76 65 6e 20 63 68 61 6e 6e 65 6c 20 66 6f 72 20 |ven channel for | 000022e0 75 73 65 20 62 79 20 74 68 65 20 51 54 4d 20 70 |use by the QTM p| 000022f0 6c 61 79 65 72 20 69 66 20 69 74 20 68 61 73 0a |layer if it has.| 00002300 70 72 65 76 69 6f 75 73 6c 79 20 62 65 65 6e 20 |previously been | 00002310 72 65 6d 6f 76 65 64 20 75 73 69 6e 67 20 53 57 |removed using SW| 00002320 49 20 22 51 54 4d 5f 52 65 6d 6f 76 65 43 68 61 |I "QTM_RemoveCha| 00002330 6e 6e 65 6c 22 2e 0a 0a 0a 0a 53 57 49 20 22 51 |nnel".....SWI "Q| 00002340 54 4d 5f 53 74 65 72 65 6f 22 20 20 20 20 20 20 |TM_Stereo" | 00002350 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00002380 26 34 37 45 34 44 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d |&47E4D.---------| 00002390 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 000023d0 2d 2d 2d 0a 0a 4f 6e 20 65 6e 74 72 79 3a 20 52 |---..On entry: R| 000023e0 30 20 3d 20 63 68 61 6e 6e 65 6c 20 6e 75 6d 62 |0 = channel numb| 000023f0 65 72 20 74 6f 20 61 6c 74 65 72 2c 20 6f 72 20 |er to alter, or | 00002400 30 20 66 6f 72 20 70 72 65 2d 70 72 6f 67 72 61 |0 for pre-progra| 00002410 6d 6d 65 64 20 73 65 74 74 69 6e 67 73 0a 0a 20 |mmed settings.. | 00002420 20 20 20 20 20 20 20 20 20 49 66 20 52 30 20 3d | If R0 =| 00002430 20 31 2d 34 20 74 68 65 6e 20 52 31 20 3d 20 73 | 1-4 then R1 = s| 00002440 74 65 72 65 6f 20 70 6f 73 69 74 69 6f 6e 20 2d |tereo position -| 00002450 31 32 37 20 28 6c 65 66 74 29 20 74 6f 20 31 32 |127 (left) to 12| 00002460 37 20 28 72 69 67 68 74 29 0a 20 20 20 20 20 20 |7 (right). | 00002470 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002480 20 20 20 20 20 20 20 20 20 20 6f 72 20 2d 31 32 | or -12| 00002490 38 20 74 6f 20 72 65 61 64 20 63 75 72 72 65 6e |8 to read curren| 000024a0 74 20 70 6f 73 69 74 69 6f 6e 0a 0a 20 20 20 20 |t position.. | 000024b0 20 20 20 20 20 20 49 66 20 52 30 20 3d 20 30 20 | If R0 = 0 | 000024c0 74 68 65 6e 20 52 31 20 3d 20 30 20 2d 20 64 65 |then R1 = 0 - de| 000024d0 66 61 75 6c 74 20 73 74 65 72 65 6f 20 70 6f 73 |fault stereo pos| 000024e0 69 74 69 6f 6e 20 28 73 65 65 20 62 65 6c 6f 77 |ition (see below| 000024f0 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |). | 00002500 20 20 20 20 20 20 20 20 20 20 20 20 20 20 3d 20 | = | 00002510 31 20 2d 20 41 6d 69 67 61 20 73 74 65 72 65 6f |1 - Amiga stereo| 00002520 20 70 6f 73 69 74 69 6f 6e 0a 20 20 20 20 20 20 | position. | 00002530 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002540 20 20 20 20 20 20 3d 20 32 20 2d 20 63 65 6e 74 | = 2 - cent| 00002550 72 65 64 20 28 6e 6f 20 73 74 65 72 65 6f 29 0a |red (no stereo).| 00002560 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002570 20 20 20 20 20 20 20 20 20 20 20 20 3d 20 33 20 | = 3 | 00002580 2d 20 66 75 6c 6c 20 6c 65 66 74 0a 20 20 20 20 |- full left. | 00002590 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000025a0 20 20 20 20 20 20 20 20 3d 20 34 20 2d 20 66 75 | = 4 - fu| 000025b0 6c 6c 20 72 69 67 68 74 0a 0a 4f 6e 20 65 78 69 |ll right..On exi| 000025c0 74 20 3a 20 52 30 20 69 73 20 70 72 65 73 65 72 |t : R0 is preser| 000025d0 76 65 64 0a 0a 20 20 20 20 20 20 20 20 20 20 49 |ved.. I| 000025e0 66 20 52 30 20 3d 20 31 2d 34 20 74 68 65 6e 20 |f R0 = 1-4 then | 000025f0 52 31 20 3d 20 70 72 65 76 69 6f 75 73 20 73 74 |R1 = previous st| 00002600 65 72 65 6f 20 70 6f 73 69 74 69 6f 6e 0a 0a 20 |ereo position.. | 00002610 20 20 20 20 20 20 20 20 20 49 66 20 52 30 20 3d | If R0 =| 00002620 20 30 20 20 20 74 68 65 6e 20 52 31 20 69 73 20 | 0 then R1 is | 00002630 63 6f 72 72 75 70 74 65 64 0a 0a 54 68 69 73 20 |corrupted..This | 00002640 53 57 49 20 61 6c 6c 6f 77 73 20 74 68 65 20 73 |SWI allows the s| 00002650 74 65 72 65 6f 20 70 6f 73 69 74 69 6f 6e 73 20 |tereo positions | 00002660 66 6f 72 20 65 61 63 68 20 63 68 61 6e 6e 65 6c |for each channel| 00002670 20 74 6f 20 62 65 20 61 6c 74 65 72 65 64 0a 69 | to be altered.i| 00002680 6e 64 69 70 65 6e 64 65 6e 74 6c 79 2c 20 6f 72 |ndipendently, or| 00002690 20 61 6c 6c 20 74 6f 67 65 74 68 65 72 2e 20 49 | all together. I| 000026a0 66 20 52 30 3d 31 2d 34 20 6f 6e 20 65 6e 74 72 |f R0=1-4 on entr| 000026b0 79 2c 20 74 68 65 6e 20 52 31 20 6d 75 73 74 20 |y, then R1 must | 000026c0 62 65 20 65 69 74 68 65 72 20 61 0a 76 61 6c 69 |be either a.vali| 000026d0 64 20 73 74 65 72 65 6f 20 70 6f 73 69 74 69 6f |d stereo positio| 000026e0 6e 20 28 2d 31 32 37 20 74 6f 20 31 32 37 29 20 |n (-127 to 127) | 000026f0 6f 72 20 2d 31 32 38 20 74 6f 20 72 65 61 64 20 |or -128 to read | 00002700 74 68 65 20 70 72 65 76 69 6f 75 73 20 70 6f 73 |the previous pos| 00002710 69 74 69 6f 6e 2e 0a 49 66 20 52 30 3d 30 20 6f |ition..If R0=0 o| 00002720 6e 20 65 6e 74 72 79 2c 20 74 68 65 6e 20 52 31 |n entry, then R1| 00002730 20 6d 75 73 74 20 62 65 20 69 6e 20 74 68 65 20 | must be in the | 00002740 72 61 6e 67 65 20 30 2d 34 20 28 73 65 74 74 69 |range 0-4 (setti| 00002750 6e 67 73 20 64 65 73 63 72 69 62 65 64 20 61 62 |ngs described ab| 00002760 6f 76 65 29 0a 74 6f 20 61 6c 74 65 72 20 61 6c |ove).to alter al| 00002770 6c 20 74 68 65 20 63 68 61 6e 6e 65 6c 73 20 74 |l the channels t| 00002780 6f 20 6f 6e 65 20 6f 66 20 74 68 65 73 65 20 70 |o one of these p| 00002790 72 65 2d 70 72 6f 67 72 61 6d 6d 65 64 20 76 61 |re-programmed va| 000027a0 6c 75 65 73 2e 0a 0a 54 68 65 20 64 65 66 61 75 |lues...The defau| 000027b0 6c 74 20 73 74 65 72 65 6f 20 73 65 74 74 69 6e |lt stereo settin| 000027c0 67 73 20 61 72 65 3a 20 43 68 61 6e 6e 65 6c 3a |gs are: Channel:| 000027d0 20 31 20 20 20 50 6f 73 69 74 69 6f 6e 3a 20 2d | 1 Position: -| 000027e0 37 39 20 28 6c 65 66 74 29 0a 20 20 20 20 20 20 |79 (left). | 000027f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002800 20 20 20 20 20 20 20 20 20 20 20 43 68 61 6e 6e | Chann| 00002810 65 6c 3a 20 32 20 20 20 50 6f 73 69 74 69 6f 6e |el: 2 Position| 00002820 3a 20 37 39 20 20 28 72 69 67 68 74 29 0a 20 20 |: 79 (right). | 00002830 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002840 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 | C| 00002850 68 61 6e 6e 65 6c 3a 20 33 20 20 20 50 6f 73 69 |hannel: 3 Posi| 00002860 74 69 6f 6e 3a 20 34 37 20 20 28 73 6c 69 67 68 |tion: 47 (sligh| 00002870 74 6c 79 20 72 69 67 68 74 29 0a 20 20 20 20 20 |tly right). | 00002880 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002890 20 20 20 20 20 20 20 20 20 20 20 20 43 68 61 6e | Chan| 000028a0 6e 65 6c 3a 20 34 20 20 20 50 6f 73 69 74 69 6f |nel: 4 Positio| 000028b0 6e 3a 20 2d 34 37 20 28 73 6c 69 67 68 74 6c 79 |n: -47 (slightly| 000028c0 20 6c 65 66 74 29 0a 0a 0a 0a 53 57 49 20 22 51 | left)....SWI "Q| 000028d0 54 4d 5f 53 6f 6e 67 4c 65 6e 67 74 68 22 20 20 |TM_SongLength" | 000028e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00002910 26 34 37 45 34 45 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d |&47E4E.---------| 00002920 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00002960 2d 2d 2d 0a 0a 4f 6e 20 65 6e 74 72 79 3a 20 2d |---..On entry: -| 00002970 0a 0a 4f 6e 20 65 78 69 74 20 3a 20 52 30 20 3d |..On exit : R0 =| 00002980 20 6e 75 6d 62 65 72 20 6f 66 20 73 65 71 75 65 | number of seque| 00002990 6e 63 65 73 20 69 6e 20 63 75 72 72 65 6e 74 20 |nces in current | 000029a0 73 6f 6e 67 0a 20 20 20 20 20 20 20 20 20 20 52 |song. R| 000029b0 31 20 3d 20 6e 75 6d 62 65 72 20 6f 66 20 70 61 |1 = number of pa| 000029c0 74 74 65 72 6e 73 20 69 6e 20 74 68 65 20 73 6f |tterns in the so| 000029d0 6e 67 0a 0a 56 20 66 6c 61 67 20 73 65 74 20 69 |ng..V flag set i| 000029e0 66 20 6e 6f 20 73 6f 6e 67 20 69 73 20 6c 6f 61 |f no song is loa| 000029f0 64 65 64 0a 0a 54 68 69 73 20 53 57 49 20 61 6c |ded..This SWI al| 00002a00 6c 6f 77 73 20 79 6f 75 20 74 6f 20 72 65 61 64 |lows you to read| 00002a10 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 70 | the number of p| 00002a20 61 74 74 65 72 6e 73 20 61 6e 64 20 73 65 71 75 |atterns and sequ| 00002a30 65 6e 63 65 73 20 69 6e 20 74 68 65 0a 63 75 72 |ences in the.cur| 00002a40 72 65 6e 74 20 73 6f 6e 67 2e 0a 0a 0a 0a 53 57 |rent song.....SW| 00002a50 49 20 22 51 54 4d 5f 52 65 61 64 53 65 71 75 65 |I "QTM_ReadSeque| 00002a60 6e 63 65 54 61 62 6c 65 22 20 20 20 20 20 20 20 |nceTable" | 00002a70 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00002a90 20 20 20 20 26 34 37 45 34 46 0a 2d 2d 2d 2d 2d | &47E4F.-----| 00002aa0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00002ae0 2d 2d 2d 2d 2d 2d 2d 0a 0a 4f 6e 20 65 6e 74 72 |-------..On entr| 00002af0 79 3a 20 52 30 20 3d 20 73 65 71 75 65 6e 63 65 |y: R0 = sequence| 00002b00 20 6e 75 6d 62 65 72 20 74 6f 20 72 65 61 64 20 | number to read | 00002b10 28 30 2d 31 32 37 29 0a 0a 4f 6e 20 65 78 69 74 |(0-127)..On exit| 00002b20 20 3a 20 52 30 20 3d 20 70 61 74 74 65 72 6e 20 | : R0 = pattern | 00002b30 6e 75 6d 62 65 72 20 73 74 6f 72 65 64 20 61 74 |number stored at| 00002b40 20 74 68 61 74 20 70 6f 73 69 74 69 6f 6e 0a 0a | that position..| 00002b50 56 20 66 6c 61 67 20 73 65 74 20 69 66 20 6e 6f |V flag set if no| 00002b60 20 73 6f 6e 67 20 69 73 20 6c 6f 61 64 65 64 0a | song is loaded.| 00002b70 0a 54 68 69 73 20 53 57 49 20 65 6e 61 62 6c 65 |.This SWI enable| 00002b80 73 20 79 6f 75 20 74 6f 20 72 65 61 64 20 74 68 |s you to read th| 00002b90 65 20 70 61 74 74 65 72 6e 20 74 6f 20 62 65 20 |e pattern to be | 00002ba0 70 6c 61 79 65 64 20 61 74 20 61 20 67 69 76 65 |played at a give| 00002bb0 6e 20 70 6f 73 69 74 69 6f 6e 20 69 6e 0a 74 68 |n position in.th| 00002bc0 65 20 63 75 72 72 65 6e 74 20 73 6f 6e 67 27 73 |e current song's| 00002bd0 20 73 65 71 75 65 6e 63 65 20 74 61 62 6c 65 2e | sequence table.| 00002be0 0a 0a 0a 0a 53 57 49 20 22 51 54 4d 5f 56 55 42 |....SWI "QTM_VUB| 00002bf0 61 72 43 6f 6e 74 72 6f 6c 22 20 20 20 20 20 20 |arControl" | 00002c00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00002c20 20 20 20 20 20 20 20 20 20 20 26 34 37 45 35 30 | &47E50| 00002c30 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |.---------------| 00002c40 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00002c70 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 4f |-------------..O| 00002c80 6e 20 65 6e 74 72 79 3a 20 52 30 20 3d 20 30 20 |n entry: R0 = 0 | 00002c90 74 6f 20 73 77 69 74 63 68 20 74 68 65 20 56 55 |to switch the VU| 00002ca0 20 62 61 72 20 63 6f 6e 74 72 6f 6c 6c 65 72 73 | bar controllers| 00002cb0 20 6f 66 66 0a 20 20 20 20 20 20 20 20 20 20 20 | off. | 00002cc0 20 20 3d 20 31 20 74 6f 20 73 65 74 20 74 68 65 | = 1 to set the| 00002cd0 20 56 55 20 62 61 72 20 63 6f 6e 74 72 6f 6c 6c | VU bar controll| 00002ce0 65 72 20 74 6f 20 75 73 65 20 27 66 61 6b 65 27 |er to use 'fake'| 00002cf0 20 56 55 20 62 61 72 73 0a 20 20 20 20 20 20 20 | VU bars. | 00002d00 20 20 20 20 20 20 3d 20 32 20 74 6f 20 73 65 74 | = 2 to set| 00002d10 20 74 68 65 20 56 55 20 62 61 72 20 63 6f 6e 74 | the VU bar cont| 00002d20 72 6f 6c 6c 65 72 20 74 6f 20 75 73 65 20 27 65 |roller to use 'e| 00002d30 66 66 65 63 74 27 20 56 55 20 62 61 72 73 0a 20 |ffect' VU bars. | 00002d40 20 20 20 20 20 20 20 20 20 20 20 20 3d 20 33 20 | = 3 | 00002d50 74 6f 20 73 65 74 20 74 68 65 20 56 55 20 62 61 |to set the VU ba| 00002d60 72 20 63 6f 6e 74 72 6f 6c 6c 65 72 20 74 6f 20 |r controller to | 00002d70 75 73 65 20 27 72 65 61 6c 27 20 56 55 20 62 61 |use 'real' VU ba| 00002d80 72 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 |rs. | 00002d90 3d 20 2d 31 20 74 6f 20 72 65 61 64 20 63 75 72 |= -1 to read cur| 00002da0 72 65 6e 74 20 73 65 74 74 69 6e 67 0a 20 20 20 |rent setting. | 00002db0 20 20 20 20 20 20 20 52 31 20 3d 20 6e 65 77 20 | R1 = new | 00002dc0 56 55 20 67 72 61 76 69 74 79 2c 20 6f 72 20 2d |VU gravity, or -| 00002dd0 31 20 74 6f 20 72 65 61 64 0a 0a 4f 6e 20 65 78 |1 to read..On ex| 00002de0 69 74 20 3a 20 52 30 20 3d 20 70 72 65 76 69 6f |it : R0 = previo| 00002df0 75 73 20 56 55 20 63 6f 6e 74 72 6f 6c 6c 65 72 |us VU controller| 00002e00 20 73 74 61 74 65 0a 20 20 20 20 20 20 20 20 20 | state. | 00002e10 20 52 31 20 3d 20 70 72 65 76 69 6f 75 73 20 56 | R1 = previous V| 00002e20 55 20 62 61 72 20 67 72 61 76 69 74 79 0a 0a 54 |U bar gravity..T| 00002e30 68 69 73 20 53 57 49 20 61 6c 6c 6f 77 73 20 63 |his SWI allows c| 00002e40 6f 6e 74 72 6f 6c 20 6f 66 20 74 68 65 20 68 69 |ontrol of the hi| 00002e50 67 68 6c 79 20 61 63 63 75 72 61 74 65 20 56 55 |ghly accurate VU| 00002e60 20 62 61 72 20 72 6f 75 74 69 6e 65 20 63 6f 6e | bar routine con| 00002e70 74 61 69 6e 65 64 20 69 6e 0a 74 68 65 20 51 54 |tained in.the QT| 00002e80 4d 20 6d 6f 64 75 6c 65 2e 20 54 68 65 20 64 65 |M module. The de| 00002e90 66 61 75 6c 74 20 73 65 74 74 69 6e 67 73 20 66 |fault settings f| 00002ea0 6f 72 20 74 68 65 20 56 55 20 62 61 72 20 72 6f |or the VU bar ro| 00002eb0 75 74 69 6e 65 20 61 72 65 3a 20 67 72 61 76 69 |utine are: gravi| 00002ec0 74 79 20 3d 20 32 0a 28 6c 69 6e 65 73 20 70 65 |ty = 2.(lines pe| 00002ed0 72 20 35 30 74 68 20 6f 66 20 61 20 73 65 63 6f |r 50th of a seco| 00002ee0 6e 64 29 20 61 6e 64 20 74 68 65 20 56 55 20 62 |nd) and the VU b| 00002ef0 61 72 20 63 6f 6e 74 72 6f 6c 6c 65 72 20 6f 66 |ar controller of| 00002f00 66 2e 0a 0a 0a 0a 53 57 49 20 22 51 54 4d 5f 52 |f.....SWI "QTM_R| 00002f10 65 61 64 56 55 4c 65 76 65 6c 73 22 20 20 20 20 |eadVULevels" | 00002f20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00002f40 20 20 20 20 20 20 20 20 20 20 20 20 26 34 37 45 | &47E| 00002f50 35 31 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |51.-------------| 00002f60 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00002f90 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a |---------------.| 00002fa0 0a 4f 6e 20 65 6e 74 72 79 3a 20 52 30 20 3d 20 |.On entry: R0 = | 00002fb0 43 68 61 6e 6e 65 6c 20 6e 75 6d 62 65 72 20 28 |Channel number (| 00002fc0 31 2d 34 29 20 6f 72 20 30 20 66 6f 72 20 61 6c |1-4) or 0 for al| 00002fd0 6c 20 63 68 61 6e 6e 65 6c 73 0a 0a 4f 6e 20 65 |l channels..On e| 00002fe0 78 69 74 20 3a 20 49 66 20 52 30 20 3d 20 31 2d |xit : If R0 = 1-| 00002ff0 34 20 6f 6e 20 65 6e 74 72 79 2c 20 74 68 65 6e |4 on entry, then| 00003000 20 52 30 20 3d 20 56 55 20 62 61 72 20 68 65 69 | R0 = VU bar hei| 00003010 67 68 74 20 66 6f 72 20 74 68 65 20 63 68 61 6e |ght for the chan| 00003020 6e 65 6c 0a 20 20 20 20 20 20 20 20 20 20 20 20 |nel. | 00003030 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00003040 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 70 | sp| 00003050 65 63 69 66 69 65 64 20 69 6e 20 72 30 20 28 30 |ecified in r0 (0| 00003060 2d 36 34 29 0a 20 20 20 20 20 20 20 20 20 20 49 |-64). I| 00003070 66 20 52 30 20 3d 20 30 20 6f 6e 20 65 6e 74 72 |f R0 = 0 on entr| 00003080 79 2c 20 74 68 65 6e 20 20 20 52 30 20 3d 20 77 |y, then R0 = w| 00003090 6f 72 64 20 63 6f 6e 74 61 69 6e 69 6e 67 20 31 |ord containing 1| 000030a0 20 62 79 74 65 20 70 65 72 20 63 68 61 6e 6e 65 | byte per channe| 000030b0 6c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |l. | 000030c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000030d0 20 20 20 20 20 20 20 20 20 20 20 20 6f 66 20 61 | of a| 000030e0 6c 6c 20 74 68 65 20 34 20 63 68 61 6e 6e 65 6c |ll the 4 channel| 000030f0 27 73 20 56 55 20 62 61 72 0a 20 20 20 20 20 20 |'s VU bar. | 00003100 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00003120 20 20 20 20 68 65 69 67 68 74 73 20 28 30 2d 36 | heights (0-6| 00003130 34 2c 20 65 61 63 68 20 62 79 74 65 29 0a 0a 54 |4, each byte)..T| 00003140 68 69 73 20 53 57 49 20 6c 65 74 73 20 79 6f 75 |his SWI lets you| 00003150 20 72 65 61 64 20 74 68 65 20 63 75 72 72 65 6e | read the curren| 00003160 74 20 56 55 20 6c 65 76 65 6c 73 20 6f 66 20 74 |t VU levels of t| 00003170 68 65 20 51 54 4d 20 56 55 20 62 61 72 20 68 61 |he QTM VU bar ha| 00003180 6e 64 6c 65 72 2e 20 54 68 69 73 0a 63 61 6c 6c |ndler. This.call| 00003190 20 73 68 6f 75 6c 64 20 6f 6e 6c 79 20 62 65 20 | should only be | 000031a0 75 73 65 64 20 69 66 20 74 68 65 20 56 55 20 62 |used if the VU b| 000031b0 61 72 20 68 61 6e 64 6c 65 72 20 68 61 73 20 62 |ar handler has b| 000031c0 65 65 6e 20 65 6e 61 62 6c 65 64 20 75 73 69 6e |een enabled usin| 000031d0 67 20 74 68 65 0a 22 51 54 4d 5f 56 55 42 61 72 |g the."QTM_VUBar| 000031e0 43 6f 6e 74 72 6f 6c 22 20 53 57 49 2e 0a 0a 0a |Control" SWI....| 000031f0 0a 53 57 49 20 22 51 54 4d 5f 52 65 61 64 53 61 |.SWI "QTM_ReadSa| 00003200 6d 70 6c 65 54 61 62 6c 65 22 20 20 20 20 20 20 |mpleTable" | 00003210 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00003230 20 20 20 20 20 20 20 26 34 37 45 35 32 0a 2d 2d | &47E52.--| 00003240 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00003280 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 4f 6e 20 65 |----------..On e| 00003290 6e 74 72 79 3a 20 52 30 20 3d 20 73 61 6d 70 6c |ntry: R0 = sampl| 000032a0 65 20 6e 75 6d 62 65 72 20 28 31 2d 33 31 29 0a |e number (1-31).| 000032b0 0a 4f 6e 20 65 78 69 74 20 3a 20 52 30 20 3d 20 |.On exit : R0 = | 000032c0 70 6f 69 6e 74 65 72 20 74 6f 20 32 32 20 62 79 |pointer to 22 by| 000032d0 74 65 20 62 6c 6f 63 6b 20 28 6e 6f 74 20 74 65 |te block (not te| 000032e0 72 6d 69 6e 61 74 65 64 29 20 63 6f 6e 74 61 69 |rminated) contai| 000032f0 6e 69 6e 67 20 73 61 6d 70 6c 65 0a 20 20 20 20 |ning sample. | 00003300 20 20 20 20 20 20 20 20 20 20 20 6e 61 6d 65 0a | name.| 00003310 20 20 20 20 20 20 20 20 20 20 52 31 20 3d 20 73 | R1 = s| 00003320 61 6d 70 6c 65 20 6c 65 6e 67 74 68 20 28 69 6e |ample length (in| 00003330 20 62 79 74 65 73 29 0a 20 20 20 20 20 20 20 20 | bytes). | 00003340 20 20 52 32 20 3d 20 72 65 70 65 61 74 20 6f 66 | R2 = repeat of| 00003350 66 73 65 74 20 28 62 79 74 65 73 20 66 72 6f 6d |fset (bytes from| 00003360 20 73 74 61 72 74 20 6f 66 20 73 61 6d 70 6c 65 | start of sample| 00003370 29 0a 20 20 20 20 20 20 20 20 20 20 52 33 20 3d |). R3 =| 00003380 20 72 65 70 65 61 74 20 6c 65 6e 67 74 68 20 28 | repeat length (| 00003390 69 6e 20 62 79 74 65 73 29 0a 20 20 20 20 20 20 |in bytes). | 000033a0 20 20 20 20 52 34 20 3d 20 64 65 66 61 75 6c 74 | R4 = default| 000033b0 20 76 6f 6c 75 6d 65 20 28 30 2d 36 34 29 0a 20 | volume (0-64). | 000033c0 20 20 20 20 20 20 20 20 20 52 35 20 3d 20 66 69 | R5 = fi| 000033d0 6e 65 20 74 75 6e 69 6e 67 20 62 79 74 65 20 28 |ne tuning byte (| 000033e0 73 69 67 6e 65 64 20 34 20 62 69 74 20 6e 75 6d |signed 4 bit num| 000033f0 62 65 72 20 65 67 2e 20 38 3d 2d 38 2c 20 31 35 |ber eg. 8=-8, 15| 00003400 3d 2d 31 29 0a 20 20 20 20 20 20 20 20 20 20 52 |=-1). R| 00003410 36 20 3d 20 61 64 64 72 65 73 73 20 6f 66 20 72 |6 = address of r| 00003420 61 77 20 73 61 6d 70 6c 65 20 64 61 74 61 20 28 |aw sample data (| 00003430 6c 6f 67 61 72 69 74 68 6d 69 63 20 66 6f 72 6d |logarithmic form| 00003440 61 74 29 0a 0a 56 20 66 6c 61 67 20 73 65 74 20 |at)..V flag set | 00003450 69 66 20 6e 6f 20 73 6f 6e 67 20 69 73 20 6c 6f |if no song is lo| 00003460 61 64 65 64 20 6f 72 20 69 66 20 73 61 6d 70 6c |aded or if sampl| 00003470 65 20 6e 75 6d 62 65 72 20 69 73 20 6f 75 74 20 |e number is out | 00003480 6f 66 20 74 68 65 20 72 61 6e 67 65 20 31 2d 33 |of the range 1-3| 00003490 31 0a 0a 54 68 69 73 20 53 57 49 20 61 6c 6c 6f |1..This SWI allo| 000034a0 77 73 20 79 6f 75 20 74 6f 20 72 65 61 64 20 69 |ws you to read i| 000034b0 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f 6e 20 61 6e |nformation on an| 000034c0 79 20 6f 66 20 74 68 65 20 33 31 20 73 61 6d 70 |y of the 31 samp| 000034d0 6c 65 73 20 77 68 69 63 68 0a 61 72 65 20 75 73 |les which.are us| 000034e0 75 61 6c 6c 79 20 61 76 61 69 6c 61 62 6c 65 20 |ually available | 000034f0 69 6e 20 53 6f 75 6e 64 20 54 72 61 63 6b 65 72 |in Sound Tracker| 00003500 20 73 6f 6e 67 20 6d 6f 64 75 6c 65 73 2e 20 49 | song modules. I| 00003510 66 20 61 6e 20 61 74 74 65 6d 70 74 20 69 73 0a |f an attempt is.| 00003520 6d 61 64 65 20 74 6f 20 72 65 61 64 20 74 68 65 |made to read the| 00003530 20 73 61 6d 70 6c 65 20 64 61 74 61 20 6f 66 20 | sample data of | 00003540 61 20 73 61 6d 70 6c 65 20 6e 75 6d 62 65 72 20 |a sample number | 00003550 6f 76 65 72 20 31 35 20 77 68 65 6e 20 61 6e 20 |over 15 when an | 00003560 6f 6c 64 65 72 20 31 35 0a 69 6e 73 74 20 73 6f |older 15.inst so| 00003570 6e 67 20 6d 6f 64 75 6c 65 20 69 73 20 6c 6f 61 |ng module is loa| 00003580 64 65 64 2c 20 51 54 4d 20 77 69 6c 6c 20 72 65 |ded, QTM will re| 00003590 74 75 72 6e 20 7a 65 72 6f 20 69 6e 20 52 31 2d |turn zero in R1-| 000035a0 52 36 2c 20 61 6e 64 20 52 30 20 77 69 6c 6c 20 |R6, and R0 will | 000035b0 70 6f 69 6e 74 0a 74 6f 20 61 20 30 20 62 79 74 |point.to a 0 byt| 000035c0 65 2e 0a 0a 0a 0a 53 57 49 20 22 51 54 4d 5f 52 |e.....SWI "QTM_R| 000035d0 65 61 64 53 70 65 65 64 22 20 20 20 20 20 20 20 |eadSpeed" | 000035e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00003600 20 20 20 20 20 20 20 20 20 20 20 20 26 34 37 45 | &47E| 00003610 35 33 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |53.-------------| 00003620 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00003650 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a |---------------.| 00003660 0a 4f 6e 20 65 6e 74 72 79 3a 20 2d 0a 0a 4f 6e |.On entry: -..On| 00003670 20 65 78 69 74 20 3a 20 52 30 20 3d 20 63 75 72 | exit : R0 = cur| 00003680 72 65 6e 74 20 73 6f 6e 67 20 73 70 65 65 64 20 |rent song speed | 00003690 28 31 2d 33 31 29 20 28 6f 72 20 30 20 69 66 20 |(1-31) (or 0 if | 000036a0 73 6f 6e 67 20 69 73 20 6e 6f 74 20 70 6c 61 79 |song is not play| 000036b0 69 6e 67 29 0a 20 20 20 20 20 20 20 20 20 20 52 |ing). R| 000036c0 31 20 3d 20 63 75 72 72 65 6e 74 20 73 6f 6e 67 |1 = current song| 000036d0 20 43 49 41 20 74 65 6d 70 6f 20 73 65 74 74 69 | CIA tempo setti| 000036e0 6e 67 20 28 33 32 2d 32 35 35 29 0a 20 20 20 20 |ng (32-255). | 000036f0 20 20 20 20 20 20 52 32 20 3d 20 73 70 65 65 64 | R2 = speed| 00003700 20 63 6f 75 6e 74 65 72 20 76 61 6c 75 65 20 28 | counter value (| 00003710 31 2d 3c 73 70 65 65 64 2d 31 3e 29 0a 0a 54 68 |1-<speed-1>)..Th| 00003720 69 73 20 53 57 49 20 72 65 74 75 72 6e 73 20 69 |is SWI returns i| 00003730 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f 6e 20 74 68 |nformation on th| 00003740 65 20 63 75 72 72 65 6e 74 20 73 70 65 65 64 20 |e current speed | 00003750 61 6e 64 20 63 6f 75 6e 74 65 72 20 73 65 74 74 |and counter sett| 00003760 69 6e 67 73 20 6f 66 0a 74 68 65 20 63 75 72 72 |ings of.the curr| 00003770 65 6e 74 20 73 6f 6e 67 2e 20 54 68 65 20 73 70 |ent song. The sp| 00003780 65 65 64 20 76 61 75 6c 65 20 28 52 30 29 20 69 |eed vaule (R0) i| 00003790 73 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 |s the number of | 000037a0 74 69 6d 65 73 20 74 68 65 20 73 6f 6e 67 0a 63 |times the song.c| 000037b0 6f 6e 74 72 6f 6c 6c 65 72 20 68 61 73 20 74 6f |ontroller has to| 000037c0 20 62 65 20 63 61 6c 6c 65 64 2c 20 62 65 66 6f | be called, befo| 000037d0 72 65 20 69 74 20 70 6c 61 79 73 20 74 68 65 6e |re it plays then| 000037e0 20 6e 65 78 74 20 6e 6f 74 65 20 2d 20 74 68 65 | next note - the| 000037f0 20 64 65 66 61 75 6c 74 0a 69 73 20 36 20 74 69 | default.is 6 ti| 00003800 6d 65 73 2e 0a 20 20 54 68 65 20 43 49 41 20 74 |mes.. The CIA t| 00003810 65 6d 70 6f 20 73 65 74 74 69 6e 67 20 63 6f 6e |empo setting con| 00003820 74 72 6f 6c 73 20 68 6f 77 20 66 61 73 74 20 74 |trols how fast t| 00003830 68 65 20 73 6f 6e 67 20 63 6f 6e 74 72 6f 6c 6c |he song controll| 00003840 65 72 20 69 73 20 63 61 6c 6c 65 64 2c 20 74 68 |er is called, th| 00003850 65 0a 64 65 66 61 75 6c 74 20 69 73 20 35 30 20 |e.default is 50 | 00003860 74 69 6d 65 73 20 61 20 73 65 63 6f 6e 64 20 3d |times a second =| 00003870 20 74 65 6d 70 6f 20 31 32 35 2e 0a 20 20 54 68 | tempo 125.. Th| 00003880 65 20 73 70 65 65 64 20 63 6f 75 6e 74 65 72 20 |e speed counter | 00003890 28 52 32 29 20 76 61 72 69 65 73 20 66 72 6f 6d |(R2) varies from| 000038a0 20 31 20 74 6f 20 28 73 70 65 65 64 2d 31 29 2c | 1 to (speed-1),| 000038b0 20 69 74 20 69 73 20 64 65 63 72 65 6d 65 6e 74 | it is decrement| 000038c0 65 64 20 6f 6e 63 65 0a 65 76 65 72 79 20 74 69 |ed once.every ti| 000038d0 6d 65 20 74 68 65 20 73 6f 6e 67 20 63 6f 6e 74 |me the song cont| 000038e0 72 6f 6c 6c 65 72 20 69 73 20 63 61 6c 6c 65 64 |roller is called| 000038f0 2c 20 75 6e 74 69 6c 20 69 74 20 72 65 61 63 68 |, until it reach| 00003900 65 73 20 30 2c 20 77 68 65 6e 20 74 68 65 20 6e |es 0, when the n| 00003910 65 78 74 0a 6e 6f 74 65 20 69 73 20 70 6c 61 79 |ext.note is play| 00003920 65 64 20 61 6e 64 20 74 68 65 20 63 6f 75 6e 74 |ed and the count| 00003930 65 72 20 69 73 20 72 65 73 65 74 20 74 6f 20 74 |er is reset to t| 00003940 68 65 20 73 70 65 65 64 2d 31 2e 0a 0a 0a 0a 53 |he speed-1.....S| 00003950 57 49 20 22 51 54 4d 5f 50 6c 61 79 53 61 6d 70 |WI "QTM_PlaySamp| 00003960 6c 65 22 20 20 20 20 20 20 20 20 20 20 20 20 20 |le" | 00003970 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00003990 20 20 20 20 20 26 34 37 45 35 34 0a 2d 2d 2d 2d | &47E54.----| 000039a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 000039e0 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 4f 6e 20 65 6e 74 |--------..On ent| 000039f0 72 79 3a 20 52 30 20 3d 20 63 68 61 6e 6e 65 6c |ry: R0 = channel| 00003a00 20 6e 75 6d 62 65 72 20 28 31 2d 34 29 0a 20 20 | number (1-4). | 00003a10 20 20 20 20 20 20 20 20 52 31 20 3d 20 6e 6f 74 | R1 = not| 00003a20 65 20 6e 75 6d 62 65 72 20 28 31 2d 33 36 29 20 |e number (1-36) | 00003a30 28 31 3d 27 43 2d 31 27 2c 20 32 3d 27 43 23 31 |(1='C-1', 2='C#1| 00003a40 27 2e 2e 2e 20 33 36 3d 27 42 23 33 27 29 0a 20 |'... 36='B#3'). | 00003a50 20 20 20 20 20 20 20 20 20 52 32 20 3d 20 73 61 | R2 = sa| 00003a60 6d 70 6c 65 20 6e 75 6d 62 65 72 20 28 31 2d 33 |mple number (1-3| 00003a70 31 29 0a 0a 4f 6e 20 65 78 69 74 20 3a 20 52 30 |1)..On exit : R0| 00003a80 2d 52 32 20 70 72 65 73 65 72 76 65 64 0a 0a 41 |-R2 preserved..A| 00003a90 6e 20 65 72 72 6f 72 20 69 73 20 67 65 6e 65 72 |n error is gener| 00003aa0 61 74 65 64 20 69 66 20 61 6e 79 20 6f 66 20 74 |ated if any of t| 00003ab0 68 65 20 72 65 67 69 73 74 65 72 73 20 63 6f 6e |he registers con| 00003ac0 74 61 69 6e 20 69 6c 6c 65 67 61 6c 20 76 61 6c |tain illegal val| 00003ad0 75 65 73 2e 0a 0a 54 68 69 73 20 53 57 49 20 61 |ues...This SWI a| 00003ae0 6c 6c 6f 77 73 20 79 6f 75 20 74 6f 20 70 6c 61 |llows you to pla| 00003af0 79 20 61 6e 79 20 6f 66 20 74 68 65 20 33 31 20 |y any of the 31 | 00003b00 28 6f 72 20 31 35 29 20 73 61 6d 70 6c 65 73 20 |(or 15) samples | 00003b10 69 6e 20 74 68 65 20 63 75 72 72 65 6e 74 6c 79 |in the currently| 00003b20 0a 6c 6f 61 64 65 64 20 73 6f 6e 67 20 6f 6e 20 |.loaded song on | 00003b30 61 6e 79 20 6f 66 20 74 68 65 20 34 20 61 76 61 |any of the 4 ava| 00003b40 69 6c 61 62 6c 65 20 63 68 61 6e 6e 65 6c 73 2e |ilable channels.| 00003b50 20 41 20 73 61 6d 70 6c 65 20 63 61 6e 20 62 65 | A sample can be| 00003b60 20 70 6c 61 79 65 64 20 61 74 0a 61 6e 79 20 74 | played at.any t| 00003b70 69 6d 65 20 77 68 69 6c 65 20 74 68 65 20 73 6f |ime while the so| 00003b80 6e 67 20 69 73 20 6c 6f 61 64 65 64 2c 20 61 6c |ng is loaded, al| 00003b90 74 68 6f 75 67 68 20 69 66 20 74 68 65 20 73 6f |though if the so| 00003ba0 6e 67 20 69 73 20 63 75 72 72 65 6e 74 6c 79 0a |ng is currently.| 00003bb0 70 6c 61 79 69 6e 67 2c 20 74 68 65 6e 20 74 68 |playing, then th| 00003bc0 65 20 73 61 6d 70 6c 65 20 6d 61 79 20 62 65 20 |e sample may be | 00003bd0 63 75 74 20 73 68 6f 72 74 2e 20 50 6c 61 79 69 |cut short. Playi| 00003be0 6e 67 20 61 20 6e 6f 6e 2d 65 78 69 73 74 61 6e |ng a non-existan| 00003bf0 74 20 73 61 6d 70 6c 65 2c 0a 28 6f 72 20 61 20 |t sample,.(or a | 00003c00 73 61 6d 70 6c 65 20 61 62 6f 76 65 20 31 35 2c |sample above 15,| 00003c10 20 69 66 20 74 68 65 20 73 6f 6e 67 20 69 73 20 | if the song is | 00003c20 61 20 31 35 20 69 6e 73 74 20 6d 6f 64 75 6c 65 |a 15 inst module| 00003c30 29 20 77 69 6c 6c 20 72 65 73 75 6c 74 20 69 6e |) will result in| 00003c40 0a 6e 6f 74 68 69 6e 67 20 62 65 69 6e 67 20 70 |.nothing being p| 00003c50 6c 61 79 65 64 2e 0a 0a 0a 0a 53 57 49 20 22 51 |layed.....SWI "Q| 00003c60 54 4d 5f 53 6f 6e 67 53 74 61 74 75 73 22 20 20 |TM_SongStatus" | 00003c70 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00003ca0 26 34 37 45 35 35 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d |&47E55.---------| 00003cb0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00003cf0 2d 2d 2d 0a 0a 4f 6e 20 65 6e 74 72 79 3a 20 2d |---..On entry: -| 00003d00 0a 0a 4f 6e 20 65 78 69 74 20 3a 20 52 30 20 3d |..On exit : R0 =| 00003d10 20 73 6f 6e 67 20 73 74 61 74 75 73 20 66 6c 61 | song status fla| 00003d20 67 73 3a 20 20 20 20 20 20 6f 6e 20 20 20 20 20 |gs: on | 00003d30 20 20 20 20 20 20 20 20 6f 66 66 0a 20 20 20 20 | off. | 00003d40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00003d60 20 20 20 7c 20 20 20 20 20 20 20 20 20 20 20 20 | | | 00003d70 20 20 7c 0a 20 20 20 20 20 20 20 20 20 20 20 20 | |. | 00003d80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00003d90 20 20 20 62 69 74 20 30 20 3d 20 73 6f 6e 67 20 | bit 0 = song | 00003da0 6c 6f 61 64 65 64 20 20 20 20 6e 6f 20 73 6f 6e |loaded no son| 00003db0 67 20 6c 6f 61 64 65 64 0a 20 20 20 20 20 20 20 |g loaded. | 00003dc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00003dd0 20 20 20 20 20 20 20 20 20 20 20 20 31 20 3d 20 | 1 = | 00003de0 6c 6f 61 64 65 64 20 74 6f 20 52 4d 41 20 20 75 |loaded to RMA u| 00003df0 73 65 72 20 61 64 64 72 20 6c 6f 61 64 0a 20 20 |ser addr load. | 00003e00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00003e20 20 32 20 3d 20 70 6c 61 79 69 6e 67 20 20 20 20 | 2 = playing | 00003e30 20 20 20 20 73 74 6f 70 70 65 64 2f 70 61 75 73 | stopped/paus| 00003e40 65 64 0a 0a 54 68 69 73 20 53 57 49 20 61 6c 6c |ed..This SWI all| 00003e50 6f 77 73 20 79 6f 75 20 74 6f 20 72 65 61 64 20 |ows you to read | 00003e60 74 68 65 20 63 75 72 72 65 6e 74 20 73 74 61 74 |the current stat| 00003e70 75 73 20 6f 66 20 74 68 65 20 51 54 4d 20 73 6f |us of the QTM so| 00003e80 6e 67 20 63 6f 6e 74 72 6f 6c 6c 65 72 2e 0a 0a |ng controller...| 00003e90 4e 6f 20 65 72 72 6f 72 20 69 73 20 67 65 6e 65 |No error is gene| 00003ea0 72 61 74 65 64 20 69 66 20 74 68 65 72 65 20 69 |rated if there i| 00003eb0 73 20 6e 6f 20 73 6f 6e 67 20 6c 6f 61 64 65 64 |s no song loaded| 00003ec0 2e 0a 0a 0a 0a 53 57 49 20 22 51 54 4d 5f 52 65 |.....SWI "QTM_Re| 00003ed0 61 64 50 6c 61 79 69 6e 67 54 69 6d 65 22 20 20 |adPlayingTime" | 00003ee0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00003f00 20 20 20 20 20 20 20 20 20 20 20 26 34 37 45 35 | &47E5| 00003f10 36 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |6.--------------| 00003f20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00003f50 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a |--------------..| 00003f60 4f 6e 20 65 6e 74 72 79 3a 20 2d 0a 0a 4f 6e 20 |On entry: -..On | 00003f70 65 78 69 74 20 3a 20 52 30 20 3d 20 74 6f 74 61 |exit : R0 = tota| 00003f80 6c 20 70 6c 61 79 69 6e 67 20 74 69 6d 65 20 73 |l playing time s| 00003f90 6f 20 66 61 72 20 28 73 65 63 6f 6e 64 73 29 0a |o far (seconds).| 00003fa0 20 20 20 20 20 20 20 20 20 20 52 31 20 3d 20 74 | R1 = t| 00003fb0 69 6d 65 20 73 69 6e 63 65 20 6c 61 73 74 20 53 |ime since last S| 00003fc0 57 49 20 51 54 4d 5f 53 74 61 72 74 20 28 73 65 |WI QTM_Start (se| 00003fd0 63 6f 6e 64 73 29 0a 20 20 20 20 20 20 20 20 20 |conds). | 00003fe0 20 52 32 20 3d 20 74 6f 74 61 6c 20 70 6c 61 79 | R2 = total play| 00003ff0 69 6e 67 20 74 69 6d 65 20 6f 66 20 74 68 65 20 |ing time of the | 00004000 77 68 6f 6c 65 20 73 6f 6e 67 20 28 73 65 63 6f |whole song (seco| 00004010 6e 64 73 29 0a 0a 56 20 66 6c 61 67 20 73 65 74 |nds)..V flag set| 00004020 20 69 66 20 6e 6f 20 73 6f 6e 67 20 69 73 20 6c | if no song is l| 00004030 6f 61 64 65 64 0a 0a 54 68 69 73 20 53 57 49 20 |oaded..This SWI | 00004040 61 6c 6c 6f 77 73 20 79 6f 75 20 74 6f 20 72 65 |allows you to re| 00004050 61 64 20 74 68 65 20 32 20 51 54 4d 20 73 6f 6e |ad the 2 QTM son| 00004060 67 20 74 69 6d 65 72 73 2c 20 61 6e 64 20 74 68 |g timers, and th| 00004070 65 20 74 6f 74 61 6c 20 74 69 6d 65 20 6f 66 20 |e total time of | 00004080 61 0a 73 6f 6e 67 2e 20 54 68 65 20 63 6f 6e 74 |a.song. The cont| 00004090 65 6e 74 73 20 6f 66 20 52 30 20 61 6e 64 20 52 |ents of R0 and R| 000040a0 31 20 6f 6e 20 65 78 69 74 20 61 72 65 20 63 61 |1 on exit are ca| 000040b0 6c 63 75 6c 61 74 65 64 20 66 72 6f 6d 20 74 68 |lculated from th| 000040c0 65 20 69 6e 74 65 72 6e 61 6c 0a 31 30 30 48 7a |e internal.100Hz| 000040d0 20 74 69 6d 65 72 20 2d 20 62 75 74 20 74 68 65 | timer - but the| 000040e0 20 63 6f 6e 74 65 6e 74 73 20 6f 66 20 52 32 20 | contents of R2 | 000040f0 72 65 6c 79 20 6f 6e 20 61 20 73 70 65 63 69 61 |rely on a specia| 00004100 6c 20 31 30 30 25 20 61 63 63 75 72 61 74 65 2c |l 100% accurate,| 00004110 20 73 6f 6e 67 0a 6c 65 6e 67 74 68 20 63 61 6c | song.length cal| 00004120 63 75 6c 61 74 69 6f 6e 20 72 6f 75 74 69 6e 65 |culation routine| 00004130 2e 2e 2e 0a 20 20 54 68 65 20 51 54 4d 2d 55 6c |.... The QTM-Ul| 00004140 74 72 61 2d 6d 65 67 61 2d 74 69 6d 65 2d 77 6f |tra-mega-time-wo| 00004150 72 6b 65 72 2d 6f 75 74 65 72 20 69 73 20 74 68 |rker-outer is th| 00004160 65 20 66 69 72 73 74 20 73 6f 6e 67 20 74 69 6d |e first song tim| 00004170 65 20 63 61 6c 63 75 6c 61 74 69 6f 6e 0a 72 6f |e calculation.ro| 00004180 75 74 69 6e 65 20 6f 6e 20 74 68 65 20 41 72 63 |utine on the Arc| 00004190 2c 20 61 6e 64 20 74 68 65 20 6f 6e 6c 79 20 72 |, and the only r| 000041a0 6f 75 74 69 6e 65 20 6f 6e 20 61 6e 79 20 63 6f |outine on any co| 000041b0 6d 70 75 74 65 72 20 77 68 69 63 68 20 63 61 6e |mputer which can| 000041c0 20 61 63 63 75 72 61 74 65 6c 79 0a 77 6f 72 6b | accurately.work| 000041d0 20 6f 75 74 20 74 69 6d 65 73 20 63 6f 72 72 65 | out times corre| 000041e0 63 74 6c 79 20 77 69 74 68 20 65 66 66 65 63 74 |ctly with effect| 000041f0 73 20 73 75 63 68 20 61 73 20 27 43 49 41 27 20 |s such as 'CIA' | 00004200 74 65 6d 70 6f 73 2c 20 70 61 74 74 65 72 6e 20 |tempos, pattern | 00004210 6c 6f 6f 70 73 20 61 6e 64 0a 70 61 74 74 65 72 |loops and.patter| 00004220 6e 20 64 65 6c 61 79 73 2e 20 54 68 65 20 72 6f |n delays. The ro| 00004230 75 74 69 6e 65 20 77 6f 72 6b 73 20 62 79 20 73 |utine works by s| 00004240 63 61 6e 6e 69 6e 67 20 74 68 72 6f 75 67 68 20 |canning through | 00004250 61 6c 6c 20 74 68 65 20 73 6f 6e 67 27 73 0a 70 |all the song's.p| 00004260 61 74 74 65 72 6e 73 2c 20 69 6e 20 74 68 65 20 |atterns, in the | 00004270 63 6f 72 72 65 63 74 20 6f 72 64 65 72 20 2d 20 |correct order - | 00004280 63 61 6c 63 75 6c 61 74 69 6e 67 20 74 68 65 20 |calculating the | 00004290 74 69 6d 65 20 6f 66 20 65 61 63 68 20 65 76 65 |time of each eve| 000042a0 6e 74 20 61 73 20 69 74 0a 67 6f 65 73 2c 20 61 |nt as it.goes, a| 000042b0 6e 64 20 74 61 6b 69 6e 67 20 69 6e 74 6f 20 61 |nd taking into a| 000042c0 63 63 6f 75 6e 74 20 61 6e 64 20 73 70 65 65 64 |ccount and speed| 000042d0 2f 74 65 6d 70 6f 2f 6c 6f 6f 70 20 6f 72 20 64 |/tempo/loop or d| 000042e0 65 6c 61 79 20 73 65 74 74 69 6e 67 73 20 74 68 |elay settings th| 000042f0 61 74 20 6d 61 79 0a 62 65 20 69 6e 20 75 73 65 |at may.be in use| 00004300 2e 0a 20 20 57 68 65 6e 20 74 68 69 73 20 53 57 |.. When this SW| 00004310 49 20 69 73 20 63 61 6c 6c 65 64 20 66 6f 72 20 |I is called for | 00004320 74 68 65 20 66 69 72 73 74 20 74 69 6d 65 20 61 |the first time a| 00004330 66 74 65 72 20 6c 6f 61 64 69 6e 67 20 61 20 73 |fter loading a s| 00004340 6f 6e 67 2c 20 74 68 65 20 74 6f 74 61 6c 0a 6c |ong, the total.l| 00004350 65 6e 67 74 68 20 77 69 6c 6c 20 62 65 20 77 6f |ength will be wo| 00004360 72 6b 65 64 20 6f 75 74 20 75 73 69 6e 67 20 74 |rked out using t| 00004370 68 65 20 73 70 65 63 69 61 6c 20 72 6f 75 74 69 |he special routi| 00004380 6e 65 2e 20 4f 6e 20 6c 61 74 65 72 20 63 61 6c |ne. On later cal| 00004390 6c 73 20 74 6f 20 74 68 69 73 0a 53 57 49 20 28 |ls to this.SWI (| 000043a0 77 68 69 6c 65 20 74 68 65 20 73 61 6d 65 20 73 |while the same s| 000043b0 6f 6e 67 20 69 73 20 6c 6f 61 64 65 64 29 2c 20 |ong is loaded), | 000043c0 74 68 65 20 74 6f 74 61 6c 20 6c 65 6e 67 74 68 |the total length| 000043d0 20 77 69 6c 6c 20 6e 6f 74 20 62 65 0a 72 65 2d | will not be.re-| 000043e0 63 61 6c 63 75 6c 61 74 65 64 2c 20 62 75 74 20 |calculated, but | 000043f0 74 68 65 20 6f 72 69 67 6e 61 6c 20 63 61 6c 63 |the orignal calc| 00004400 75 6c 61 74 69 6f 6e 20 77 69 6c 6c 20 75 73 65 |ulation will use| 00004410 64 2c 20 74 6f 20 73 61 76 65 20 74 69 6d 65 2e |d, to save time.| 00004420