summaryrefslogtreecommitdiffstats
path: root/Graphic_Equalizer/src/smartmedia.hcc
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2004-11-26 16:04:09 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2004-11-26 16:04:09 (GMT)
commit2486259bcf847d66502f4d64311da4a5b920f884 (patch)
treee1fcf9e4f9dc5886413874dd5c99759264b5f87d /Graphic_Equalizer/src/smartmedia.hcc
parentc2322b876d59479db2052e3b9828c902da245484 (diff)
downloadTASS-2486259bcf847d66502f4d64311da4a5b920f884.zip
TASS-2486259bcf847d66502f4d64311da4a5b920f884.tar.gz
TASS-2486259bcf847d66502f4d64311da4a5b920f884.tar.bz2
changed macro proc's to functions.
replaced for loops for while loops.
Diffstat (limited to 'Graphic_Equalizer/src/smartmedia.hcc')
-rw-r--r--Graphic_Equalizer/src/smartmedia.hcc76
1 files changed, 45 insertions, 31 deletions
diff --git a/Graphic_Equalizer/src/smartmedia.hcc b/Graphic_Equalizer/src/smartmedia.hcc
index 9cbc986..efc0e3d 100644
--- a/Graphic_Equalizer/src/smartmedia.hcc
+++ b/Graphic_Equalizer/src/smartmedia.hcc
@@ -23,16 +23,19 @@
/******** Application Includes ********/
#include "configuration.hch"
+#include "display_shared.hch"
#include "smartmedia.hch"
#if HAVE_DEBUG
#include "debug.hch"
#endif
+#include "audio.hch"
+#include "mouse_shared.hch"
#include "eventhandler_shared.hch"
#include "display.hch" /* FIXME: temporary include, needs to be moved to 'init' */
-/*! \fn void smartmedia_init(void);
+/*! \fn unsigned 1 smartmedia_init(void);
* \brief We here initialize the Smart Media card and verify wether the
* card is inserted and such.
*
@@ -41,33 +44,37 @@
* \return We return 0 on success, 1 on error.
* \retval unsigned 1
*/
-macro proc smartmedia_init(result) {
+unsigned 1 smartmedia_init(void) {
+ unsigned 1 retval;
/*
* Firstly we enable both the CPLD and the SmartMedia.
*/
RC200CPLDEnable();
- RC200SmartMediaInit(&result);
+ RC200SmartMediaInit(&retval);
- if (result) {
- RC200SmartMediaReset(&result);
- RC200SmartMediaInit(&result);
- }
+ if (retval) {
+ RC200SmartMediaReset(&retval);
+ RC200SmartMediaInit(&retval);
+ }
+
+ return retval;
} /* --- smartmedia_init() --- */
-/*! \fn void smartmedia_loaddata(RAM_BANK0);
+/*! \fn void smartmedia_loaddata(skindata_t *skindata);
* \brief We load our memory with skin and help data from the smartmedia.
*
- * \param RAM_BANK0 Handle to RAM_BANK0
+ * \param skindata_t *skindata pointer to skindata struct.
*
* \return void
* \retval void
*/
-macro proc smartmedia_loaddata(skindata, RAM_BANK0) {
+void smartmedia_loaddata(skindata_t *skindata) {
/*
* Setup RAM Handle, and determin maximum Data and Address widths
*/
+ macro expr RAM_BANK0 = PalPL2RAMCT(0);
macro expr DW = PalPL2RAMGetMaxDataWidthCT();
macro expr AW = PalPL2RAMGetMaxAddressWidthCT();
@@ -120,9 +127,12 @@ macro proc smartmedia_loaddata(skindata, RAM_BANK0) {
* address pointer to the address from our loop.
*/
#if SKIP_LOAD
- PalPL2RAMSetWriteAddress(RAM_BANK0, 0);
+ if (STAGE_LOAD_PRESET == stage) {
+ PalPL2RAMSetWriteAddress(RAM_BANK0, address);
+ } else {
+ PalPL2RAMSetWriteAddress(RAM_BANK0, 0);
+ }
#else
-/* Warning: Make sure the proper images are loaded into ram before calling! */
PalPL2RAMSetWriteAddress(RAM_BANK0, address);
#endif
@@ -171,7 +181,11 @@ macro proc smartmedia_loaddata(skindata, RAM_BANK0) {
}
#else
- data = 0x0000ff00;
+ if (STAGE_LOAD_PRESET == stage) {
+ data = (address <- 1) ? 0x000000ff : 0x00000000;
+ } else {
+ data = 0x0000ff00;
+ }
#endif
/*
* Now that we have gathered all pixel data, store it in ram.
@@ -185,7 +199,7 @@ macro proc smartmedia_loaddata(skindata, RAM_BANK0) {
if (!(address <- 11)) {
print_cr();
print_hex_value(0 @ (address \\ 12));
- print_string(" / 000000AF | data: ");
+ print_string(" / 000000E1 | data: ");
print_hex_value(data <- 32);
}
#endif
@@ -201,21 +215,21 @@ macro proc smartmedia_loaddata(skindata, RAM_BANK0) {
* This block needs to probably move up into the fore loop where we
* calculate these settings later.
*/
- skindata.area_spectrum_top = 200;
- skindata.area_spectrum_bottom = 335;
- skindata.area_spectrum_left = 77;
- skindata.area_spectrum_right = 575;
- skindata.area_waveform_top = 46;
- skindata.area_waveform_bottom = 118;
- skindata.area_waveform_left = 76;
- skindata.area_waveform_right = 413;
- skindata.area_volume_top = 112;
- skindata.area_volume_bottom = 66;
- skindata.area_volume_left = 439;
- skindata.area_volume_right = 455;
- skindata.color_area_volume = PIXEL_VOLUME;
- skindata.color_area_waveform = PIXEL_WAVEFORM;
-// skindata.color_area_spectrum_top = PIXEL_SPECTRUM;
-// skindata.color_area_spectrum_bottom = PIXEL_SPECTRUM;
- skindata.color_equalizer = PIXEL_EQUALIZER;
+ skindata->area_spectrum_top = 200;
+ skindata->area_spectrum_bottom = 335;
+ skindata->area_spectrum_left = 77;
+ skindata->area_spectrum_right = 575;
+ skindata->area_waveform_top = 46;
+ skindata->area_waveform_bottom = 118;
+ skindata->area_waveform_left = 76;
+ skindata->area_waveform_right = 413;
+ skindata->area_volume_top = 112;
+ skindata->area_volume_bottom = 66;
+ skindata->area_volume_left = 439;
+ skindata->area_volume_right = 455;
+ skindata->color_area_volume = PIXEL_VOLUME;
+ skindata->color_area_waveform = PIXEL_WAVEFORM;
+// skindata->color_area_spectrum_top = PIXEL_SPECTRUM;
+// skindata->color_area_spectrum_bottom = PIXEL_SPECTRUM;
+ skindata->color_equalizer = PIXEL_EQUALIZER;
} /* --- smartmedia_loaddata() --- */