Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
3be104e0
Commit
3be104e0
authored
May 23, 2000
by
Ove Kaaven
Committed by
Alexandre Julliard
May 23, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved DirectDrawPalette handling (set it on init, not every time it
changes). Added VGA_WriteChars() function.
parent
ce23e9b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
vga.c
graphics/vga.c
+26
-3
vga.h
include/vga.h
+1
-0
No files found.
graphics/vga.c
View file @
3be104e0
...
...
@@ -47,6 +47,11 @@ HANDLE VGA_AlphaConsole(void)
return
GetStdHandle
(
STD_OUTPUT_HANDLE
);
}
char
*
VGA_AlphaBuffer
(
void
)
{
return
DOSMEM_MapDosToLinear
(
0xb8000
);
}
/*** GRAPHICS MODE ***/
int
VGA_SetMode
(
unsigned
Xres
,
unsigned
Yres
,
unsigned
Depth
)
...
...
@@ -80,6 +85,8 @@ int VGA_SetMode(unsigned Xres,unsigned Yres,unsigned Depth)
lpddraw
=
NULL
;
return
1
;
}
FIXME
(
"no default palette entries
\n
"
);
IDirectDrawSurface_SetPalette
(
lpddsurf
,
lpddpal
);
vga_refresh
=
0
;
/* poll every 20ms (50fps should provide adequate responsiveness) */
VGA_InstallTimer
(
20
);
...
...
@@ -101,8 +108,11 @@ void VGA_Exit(void)
{
if
(
lpddraw
)
{
VGA_DeinstallTimer
();
IDirectDrawSurface_SetPalette
(
lpddsurf
,
NULL
);
IDirectDrawSurface_Release
(
lpddsurf
);
lpddsurf
=
NULL
;
IDirectDrawPalette_Release
(
lpddpal
);
lpddpal
=
NULL
;
IDirectDraw_Release
(
lpddraw
);
lpddraw
=
NULL
;
}
...
...
@@ -112,7 +122,6 @@ void VGA_SetPalette(PALETTEENTRY*pal,int start,int len)
{
if
(
!
lpddraw
)
return
;
IDirectDrawPalette_SetEntries
(
lpddpal
,
0
,
start
,
len
,
pal
);
IDirectDrawSurface_SetPalette
(
lpddsurf
,
lpddpal
);
}
void
VGA_SetQuadPalette
(
RGBQUAD
*
color
,
int
start
,
int
len
)
...
...
@@ -128,7 +137,6 @@ void VGA_SetQuadPalette(RGBQUAD*color,int start,int len)
pal
[
c
].
peFlags
=
0
;
}
IDirectDrawPalette_SetEntries
(
lpddpal
,
0
,
start
,
len
,
pal
);
IDirectDrawSurface_SetPalette
(
lpddsurf
,
lpddpal
);
}
LPSTR
VGA_Lock
(
unsigned
*
Pitch
,
unsigned
*
Height
,
unsigned
*
Width
,
unsigned
*
Depth
)
...
...
@@ -193,6 +201,21 @@ void VGA_GetCursorPos(unsigned*X,unsigned*Y)
if
(
Y
)
*
Y
=
info
.
dwCursorPosition
.
Y
;
}
void
VGA_WriteChars
(
unsigned
X
,
unsigned
Y
,
unsigned
ch
,
int
attr
,
int
count
)
{
unsigned
XR
,
YR
;
char
*
dat
;
VGA_GetAlphaMode
(
&
XR
,
&
YR
);
dat
=
VGA_AlphaBuffer
()
+
((
XR
*
Y
+
X
)
*
2
);
/* FIXME: also call WriteConsoleOutputA, for better responsiveness */
while
(
count
--
)
{
*
dat
++
=
ch
;
if
(
attr
>=
0
)
*
dat
=
attr
;
dat
++
;
}
}
/*** CONTROL ***/
void
CALLBACK
VGA_Poll
(
ULONG_PTR
arg
)
...
...
@@ -224,7 +247,7 @@ void CALLBACK VGA_Poll( ULONG_PTR arg )
HANDLE
con
=
VGA_AlphaConsole
();
VGA_GetAlphaMode
(
&
Width
,
&
Height
);
dat
=
DOSMEM_MapDosToLinear
(
0xb8000
);
dat
=
VGA_AlphaBuffer
(
);
siz
.
X
=
80
;
siz
.
Y
=
1
;
off
.
X
=
0
;
off
.
Y
=
0
;
/* copy from virtual VGA frame buffer to console */
...
...
include/vga.h
View file @
3be104e0
...
...
@@ -25,6 +25,7 @@ int VGA_SetAlphaMode(unsigned Xres,unsigned Yres);
void
VGA_GetAlphaMode
(
unsigned
*
Xres
,
unsigned
*
Yres
);
void
VGA_SetCursorPos
(
unsigned
X
,
unsigned
Y
);
void
VGA_GetCursorPos
(
unsigned
*
X
,
unsigned
*
Y
);
void
VGA_WriteChars
(
unsigned
X
,
unsigned
Y
,
unsigned
ch
,
int
attr
,
int
count
);
/* control */
void
CALLBACK
VGA_Poll
(
ULONG_PTR
arg
);
...
...
Write
Preview
Markdown
is supported
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