summaryrefslogtreecommitdiffstats
path: root/Graphic_Equalizer/src/display.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/display.hcc
parentedf01e33d5680018a8c48224b8f7134587f3fcdf (diff)
downloadTASS-51085a870cc074c3eeef5a6ba1b45503ce0e0f4d.zip
TASS-51085a870cc074c3eeef5a6ba1b45503ce0e0f4d.tar.gz
TASS-51085a870cc074c3eeef5a6ba1b45503ce0e0f4d.tar.bz2
Diffstat (limited to 'Graphic_Equalizer/src/display.hcc')
-rw-r--r--Graphic_Equalizer/src/display.hcc150
1 files changed, 82 insertions, 68 deletions
diff --git a/Graphic_Equalizer/src/display.hcc b/Graphic_Equalizer/src/display.hcc
index 8be1f2e..12f440c 100644
--- a/Graphic_Equalizer/src/display.hcc
+++ b/Graphic_Equalizer/src/display.hcc
@@ -23,32 +23,39 @@
/******** Application Includes ********/
#include "configuration.hch"
-#include "display.hch"
#include "eventhandler_shared.hch"
+#include "mouse_shared.hch"
+#include "display_shared.hch"
+#include "display.hch"
+
+#if HAVE_DEBUG
+ #include "debug.hch"
+#endif
-/*! \fn void display_main(events_t *events, mousedata_t *mousedata);
+/*! \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 pointer to struct with all events.
- * \param mousedata_t *mousedata pointer to struct with coordinates to
- * current X en Y.
+ * \param events_t *events struct with all events.
+ * \param mousedata_t *mousedata struct with coordinates to current
+ * X en Y.
*
* \return Never Returns.
* \retval void
*/
-void display_main(events_t *events, mousedata_t *mousedata) {
+macro proc display_main(events, mousedata, CLOCKRATE, RAM_BANK0) {
/*
* 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);
+ 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);
+ macro expr SCANX = PalVideoOutGetX(VIDEOOUT);
+ macro expr SCANY = PalVideoOutGetY(VIDEOOUT);
unsigned AW address;
unsigned DW pixeldata;
@@ -59,7 +66,7 @@ void display_main(events_t *events, mousedata_t *mousedata) {
* 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
+#if USE_MASK_ONLY && HAVE_SMARTMEDIA
#define PIXEL (0 @ pixeldata[31:24])
#else
#define PIXEL (pixeldata <- 24)
@@ -72,69 +79,76 @@ void display_main(events_t *events, mousedata_t *mousedata) {
/*
* 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;
- }
+ 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.
+ */
+ PalPL2RAMRead(RAM_BANK0, &pixeldata);
+ PalPL2RAMSetReadAddress(RAM_BANK0, address);
+/*
+ switch (pixeldata[31:24]) {
+ case AREA_VOLUME_YAXIS:
+ if (SCANY <= 0 @ events->volume_position) {
+ PalVideoOutWrite(VIDEOOUT, PIXEL_VOLUME_YAXIS);
+ } else {
+ PalVideoOutWrite(VIDEOOUT, PIXEL);
+ }
+ break;
+ default:
+ PalVideoOutWrite(VIDEOOUT, PIXEL);
+ break;
+ }*/
+ // PalVideoOutWrite(VIDEOOUT, pixeldata <- 24));
+ print_hex_value(pixeldata <- 32);
- /*
- */
- if ((ScanX == mousedata->x) && (ScanY == mousedata->y)) {
- events->mask = pixeldata[31:24];
- }
+ /*
+ *
+ if ((SCANX == 0 @ mousedata->x) && (SCANY == 0 @ mousedata->y)) {
+ events->mask = pixeldata[31:24];
+ } 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.
- */
- 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.
+ * 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 (Y == (TotalY -1)) {
+ if ((SCANX > (VISIBLEX - 4)) && (SCANX <= (TOTALX - 4))) {
/*
- * The reset address is determined by the help
- * bit. FIXME: This needs come from a struct.
+ * 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.
*/
- address = (events->help) ? ADDRESS_HELP_START : ADDRESS_SKIN_START;
+ if (SCANY == (TOTALY -1)) {
+ /*
+ * The reset address is determined by the help
+ * bit.
+ */
+ address = 0;//(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 {
/*
- * We should not ever get inhere. To keep
- * everything consequent however, we add a
- * a delay.
+ * Increase the memory counter for each pixel drawn
+ * thus keeping the memory location in sync with
+ * the current pixel position.
*/
- delay;
+ address++;
}
- } else {
- /*
- * Increase the memory counter for each pixel drawn
- * thus keeping the memory location in sync with
- * the current pixel position.
- */
- address++;
}
+ }
} /* --- display_main() --- */