summaryrefslogtreecommitdiffstats
path: root/Graphic_Equalizer/src
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2004-10-13 14:41:25 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2004-10-13 14:41:25 (GMT)
commitaf5a259129437cd0ed97186cf7a12e8be17767ec (patch)
tree3dc72d75a0773e68e2e8d1ea72facb9615b1bbcd /Graphic_Equalizer/src
parenta03854f45e76fa41f007536b8c858e2d0aa93f2d (diff)
downloadTASS-af5a259129437cd0ed97186cf7a12e8be17767ec.zip
TASS-af5a259129437cd0ed97186cf7a12e8be17767ec.tar.gz
TASS-af5a259129437cd0ed97186cf7a12e8be17767ec.tar.bz2
Mousedriver no longer uses mpram, but a 3 elemented struct to move data around the application. (mpram is only for multiple clock domains and the audio domain doesn't need to know the position of the mouse anyway)
Diffstat (limited to 'Graphic_Equalizer/src')
-rw-r--r--Graphic_Equalizer/src/display/display.hcc15
-rw-r--r--Graphic_Equalizer/src/display/mousedriver.hcc52
2 files changed, 40 insertions, 27 deletions
diff --git a/Graphic_Equalizer/src/display/display.hcc b/Graphic_Equalizer/src/display/display.hcc
index 583cb7f..48dd78c 100644
--- a/Graphic_Equalizer/src/display/display.hcc
+++ b/Graphic_Equalizer/src/display/display.hcc
@@ -38,8 +38,19 @@
*/
static macro proc display_main(VideoOut) {
unsigned 24 Pixel;
+
+ /*
+ * These macro's are used to efficiently get the current X ScanLine
+ * and Y ScanLine.
+ */
+ macro expr ScanX = PalVideoOutGetX (VideoOut);
+ macro expr ScanY = PalVideoOutGetY (VideoOut);
- for (Pixel = 0;; Pixel++) {
- PalVideoOutWrite(VideoOut, Pixel);
+ for (Pixel = 0;; Pixel += 26214) {
+ if (ScanX < 641) {
+ PalVideoOutWrite(VideoOut, Pixel);
+ } else {
+ Pixel = 0;
+ }
}
} /* --- display_main() --- */
diff --git a/Graphic_Equalizer/src/display/mousedriver.hcc b/Graphic_Equalizer/src/display/mousedriver.hcc
index b257c88..682e2b0 100644
--- a/Graphic_Equalizer/src/display/mousedriver.hcc
+++ b/Graphic_Equalizer/src/display/mousedriver.hcc
@@ -32,8 +32,8 @@
* Mouse data is stored in shared memory. When new mouse data is available
* Mouse notification is triggerd.
*/
-mpram SharedMemory MouseData;
-chan unsigned 1 MouseDataNotification;
+struct mousedata_s mousedata;
+chan unsigned 1 mousedata_notification;
/*! \fn void mouse_main(void);
* \brief Main mousedriver. This function never returns! It calls the
@@ -47,14 +47,16 @@ chan unsigned 1 MouseDataNotification;
*/
void mouse_main(void) {
unsigned 14 touch_sampler;
- unsigned 10 X, oldX;
- unsigned 9 Y, oldY;
- unsigned 3 MouseState, OldMouseState;
- unsigned 1 Touch, touched, oldtouched;
+ unsigned 10 x, oldy;
+ unsigned 9 y, oldx;
+ unsigned 3 mouse_state, oldmousestate;
+ unsigned 1 touch, touched, oldtouched;
/*
* We only check for mouse states once every 2^14 time. This to
- * overcome the sampling of the 'Touch' state of the RC200 libs
+ * overcome the sampling of the 'Touch' state of the RC200 libs. When
+ * using newer libs this might be overkill, e.g. smaller values may due
+ * or sampling all together will be redundant.
*/
for(touch_sampler = 1;;touch_sampler++) {
if (!touch_sampler) {
@@ -65,24 +67,24 @@ void mouse_main(void) {
*/
if (touched) {
if(oldtouched) {
- MouseState = MOUSE_STATE_DOWN;
+ mousestate = MOUSE_STATE_DOWN;
} else {
- MouseState = MOUSE_STATE_ON_PRESS;
+ mousestate = MOUSE_STATE_ON_PRESS;
}
- oldtouched = 1;
+ oldtouched = TRUE;
} else {
if(oldtouched) {
- MouseState = MOUSE_STATE_ON_RELEASE;
+ mousestate = MOUSE_STATE_ON_RELEASE;
} else {
- MouseState = MOUSE_STATE_UP;
+ mousestate = MOUSE_STATE_UP;
}
- oldtouched = 0;
+ oldtouched = FALSE;
}
/*
* We have now processed our Touch. Reset it for the
* next run.
*/
- touched = 0;
+ touched = FALSE;
/*
* Compare Previous States and Coordinates to determine
@@ -90,14 +92,14 @@ void mouse_main(void) {
* shared memory, notify the listening processes and
* Set the new as previous values for the next run.
*/
- if ((OldMouseState != MouseState) || (oldX != X) || (oldY != Y)) {
- MouseData.ReadWrite[MOUSE_POSITION_X] = 0 @ X;
- MouseData.ReadWrite[MOUSE_POSITION_Y] = 0 @ Y;
- MouseData.ReadWrite[MOUSE_STATE] = 0 @ MouseState;
- MouseDataNotification ! MOUSE_UPDATED;
- oldX = X;
- oldY = Y;
- OldMouseState = MouseState;
+ if ((oldmousestate != mousestate) || (oldx != x) || (oldy != y)) {
+ mousedata.x = x;
+ mousedata.y = y;
+ mousedata.state = mousestate;
+ mousedata_notification ! MOUSE_UPDATED;
+ oldx = x;
+ oldy = y;
+ oldmousestate = mousestate;
}
}
@@ -106,9 +108,9 @@ void mouse_main(void) {
* the display was touched. If touched store this in a local
* store. This we do to catch the sampling of the RC200 lib.
*/
- RC200TouchScreenReadScaled(&X, &Y, &Touch);
- if (Touch) {
- touched = 1;
+ RC200TouchScreenReadScaled(&x, &y, &touch);
+ if (touch) {
+ touched = TRUE;
}
}
} /* --- mouse_main_loop() --- */