summaryrefslogtreecommitdiffstats
path: root/Graphic_Equalizer/src/events.hcc
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2004-11-24 15:29:03 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2004-11-24 15:29:03 (GMT)
commit3ff31863d7dc06829c1233a377ac2bce03cd8fe0 (patch)
treefe78ecd392487a2a63ffb80158fac6e1ae7a66fe /Graphic_Equalizer/src/events.hcc
parent14199e75ce0b65d51148c3a8e0558d377eb8463e (diff)
downloadTASS-3ff31863d7dc06829c1233a377ac2bce03cd8fe0.zip
TASS-3ff31863d7dc06829c1233a377ac2bce03cd8fe0.tar.gz
TASS-3ff31863d7dc06829c1233a377ac2bce03cd8fe0.tar.bz2
if possible, events are defined here.
Currently we have one function, the loading of presets from RAM memory into fpga ram. equalizer lookup tables are now moved to here.
Diffstat (limited to 'Graphic_Equalizer/src/events.hcc')
-rw-r--r--Graphic_Equalizer/src/events.hcc26
1 files changed, 20 insertions, 6 deletions
diff --git a/Graphic_Equalizer/src/events.hcc b/Graphic_Equalizer/src/events.hcc
index 89f9eaa..d265808 100644
--- a/Graphic_Equalizer/src/events.hcc
+++ b/Graphic_Equalizer/src/events.hcc
@@ -26,6 +26,7 @@
/******** Application Includes ********/
#include "configuration.hch"
+#include "eventhandler_shared.hch"
#include "events.hch"
#if HAVE_DEBUG
@@ -44,31 +45,44 @@
* \return void
* \retval void
*/
-void load_preset(unsigned 20 preset_address, unsigned 4 *equalizer_levels) {
+macro proc load_preset(preset_address, equalizer_levels) {
macro expr RAM_BANK0 = PalPL2RAMCT(0);
macro expr AW = PalPL2RAMGetMaxAddressWidthCT();
macro expr DW = PalPL2RAMGetMaxDataWidthCT();
unsigned DW data;
+ unsigned AW address;
unsigned 10 equalizer_index;
+ address = preset_address;
/*
* PL2Ram needs a clockclycle between the set of an address and read.
* Therefore we set it once here.
*/
- PalPL2RAMSetReadAddress(RAM_BANK0, preset_address);
+ PalPL2RAMSetReadAddress(RAM_BANK0, address);
/*
*
*/
- for (equalizer_index = 0; equalizer_index != 768; equalizer_index++) {
+ for (equalizer_index = 0; equalizer_index != 768; equalizer_index += 2) {
/*
* We've allready set the address hence we can allready
* increase it for next use.
*/
- preset_address++;
+ address++;
PalPL2RAMRead(RAM_BANK0, &data);
- equalizer_levels[equalizer_index] = data <- 4;
+ equalizer_levels[equalizer_index] = data[3:0];
+ equalizer_levels[equalizer_index +1] = data[7:4];
}
-} /* --- load_preset() --- */ \ No newline at end of file
+} /* --- load_preset() --- */
+
+
+
+/*
+ * Equalizer lookuptabes.
+ * TODO: This table is now hardcoded. To ensure full skinability this table
+ * should be dynamically loaded.
+ */
+rom unsigned 4 equalizer_table[66] = {15, 15, 15, 15, 15, 14, 14, 14, 14, 13, 13, 13, 13, 12, 12, 12, 12, 11, 11, 11, 11, 10, 10, 10, 10, 9, 9, 9, 9, 8, 8, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0};
+rom unsigned 10 equalizer_table_inv[16] = {446, 444, 440, 436, 432, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 384}; \ No newline at end of file