summaryrefslogtreecommitdiffstats
path: root/Graphic_Equalizer/src/smartmedia.hcc
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2004-11-10 16:11:03 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2004-11-10 16:11:03 (GMT)
commit51085a870cc074c3eeef5a6ba1b45503ce0e0f4d (patch)
tree2232a881b7a90f475da5640161f32cf900102369 /Graphic_Equalizer/src/smartmedia.hcc
parentedf01e33d5680018a8c48224b8f7134587f3fcdf (diff)
downloadTASS-51085a870cc074c3eeef5a6ba1b45503ce0e0f4d.zip
TASS-51085a870cc074c3eeef5a6ba1b45503ce0e0f4d.tar.gz
TASS-51085a870cc074c3eeef5a6ba1b45503ce0e0f4d.tar.bz2
Diffstat (limited to 'Graphic_Equalizer/src/smartmedia.hcc')
-rw-r--r--Graphic_Equalizer/src/smartmedia.hcc36
1 files changed, 22 insertions, 14 deletions
diff --git a/Graphic_Equalizer/src/smartmedia.hcc b/Graphic_Equalizer/src/smartmedia.hcc
index 7fc647b..78682ba 100644
--- a/Graphic_Equalizer/src/smartmedia.hcc
+++ b/Graphic_Equalizer/src/smartmedia.hcc
@@ -25,6 +25,10 @@
#include "configuration.hch"
#include "smartmedia.hch"
+#if HAVE_DEBUG
+ #include "debug.hch"
+#endif
+
/*! \fn void smartmedia_init(void);
@@ -58,19 +62,18 @@ unsigned 1 smartmedia_init(void) {
-/*! \fn void smartmedia_loaddata(void);
+/*! \fn void smartmedia_loaddata(RAM_BANK0);
* \brief We load our memory with skin and help data from the smartmedia.
*
- * \param void None.
+ * \param RAM_BANK0 Handle to RAM_BANK0
*
* \return void
* \retval void
*/
-void smartmedia_loaddata(void) {
+macro proc smartmedia_loaddata(RAM_BANK0) {
/*
* Setup RAM Handle, and determin maximum Data and Address widths
*/
- macro expr RAM_BANK0 = PalPL2RAMCT(0);
macro expr DW = PalPL2RAMGetMaxDataWidthCT();
macro expr AW = PalPL2RAMGetMaxAddressWidthCT();
@@ -84,20 +87,24 @@ void smartmedia_loaddata(void) {
* Print some nice stats about data loading.
*/
print_eol();
- print_hex_value(0 @ 0);
+ print_hex_value(0);
#endif
/*
* Before we enter our loop to fill our memory with valid data, we have
* to set the startup positions for the SmartMedia.
*/
- smartmedia_address = SMARTMEDIA_ADDRES_SKIN_START;
+ smartmedia_address = SMARTMEDIA_ADDRESS_SKIN_START;
smartmedia_address_mask = SMARTMEDIA_ADDRESS_SKINMASK_START;
- for (address = ADDRESS_SKIN_START; address != (ADDRESS_HELP_END);) {
+ /*
+ * We start with the address of the skin, and do the loop until we have
+ * done the end of the help.
+ */
+ for (address = ADDRESS_SKIN_START; address != (ADDRESS_HELP_END +1); address++) {
/*
* Once we are done with the loading of our skin, we need to
* change the smartmedia start addresses.
*/
- if (address == ADDRRESS_HELP_START) {
+ if (address == ADDRESS_HELP_START) {
smartmedia_address = SMARTMEDIA_ADDRESS_HELP_START;
smartmedia_address_mask = SMARTMEDIA_ADDRESS_HELPMASK_START;
}
@@ -137,22 +144,23 @@ void smartmedia_loaddata(void) {
#else
mask = 0x01;
r = 0xff;
- g = 0x00;
+ g = 0x0f;
b = 0x00;
#endif
/*
* Now that we have gathered all pixel data, store it in ram.
*/
- PalPL2RAMWrite(RAM_BANK0, (unsigned DW)(0 @ mask @ r @ g @ b))
+ PalPL2RAMWrite(RAM_BANK0, (unsigned DW)(0 @ mask @ r @ g @ b));
#if HAVE_DEBUG
/*
* Print some nice stats about data loading.
*/
- if (!address[8:0]) {
+ if (!address[12:0]) {
print_cr();
- print_hex_value(0 @ address);
- print_string(" / 02E4000");
+ print_hex_value(0 @ address[19:13]);
+ print_string(" / 00000064 | data: ");
+ print_hex_value(0 @ mask @ r @ g @ b);
}
#endif
@@ -161,6 +169,6 @@ void smartmedia_loaddata(void) {
*/
smartmedia_address += 3;
smartmedia_address_mask++;
- address++;
+
}
} /* --- smartmedia_loaddata() --- */