2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Display Inside...
10 NOTE: This file is mostly based on XFree86 vgaWH.c sources
13 /****************************************************************************************/
15 #include <proto/exec.h>
17 #include "displayhw.h"
18 #include "displayclass.h"
20 #include <asm/registers.h>
22 /****************************************************************************************/
24 /****************************************************************************************/
26 #define min(a,b) ((a) < (b) ? (a) : (b))
27 #define max(a,b) ((a) > (b) ? (a) : (b))
29 /****************************************************************************************/
33 ** Load specified palette, if NULL load default
35 void DisplayLoadPalette(struct DisplayHWRec
*regs
, unsigned char *pal
)
39 /****************************************************************************************/
43 ** displayHWSaveScreen
44 ** perform a sequencer reset.
46 void DisplaySaveScreen(int start
)
50 /****************************************************************************************/
55 int DisplayBlankScreen(int on
)
60 /****************************************************************************************/
62 #define DisplayIOBase 0x3d0
64 /****************************************************************************************/
68 ** restore a video mode
70 void DisplayRestore(struct displayHWRec
*restore
, BOOL onlyDac
)
74 /****************************************************************************************/
78 ** save the current video mode
80 void * DisplaySave(struct displayHWRec
*save
)
83 return ((void *) save
);
86 /****************************************************************************************/
89 ** Init VGA registers for given displaymode
91 int DisplayInitMode(struct DisplayModeDesc
*mode
, struct displayHWRec
*regs
)
96 /****************************************************************************************/
98 void DisplayRefreshArea(struct bitmap_data
*bmap
, int num
, struct Box
*pbox
)
100 int width
, height
, FBPitch
, left
, right
, i
, j
, SRCPitch
, phase
;
101 register unsigned long m
;
102 unsigned char s1
, s2
, s3
, s4
;
103 unsigned long *src
, *srcPtr
;
104 unsigned char *dst
, *dstPtr
;
106 FBPitch
= RREG_B(LVPW
) * 2;
107 SRCPitch
= bmap
->width
/ 4;
109 left
= pbox
->x1
& ~7;
110 right
= (pbox
->x2
& ~7) + 7;
114 width
= (right
- left
+ 1) >> 3;
115 height
= pbox
->y2
- pbox
->y1
+ 1;
116 src
= (unsigned long*)(bmap
->VideoData
+ (pbox
->y1
* SRCPitch
* 4) + left
);
117 dst
= (unsigned char*)(RREG_L(LSSA
) + (pbox
->y1
* FBPitch
) + (left
/ 8));
119 if((phase
= ((long)dst
& 3L)))
122 if(phase
> width
) phase
= width
;
133 //#define MERGE (m >> 24) | (m >> 15) | (m >> 6) | (m << 3)
134 #define MERGE (m >> 21) | (m >> 14) | (m >> 7) | m
138 m
= (srcPtr
[1] & 0x01010101) | ((srcPtr
[0] & 0x01010101) << 4);
145 m
= (srcPtr
[1] & 0x01010101) | ((srcPtr
[0] & 0x01010101) << 4);
147 m
= (srcPtr
[3] & 0x01010101) | ((srcPtr
[2] & 0x01010101) << 4);
149 m
= (srcPtr
[5] & 0x01010101) | ((srcPtr
[4] & 0x01010101) << 4);
151 m
= (srcPtr
[7] & 0x01010101) | ((srcPtr
[6] & 0x01010101) << 4);
153 *((unsigned long*)dstPtr
) = s4
| (s3
<< 8) | (s2
<< 16) | (s1
<< 24);
161 m
= (srcPtr
[1] & 0x01010101) | ((srcPtr
[0] & 0x01010101) << 4);
169 } /* while(height--) */
176 /****************************************************************************************/