Fix IO memory access .. SB128 driver makes noises in VMWare - CMI is untested (Curren...
[AROS.git] / rom / graphics / scrollvport.c
blobfb5522bb7b71e3ca17294bd26bca3f83edc59955
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function ScrollVPort()
6 Lang: english
7 */
9 #include <aros/debug.h>
10 #include <proto/oop.h>
12 #include "graphics_intern.h"
13 #include "gfxfuncsupport.h"
15 /*****************************************************************************
17 NAME */
18 #include <proto/graphics.h>
20 AROS_LH1(void, ScrollVPort,
22 /* SYNOPSIS */
23 AROS_LHA(struct ViewPort *, vp, A0),
25 /* LOCATION */
26 struct GfxBase *, GfxBase, 98, Graphics)
28 /* FUNCTION
30 INPUTS
32 RESULT
34 NOTES
35 AROS video drivers can perform a validation of offsets, and may refuse
36 to scroll the screen too far (if they somehow can't provide the requested
37 offset). In this case offset values in the ViewPort will be updated in
38 order to reflect the real result of the operation.
40 EXAMPLE
42 BUGS
44 SEE ALSO
46 INTERNALS
48 HISTORY
51 ******************************************************************************/
53 AROS_LIBFUNC_INIT
56 * Bitmap object pointer is contained in struct ViewPortData,
57 * connected to a ViewPortExtra.
58 * This is true even for planar Amiga bitmaps.
60 struct ViewPortExtra *vpe = (struct ViewPortExtra *)GfxLookUp(vp);
62 if (vpe)
64 struct TagItem tags[] =
66 { .ti_Tag = aHidd_BitMap_LeftEdge, .ti_Data = vp->DxOffset, },
67 { .ti_Tag = aHidd_BitMap_TopEdge, .ti_Data = vp->DyOffset, },
68 { .ti_Tag = TAG_DONE, }
70 IPTR offset;
72 /* Actually move the bitmap */
73 OOP_SetAttrs(VPE_DATA(vpe)->Bitmap, tags);
75 /* The bitmap may fail to move. Fix up offsets now */
76 OOP_GetAttr(VPE_DATA(vpe)->Bitmap, aHidd_BitMap_LeftEdge, &offset);
77 vp->DxOffset = offset;
78 OOP_GetAttr(VPE_DATA(vpe)->Bitmap, aHidd_BitMap_TopEdge, &offset);
79 vp->DyOffset = offset;
82 AROS_LIBFUNC_EXIT
83 } /* ScrollVPort */