summaryrefslogtreecommitdiffstats
path: root/Graphic_Equalizer/src/display.hcc
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2004-11-10 12:45:18 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2004-11-10 12:45:18 (GMT)
commit9451e82004bb59a95d9589058759169c1c486c91 (patch)
tree991c9238e4290ed097f0d02494dc80c0f10c68f1 /Graphic_Equalizer/src/display.hcc
parentb7b9f1ff4da4dae9d4c14ee5e03a7555b254c31c (diff)
downloadTASS-9451e82004bb59a95d9589058759169c1c486c91.zip
TASS-9451e82004bb59a95d9589058759169c1c486c91.tar.gz
TASS-9451e82004bb59a95d9589058759169c1c486c91.tar.bz2
First Real Version
Diffstat (limited to 'Graphic_Equalizer/src/display.hcc')
-rw-r--r--Graphic_Equalizer/src/display.hcc140
1 files changed, 140 insertions, 0 deletions
diff --git a/Graphic_Equalizer/src/display.hcc b/Graphic_Equalizer/src/display.hcc
new file mode 100644
index 0000000..8be1f2e
--- /dev/null
+++ b/Graphic_Equalizer/src/display.hcc
@@ -0,0 +1,140 @@
+/*! \file display.hcc
+ *
+ * \section generic Message build up information and more
+ *
+ * \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
+ *
+ ********************************************************************/
+
+/******** System Includes *************/
+#include <stdlib.hch>
+
+#include "pal_master.hch"
+
+/******** Application Includes ********/
+#include "configuration.hch"
+#include "display.hch"
+#include "eventhandler_shared.hch"
+
+
+
+/*! \fn void display_main(events_t *events, mousedata_t *mousedata);
+ * \brief This routine handles all drawing of pixels. It never returns!
+ *
+ * \param events_t *events pointer to struct with all events.
+ * \param mousedata_t *mousedata pointer to struct with coordinates to
+ * current X en Y.
+ *
+ * \return Never Returns.
+ * \retval void
+ */
+void display_main(events_t *events, mousedata_t *mousedata) {
+ /*
+ * Setup macro's RAM/Video handles and to coordinate pixel writing.
+ */
+ macro expr RAM_BANK0 = PalPL2RAMCT(0);
+ macro expr VideoOut = PalVideoOutOptimalCT(ClockRate);
+ macro expr VisibleX = PalVideoOutGetVisibleX (VideoOut, ClockRate);
+ macro expr TotalX = PalVideoOutGetTotalX (VideoOut, ClockRate);
+ macro expr TotalY = PalVideoOutGetTotalY (VideoOut);
+ macro expr X = PalVideoOutGetX (VideoOut);
+ macro expr Y = PalVideoOutGetY (VideoOut);
+
+ unsigned AW address;
+ unsigned DW pixeldata;
+
+/*
+ * To draw something usefull when only drawing our mask, we simply draw the
+ * mask itself. Thus creating a blueish image to help identify all interesting
+ * area's on the screen. Otherwise we only use the last 24 bits, the RGB values
+ * to draw on the screen.
+ */
+#if USE_MASK_ONLY
+#define PIXEL (0 @ pixeldata[31:24])
+#else
+#define PIXEL (pixeldata <- 24)
+#endif
+ /*
+ * Prime Rendering Pipeline to start where the skin starts.
+ */
+ PalPL2RAMSetReadAddress(RAM_BANK0, ADDRESS_SKIN_START);
+
+ /*
+ * Run the following tasks indefinatly and in parallel
+ */
+ par (;;) {
+ /*
+ * Before starting this loop we allready set the the address.
+ * Therefor we can start reading the previously set address and
+ * prepare the next address for the next cycle.
+ */
+ PalPL2RAMRead(RAM_BANK0, &pixeldata);
+ PalPL2RAMSetReadAddress(RAM_BANK0, address);
+
+ switch (pixeldata[31:24]) {
+ case (AREA_VOLUME_YAXIS == pixeldata[31:24]):
+ if (ScanY <= events->volume_position) {
+ PalVideoOutWrite(VideoOut, PIXEL_VOLUME_YAXIS);
+ } else {
+ PalVideoOutWrite(VideoOut, PIXEL);
+ }
+ break;
+ default:
+ PalVideoOutWrite(VideoOut, PIXEL);
+ break;
+ }
+
+ /*
+ */
+ if ((ScanX == mousedata->x) && (ScanY == mousedata->y)) {
+ events->mask = pixeldata[31:24];
+ }
+
+ /*
+ * The current position of the screen can lay in an area called
+ * the blanking area. We don't have data for this area as it is
+ * not drawn. We therefor have to determin wether we are beyond
+ * the visible area of the screen, but before the end of the
+ * total width of the screen.
+ * Our pipeline consists of 4 total stages. Therefor we have to
+ * substract 4 pixels.
+ */
+ if ((X > (VisibleX - 4)) && (X <= (TotalX - 4))) {
+ /*
+ * We are in the blanking area of the screen. If we are
+ * on the last line, and thus last pixel we reset our
+ * address counter.
+ */
+ if (Y == (TotalY -1)) {
+ /*
+ * The reset address is determined by the help
+ * bit. FIXME: This needs come from a struct.
+ */
+ address = (events->help) ? ADDRESS_HELP_START : ADDRESS_SKIN_START;
+ } else {
+ /*
+ * We should not ever get inhere. To keep
+ * everything consequent however, we add a
+ * a delay.
+ */
+ delay;
+ }
+ } else {
+ /*
+ * Increase the memory counter for each pixel drawn
+ * thus keeping the memory location in sync with
+ * the current pixel position.
+ */
+ address++;
+ }
+} /* --- display_main() --- */