summaryrefslogtreecommitdiffstats
path: root/Graphic_Equalizer/src
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2004-11-01 15:08:38 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2004-11-01 15:08:38 (GMT)
commit495b53f424ba517f6f37cfcb45ff8905b9a972d9 (patch)
tree6ed2b77f48a0bed292761eeed5d2fea49dab28d1 /Graphic_Equalizer/src
parentc515ffa43d033a2e49c5bfab71ee75dc1721958a (diff)
downloadTASS-495b53f424ba517f6f37cfcb45ff8905b9a972d9.zip
TASS-495b53f424ba517f6f37cfcb45ff8905b9a972d9.tar.gz
TASS-495b53f424ba517f6f37cfcb45ff8905b9a972d9.tar.bz2
Created Initial Configuration file and added Current SmartMedia Data.
The display routine has been updated to draw whatever is currently in the ram.
Diffstat (limited to 'Graphic_Equalizer/src')
-rw-r--r--Graphic_Equalizer/src/display/display.hcc91
1 files changed, 65 insertions, 26 deletions
diff --git a/Graphic_Equalizer/src/display/display.hcc b/Graphic_Equalizer/src/display/display.hcc
index 0440ffe..2dfc669 100644
--- a/Graphic_Equalizer/src/display/display.hcc
+++ b/Graphic_Equalizer/src/display/display.hcc
@@ -26,45 +26,84 @@
-/*! \fn void display_main(void);
+/*! \fn void display_main(RAM_BANK0, RAM_BANK1);
* \brief This routine handles all drawing of pixels. It never returns!
*
- * \param void None.
+ * \param PL2RAM RAM_BANK0 Handle to the first rambank.
+ * \param PL2RAM RAM_BANK1 Handle to the second rambank.
*
* \return Never Returns.
* \retval void
*/
-void display_main(void) {
- /* Set VideoOut Pointer */
+macro void display_main(RAM_BANK0, RAM_BANK1) {
+ /*
+ * Setup macro's to coordinate pixel writing.
+ */
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 32 pixeldata;
+ unsigned AW nextaddr;
+ unsigned DW pixeldata;
+ unsigned 1 SwitchData, help;
- unsigned 24 pixel;
- unsigned 20 pixels;
-#if 0
- unsigned 8 r, g, b;
-#endif
+ /*
+ * Prime Rendering Pipeline to start at bank 0 address 0.
+ */
+ PalPL2RAMSetReadAddress(RAM_BANK0, 0);
/*
- * These macro's are used to efficiently get the current X ScanLine
- * and Y ScanLine.
+ * Run the following tasks indefinatly and in parallel
*/
- macro expr ScanX = PalVideoOutGetX(VideoOut);
- macro expr ScanY = PalVideoOutGetY(VideoOut);
+ par (;;) {
+ /*
+ * We write only the last 24 bits of pixeldata as it also
+ * contains information about the mask.
+ */
+ PalVideoOutWrite(VideoOut, pixeldata <- 24);
+
+ /* FIXME this needs to be replaced by a global state array */
+ PalSwitchRead(PalSwitchCT(0), &help);
+ /*
+ * When 'help' is activated, we display data from rambank 1
+ * otherwise we draw from rambank 0.
+ */
+ if (help) {
+ PalPL2RAMRead(RAM_BANK1, &Data);
+ PalPL2RAMSetReadAddress(RAM_BANK1, nextaddr);
+ } else {
+ PalPL2RAMRead(PL2RAM_BANK0, &Data);
+ PalPL2RAMSetReadAddress(RAM_BANK0, nextaddr);
+ }
-#if 0
- r = 0;
- g = 0;
- b = 0;
- pixel = r @ g @ b;
-#endif
- for (pixels = 1;; pixels++) {
/*
- * If we wrote to all pixels we change the color.
+ * 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 5 total stages. Therefor we have to
+ * substract 5 pixels.
*/
- if ((640 * 480) == pixels) {
- pixels = 0;
- pixel++;
+ if ((X > (VisibleX - 5)) && (X <= (TotalX - 5))) {
+ /*
+ * 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)) {
+ nextaddr = 0;
+ }
+ } else {
+ /*
+ * Increase the memory counter for each pixel drawn
+ * thus keeping the memory location in sync with
+ * the current pixel position.
+ */
+ nextaddr++;
}
- PalVideoOutWrite(VideoOut, pixel);
- }
} /* --- display_main() --- */