From 071277b16b2d32a4f59f132db0db8035ca0af9b4 Mon Sep 17 00:00:00 2001 From: Oliver Schinagl Date: Thu, 16 Dec 2004 16:21:26 +0000 Subject: Added stages for all about screens. --- Graphic_Equalizer/src/smartmedia.hcc | 188 +++++++++++++++++++++++++++-------- 1 file changed, 145 insertions(+), 43 deletions(-) diff --git a/Graphic_Equalizer/src/smartmedia.hcc b/Graphic_Equalizer/src/smartmedia.hcc index 308e3a5..2de76cf 100644 --- a/Graphic_Equalizer/src/smartmedia.hcc +++ b/Graphic_Equalizer/src/smartmedia.hcc @@ -79,9 +79,9 @@ void smartmedia_loaddata(skindata_t *skindata) { unsigned DW data; unsigned 27 smartmedia_address, smartmedia_address_mask; - unsigned AW address; + unsigned AW address, address_offset; unsigned 8 mask, r, g, b; - unsigned 3 stage; + unsigned 4 stage; unsigned 1 result; extern ram unsigned 8 presets_default_values[768]; @@ -97,38 +97,116 @@ void smartmedia_loaddata(skindata_t *skindata) { * 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_ADDRESS_SKIN_START; - smartmedia_address_mask = SMARTMEDIA_ADDRESS_SKINMASK_START; - stage = STAGE_LOAD_SKIN; + address_offset = 0; + smartmedia_address = 0; + smartmedia_address_mask = SMARTMEDIA_ADDRESS_PRESET_DEMO_START; + stage = STAGE_LOAD_PRESET; /* * 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_PRESET_RESET_END +1); address++) { - /* - * Once we are done with the loading of our skin, we need to - * change the smartmedia start addresses. - */ - switch (address) { - case ADDRESS_HELP_START: - smartmedia_address = SMARTMEDIA_ADDRESS_HELP_START; - smartmedia_address_mask = SMARTMEDIA_ADDRESS_HELPMASK_START; - stage = STAGE_LOAD_HELP; - break; - case ADDRESS_GRAPHMASK_START: - smartmedia_address_mask = SMARTMEDIA_ADDRESS_GRAPHMASK_START; - stage = STAGE_LOAD_GRAPH; - break; - case ADDRESS_PRESET_DEMO_START: - smartmedia_address_mask = SMARTMEDIA_ADDRESS_PRESET_DEMO_START; - stage = STAGE_LOAD_PRESET; - break; - case ADDRESS_PRESET_RESET_START: + while ((ADDRESS_ABOUT_BOTTOM_END +1) != (address_offset +address)) { + if (STAGE_LOAD_PRESET == stage) { + if (ADDRESS_PRESET_RESET_START == (address_offset +address)) { smartmedia_address_mask = SMARTMEDIA_ADDRESS_PRESET_RESET_START; - stage = STAGE_LOAD_PRESET; - break; - default: - break; + } + if (ADDRESS_PRESET_RESET_END == (address_offset +address)) { /* case ADRESS_SKIN_START */ +#if HAVE_DEBUG + print_string(" ADDRESS_SKIN_START");print_eol(); +#endif + address = 0; + address_offset = ADDRESS_SKIN_START; + smartmedia_address = SMARTMEDIA_ADDRESS_SKIN_START; + smartmedia_address_mask = SMARTMEDIA_ADDRESS_SKINMASK_START; + stage = STAGE_LOAD_SKIN; + } + } else { + /* + * Once we are done with the loading of our skin, we need to + * change the smartmedia start addresses. + */ + switch (address_offset +address) { + case ADDRESS_HELP_START: +#if HAVE_DEBUG + print_string(" ADDRESS_HELP_START");print_eol(); +#endif + address = 0; + address_offset = ADDRESS_HELP_START; + smartmedia_address = SMARTMEDIA_ADDRESS_HELP_START; + smartmedia_address_mask = SMARTMEDIA_ADDRESS_HELPMASK_START; + stage = STAGE_LOAD_HELP; + break; + case ADDRESS_GRAPHMASK_START: +#if HAVE_DEBUG + print_string(" ADDRESS_GRAPHMASK_START");print_eol(); +#endif + address = 0; + address_offset = ADDRESS_GRAPHMASK_START; + smartmedia_address_mask = SMARTMEDIA_ADDRESS_GRAPHMASK_START; + stage = STAGE_LOAD_GRAPH; + break; + case ADDRESS_ABOUT_TOP_FONTYS_START: +#if HAVE_DEBUG + print_string(" ADDRESS_ABOUT_TOP_FONTYS_START");print_eol(); +#endif + address = 0; + address_offset = ADDRESS_ABOUT_TOP_FONTYS_START; + smartmedia_address = SMARTMEDIA_ADDRESS_TOP_FONTYS_START; + smartmedia_address_mask = SMARTMEDIA_ADDRESS_TOPMASK_START; + stage = STAGE_LOAD_TOP_FONTYS; + break; + case ADDRESS_ABOUT_TOP_TASS_START: +#if HAVE_DEBUG + print_string(" ADDRESS_ABOUT_TOP_TASS_START");print_eol(); +#endif + address = 0; + address_offset = ADDRESS_ABOUT_TOP_TASS_START; + smartmedia_address = SMARTMEDIA_ADDRESS_TOP_TASS_START; + smartmedia_address_mask = SMARTMEDIA_ADDRESS_TOPMASK_START; + stage = STAGE_LOAD_TOP_TASS; + break; + case ADDRESS_ABOUT_TOP_TRANSFER_START: +#if HAVE_DEBUG + print_string(" ADDRESS_ABOUT_TOP_TRANSFER_START");print_eol(); +#endif + address = 0; + address_offset = ADDRESS_ABOUT_TOP_TRANSFER_START; + smartmedia_address = SMARTMEDIA_ADDRESS_TOP_TRANSFER_START; + smartmedia_address_mask = SMARTMEDIA_ADDRESS_TOPMASK_START; + stage = STAGE_LOAD_TOP_TRANSFER; + break; + case ADDRESS_ABOUT_TOP_CELOXICA_START: +#if HAVE_DEBUG + print_string(" ADDRESS_ABOUT_TOP_CELOXICA_START");print_eol(); +#endif + address = 0; + address_offset = ADDRESS_ABOUT_TOP_CELOXICA_START; + smartmedia_address = SMARTMEDIA_ADDRESS_TOP_CELOXICA_START; + smartmedia_address_mask = SMARTMEDIA_ADDRESS_TOPMASK_START; + stage = STAGE_LOAD_TOP_CELOXICA; + break; +/* + case ADDRESS_ABOUT_TOP_DETAILS_START: + address = 0; + address_offset = ADDRESS_ABOUT_TOP_DETAILS_START; + smartmedia_address = SMARTMEDIA_ADDRESS_TOP_DETAILS_START; + smartmedia_address_mask = SMARTMEDIA_ADDRESS_TOPMASK_START; + stage = STAGE_LOAD_TOP_DETAILS; + break; +*/ + case ADDRESS_ABOUT_BOTTOM_START: +#if HAVE_DEBUG + print_string(" ADDRESS_ABOUT_BOTTOM_START");print_eol(); +#endif + address = 0; + address_offset = ADDRESS_ABOUT_BOTTOM_START; + smartmedia_address = SMARTMEDIA_ADDRESS_BOTTOM_START; + smartmedia_address_mask = SMARTMEDIA_ADDRESS_BOTTOMMASK_START; + stage = STAGE_LOAD_ABOUT_BOTTOM; + break; + default: + break; + } } /* @@ -136,7 +214,7 @@ void smartmedia_loaddata(skindata_t *skindata) { * address pointer to the address from our loop. */ #if HAVE_SMARTMEDIA - PalPL2RAMSetWriteAddress(RAM_BANK0, address); + PalPL2RAMSetWriteAddress(RAM_BANK0, (STAGE_LOAD_GRAPH == stage) ? (address_offset +(0 @ (address \\ 2))) : (address_offset +address)); //(STAGE_LOAD_PRESET == stage) ? (address_offset +(0 @ (address \\ 2))) : #else PalPL2RAMSetWriteAddress(RAM_BANK0, 0); #endif @@ -153,7 +231,7 @@ void smartmedia_loaddata(skindata_t *skindata) { * stop reading after each byte with OperationEnd call. This is * VERY slow and must be changed. */ - if ((STAGE_LOAD_SKIN == stage) || (STAGE_LOAD_HELP == stage)) { + if ((STAGE_LOAD_PRESET != stage) && (STAGE_LOAD_GRAPH != stage)) { RC200SmartMediaSetAddress(READ, smartmedia_address); RC200SmartMediaRead(&r, TRUE); RC200SmartMediaOperationEnd(&result); @@ -164,22 +242,41 @@ void smartmedia_loaddata(skindata_t *skindata) { RC200SmartMediaRead(&b, TRUE); RC200SmartMediaOperationEnd(&result); } + + if (STAGE_LOAD_GRAPH == stage) { + RC200SmartMediaSetAddress(READ, smartmedia_address_mask +1); + RC200SmartMediaRead(&r, TRUE); + RC200SmartMediaOperationEnd(&result); + RC200SmartMediaSetAddress(READ, (smartmedia_address_mask +2)); + RC200SmartMediaRead(&g, TRUE); + RC200SmartMediaOperationEnd(&result); + RC200SmartMediaSetAddress(READ, (smartmedia_address_mask +3)); + RC200SmartMediaRead(&b, TRUE); + RC200SmartMediaOperationEnd(&result); + } + RC200SmartMediaSetAddress(READ, smartmedia_address_mask); RC200SmartMediaRead(&mask, TRUE); RC200SmartMediaOperationEnd(&result); switch (stage) { - case STAGE_LOAD_SKIN: - data = 0 @ mask @ r @ g @ b; + case STAGE_LOAD_PRESET: + presets_default_values[address <- 10] = mask; break; - case STAGE_LOAD_HELP: + case STAGE_LOAD_SKIN: /* fall through */ + case STAGE_LOAD_HELP: /* fall through */ + case STAGE_LOAD_GRAPH: /* fall through */ + case STAGE_LOAD_TOP_FONTYS: /* fall through */ + case STAGE_LOAD_TOP_TASS: /* fall through */ + case STAGE_LOAD_TOP_TRANSFER: /* fall through */ + case STAGE_LOAD_TOP_CELOXICA: /* fall through */ + case STAGE_LOAD_TOP_DETAILS: /* fall through */ + case STAGE_LOAD_ABOUT_BOTTOM: data = 0 @ mask @ r @ g @ b; break; - case STAGE_LOAD_GRAPH: - data = (unsigned DW)(0 @ mask) << 24; - break; - case STAGE_LOAD_PRESET: - presets_default_values[(address -ADDRESS_PRESET_DEMO_START) <- 10] = mask; + // case STAGE_LOAD_GRAPH: + // data = ((address <- 2) ? ((data << 8) +(0 @ mask)) : (0 @ mask)); + // break; } #else @@ -194,10 +291,10 @@ void smartmedia_loaddata(skindata_t *skindata) { /* * Print some nice stats about data loading. */ - if (!(address <- 10)) { + if (!((address_offset +address) <- 10)) { print_cr(); - print_hex_value(0 @ (address \\ 11)); - print_string(" / 000001C2 | data: "); + print_hex_value(0 @ ((address_offset +address) \\ 11)); + print_string(" / 000001D7 | data: "); print_hex_value(data <- 32); } #endif @@ -206,7 +303,12 @@ void smartmedia_loaddata(skindata_t *skindata) { * Finally increase al our indexes approperiatly. */ smartmedia_address += 3; - smartmedia_address_mask++; + if (STAGE_LOAD_GRAPH == stage) { + smartmedia_address_mask += 4; + } else { + smartmedia_address_mask++; + } + address++; } /* -- cgit v0.12