Mercurial > repos > blastem
annotate mem_win.c @ 1374:8f404b1fa572
Go back to resetting the refresh counter after a DMA. Probably not quite correct as it is probably reset on VDP triggered refresh, but this is close enough for now given the general limitations with my refresh code. VDP FIFO Testing seems to be passing 100% reliably again (was occassionally failing still with the last commit)
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 23 May 2017 23:47:40 -0700 |
parents | bce97fc0bb8a |
children |
rev | line source |
---|---|
741
80a67be1770b
Initial work on Windows port
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 /* |
80a67be1770b
Initial work on Windows port
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 Copyright 2013 Michael Pavone |
80a67be1770b
Initial work on Windows port
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 This file is part of BlastEm. |
80a67be1770b
Initial work on Windows port
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text. |
80a67be1770b
Initial work on Windows port
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 */ |
80a67be1770b
Initial work on Windows port
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 |
80a67be1770b
Initial work on Windows port
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 #include "mem.h" |
795
bce97fc0bb8a
Fix mingw-w64 build and cross-compilation
=?UTF-8?q?Higor=20Eur=C3=ADpedes?= <heuripedes@gmail.com>
parents:
741
diff
changeset
|
8 #include <windows.h> |
741
80a67be1770b
Initial work on Windows port
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 |
80a67be1770b
Initial work on Windows port
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 void * alloc_code(size_t *size) |
80a67be1770b
Initial work on Windows port
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 { |
80a67be1770b
Initial work on Windows port
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 *size += PAGE_SIZE - (*size & (PAGE_SIZE - 1)); |
80a67be1770b
Initial work on Windows port
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 |
80a67be1770b
Initial work on Windows port
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 return VirtualAlloc(NULL, *size, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); |
80a67be1770b
Initial work on Windows port
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 } |