home *** CD-ROM | disk | FTP | other *** search
- SampleMod 1.02 docs.
- ====================
-
- SampleMod is used to control the sampler built in 'Egebladet' issue 19. It
- is not suitable for working with other hardware.
-
-
-
- Short SWI list
- ==============
-
- &C0CC0 ADC_Bypass Bypass the ADC input to the sound output
- &C0CC1 ADC_Sample Sample from the ADC into memory
- &C0CC2 ADC_DoConversion Get a value from the ADC with initial delay
- &C0CC3 ADC_NextConversion Get a value from the ADC
-
-
-
- SWIs in detail
- ==============
-
- General note: When few or no errors are listed under 'Possible errors', care
- should be taken about the parametres passed to the routine. There are no
- bounds checking in these routines.
-
-
- &C0CC0 'ADC_Bypass' Bypass the ADC input to the sound output
- ------------------------------------------------------------
- On entry: R0 = Sample period in 0.5 µs units
-
- This call will enter a loop, where the ADC is read continiously, and the
- values are sent directly to the VIDC sound output. Nearly everything else
- going on will be stopped (Screen DMA, IRQ's, FIQ's, etc.), so the maximum
- quality is output. The bypassing is stopped when an interrupt arrives from
- the keyboard, which is when a key is pressed or the mouse is moved.
-
-
- &C0CC1 'ADC_Sample' Sample from the ADC into memory
- ---------------------------------------------------
- On entry: R0 = Pointer to start of buffer for data
- R1 = Length of buffer
- R2 = Sample period in 0.5 µs units
- R3 = Trigger level (12-bit unsigned linear value)
-
- The SWI will enter a loop where it's reading from the ADC at the given
- sample rate, waiting for the value to exceed the given trigger level. When
- this happens, the buffer is filled with the values from the ADC, still
- reading at the sample rate. When the buffer is full, the SWI returns.
- While waiting for the trigger level, the border is coloured using the
- current value from the ADC, so when the colour remains constant, the
- sampling has started. The 12-bit values read from the ADC are converted to
- 8-bit logarithmic values before they're stored in the buffer. The trigger
- level is a 12-bit ADC-style level, i.e. 0 to &1000 with &800 meaning zero
- input voltage.
-
- Possible errors:
- 'No writable memory at this address'
-
-
- &C0CC2 'ADC_DoConversion' Get a value from the ADC with initial delay
- ---------------------------------------------------------------------
- On exit: R0 = 12-bit unsigned value from the ADC
-
- This SWI will start a conversion, wait for approx. 13 µs, and read the
- value from the ADC. After reading the value, the ADC is started converting
- again.
-
-
- &C0CC3 'ADC_NextConversion' Get a value from the ADC
- ----------------------------------------------------
- On exit: R0 = 12-bit unsigned value from the ADC
-
- This SWI will read the ADC without the initial delay, and start a new
- conversion afterwards. Typically called repeatedly after calling
- 'ADC_DoConversion' the first time.
-