Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xing Lin
qemu
Commits
b8ed223b
Commit
b8ed223b
authored
Oct 30, 2003
by
bellard
Browse files
big endian fixes
git-svn-id:
svn://svn.savannah.nongnu.org/qemu/trunk@437
c046a42c-6fe2-441c-8c8c-71466251a162
parent
c970a162
Changes
1
Hide whitespace changes
Inline
Side-by-side
hw/vga.c
View file @
b8ed223b
...
...
@@ -141,12 +141,24 @@ static const uint8_t gr_mask[16] = {
(((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >> 8) | \
(((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) ))
#ifdef WORD_BIGENDIAN
#ifdef WORD
S
_BIGENDIAN
#define PAT(x) cbswap_32(x)
#else
#define PAT(x) (x)
#endif
#ifdef WORDS_BIGENDIAN
#define BIG 1
#else
#define BIG 0
#endif
#ifdef WORDS_BIGENDIAN
#define GET_PLANE(data, p) (((data) >> (24 - (p) * 8)) & 0xff)
#else
#define GET_PLANE(data, p) (((data) >> ((p) * 8)) & 0xff)
#endif
static
const
uint32_t
mask16
[
16
]
=
{
PAT
(
0x00000000
),
PAT
(
0x000000ff
),
...
...
@@ -168,7 +180,7 @@ static const uint32_t mask16[16] = {
#undef PAT
#ifdef WORD_BIGENDIAN
#ifdef WORD
S
_BIGENDIAN
#define PAT(x) (x)
#else
#define PAT(x) cbswap_32(x)
...
...
@@ -465,11 +477,7 @@ static uint32_t vga_mem_readb(uint32_t addr)
if
(
!
(
s
->
gr
[
5
]
&
0x08
))
{
/* read mode 0 */
plane
=
s
->
gr
[
4
];
#ifdef WORD_BIGENDIAN
ret
=
(
s
->
latch
>>
(
24
-
(
plane
*
8
)))
&
0xff
;
#else
ret
=
(
s
->
latch
>>
(
plane
*
8
))
&
0xff
;
#endif
ret
=
GET_PLANE
(
s
->
latch
,
plane
);
}
else
{
/* read mode 1 */
ret
=
(
s
->
latch
^
mask16
[
s
->
gr
[
2
]])
&
mask16
[
s
->
gr
[
7
]];
...
...
@@ -641,18 +649,6 @@ void vga_mem_writel(uint32_t addr, uint32_t val)
vga_mem_writeb
(
addr
+
3
,
(
val
>>
24
)
&
0xff
);
}
#ifdef WORD_BIGENDIAN
#define BIG 1
#else
#define BIG 0
#endif
#ifdef WORDS_BIGENDIAN
#define GET_PLANE(data, p) (((data) >> (24 - (p) * 8)) & 0xff)
#else
#define GET_PLANE(data, p) (((data) >> ((p) * 8)) & 0xff)
#endif
typedef
void
vga_draw_glyph8_func
(
uint8_t
*
d
,
int
linesize
,
const
uint8_t
*
font_ptr
,
int
h
,
uint32_t
fgcol
,
uint32_t
bgcol
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment