Merge branch 'master' into retro2

This commit is contained in:
Andrea Odetti 2020-12-12 19:57:17 +00:00
commit a04425bc67
14 changed files with 70 additions and 173 deletions

View file

@ -64,15 +64,18 @@
-load-state &lt;savestate&gt;<br> -load-state &lt;savestate&gt;<br>
Load a save-state file (and auto power-on the Apple II).<br> Load a save-state file (and auto power-on the Apple II).<br>
NB. This takes precedent over the -d1, -d2, -s#d#, -h1, -h2, s0-7, -model and -r switches.<br><br> NB. This takes precedent over the -d1, -d2, -s#d#, -h1, -h2, s0-7, -model and -r switches.<br><br>
-f<br> -f or -full-screen<br>
Start in full-screen mode<br><br> Start in full-screen mode.<br><br>
-no-full-screen<br>
Start in Windowed mode (default).<br><br>
-fs-height=&lt;best|nnnn&gt;<br> -fs-height=&lt;best|nnnn&gt;<br>
Use to select a better resolution for full-screen mode.<br> Use to select a better resolution for full-screen or Windowed mode.<br>
<ul> <ul>
<li>best: picks the highest resolution where the height is an integer multiple of (192*2)</li> <li>best: picks the highest resolution where the height is an integer multiple of (192*2)</li>
<li>nnnn: select a specific resolution with height=nnnn pixels</li> <li>nnnn: select a specific resolution with height=nnnn pixels</li>
</ul> </ul>
NB. This changes the display resolution (and restores on exit).<br><br> NB. This changes the display resolution (and restores on exit).<br>
NB. Specify -no-full-screen after this switch for Windowed mode. Without this it'll just default to full-screen.<br><br>
-rom &lt;file&gt;<br> -rom &lt;file&gt;<br>
Use custom 12K ROM (at $D000) for Apple II machine, or 16K ROM (at $C000) for Apple //e machine.<br><br> Use custom 12K ROM (at $D000) for Apple II machine, or 16K ROM (at $C000) for Apple //e machine.<br><br>
-f8rom &lt;file&gt;<br> -f8rom &lt;file&gt;<br>

View file

@ -189,14 +189,18 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
lpNextArg = GetNextArg(lpNextArg); lpNextArg = GetNextArg(lpNextArg);
g_cmdLine.szSnapshotName = lpCmdLine; g_cmdLine.szSnapshotName = lpCmdLine;
} }
else if (strcmp(lpCmdLine, "-f") == 0) else if (strcmp(lpCmdLine, "-f") == 0 || strcmp(lpCmdLine, "-full-screen") == 0)
{ {
g_cmdLine.bSetFullScreen = true; g_cmdLine.bSetFullScreen = true;
} }
else if (strcmp(lpCmdLine, "-no-full-screen") == 0)
{
g_cmdLine.bSetFullScreen = false;
}
#define CMD_FS_HEIGHT "-fs-height=" #define CMD_FS_HEIGHT "-fs-height="
else if (strncmp(lpCmdLine, CMD_FS_HEIGHT, sizeof(CMD_FS_HEIGHT)-1) == 0) else if (strncmp(lpCmdLine, CMD_FS_HEIGHT, sizeof(CMD_FS_HEIGHT)-1) == 0)
{ {
g_cmdLine.bSetFullScreen = true; // Implied g_cmdLine.bSetFullScreen = true; // Implied. Can be overridden by "-no-full-screen"
LPSTR lpTmp = lpCmdLine + sizeof(CMD_FS_HEIGHT)-1; LPSTR lpTmp = lpCmdLine + sizeof(CMD_FS_HEIGHT)-1;
bool bRes = false; bool bRes = false;

View file

@ -554,7 +554,7 @@ DWORD CImageBase::NibblizeTrack(LPBYTE trackimagebuffer, SectorOrder_e SectorOrd
*(imageptr++) = 0xD5; *(imageptr++) = 0xD5;
*(imageptr++) = 0xAA; *(imageptr++) = 0xAA;
*(imageptr++) = 0xAD; *(imageptr++) = 0xAD;
CopyMemory(imageptr, Code62(ms_SectorNumber[SectorOrder][sector]), 343); memcpy(imageptr, Code62(ms_SectorNumber[SectorOrder][sector]), 343);
imageptr += 343; imageptr += 343;
*(imageptr++) = 0xDE; *(imageptr++) = 0xDE;
*(imageptr++) = 0xAA; *(imageptr++) = 0xAA;
@ -575,9 +575,9 @@ DWORD CImageBase::NibblizeTrack(LPBYTE trackimagebuffer, SectorOrder_e SectorOrd
void CImageBase::SkewTrack(const int nTrack, const int nNumNibbles, const LPBYTE pTrackImageBuffer) void CImageBase::SkewTrack(const int nTrack, const int nNumNibbles, const LPBYTE pTrackImageBuffer)
{ {
int nSkewBytes = (nTrack*768) % nNumNibbles; int nSkewBytes = (nTrack*768) % nNumNibbles;
CopyMemory(m_pWorkBuffer, pTrackImageBuffer, nNumNibbles); memcpy(m_pWorkBuffer, pTrackImageBuffer, nNumNibbles);
CopyMemory(pTrackImageBuffer, m_pWorkBuffer+nSkewBytes, nNumNibbles-nSkewBytes); memcpy(pTrackImageBuffer, m_pWorkBuffer+nSkewBytes, nNumNibbles-nSkewBytes);
CopyMemory(pTrackImageBuffer+nNumNibbles-nSkewBytes, m_pWorkBuffer, nSkewBytes); memcpy(pTrackImageBuffer+nNumNibbles-nSkewBytes, m_pWorkBuffer, nSkewBytes);
} }
//------------------------------------- //-------------------------------------

View file

@ -597,7 +597,7 @@ static BYTE __stdcall HD_IO_EMUL(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG
} }
} }
MoveMemory(pHDD->hd_buf, mem+pHDD->hd_memblock, HD_BLOCK_SIZE); memmove(pHDD->hd_buf, mem+pHDD->hd_memblock, HD_BLOCK_SIZE);
if (bRes) if (bRes)
bRes = ImageWriteBlock(pHDD->imagehandle, pHDD->hd_diskblock, pHDD->hd_buf); bRes = ImageWriteBlock(pHDD->imagehandle, pHDD->hd_diskblock, pHDD->hd_buf);

View file

@ -1132,7 +1132,7 @@ static void UpdatePaging(BOOL initialize)
// SAVE THE CURRENT PAGING SHADOW TABLE // SAVE THE CURRENT PAGING SHADOW TABLE
LPBYTE oldshadow[256]; LPBYTE oldshadow[256];
if (!initialize) if (!initialize)
CopyMemory(oldshadow,memshadow,256*sizeof(LPBYTE)); memcpy(oldshadow,memshadow,256*sizeof(LPBYTE));
// UPDATE THE PAGING TABLES BASED ON THE NEW PAGING SWITCH VALUES // UPDATE THE PAGING TABLES BASED ON THE NEW PAGING SWITCH VALUES
UINT loop; UINT loop;
@ -1245,10 +1245,10 @@ static void UpdatePaging(BOOL initialize)
((*(memdirty+loop) & 1) || (loop <= 1))) ((*(memdirty+loop) & 1) || (loop <= 1)))
{ {
*(memdirty+loop) &= ~1; *(memdirty+loop) &= ~1;
CopyMemory(oldshadow[loop],mem+(loop << 8),256); memcpy(oldshadow[loop],mem+(loop << 8),256);
} }
CopyMemory(mem+(loop << 8),memshadow[loop],256); memcpy(mem+(loop << 8),memshadow[loop],256);
} }
} }
} }
@ -1320,7 +1320,7 @@ static void BackMainImage(void)
for (UINT loop = 0; loop < 256; loop++) for (UINT loop = 0; loop < 256; loop++)
{ {
if (memshadow[loop] && ((*(memdirty+loop) & 1) || (loop <= 1))) if (memshadow[loop] && ((*(memdirty+loop) & 1) || (loop <= 1)))
CopyMemory(memshadow[loop], mem+(loop << 8), 256); memcpy(memshadow[loop], mem+(loop << 8), 256);
*(memdirty+loop) &= ~1; *(memdirty+loop) &= ~1;
} }

View file

@ -1649,6 +1649,9 @@ void MB_Destroy()
for (int id=0; id<kNumSyncEvents; id++) for (int id=0; id<kNumSyncEvents; id++)
{ {
if (g_syncEvent[id] && g_syncEvent[id]->m_active)
g_SynchronousEventMgr.Remove(id);
delete g_syncEvent[id]; delete g_syncEvent[id];
g_syncEvent[id] = NULL; g_syncEvent[id] = NULL;
} }

View file

@ -17,6 +17,7 @@ public:
void Initialize(LPBYTE pCxRomPeripheral, UINT uSlot); void Initialize(LPBYTE pCxRomPeripheral, UINT uSlot);
// void Uninitialize(); // void Uninitialize();
void Reset(); void Reset();
UINT GetSlot(void) { return m_uSlot; }
static BYTE __stdcall IORead(WORD PC, WORD uAddr, BYTE bWrite, BYTE uValue, ULONG nExecutedCycles); static BYTE __stdcall IORead(WORD PC, WORD uAddr, BYTE bWrite, BYTE uValue, ULONG nExecutedCycles);
static BYTE __stdcall IOWrite(WORD PC, WORD uAddr, BYTE bWrite, BYTE uValue, ULONG nExecutedCycles); static BYTE __stdcall IOWrite(WORD PC, WORD uAddr, BYTE bWrite, BYTE uValue, ULONG nExecutedCycles);

View file

@ -31,6 +31,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "NTSC_CharSet.h" #include "NTSC_CharSet.h"
// Some reference material here from 2000:
// http://www.kreativekorp.com/miscpages/a2info/munafo.shtml
//
#define NTSC_REMOVE_WHITE_RINGING 1 // 0 = theoritical dimmed white has chroma, 1 = pure white without chroma tinting #define NTSC_REMOVE_WHITE_RINGING 1 // 0 = theoritical dimmed white has chroma, 1 = pure white without chroma tinting
#define NTSC_REMOVE_BLACK_GHOSTING 1 // 1 = remove black smear/smudges carrying over #define NTSC_REMOVE_BLACK_GHOSTING 1 // 1 = remove black smear/smudges carrying over
@ -64,47 +67,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//#define CYCLESTART (PI/4.f) // PI/4 = 45 degrees //#define CYCLESTART (PI/4.f) // PI/4 = 45 degrees
#define CYCLESTART (DEG_TO_RAD(45)) #define CYCLESTART (DEG_TO_RAD(45))
// Types
struct ColorSpace_PAL_t // Phase Amplitute Luma
{
float phase;
float amp;
float luma;
};
struct ColorSpace_YIQ_t
{
float y, i, q;
};
struct rgba_t
{
uint8_t r;
uint8_t g;
uint8_t b;
uint8_t a;
};
struct abgr_t
{
uint8_t a;
uint8_t b;
uint8_t g;
uint8_t r;
};
struct ColorSpace_BGRA_t
{
union
{
uint32_t n;
bgra_t bgra;
rgba_t rgba;
abgr_t abgr;
};
};
// Globals (Public) ___________________________________________________ // Globals (Public) ___________________________________________________
uint16_t g_nVideoClockVert = 0; // 9-bit: VC VB VA V5 V4 V3 V2 V1 V0 = 0 .. 262 uint16_t g_nVideoClockVert = 0; // 9-bit: VC VB VA V5 V4 V3 V2 V1 V0 = 0 .. 262
@ -345,62 +307,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
}; };
#endif #endif
/*
http://www.kreativekorp.com/miscpages/a2info/munafo.shtml
"Primary" lo-res colors
Color GR Duty cycle Phase
======================================
Red COLOR=1 45 to 135 90
Dark-blue COLOR=2 315 to 45 0
Dark-green COLOR=4 225 to 315 270
Brown COLOR=8 135 to 225 180
*/
ColorSpace_PAL_t aPaletteYIQ[ 16 ] =
{ // Lo Hi Dh
{ 0, 0, 0 } // 0 0 Black
,{ 90, 60, 25 } // 1 1 Red
,{ 0, 60, 25 } // 2 8 Dark Blue
,{ 45,100, 50 } // 3 2 9 Purple
,{270, 60, 25 } // 4 Dark Green
,{ 0, 0, 50 } // 5 Grey
,{315,100, 50 } // 6 Medium Blue
,{ 0, 60, 75 } // 7 Light Blue
,{180, 60, 25 } // 8 Brown
,{135,100, 50 } // 9 Orange
,{ 0, 0, 50 } // 10
,{ 90, 60, 75 } // 11 Pink
,{225,100, 50 } // 12 Light Green
,{180, 60, 75 } // 13 Yellow
,{270, 60, 75} // 14 Aqua
,{ 0, 0,100 } // 15 White
};
// purple HCOLOR=2 45 100 50 255 68 253
// orange HCOLOR=5 135 100 50 255 106 60
// green HCOLOR=1 225 100 50 20 245 60
// blue HCOLOR=6 315 100 50 20 207 253
rgba_t aPaletteRGB[ 16 ] =
{
{ 0, 0, 0 } // 0
,{ 227, 30, 96 } // 1
,{ 96, 78, 189 } // 2
,{ 255, 68, 253 } // 3
,{ 0, 163, 96 } // 4
,{ 156, 156, 156 } // 5
,{ 20, 207, 253 } // 6
,{ 208, 195, 255 } // 7
,{ 96, 114, 3 } // 8
,{ 255, 106, 60 } // 9
,{ 156, 156, 156 } // 10
,{ 255, 160, 208 } // 11
,{ 20, 245, 60 } // 12
,{ 208, 221, 141 } // 13
,{ 114, 255, 208 } // 14
,{ 255, 255, 255 } // 15
};
static csbits_t csbits; // charset, optionally followed by alt charset static csbits_t csbits; // charset, optionally followed by alt charset
// Prototypes // Prototypes

View file

@ -653,19 +653,23 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
MB_Reset(); MB_Reset();
LogFileOutput("Main: MB_Reset()\n"); LogFileOutput("Main: MB_Reset()\n");
CMouseInterface* pMouseCard = GetCardMgr().GetMouseCard(); if (g_bRestart)
if (pMouseCard)
{ {
pMouseCard->Reset(); // Deassert any pending IRQs - GH#514 CMouseInterface* pMouseCard = GetCardMgr().GetMouseCard();
LogFileOutput("Main: CMouseInterface::Uninitialize()\n"); if (pMouseCard)
{
// dtor removes event from g_SynchronousEventMgr - do before g_SynchronousEventMgr.Reset()
GetCardMgr().Remove( pMouseCard->GetSlot() );
LogFileOutput("Main: CMouseInterface::dtor\n");
}
_ASSERT(g_SynchronousEventMgr.GetHead() == NULL);
g_SynchronousEventMgr.Reset();
} }
DSUninit(); DSUninit();
LogFileOutput("Main: DSUninit()\n"); LogFileOutput("Main: DSUninit()\n");
if (g_bRestart)
g_SynchronousEventMgr.Reset();
if (g_bHookSystemKey) if (g_bHookSystemKey)
{ {
UninitHookThread(); UninitHookThread();
@ -985,23 +989,23 @@ static void RepeatInitialization(void)
} }
else else
{ {
if (g_cmdLine.bestWidth && g_cmdLine.bestHeight)
{
DEVMODE devMode;
memset(&devMode, 0, sizeof(devMode));
devMode.dmSize = sizeof(devMode);
devMode.dmPelsWidth = g_cmdLine.bestWidth;
devMode.dmPelsHeight = g_cmdLine.bestHeight;
devMode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
DWORD dwFlags = 0;
LONG res = ChangeDisplaySettings(&devMode, dwFlags);
if (res == 0)
g_cmdLine.bChangedDisplayResolution = true;
}
if (g_cmdLine.bSetFullScreen) if (g_cmdLine.bSetFullScreen)
{ {
if (g_cmdLine.bestWidth && g_cmdLine.bestHeight)
{
DEVMODE devMode;
memset(&devMode, 0, sizeof(devMode));
devMode.dmSize = sizeof(devMode);
devMode.dmPelsWidth = g_cmdLine.bestWidth;
devMode.dmPelsHeight = g_cmdLine.bestHeight;
devMode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
DWORD dwFlags = 0;
LONG res = ChangeDisplaySettings(&devMode, dwFlags);
if (res == 0)
g_cmdLine.bChangedDisplayResolution = true;
}
PostMessage(g_hFrameWindow, WM_USER_FULLSCREEN, 0, 0); PostMessage(g_hFrameWindow, WM_USER_FULLSCREEN, 0, 0);
g_cmdLine.bSetFullScreen = false; g_cmdLine.bSetFullScreen = false;
} }

View file

@ -151,7 +151,7 @@ void VideoBenchmark () {
DWORD totaltextfps = 0; DWORD totaltextfps = 0;
g_uVideoMode = VF_TEXT; g_uVideoMode = VF_TEXT;
FillMemory(mem+0x400,0x400,0x14); memset(mem+0x400,0x14,0x400);
VideoRedrawScreen(); VideoRedrawScreen();
DWORD milliseconds = GetTickCount(); DWORD milliseconds = GetTickCount();
while (GetTickCount() == milliseconds) ; while (GetTickCount() == milliseconds) ;
@ -159,9 +159,9 @@ void VideoBenchmark () {
DWORD cycle = 0; DWORD cycle = 0;
do { do {
if (cycle & 1) if (cycle & 1)
FillMemory(mem+0x400,0x400,0x14); memset(mem+0x400,0x14,0x400);
else else
CopyMemory(mem+0x400,mem+((cycle & 2) ? 0x4000 : 0x6000),0x400); memcpy(mem+0x400,mem+((cycle & 2) ? 0x4000 : 0x6000),0x400);
VideoRefreshScreen(); VideoRefreshScreen();
if (cycle++ >= 3) if (cycle++ >= 3)
cycle = 0; cycle = 0;
@ -173,7 +173,7 @@ void VideoBenchmark () {
// SIMULATE THE ACTIVITY OF AN AVERAGE GAME // SIMULATE THE ACTIVITY OF AN AVERAGE GAME
DWORD totalhiresfps = 0; DWORD totalhiresfps = 0;
g_uVideoMode = VF_HIRES; g_uVideoMode = VF_HIRES;
FillMemory(mem+0x2000,0x2000,0x14); memset(mem+0x2000,0x14,0x2000);
VideoRedrawScreen(); VideoRedrawScreen();
milliseconds = GetTickCount(); milliseconds = GetTickCount();
while (GetTickCount() == milliseconds) ; while (GetTickCount() == milliseconds) ;
@ -181,9 +181,9 @@ void VideoBenchmark () {
cycle = 0; cycle = 0;
do { do {
if (cycle & 1) if (cycle & 1)
FillMemory(mem+0x2000,0x2000,0x14); memset(mem+0x2000,0x14,0x2000);
else else
CopyMemory(mem+0x2000,mem+((cycle & 2) ? 0x4000 : 0x6000),0x2000); memcpy(mem+0x2000,mem+((cycle & 2) ? 0x4000 : 0x6000),0x2000);
VideoRefreshScreen(); VideoRefreshScreen();
if (cycle++ >= 3) if (cycle++ >= 3)
cycle = 0; cycle = 0;
@ -257,7 +257,7 @@ void VideoBenchmark () {
// WITH FULL EMULATION OF THE CPU, JOYSTICK, AND DISK HAPPENING AT // WITH FULL EMULATION OF THE CPU, JOYSTICK, AND DISK HAPPENING AT
// THE SAME TIME // THE SAME TIME
DWORD realisticfps = 0; DWORD realisticfps = 0;
FillMemory(mem+0x2000,0x2000,0xAA); memset(mem+0x2000,0xAA,0x2000);
VideoRedrawScreen(); VideoRedrawScreen();
milliseconds = GetTickCount(); milliseconds = GetTickCount();
while (GetTickCount() == milliseconds) ; while (GetTickCount() == milliseconds) ;
@ -274,9 +274,9 @@ void VideoBenchmark () {
} }
} }
if (cycle & 1) if (cycle & 1)
FillMemory(mem+0x2000,0x2000,0xAA); memset(mem+0x2000,0xAA,0x2000);
else else
CopyMemory(mem+0x2000,mem+((cycle & 2) ? 0x4000 : 0x6000),0x2000); memcpy(mem+0x2000,mem+((cycle & 2) ? 0x4000 : 0x6000),0x2000);
VideoRedrawScreen(); VideoRedrawScreen();
if (cycle++ >= 3) if (cycle++ >= 3)
cycle = 0; cycle = 0;

View file

@ -31,7 +31,7 @@ void VideoBenchmark(std::function<void()> redraw, std::function<void()> refresh)
// GOING ON, CHANGING HALF OF THE BYTES IN THE VIDEO BUFFER EACH FRAME TO // GOING ON, CHANGING HALF OF THE BYTES IN THE VIDEO BUFFER EACH FRAME TO
// SIMULATE THE ACTIVITY OF AN AVERAGE GAME // SIMULATE THE ACTIVITY OF AN AVERAGE GAME
g_uVideoMode = VF_HIRES; g_uVideoMode = VF_HIRES;
FillMemory(mem+0x2000,0x2000,0x14); memset(mem+0x2000,0x14,0x2000);
redraw(); redraw();
typedef std::chrono::microseconds interval_t; typedef std::chrono::microseconds interval_t;
@ -43,9 +43,9 @@ void VideoBenchmark(std::function<void()> redraw, std::function<void()> refresh)
auto start = std::chrono::steady_clock::now(); auto start = std::chrono::steady_clock::now();
do { do {
if (totalhiresfps & 1) if (totalhiresfps & 1)
FillMemory(mem+0x2000,0x2000,0x14); memset(mem+0x2000,0x14,0x2000);
else else
CopyMemory(mem+0x2000,mem+((totalhiresfps & 2) ? 0x4000 : 0x6000),0x2000); memcpy(mem+0x2000,mem+((totalhiresfps & 2) ? 0x4000 : 0x6000),0x2000);
refresh(); refresh();
totalhiresfps++; totalhiresfps++;
@ -123,7 +123,7 @@ void VideoBenchmark(std::function<void()> redraw, std::function<void()> refresh)
// WITH FULL EMULATION OF THE CPU, JOYSTICK, AND DISK HAPPENING AT // WITH FULL EMULATION OF THE CPU, JOYSTICK, AND DISK HAPPENING AT
// THE SAME TIME // THE SAME TIME
counter_t realisticfps = 0; counter_t realisticfps = 0;
FillMemory(mem+0x2000,0x2000,0xAA); memset(mem+0x2000,0xAA,0x2000);
redraw(); redraw();
const size_t dwClksPerFrame = NTSC_GetCyclesPerFrame(); const size_t dwClksPerFrame = NTSC_GetCyclesPerFrame();
@ -145,9 +145,9 @@ void VideoBenchmark(std::function<void()> redraw, std::function<void()> refresh)
{ {
cyclesThisFrame -= dwClksPerFrame; cyclesThisFrame -= dwClksPerFrame;
if (realisticfps & 1) if (realisticfps & 1)
FillMemory(mem+0x2000,0x2000,0xAA); memset(mem+0x2000,0xAA,0x2000);
else else
CopyMemory(mem+0x2000,mem+((realisticfps & 2) ? 0x4000 : 0x6000),0x2000); memcpy(mem+0x2000,mem+((realisticfps & 2) ? 0x4000 : 0x6000),0x2000);
realisticfps++; realisticfps++;
refresh(); refresh();
} }

View file

@ -2,7 +2,6 @@
#include "linux/windows/wincompat.h" #include "linux/windows/wincompat.h"
#include "linux/windows/guiddef.h" #include "linux/windows/guiddef.h"
#include "linux/windows/memory.h"
#include "linux/windows/handles.h" #include "linux/windows/handles.h"
#include "linux/windows/bitmap.h" #include "linux/windows/bitmap.h"
#include "linux/windows/files.h" #include "linux/windows/files.h"

View file

@ -1,17 +0,0 @@
#include "linux/windows/memory.h"
#include <cstdlib>
LPVOID VirtualAlloc(LPVOID lpAddress, size_t dwSize,
DWORD flAllocationType, DWORD flProtect) {
/* just malloc and alles? 0_0 */
void* mymemory = realloc(lpAddress, dwSize);
if (flAllocationType & MEM_COMMIT)
ZeroMemory(mymemory, dwSize); // original VirtualAlloc does this (if..)
return mymemory;
}
BOOL VirtualFree(LPVOID lpAddress, size_t dwSize,
DWORD dwFreeType) {
free(lpAddress);
return TRUE;
}

View file

@ -1,6 +0,0 @@
#pragma once
#define MoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
#define FillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
#define EqualMemory(Destination,Source,Length) (!memcmp((Destination),(Source),(Length)))
#define CopyMemory(Destination,Source,Length) memcpy((Destination),(Source),(Length))