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
da1a284f
Commit
da1a284f
authored
Jun 19, 2001
by
Marcus Meissner
Committed by
Alexandre Julliard
Jun 19, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made DOS VGA display again with last months DDRAW updates.
parent
c660410b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
5 deletions
+41
-5
vga.c
msdos/vga.c
+41
-5
No files found.
msdos/vga.c
View file @
da1a284f
...
...
@@ -7,6 +7,8 @@
#include <string.h>
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "wincon.h"
#include "miscemu.h"
#include "vga.h"
...
...
@@ -26,6 +28,9 @@ static HANDLE poll_timer;
typedef
HRESULT
WINAPI
(
*
DirectDrawCreateProc
)(
LPGUID
,
LPDIRECTDRAW
*
,
LPUNKNOWN
);
static
DirectDrawCreateProc
pDirectDrawCreate
;
typedef
HWND
WINAPI
(
*
CreateWindowExAProc
)(
DWORD
,
LPCSTR
,
LPCSTR
,
DWORD
,
INT
,
INT
,
INT
,
INT
,
HWND
,
HMENU
,
HINSTANCE
,
LPVOID
);
static
CreateWindowExAProc
pCreateWindowExA
;
static
void
VGA_DeinstallTimer
(
void
)
{
if
(
poll_timer
)
{
...
...
@@ -57,25 +62,56 @@ char*VGA_AlphaBuffer(void)
int
VGA_SetMode
(
unsigned
Xres
,
unsigned
Yres
,
unsigned
Depth
)
{
LRESULT
res
;
HWND
hwnd
;
if
(
lpddraw
)
VGA_Exit
();
if
(
!
lpddraw
)
{
if
(
!
pDirectDrawCreate
)
{
HMODULE
hmod
=
LoadLibraryA
(
"ddraw.dll"
);
if
(
hmod
)
pDirectDrawCreate
=
(
DirectDrawCreateProc
)
GetProcAddress
(
hmod
,
"DirectDrawCreate"
);
if
(
!
pDirectDrawCreate
)
{
ERR
(
"Can't lookup DirectDrawCreate from ddraw.dll.
\n
"
);
return
1
;
}
}
if
(
pDirectDrawCreate
)
pDirectDrawCreate
(
NULL
,
&
lpddraw
,
NULL
);
if
(
!
pCreateWindowExA
)
{
HMODULE
hmod
=
LoadLibraryA
(
"user32.dll"
);
if
(
!
hmod
)
{
ERR
(
"Can't load user32.dll.
\n
"
);
return
1
;
}
if
(
hmod
)
pCreateWindowExA
=
(
CreateWindowExAProc
)
GetProcAddress
(
hmod
,
"CreateWindowExA"
);
if
(
!
pCreateWindowExA
)
{
ERR
(
"Can't lookup CreateWindowExA from user32.dll.
\n
"
);
return
1
;
}
}
res
=
pDirectDrawCreate
(
NULL
,
&
lpddraw
,
NULL
);
if
(
!
lpddraw
)
{
ERR
(
"DirectDraw is not available
\n
"
);
ERR
(
"DirectDraw is not available
(res = %lx)
\n
"
,
res
);
return
1
;
}
if
(
IDirectDraw_SetDisplayMode
(
lpddraw
,
Xres
,
Yres
,
Depth
))
{
ERR
(
"DirectDraw does not support requested display mode
\n
"
);
hwnd
=
pCreateWindowExA
(
0
,
"STATIC"
,
"WINEDOS VGA"
,
WS_POPUP
|
WS_BORDER
|
WS_CAPTION
|
WS_SYSMENU
,
0
,
0
,
Xres
,
Yres
,
0
,
0
,
0
,
NULL
);
if
(
!
hwnd
)
{
ERR
(
"Failed to create user window.
\n
"
);
}
if
((
res
=
IDirectDraw_SetCooperativeLevel
(
lpddraw
,
hwnd
,
DDSCL_FULLSCREEN
|
DDSCL_EXCLUSIVE
)))
{
ERR
(
"Could not set cooperative level to exclusive (%lx)
\n
"
,
res
);
}
if
((
res
=
IDirectDraw_SetDisplayMode
(
lpddraw
,
Xres
,
Yres
,
Depth
)))
{
ERR
(
"DirectDraw does not support requested display mode (%dx%dx%d), res = %lx!
\n
"
,
Xres
,
Yres
,
Depth
,
res
);
IDirectDraw_Release
(
lpddraw
);
lpddraw
=
NULL
;
return
1
;
}
IDirectDraw_CreatePalette
(
lpddraw
,
DDPCAPS_8BIT
,
NULL
,
&
lpddpal
,
NULL
);
res
=
IDirectDraw_CreatePalette
(
lpddraw
,
DDPCAPS_8BIT
,
NULL
,
&
lpddpal
,
NULL
);
if
(
res
)
{
ERR
(
"Could not create palette (res = %lx)
\n
"
,
res
);
}
memset
(
&
sdesc
,
0
,
sizeof
(
sdesc
));
sdesc
.
dwSize
=
sizeof
(
sdesc
);
sdesc
.
dwFlags
=
DDSD_CAPS
;
...
...
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