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
9adb6f2e
Commit
9adb6f2e
authored
Aug 25, 2003
by
Jukka Heinonen
Committed by
Alexandre Julliard
Aug 25, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace some magic numbers with symbols.
Add sanity checks so that VGA window cannot be used to access memory outside framebuffer.
parent
2fb93f1b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
vga.c
dlls/winedos/vga.c
+19
-6
No files found.
dlls/winedos/vga.c
View file @
9adb6f2e
...
...
@@ -43,6 +43,16 @@ static BOOL vga_retrace_vertical;
static
BOOL
vga_retrace_horizontal
;
/*
* Size and location of VGA controller window to framebuffer.
*
* Note: We support only single window even though some
* controllers support two. This should not be changed unless
* there are programs that depend on having two windows.
*/
#define VGA_WINDOW_SIZE (64 * 1024)
#define VGA_WINDOW_START ((char *)0xa0000)
/*
* VGA controller memory is emulated using linear framebuffer.
* This frambuffer also acts as an interface
* between VGA controller emulation and DirectDraw.
...
...
@@ -593,15 +603,17 @@ void VGA_SetWindowStart(int start)
if
(
vga_fb_window
==
-
1
)
FIXME
(
"Remove VGA memory emulation.
\n
"
);
else
memmove
(
vga_fb_data
+
vga_fb_window
,
(
char
*
)
0xa0000
,
64
*
1024
);
else
if
(
vga_fb_window
+
VGA_WINDOW_SIZE
<
vga_fb_size
)
memmove
(
vga_fb_data
+
vga_fb_window
,
VGA_WINDOW_START
,
VGA_WINDOW_SIZE
);
vga_fb_window
=
start
;
if
(
vga_fb_window
==
-
1
)
FIXME
(
"Install VGA memory emulation.
\n
"
);
else
memmove
(
(
char
*
)
0xa0000
,
vga_fb_data
+
vga_fb_window
,
64
*
1024
);
else
if
(
vga_fb_window
+
VGA_WINDOW_SIZE
<
vga_fb_size
)
memmove
(
VGA_WINDOW_START
,
vga_fb_data
+
vga_fb_window
,
VGA_WINDOW_SIZE
);
LeaveCriticalSection
(
&
vga_lock
);
}
...
...
@@ -913,8 +925,9 @@ static void VGA_Poll_Graphics(void)
/*
* Synchronize framebuffer contents.
*/
if
(
vga_fb_window
!=
-
1
)
memmove
(
vga_fb_data
+
vga_fb_window
,
(
char
*
)
0xa0000
,
64
*
1024
);
if
(
vga_fb_window
!=
-
1
&&
vga_fb_window
+
VGA_WINDOW_SIZE
<
vga_fb_size
)
memmove
(
vga_fb_data
+
vga_fb_window
,
VGA_WINDOW_START
,
VGA_WINDOW_SIZE
);
/*
* Double VGA framebuffer (320x200 -> 640x400), if needed.
...
...
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