![](http://datasheet.mmic.net.cn/260000/PPSMMANUAL_datasheet_15946768/PPSMMANUAL_36.png)
6-14
Using Using Graphics Tools
Programmer’s Manual
U16 oldWidth2, oldHeight2;
U32 tempScreen = (U32)GetScreenMem(64, 64);
/* Direct all graphic routine to memory area pointed by
tempScreen with width 64 pixels and height 64 pixels */
ChangeWindow(tempScreen, 64, 64, &oldScreen1, &oldWidth1, &oldHeight1);
/* This may be any routine for calculating the co-ordinates to
be drawn or drawing anything by calling graphics routines */
DoCalculation();
/* Direct all graphic routine back to original panning screen */
ChangeWindow(oldScreen1, oldWidth1, oldHeight1, &oldScreen2, &oldWidth2,
&oldHeight2);
6.15
Change Panning Screen Parameters
STATUS
ChangePanning
(P_PAN_SCREEN newPanning U16 flag
P_PAN_SCREEN oldPanning)
ChangePanning() allows applications to change the active panning screen to
another memory area during run-time. The flag is to indicate whether the old
panning screen is still needed or it will be destroyed.
P_PAN_SCREEN is a pointer to structure PAN_SCREEN which has the following
elements:
Table 12-11 Panning Screen Parameters
Name
Description
panAddress
The memory address where panning
screen origin is located. All graphics
routines will draw in the area relative to
this address.
horzSize
The panning screen width in number of
pixels.
vertSize
The panning screen height in number of
pixels.
displayXOrigin
The x-coordinate of the LCD display
screen relative to the panning screen.
In normal case, when ChangeWindow() is
not called, displayXOriginand
displayYOriginare used to calculate the
value of displayScreenAdd
rand
regPOSR
.
displayYOrigin
The y-coordinate of the LCD display
screen relative to the panning screen.
In normal case, when ChangeWindow() is
not called, displayXOriginand
displayYOriginare used to calculate the
value of displayScreenAdd
rand
regPOSR
.
Personal Portable System Manager
Programmer’s Manual
6-15
Upon start-up, panAddress
displayXOrigin and displayYOrigin
bits per pixel display or horzSize16 for a 1 bit per pixel display.
/8 for a 2
When DisplayMove() is called, both
modified so that the system will know from which word and from which pixel
position within the word the LCD display screen should start mapping.
will be
When ChangeWindow() is called,
changed so that all graphics routines will use these 3 parameters for calculation
and image processing.
will be
If all or several tasks in a system want to share a common panning screen to save
memory, the following steps can be followed:
1)
In main()
call GetScreenMem() to create a memory area for the common
panning screen
call ChangePanning() to free the PPSM system panning screen
for each task that shares the common panning screen, call
AdvTaskCreate() with parameter PPSM_NOSCREEN to create
the task with no panning screen
for each corresponding task that shares the common panning
screen
during initialization, call ChangePanning() with
2)
displayScreenAddr
regPOSR
regPSW
Table 12-11 Panning Screen Parameters
Name
Description
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.