summaryrefslogtreecommitdiffstats
path: root/Graphic_Equalizer/src/display.hcc
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2004-11-11 10:27:31 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2004-11-11 10:27:31 (GMT)
commit9877678730e53e9ee99241a8ab5babe35eacf28d (patch)
tree275313725d8a1816a665b892c6116549e26f24a7 /Graphic_Equalizer/src/display.hcc
parent51085a870cc074c3eeef5a6ba1b45503ce0e0f4d (diff)
downloadTASS-9877678730e53e9ee99241a8ab5babe35eacf28d.zip
TASS-9877678730e53e9ee99241a8ab5babe35eacf28d.tar.gz
TASS-9877678730e53e9ee99241a8ab5babe35eacf28d.tar.bz2
Diffstat (limited to 'Graphic_Equalizer/src/display.hcc')
-rw-r--r--Graphic_Equalizer/src/display.hcc92
1 files changed, 58 insertions, 34 deletions
diff --git a/Graphic_Equalizer/src/display.hcc b/Graphic_Equalizer/src/display.hcc
index 12f440c..3260990 100644
--- a/Graphic_Equalizer/src/display.hcc
+++ b/Graphic_Equalizer/src/display.hcc
@@ -34,7 +34,17 @@
-/*! \fn void display_main(events_t *events, mousedata_t *mousedata, ClockRate, RAM_BANK0);
+/*
+ * Channel to notify others when new mousedata is available. If so
+ * Then mousedata struct is updated with shared data.
+ */
+chan unsigned 1 maskupdate_notification;
+
+
+
+/*! \fn void display_main(events_t *events,
+ * mousedata_t *mousedata, ClockRate, RAM_BANK0);
+ *
* \brief This routine handles all drawing of pixels. It never returns!
*
* \param events_t *events struct with all events.
@@ -44,13 +54,12 @@
* \return Never Returns.
* \retval void
*/
-macro proc display_main(events, mousedata, CLOCKRATE, RAM_BANK0) {
+macro proc display_main(events, mousedata, CLOCKRATE, VIDEOOUT, RAM_BANK0) {
/*
* Setup macro's RAM/Video handles and to coordinate pixel writing.
*/
macro expr DW = PalPL2RAMGetMaxDataWidthCT();
macro expr AW = PalPL2RAMGetMaxAddressWidthCT();
- macro expr VIDEOOUT = PalVideoOutOptimalCT(CLOCKRATE);
macro expr VISIBLEX = PalVideoOutGetVisibleX(VIDEOOUT, CLOCKRATE);
macro expr TOTALX = PalVideoOutGetTotalX(VIDEOOUT, CLOCKRATE);
macro expr TOTALY = PalVideoOutGetTotalY(VIDEOOUT);
@@ -66,7 +75,7 @@ macro proc display_main(events, mousedata, CLOCKRATE, RAM_BANK0) {
* 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 && HAVE_SMARTMEDIA
+#if (USE_MASK_ONLY && HAVE_SMARTMEDIA)
#define PIXEL (0 @ pixeldata[31:24])
#else
#define PIXEL (pixeldata <- 24)
@@ -82,16 +91,20 @@ macro proc display_main(events, mousedata, CLOCKRATE, RAM_BANK0) {
for (;;) {
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.
+ * 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);
-/*
+
+ /*
+ * Determin what to draw where here.
+ */
switch (pixeldata[31:24]) {
case AREA_VOLUME_YAXIS:
- if (SCANY <= 0 @ events->volume_position) {
+ if (SCANY >= 0 @ events.volume_position) {
PalVideoOutWrite(VIDEOOUT, PIXEL_VOLUME_YAXIS);
} else {
PalVideoOutWrite(VIDEOOUT, PIXEL);
@@ -100,52 +113,63 @@ macro proc display_main(events, mousedata, CLOCKRATE, RAM_BANK0) {
default:
PalVideoOutWrite(VIDEOOUT, PIXEL);
break;
- }*/
- // PalVideoOutWrite(VIDEOOUT, pixeldata <- 24));
- print_hex_value(pixeldata <- 32);
+ }
/*
- *
- if ((SCANX == 0 @ mousedata->x) && (SCANY == 0 @ mousedata->y)) {
- events->mask = pixeldata[31:24];
+ * We compare our current X and Y scan positions of the
+ * output to the x and y data of the mouse. When those
+ * are equal we set the current mask to the mask stored
+ * in memory at that location. We then know what mask
+ * is to be used for events.
+ */
+ if (MOUSE_UPDATED == mousedata.status) {
+ if ((SCANX == 0 @ mousedata.x) && (SCANY == 0 @ mousedata.y)) {
+ par {
+ events.mask = pixeldata[31:24];
+ maskupdate_notification ! MOUSE_UPDATED;
+ mousedata.status = MOUSE_NOT_UPDATED;
+ }
+ } else {
+ delay;
+ }
} else {
delay;
}
/*
- * 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.
+ * 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 ((SCANX > (VISIBLEX - 4)) && (SCANX <= (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.
+ * 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 (SCANY == (TOTALY -1)) {
/*
- * The reset address is determined by the help
- * bit.
+ * The reset address is determined by
+ * the help bit.
*/
- address = 0;//(events->help) ? ADDRESS_HELP_START : ADDRESS_SKIN_START;
+ 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.
+ * We should not ever get inhere. To
+ * keep everything consequent however,
+ * we add a delay.
*/
delay;
}
} else {
/*
- * Increase the memory counter for each pixel drawn
- * thus keeping the memory location in sync with
- * the current pixel position.
+ * Increase the memory counter for each pixel
+ * drawn thus keeping the memory location in
+ * sync with the current pixel position.
*/
address++;
}