summaryrefslogtreecommitdiffstats
path: root/Graphic_Equalizer_Original_Port/include
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2004-12-09 13:44:56 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2004-12-09 13:44:56 (GMT)
commit593d5fded11b8723ce27883e06865ab205c6f008 (patch)
tree1f25584a40a2f24861464f0e6ea5416db7951514 /Graphic_Equalizer_Original_Port/include
parent2b08ad7b3243965c832960b8089013cd1f6f46f3 (diff)
downloadTASS-593d5fded11b8723ce27883e06865ab205c6f008.zip
TASS-593d5fded11b8723ce27883e06865ab205c6f008.tar.gz
TASS-593d5fded11b8723ce27883e06865ab205c6f008.tar.bz2
Phase 1: Original Port Completed.
Recommended additions: add and update (doxygen) documentation
Diffstat (limited to 'Graphic_Equalizer_Original_Port/include')
-rw-r--r--Graphic_Equalizer_Original_Port/include/audio.hch87
-rw-r--r--Graphic_Equalizer_Original_Port/include/configuration.hch56
-rw-r--r--Graphic_Equalizer_Original_Port/include/display.hch52
-rw-r--r--Graphic_Equalizer_Original_Port/include/display_shared.hch80
-rw-r--r--Graphic_Equalizer_Original_Port/include/eventhandler.hch39
-rw-r--r--Graphic_Equalizer_Original_Port/include/eventhandler_shared.hch71
-rw-r--r--Graphic_Equalizer_Original_Port/include/events.hch33
-rw-r--r--Graphic_Equalizer_Original_Port/include/fft.hch34
-rw-r--r--Graphic_Equalizer_Original_Port/include/mouse.hch41
-rw-r--r--Graphic_Equalizer_Original_Port/include/mouse_shared.hch56
-rw-r--r--Graphic_Equalizer_Original_Port/include/runfft.hch1
-rw-r--r--Graphic_Equalizer_Original_Port/include/smartmedia.hch68
-rw-r--r--Graphic_Equalizer_Original_Port/include/smartmedia_shared.hch80
-rw-r--r--Graphic_Equalizer_Original_Port/include/weights_256.hch264
14 files changed, 962 insertions, 0 deletions
diff --git a/Graphic_Equalizer_Original_Port/include/audio.hch b/Graphic_Equalizer_Original_Port/include/audio.hch
new file mode 100644
index 0000000..988ef59
--- /dev/null
+++ b/Graphic_Equalizer_Original_Port/include/audio.hch
@@ -0,0 +1,87 @@
+/*! \file audio.hch
+ *
+ * \section generic Graphic Equalizer API
+ *
+ * \section project Project information.
+ * Project Graphic Equalizer\n
+ * \author O.M. Schinagl
+ * \date 20041021
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041021: O.M. Schinagl\n Initial version
+ *
+ ********************************************************************/
+
+#ifndef _AUDIO_HCH
+#define _AUDIO_HCH 1
+
+/*
+ * Type definition of the shared memory to be used in various processes
+ */
+typedef struct {
+ mpram {
+ ram unsigned 7 write[256];
+ rom unsigned 7 read[256];
+ } fft_info with { block = "BlockRAM"};
+ mpram {
+ ram unsigned 6 write[256];
+ rom unsigned 6 read[256];
+ } ifft_info with { block = "BlockRAM"};
+ unsigned 4 *equalizer_levels_ptr;
+ unsigned 1 display_log;
+} audiodata_t;
+
+
+
+
+/*
+ * States used to indicate wether audio data is sampled.
+ */
+#define AUDIO_NOT_READY 0
+#define AUDIO_READY 1
+
+
+
+/*
+ * Line in or Mic in aliases for audio_init.
+ */
+#define LINE_IN RC200AudioInLineIn
+#define MIC_IN RC200AudioInMicrophone
+
+
+
+/*
+ * Sample Rate Aliases for audio_init.
+ */
+#define SR_8000 RC200AudioSampleRate8000
+#define SR_11025 RC200AudioSampleRate11025
+#define SR_16000 RC200AudioSampleRate16000
+#define SR_22050 RC200AudioSampleRate22050
+#define SR_44100 RC200AudioSampleRate44100
+#define SR_48000 RC200AudioSampleRate48000
+
+
+
+/*
+ * Initialize the Audio sub-system. gain_level sets the internal amplifier to
+ * passed level, input_source chooses between line in or mic in. The
+ * sample_rate is set to supplied rate. Defines for these are mentioned above.
+ */
+macro proc audio_init(gain_level, input_source, sample_rate, AUDIOIN, AUDIOOUT);
+
+
+
+/*
+ * Main audiodriver loop. This procedure never returns! It handles audio io and
+ * updates the shared memory. It needs Audio I/O handlers passed.
+ */
+macro proc audio_main(audiodata, AUDIOIN, AUDIOOUT);
+
+#else
+#error "ERROR file audio.hch multiple times included"
+#endif /* --- _AUDIO_HCH --- */
+
diff --git a/Graphic_Equalizer_Original_Port/include/configuration.hch b/Graphic_Equalizer_Original_Port/include/configuration.hch
new file mode 100644
index 0000000..17c1b3f
--- /dev/null
+++ b/Graphic_Equalizer_Original_Port/include/configuration.hch
@@ -0,0 +1,56 @@
+/*! \file configuration.hch
+ *
+ * \section generic Configuration for the entire application
+ *
+ * \section project Project information.
+ * Project Graphic Equalizer\n
+ * \author O.M. Schinagl
+ * \date 20041101
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041101: O.M. Schinagl\n Initial version
+ *
+ ********************************************************************/
+
+#ifndef _CONFIGURATION_HCH
+#define _CONFIGURATION_HCH 1
+
+
+
+/*
+ * To print debug information on the RS232 port set this define.
+ */
+#define HAVE_DEBUG 0
+
+
+
+/*
+ * If we don't want to use the SmartMedia set this to 0. Data is then read from
+ * the ram, assuming it's there. Otherwise 1 will load the smartmedia
+ * routines.
+ */
+#define HAVE_SMARTMEDIA 0
+
+
+
+/*
+ * FFT specific. TODO: Clean Up!
+ */
+#define USE_RUNFFT 1
+#define HARDWARE_MULTIPLY 1
+#define PERFORM_FFT_CALCULATION 1
+#define USE_UNSIGNED_AUDIO 0
+
+/*
+FIXME: DK doesn't override from commandline defines. We have to therefore
+ ignore this include guard until we can find around this.
+#else
+#error "ERROR file configuration.hch multiple times included"
+*/
+#endif /* --- _CONFIGURATION_HCH --- */
+
+
diff --git a/Graphic_Equalizer_Original_Port/include/display.hch b/Graphic_Equalizer_Original_Port/include/display.hch
new file mode 100644
index 0000000..af29b4f
--- /dev/null
+++ b/Graphic_Equalizer_Original_Port/include/display.hch
@@ -0,0 +1,52 @@
+/*! \file display.hch
+ *
+ * \section generic Display API
+ *
+ * \section project Project information.
+ * Project Graphic Equalizer\n
+ * \author
+ * \date 20041011
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041011: \n Initial version
+ *
+ ********************************************************************/
+
+#ifndef _DISPLAY_HCH
+#define _DISPLAY_HCH 1
+
+
+
+/*
+ * Set the color for various items that will be drawn on screen.
+ */
+#define PIXEL (pixeldata <- 24)
+#define PIXEL_VOLUME (0x2d74b5)
+#define PIXEL_EQUALIZER (0xc7541f)
+#define PIXEL_SPECTRUM ((((skindata->area_spectrum_bottom -(SCANY <- 10)) <<1) <- 8) @ 0x00 @ (((skindata->area_spectrum_bottom -(SCANY <- 10)) <<1) <- 8))
+#define PIXEL_WAVEFORM (0x2d74b5)
+
+
+
+/*
+ * Main display loop. This function never returns! It handles display output.
+ * It needs to respond to certain events set by the events pointer. Also it
+ * informs events what the current mask is. To optain the current mask we need
+ * the X and Y coordinates from our mousedata pointer.
+ */
+void display_main(skindata_t *skindata, audiodata_t *audiodata, events_t *events, mousedata_t *mousedata);
+
+
+
+/*
+ * reload equalizer bars into the display memory.
+ */
+void reload_equalizer(events_t *events, unsigned 4 *equalizer_levels_ptr);
+
+#else
+#error "ERROR file display.hch multiple times included"
+#endif /* --- _DISPLAY_HCH --- */
diff --git a/Graphic_Equalizer_Original_Port/include/display_shared.hch b/Graphic_Equalizer_Original_Port/include/display_shared.hch
new file mode 100644
index 0000000..11d6edc
--- /dev/null
+++ b/Graphic_Equalizer_Original_Port/include/display_shared.hch
@@ -0,0 +1,80 @@
+/*! \file display_shared.hch
+ *
+ * \brief Datastructures and defines for usage when interacting with the
+ * display library.
+ *
+ * \section project Project information.
+ * Graphic Equalizer 2\n
+ * \author
+ * \date 20041011
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041011: \n Initial version
+ *
+ ********************************************************************/
+
+#ifndef _DISPLAY_SHARED_HCH
+#define _DISPLAY_SHARED_HCH 1
+
+
+
+/*! \struct skindata_t
+ * \brief This struct contains all area- dimensions and color information
+ * for the skin.
+ */
+struct skindata_t {
+ /*! \struct skin_info_t
+ * \brief Structure containing the four boundry limits of an area and
+ * maximal two colors per area.
+ */
+ struct skin_info_t {
+ unsigned 10 area_bottom; /*!< lowest point registerd in the area */
+ unsigned 10 area_top; /*!< highest point registerd in the area */
+ unsigned 10 area_left; /*!< leftmost point registerd in the area */
+ unsigned 10 area_right; /*!< rightmost point registerd in the area */
+ unsigned 24 color_primary; /*!< primary color for this area */
+ unsigned 24 color_secondary; /*!< optionally an area can have a second color */
+ };
+ struct skin_info_t waveform; /*!< We store all information about the waveform area here. */
+ struct skin_info_t spectrum; /*!< We store all information about the spectrum analyzer area here. */
+ struct skin_info_t volume; /*!< We store all information about the volume control area here. */
+ struct skin_info_t equalizer; /*!< We store all information about the equalizerbars here. */
+};
+
+
+
+#define AREA_WAVEFORM 0x01 /*!< Waveform area. */
+#define AREA_VOLUME_YAXIS 0x02 /*!< Volume control on the Y plane. */
+#define AREA_SPECTRUM_ANALYZER 0x03 /*!< Spectrum Analyzer area. */
+
+#define BUTTON_LOG 0x04 /*!< Logarithmic display button. */
+#define BUTTON_DEMO 0x05 /*!< Demo preset button. */
+#define BUTTON_RESET 0x06 /*!< Reset presets button. */
+
+#define BUTTON_PRESET_1 0x07 /*!< Button for switching to preset 1 */
+#define BUTTON_PRESET_2 0x08 /*!< Button for switching to preset 2 */
+#define BUTTON_PRESET_3 0x09 /*!< Button for switching to preset 3 */
+#define BUTTON_PRESET_4 0x0a /*!< Button for switching to preset 4 */
+#define BUTTON_PRESET_5 0x0b /*!< Button for switching to preset 5 */
+#define BUTTON_PRESET_6 0x0c /*!< Button for switching to preset 6 */
+
+#define BUTTON_CONVEX_FULL 0x0d /*!< / - \ 'Convex' mode Button*/
+#define BUTTON_CONVEX_HALF 0x0e /*!< /\ 'Convex' mode Button */
+#define BUTTON_PRECISE 0x0f /*!< | 'Precise' selection Button */
+#define BUTTON_CONCAVE_HALF 0x10 /*!< \/ 'Concave' mode Button */
+#define BUTTON_CONCAVE_FULL 0x11 /*!< \ _ / 'Concave' mode Button */
+
+#define BUTTON_HELP 0x12 /*!< Button to display help screen. */
+#define BUTTON_MODE 0x13 /*!< Button to change operation mode. */
+
+#define AREA_EQUALIZER_MIN 0x80 /*!< First bar of the Equalizer Area. */
+#define AREA_EQUALIZER_MAX 0xff /*!< Last bar of the Equalizer Area. */
+
+#else
+#error "ERROR file display_shared.hch multiple times included"
+#endif /* --- _DISPLAY_SHARED_HCH --- */
+
diff --git a/Graphic_Equalizer_Original_Port/include/eventhandler.hch b/Graphic_Equalizer_Original_Port/include/eventhandler.hch
new file mode 100644
index 0000000..0f3eca9
--- /dev/null
+++ b/Graphic_Equalizer_Original_Port/include/eventhandler.hch
@@ -0,0 +1,39 @@
+/*! \file eventhandler.hch
+ *
+ * \section generic SmartMedia API
+ *
+ * \section project Project information.
+ * Project Graphic Equalizer\n
+ * \author O.M. Schinagl
+ * \date 20041110
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041110: O.M. Schinagl\n Initial version
+ *
+ ********************************************************************/
+
+#ifndef _EVENTHANDLER_HCH
+#define _EVENTHANDLER_HCH 1
+
+
+
+#define LOAD_PRESET_RESET 0x000
+#define LOAD_PRESET_DEMO 0x180
+
+
+
+/*
+ * This is the main eventhandler loop. We require pointers to the event struct
+ * to store actions to be performed and a mousedata pointer so that we know on
+ * what mousestate to respond. We never returns!
+ */
+void eventhandler_main(audiodata_t *audiodata, events_t *events, mousedata_t *mousedata);
+
+#else
+#error "ERROR file eventhandler.hch multiple times included"
+#endif /* --- _EVENTHANDLER_HCH --- */
+
diff --git a/Graphic_Equalizer_Original_Port/include/eventhandler_shared.hch b/Graphic_Equalizer_Original_Port/include/eventhandler_shared.hch
new file mode 100644
index 0000000..d21cff4
--- /dev/null
+++ b/Graphic_Equalizer_Original_Port/include/eventhandler_shared.hch
@@ -0,0 +1,71 @@
+/*! \file eventhandler_shared.hch
+ *
+ * \section generic Shared definitions etc. for eveents.
+ *
+ * \section project Project information.
+ * Project Graphic Equalizer\n
+ * \author O.M. Schinagl
+ * \date 20041110
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041110: O.M. Schinagl\n Initial version
+ *
+ *****************************************************************************/
+
+#ifndef _EVENTHANDLER_SHARED_HCH
+#define _EVENTHANDLER_SHARED_HCH 1
+
+
+
+/*** Data Types **********************/
+
+/*
+ * Type definition of the shared memory to be used in various processes
+ */
+typedef struct {
+ ram unsigned 10 equalizer_display[128];
+ unsigned 10 active_preset;
+ unsigned 10 volume_position;
+ unsigned 8 mask;
+ unsigned 4 mode;
+ unsigned 4 equalizer_mode;
+ unsigned 1 locked_display;
+} events_t;
+
+
+#define MODE_SKIN 0x00
+#define MODE_HELP 0x01
+#define MODE_GRAPH 0x02
+
+
+
+#define EQUALIZERMODE_FULL 0x05
+#define EQUALIZERMODE_HALF 0x03
+#define EQUALIZERMODE_PRECISE 0x00
+
+
+/*
+ * Volume Control lookuptable.
+ * TODO: This table is now hardcoded. To ensure full skinability this table
+ * should be dynamically loaded.
+ */
+extern unsigned 5 volumecontrol_table[46];
+
+/*
+ * Equalizer lookup tables.
+ * TODO: This table is now hardcoded. To ensure full skinability this table
+ * should be dynamically loaded.
+ */
+extern unsigned 4 equalizer_table[640];
+extern unsigned 10 equalizer_table_inv[16];
+
+
+
+#else
+#error "ERROR file eventhandler_shared.hch multiple times included"
+#endif /* --- _EVENTHANDLER_SHARED_HCH --- */
+
diff --git a/Graphic_Equalizer_Original_Port/include/events.hch b/Graphic_Equalizer_Original_Port/include/events.hch
new file mode 100644
index 0000000..885e89f
--- /dev/null
+++ b/Graphic_Equalizer_Original_Port/include/events.hch
@@ -0,0 +1,33 @@
+/*! \file events.hch
+ *
+ * \section generic This module contains the various actions and events
+ * that need to be performed.
+ *
+ * \section project Project information.
+ * Project Graphic Equalizer\n
+ * \author O.M. Schinagl
+ * \date 20041710
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041710: O.M. Schinagl\n Initial version
+ *
+ ******************************************************************************/
+
+#ifndef _EVENTS_HCH
+#define _EVENTS_HCH 1
+
+
+
+/*
+ * This function loads 768 4bits presets into the equalizer_levels array
+ * pointed to by equalizer_levels.
+ */
+void load_preset(unsigned 10 preset, unsigned 4 *equalizer_levels_ptr);
+
+#else
+#error "ERROR file events.hch multiple times included"
+#endif /* --- _EVENTS_HCH --- */
diff --git a/Graphic_Equalizer_Original_Port/include/fft.hch b/Graphic_Equalizer_Original_Port/include/fft.hch
new file mode 100644
index 0000000..635ea7b
--- /dev/null
+++ b/Graphic_Equalizer_Original_Port/include/fft.hch
@@ -0,0 +1,34 @@
+#define NUMBER_OF_COLUMNS 8
+#define NUMBER_OF_POINTS (1<<NUMBER_OF_COLUMNS)
+#define NUMBER_OF_FREQUENCIES (NUMBER_OF_POINTS>>1)
+
+#if HARDWARE_MULTIPLY
+/*
+ * This routine obtains the audio data from the audio I/O component and copies this
+ * data to local arrays for calculating purposes, and calls the FFT algorithm.
+*/
+void perform_fft(signed 18 *pcm_audio);
+
+/* This routine calls the ifft algorithm and after completing that it obtains the
+ * modified audio data and copies that to the output arrays of the audio I/O component.
+ * Besides that it also fills the array used by the display routine for displaying the waveform.
+*/
+void perform_ifft(signed 18 *modified_audio ,unsigned 6 *ifft_info);
+#else
+/*
+ * This routine obtains the audio data from the audio I/O component and copies this
+ * data to local arrays for calculating purposes, and calls the FFT algorithm.
+*/
+void perform_fft(signed 16 *pcm_audio);
+
+/* This routine calls the ifft algorithm and after completing that it obtains the
+ * modified audio data and copies that to the output arrays of the audio I/O component.
+ * Besides that it also fills the array used by the display routine for displaying the waveform.
+*/
+void perform_ifft(signed 16 *modified_audio ,unsigned 6 *ifft_info);
+#endif
+
+/* This routine equalizes the frequencies derived by the FFT calculation,
+ * according to the settings of the equalizer bars.
+*/
+void equalize_audio(audiodata_t *audiodata);
diff --git a/Graphic_Equalizer_Original_Port/include/mouse.hch b/Graphic_Equalizer_Original_Port/include/mouse.hch
new file mode 100644
index 0000000..ac26bbf
--- /dev/null
+++ b/Graphic_Equalizer_Original_Port/include/mouse.hch
@@ -0,0 +1,41 @@
+/*! \file mouse.hch
+ *
+ * \section generic Mousedriver API
+ *
+ * \section project Project information.
+ * Project Graphic Equalizer\n
+ * \author O.M. Schinagl
+ * \date 20041011
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041011: O.M. Schinagl\n Initial version
+ *
+ ********************************************************************/
+
+#ifndef _MOUSEDRIVER_HCH
+#define _MOUSEDRIVER_HCH 1
+
+
+
+/*
+ * Create a define to keep API generic
+ */
+#define MouseRun(ClockRate) RC200TouchScreenRun(ClockRate)
+
+
+
+/*
+ * Main mousedriver loop. This procedure never returns! It handles mouse input,
+ * updates the shared memory and notifies listeners. It requires a pointer to
+ * a mousedata_t struct to store mouse information.
+ */
+void mouse_main(mousedata_t *mousedata);
+
+#else
+#error "ERROR file mousedriver.hch multiple times included"
+#endif /* --- _MOUSEDRIVER_HCH --- */
+
diff --git a/Graphic_Equalizer_Original_Port/include/mouse_shared.hch b/Graphic_Equalizer_Original_Port/include/mouse_shared.hch
new file mode 100644
index 0000000..09c5021
--- /dev/null
+++ b/Graphic_Equalizer_Original_Port/include/mouse_shared.hch
@@ -0,0 +1,56 @@
+/*! \file mouse_shared.hch
+ *
+ * \section generic Shared definitions etc.
+ *
+ * \section project Project information.
+ * Project Graphic Equalizer\n
+ * \author O.M. Schinagl
+ * \date 20041011
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041011: O.M. Schinagl\n Initial version
+ *
+ *****************************************************************************/
+
+#ifndef _MOUSEDRIVER_SHARED_HCH
+#define _MOUSEDRIVER_SHARED_HCH 1
+
+/*** Data Types **********************/
+
+/*
+ * Type definition of the shared memory to be used in various processes
+ */
+typedef struct {
+ unsigned 10 x, y;
+ unsigned 3 state;
+ unsigned 1 status;
+} mousedata_t;
+
+
+
+/*
+ * States used to identify wether mouse data is updated
+ */
+#define MOUSE_NOT_UPDATED 0
+#define MOUSE_UPDATED 1
+
+
+
+/*
+ * Set of Mouse States defines
+ */
+#define MOUSE_STATE_UP 0
+#define MOUSE_STATE_ON_PRESS 1
+#define MOUSE_STATE_DOWN 2
+#define MOUSE_STATE_ON_RELEASE 3
+
+
+
+#else
+#error "ERROR file mousedriver_shared.hch multiple times included"
+#endif /* --- _MOUSEDRIVER_SHARED_HCH --- */
+
diff --git a/Graphic_Equalizer_Original_Port/include/runfft.hch b/Graphic_Equalizer_Original_Port/include/runfft.hch
new file mode 100644
index 0000000..d6f6ce0
--- /dev/null
+++ b/Graphic_Equalizer_Original_Port/include/runfft.hch
@@ -0,0 +1 @@
+extern macro proc RunFFT (AudioIn, AudioOut);
diff --git a/Graphic_Equalizer_Original_Port/include/smartmedia.hch b/Graphic_Equalizer_Original_Port/include/smartmedia.hch
new file mode 100644
index 0000000..8cd87c0
--- /dev/null
+++ b/Graphic_Equalizer_Original_Port/include/smartmedia.hch
@@ -0,0 +1,68 @@
+/*! \file smartmedia.hch
+ *
+ * \section generic SmartMedia API
+ *
+ * \section project Project information.
+ * Project Graphic Equalizer\n
+ * \author O.M. Schinagl
+ * \date 20041110
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041110: O.M. Schinagl\n Initial version
+ *
+ ********************************************************************/
+
+#ifndef _SMARTMEDIA_HCH
+#define _SMARTMEDIA_HCH 1
+
+
+
+/*
+ * SmartMedia functioncalls a bit to be set to either Read or Write. This
+ * define should make life easier identifying which one is what.
+ */
+#define READ 0
+#define WRITE 1
+
+
+
+/*
+ * The different stages the smart media loaders knows.
+ */
+#define STAGE_LOAD_SKIN 0x00
+#define STAGE_LOAD_HELP 0x01
+#define STAGE_LOAD_GRAPH 0x02
+#define STAGE_LOAD_PRESET 0x03
+
+
+
+/*
+ * Create a define to keep API generic
+ * FIXME: replace with PAL calls when avaiable.
+ */
+#define CPLDRun(ClockRate) RC200CPLDRun(ClockRate)
+#define SmartMediaRun(ClockRate) RC200SmartMediaRun(ClockRate)
+
+
+
+/*
+ * Initializes the smartmedia device.
+ */
+
+unsigned 1 smartmedia_init(void);
+
+
+
+/*
+ * This function loads the memory with data from the smartmedia card.
+ */
+void smartmedia_loaddata(skindata_t *skindata);
+
+#else
+#error "ERROR file smartmedia.hch multiple times included"
+#endif /* --- _SMARTMEDIA_HCH --- */
+
diff --git a/Graphic_Equalizer_Original_Port/include/smartmedia_shared.hch b/Graphic_Equalizer_Original_Port/include/smartmedia_shared.hch
new file mode 100644
index 0000000..33fdb0a
--- /dev/null
+++ b/Graphic_Equalizer_Original_Port/include/smartmedia_shared.hch
@@ -0,0 +1,80 @@
+/*! \file smartmedia_shared.hch
+ *
+ * \section generic SmartMedia Shared
+ *
+ * \section project Project information.
+ * Project Graphic Equalizer\n
+ * \author O.M. Schinagl
+ * \date 20041202
+ * \version 0.1
+ *
+ * \section copyright Copyright
+ * Copyright ©2004 Koninklijke Philips Electronics N.V. All rights reserved
+ *
+ * \section history Change history
+ * 20041202: O.M. Schinagl\n Initial version
+ *
+ ********************************************************************/
+
+#ifndef _SMARTMEDIA_SHARED_HCH
+#define _SMARTMEDIA_SHARED_HCH 1
+
+
+
+/*
+ * Here we set the various sizes of the data in use. Do not round this values
+ * in anyway! For example, 640 pixels times 480 pixels is 307200 (4b000) pixels
+ * total.
+ */
+#define SIZE_SKIN 0x04afff
+#define SIZE_HELP 0x04afff
+#define SIZE_GRAPH 0x04afff
+#define SIZE_SKINMASK 0x018fff
+#define SIZE_HELPMASK 0x018fff
+#define SIZE_GRAPHMASK 0x018fff
+
+#define SIZE_PRESET 0x0001c0
+
+/*
+ * Here we setup the start and end address for the various components.
+ */
+
+#define SMARTMEDIA_ADDRESS_SKIN_START 0x084000 /* Block: 33 */
+#define SMARTMEDIA_ADDRESS_SKINMASK_START 0x168000 /* Block: 90 */
+#define SMARTMEDIA_ADDRESS_HELP_START 0x1b4000 /* Block: 109 */
+#define SMARTMEDIA_ADDRESS_HELPMASK_START 0x298000 /* Block: 166 */
+#define SMARTMEDIA_ADDRESS_GRAPHMASK_START 0x2e4000 /* Block: 185 */
+
+#define SMARTMEDIA_ADDRESS_PRESET_DEMO_START 0x330000 /* Block: 204 */
+#define SMARTMEDIA_ADDRESS_PRESET_RESET_START 0x334000 /* Block: 205 */
+
+#define SMARTMEDIA_ADDRESS_SKIN_END (SMARTMEDIA_ADDRESS_SKIN_START +(SIZE_SKIN *3))
+#define SMARTMEDIA_ADDRESS_SKINMASK_END (SMARTMEDIA_ADDRESS_SKINMASK_START +(SIZE_SKINMASK *3))
+#define SMARTMEDIA_ADDRESS_HELP_END (SMARTMEDIA_ADDRESS_HELP_START +(SIZE_HELP *3))
+#define SMARTMEDIA_ADDRESS_HELPMASK_END (SMARTMEDIA_ADDRESS_HELPMASK_START +(SIZE_HELPMASK *3))
+#define SMARTMEDIA_ADDRESS_GRAPHMASK_END (SMARTMEDIA_ADDRESS_GRAPHMASK_START +(SIZE_GRAPHMASK *3))
+
+#define SMARTMEDIA_ADDRESS_PRESET_DEMO_END (SMARTMEDIA_ADDRESS_PRESET_DEMO_START +(SIZE_PRESET))
+#define SMARTMEDIA_ADDRESS_PRESET_RESET_END (SMARTMEDIA_ADDRESS_PRESET_RESET_START +(SIZE_PRESET))
+
+#define ADDRESS_SKIN_START 0x000000
+#define ADDRESS_SKIN_END (ADDRESS_SKIN_START +SIZE_SKIN)
+
+#define ADDRESS_HELP_START 0x04b000
+#define ADDRESS_HELP_END (ADDRESS_HELP_START +SIZE_HELP)
+
+#define ADDRESS_GRAPHMASK_START 0x096000
+#define ADDRESS_GRAPHMASK_END (ADDRESS_GRAPHMASK_START +SIZE_GRAPH)
+
+#define ADDRESS_PRESET_DEMO_START 0x0e1000
+#define ADDRESS_PRESET_DEMO_END (ADDRESS_PRESET_DEMO_START +SIZE_PRESET)
+
+#define ADDRESS_PRESET_RESET_START 0x0e11c0
+#define ADDRESS_PRESET_RESET_END (ADDRESS_PRESET_RESET_START +SIZE_PRESET)
+
+
+
+#else
+#error "ERROR file smartmedia_shared.hch multiple times included"
+#endif /* --- _SMARTMEDIA_SHARED_HCH --- */
+
diff --git a/Graphic_Equalizer_Original_Port/include/weights_256.hch b/Graphic_Equalizer_Original_Port/include/weights_256.hch
new file mode 100644
index 0000000..f2f71ff
--- /dev/null
+++ b/Graphic_Equalizer_Original_Port/include/weights_256.hch
@@ -0,0 +1,264 @@
+#define INTBITS 1
+#define FRACBITS 14
+
+rom signed 16 weight_re[128] = {
+ 16384,
+ 16379,
+ 16364,
+ 16340,
+ 16305,
+ 16261,
+ 16207,
+ 16143,
+ 16069,
+ 15986,
+ 15893,
+ 15791,
+ 15679,
+ 15557,
+ 15426,
+ 15286,
+ 15137,
+ 14978,
+ 14811,
+ 14635,
+ 14449,
+ 14256,
+ 14053,
+ 13842,
+ 13623,
+ 13395,
+ 13160,
+ 12916,
+ 12665,
+ 12406,
+ 12140,
+ 11866,
+ 11585,
+ 11297,
+ 11003,
+ 10702,
+ 10394,
+ 10080,
+ 9760,
+ 9434,
+ 9102,
+ 8765,
+ 8423,
+ 8076,
+ 7723,
+ 7366,
+ 7005,
+ 6639,
+ 6270,
+ 5897,
+ 5520,
+ 5139,
+ 4756,
+ 4370,
+ 3981,
+ 3590,
+ 3196,
+ 2801,
+ 2404,
+ 2006,
+ 1606,
+ 1205,
+ 804,
+ 402,
+ 0,
+ -402,
+ -804,
+ -1205,
+ -1606,
+ -2006,
+ -2404,
+ -2801,
+ -3196,
+ -3590,
+ -3981,
+ -4370,
+ -4756,
+ -5139,
+ -5520,
+ -5897,
+ -6270,
+ -6639,
+ -7005,
+ -7366,
+ -7723,
+ -8076,
+ -8423,
+ -8765,
+ -9102,
+ -9434,
+ -9760,
+ -10080,
+ -10394,
+ -10702,
+ -11003,
+ -11297,
+ -11585,
+ -11866,
+ -12140,
+ -12406,
+ -12665,
+ -12916,
+ -13160,
+ -13395,
+ -13623,
+ -13842,
+ -14053,
+ -14256,
+ -14449,
+ -14635,
+ -14811,
+ -14978,
+ -15137,
+ -15286,
+ -15426,
+ -15557,
+ -15679,
+ -15791,
+ -15893,
+ -15986,
+ -16069,
+ -16143,
+ -16207,
+ -16261,
+ -16305,
+ -16340,
+ -16364,
+ -16379
+} with {block = "BlockRAM"};
+
+rom signed 16 weight_im[128] = {
+ 0,
+ -402,
+ -804,
+ -1205,
+ -1606,
+ -2006,
+ -2404,
+ -2801,
+ -3196,
+ -3590,
+ -3981,
+ -4370,
+ -4756,
+ -5139,
+ -5520,
+ -5897,
+ -6270,
+ -6639,
+ -7005,
+ -7366,
+ -7723,
+ -8076,
+ -8423,
+ -8765,
+ -9102,
+ -9434,
+ -9760,
+ -10080,
+ -10394,
+ -10702,
+ -11003,
+ -11297,
+ -11585,
+ -11866,
+ -12140,
+ -12406,
+ -12665,
+ -12916,
+ -13160,
+ -13395,
+ -13623,
+ -13842,
+ -14053,
+ -14256,
+ -14449,
+ -14635,
+ -14811,
+ -14978,
+ -15137,
+ -15286,
+ -15426,
+ -15557,
+ -15679,
+ -15791,
+ -15893,
+ -15986,
+ -16069,
+ -16143,
+ -16207,
+ -16261,
+ -16305,
+ -16340,
+ -16364,
+ -16379,
+ -16384,
+ -16379,
+ -16364,
+ -16340,
+ -16305,
+ -16261,
+ -16207,
+ -16143,
+ -16069,
+ -15986,
+ -15893,
+ -15791,
+ -15679,
+ -15557,
+ -15426,
+ -15286,
+ -15137,
+ -14978,
+ -14811,
+ -14635,
+ -14449,
+ -14256,
+ -14053,
+ -13842,
+ -13623,
+ -13395,
+ -13160,
+ -12916,
+ -12665,
+ -12406,
+ -12140,
+ -11866,
+ -11585,
+ -11297,
+ -11003,
+ -10702,
+ -10394,
+ -10080,
+ -9760,
+ -9434,
+ -9102,
+ -8765,
+ -8423,
+ -8076,
+ -7723,
+ -7366,
+ -7005,
+ -6639,
+ -6270,
+ -5897,
+ -5520,
+ -5139,
+ -4756,
+ -4370,
+ -3981,
+ -3590,
+ -3196,
+ -2801,
+ -2404,
+ -2006,
+ -1606,
+ -1205,
+ -804,
+ -402,
+} with {block = "BlockRAM"};