Changes to ease code compilation in gcc. (#541)

Changes to ease code compilation in GCC.

Disk_t and HDD contain a std::string and for this reason they need a proper constructor, ZeroMemory is not guaranteed to work.
This commit is contained in:
Andrea 2018-02-24 15:12:40 +00:00 committed by TomCh
parent 20022d999d
commit 6051bc55d0
65 changed files with 253 additions and 220 deletions

View File

@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "CPU.h"
#include "Debug.h"
#include "Disk.h"
@ -53,14 +53,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Video.h"
#include "NTSC.h"
#include "Configuration\About.h"
#include "Configuration\PropertySheet.h"
#include "Tfe\Tfe.h"
#include "Configuration/About.h"
#include "Configuration/PropertySheet.h"
#include "Tfe/Tfe.h"
static UINT16 g_AppleWinVersion[4] = {0};
char VERSIONSTRING[16] = "xx.yy.zz.ww";
TCHAR *g_pAppTitle = NULL;
const TCHAR *g_pAppTitle = NULL;
eApple2Type g_Apple2Type = A2TYPE_APPLE2EENHANCED;

View File

@ -12,7 +12,7 @@ bool SetCurrentImageDir(const char* pszImageDir);
extern const UINT16* GetAppleWinVersion(void);
extern char VERSIONSTRING[]; // Constructed in WinMain()
extern TCHAR *g_pAppTitle;
extern const TCHAR *g_pAppTitle;
extern eApple2Type g_Apple2Type;
eApple2Type GetApple2Type(void);

View File

@ -86,7 +86,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "CPU.h"
#include "Frame.h"
#include "Memory.h"
@ -99,8 +99,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "NTSC.h"
#include "z80emu.h"
#include "Z80VICE\z80.h"
#include "Z80VICE\z80mem.h"
#include "Z80VICE/z80.h"
#include "Z80VICE/z80mem.h"
#include "YamlHelper.h"
@ -195,9 +195,9 @@ void SetActiveCpu(eCpuType cpu)
//
#include "cpu/cpu_general.inl"
#include "CPU/cpu_general.inl"
#include "cpu/cpu_instructions.inl"
#include "CPU/cpu_instructions.inl"
// Break into debugger on invalid opcodes
//#define INV IsDebugBreakOnInvalid(AM_1);
@ -429,9 +429,9 @@ static __forceinline void CheckInterruptSources(ULONG uExecutedCycles)
//===========================================================================
#include "cpu/cpu6502.h" // MOS 6502
#include "cpu/cpu65C02.h" // WDC 65C02
#include "cpu/cpu65d02.h" // Debug CPU Memory Visualizer
#include "CPU/cpu6502.h" // MOS 6502
#include "CPU/cpu65C02.h" // WDC 65C02
#include "CPU/cpu65d02.h" // Debug CPU Memory Visualizer
//===========================================================================

View File

@ -91,7 +91,7 @@ inline u8 ReadByte( u16 addr, int uExecutedCycles )
IOWrite[(addr>>4) & 0xFF](regs.pc,addr,1,(BYTE)(a),uExecutedCycles); \
}
#include "cpu/cpu_instructions.inl"
#include "CPU/cpu_instructions.inl"
//===========================================================================

View File

@ -28,7 +28,7 @@
#ifndef _ALARM_H
#define _ALARM_H
#include "..\CommonVICE\types.h"
#include "../CommonVICE/types.h"
#define ALARM_CONTEXT_MAX_PENDING_ALARMS 0x100

View File

@ -31,7 +31,7 @@
#include <stdio.h>
#include "..\CommonVICE\types.h"
#include "../CommonVICE/types.h"
/* Define the number of cycles needed by the CPU to detect the NMI or IRQ. */
#define INTERRUPT_DELAY 2

View File

@ -29,7 +29,7 @@
#ifndef _MEM_H_
#define _MEM_H_
#include "..\CommonVICE\types.h"
#include "../CommonVICE/types.h"
typedef BYTE REGPARM1 read_func_t(WORD addr);
typedef read_func_t *read_func_ptr_t;

View File

@ -21,11 +21,11 @@ along with AppleWin; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "stdafx.h"
#include "StdAfx.h"
#include "..\AppleWin.h"
#include "..\Frame.h"
#include "..\resource\resource.h"
#include "../Applewin.h"
#include "../Frame.h"
#include "../resource/resource.h"
static const char g_szGPL[] =
"This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\r\n\

View File

@ -1,9 +1,9 @@
#pragma once
#include "..\AppleWin.h"
#include "..\CPU.h"
#include "..\Disk.h" // BOOL enhancedisk
#include "..\HardDisk.h" // HD_CardIsEnabled()
#include "../Applewin.h"
#include "../CPU.h"
#include "../Disk.h" // BOOL enhancedisk
#include "../Harddisk.h" // HD_CardIsEnabled()
class CConfigNeedingRestart
{

View File

@ -22,12 +22,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "StdAfx.h"
#include "..\Common.h"
#include "../Common.h"
#include "..\ParallelPrinter.h"
#include "..\Registry.h"
#include "..\SaveState.h"
#include "..\resource\resource.h"
#include "../ParallelPrinter.h"
#include "../Registry.h"
#include "../SaveState.h"
#include "../resource/resource.h"
#include "PageAdvanced.h"
#include "PropertySheetHelper.h"

View File

@ -23,12 +23,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h"
#include "..\AppleWin.h"
#include "..\Frame.h"
#include "..\Registry.h"
#include "..\SerialComms.h"
#include "..\Video.h"
#include "..\resource\resource.h"
#include "../Applewin.h"
#include "../Frame.h"
#include "../Registry.h"
#include "../SerialComms.h"
#include "../Video.h"
#include "../resource/resource.h"
#include "PageConfig.h"
#include "PropertySheetHelper.h"

View File

@ -23,11 +23,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h"
#include "..\Common.h"
#include "..\Registry.h"
#include "..\resource\resource.h"
#include "..\Tfe\Tfe.h"
#include "..\Tfe\Tfesupp.h"
#include "../Common.h"
#include "../Registry.h"
#include "../resource/resource.h"
#include "../Tfe/Tfe.h"
#include "../Tfe/Tfesupp.h"
#include "PageConfigTfe.h"
CPageConfigTfe* CPageConfigTfe::ms_this = 0; // reinit'd in ctor

View File

@ -1,7 +1,7 @@
#pragma once
#include "IPropertySheetPage.h"
#include "..\Tfe\Uilib.h"
#include "../Tfe/Uilib.h"
class CPageConfigTfe : private IPropertySheetPage
{

View File

@ -23,10 +23,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h"
#include "..\AppleWin.h"
#include "..\Frame.h"
#include "..\Registry.h"
#include "..\resource\resource.h"
#include "../Applewin.h"
#include "../Frame.h"
#include "../Registry.h"
#include "../resource/resource.h"
#include "PageDisk.h"
#include "PropertySheetHelper.h"

View File

@ -22,12 +22,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "StdAfx.h"
#include "..\SaveState_Structs_common.h"
#include "..\Common.h"
#include "../SaveState_Structs_common.h"
#include "../Common.h"
#include "..\Keyboard.h"
#include "..\Registry.h"
#include "..\resource\resource.h"
#include "../Keyboard.h"
#include "../Registry.h"
#include "../resource/resource.h"
#include "PageInput.h"
#include "PropertySheetHelper.h"

View File

@ -2,7 +2,7 @@
#include "IPropertySheetPage.h"
#include "PropertySheetDefs.h"
#include "..\Joystick.h"
#include "../Joystick.h"
class CPropertySheetHelper;
class CConfigNeedingRestart;

View File

@ -22,13 +22,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "StdAfx.h"
#include "..\SaveState_Structs_common.h"
#include "..\Common.h"
#include "../SaveState_Structs_common.h"
#include "../Common.h"
#include "..\Mockingboard.h"
#include "..\Registry.h"
#include "..\Speaker.h"
#include "..\resource\resource.h"
#include "../Mockingboard.h"
#include "../Registry.h"
#include "../Speaker.h"
#include "../resource/resource.h"
#include "PageSound.h"
#include "PropertySheetHelper.h"

View File

@ -29,9 +29,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h"
#include "..\AppleWin.h"
#include "..\Frame.h"
#include "..\resource\resource.h"
#include "../Applewin.h"
#include "../Frame.h"
#include "../resource/resource.h"
#include "PropertySheet.h"
void CPropertySheet::Init(void)

View File

@ -21,14 +21,14 @@ along with AppleWin; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "stdafx.h"
#include "StdAfx.h"
#include "..\AppleWin.h" // g_nAppMode, g_uScrollLockToggle, sg_PropertySheet
#include "..\Disk.h"
#include "..\Frame.h"
#include "..\Log.h"
#include "..\Registry.h"
#include "..\SaveState.h"
#include "../Applewin.h" // g_nAppMode, g_uScrollLockToggle, sg_PropertySheet
#include "../Disk.h"
#include "../Frame.h"
#include "../Log.h"
#include "../Registry.h"
#include "../SaveState.h"
#include "IPropertySheet.h"
#include "PropertySheetHelper.h"

View File

@ -34,15 +34,15 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Debug.h"
#include "DebugDefs.h"
#include "..\AppleWin.h"
#include "..\CPU.h"
#include "..\Disk.h"
#include "..\Frame.h"
#include "..\Keyboard.h"
#include "..\Memory.h"
#include "..\NTSC.h"
#include "..\SoundCore.h" // SoundCore_SetFade()
#include "..\Video.h"
#include "../Applewin.h"
#include "../CPU.h"
#include "../Disk.h"
#include "../Frame.h"
#include "../Keyboard.h"
#include "../Memory.h"
#include "../NTSC.h"
#include "../SoundCore.h" // SoundCore_SetFade()
#include "../Video.h"
// #define DEBUG_COMMAND_HELP 1
// #define DEBUG_ASM_HASH 1

View File

@ -1,7 +1,7 @@
#pragma once
#include "..\SaveState_Structs_v1.h" // For SS_CARD_MOCKINGBOARD
#include "..\Common.h"
#include "../SaveState_Structs_v1.h" // For SS_CARD_MOCKINGBOARD
#include "../Common.h"
#include "Debugger_Types.h"
#include "Debugger_DisassemblerData.h"

View File

@ -30,9 +30,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Debug.h"
#include "..\CPU.h"
#include "..\Frame.h"
#include "..\Memory.h"
#include "../CPU.h"
#include "../Frame.h"
#include "../Memory.h"
#define DEBUG_ASSEMBLER 0

View File

@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Debug.h"
#include "..\Frame.h"
#include "../Frame.h"
// Commands _______________________________________________________________________________________

View File

@ -31,12 +31,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Debug.h"
#include "Debugger_Display.h"
#include "..\AppleWin.h"
#include "..\CPU.h"
#include "..\Frame.h"
#include "..\Memory.h"
#include "..\Mockingboard.h"
#include "..\Video.h"
#include "../Applewin.h"
#include "../CPU.h"
#include "../Frame.h"
#include "../Memory.h"
#include "../Mockingboard.h"
#include "../Video.h"
// NEW UI debugging - force display ALL meta-info (regs, stack, bp, watches, zp) for debugging purposes
#define DEBUG_FORCE_DISPLAY 0

View File

@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Debug.h"
#include "..\AppleWin.h"
#include "../Applewin.h"
#define DEBUG_COLOR_CONSOLE 0

View File

@ -30,8 +30,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Debug.h"
#include "..\CPU.h"
#include "..\Memory.h"
#include "../CPU.h"
#include "../Memory.h"
// Args ___________________________________________________________________________________________

View File

@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Debug.h"
#include "..\AppleWin.h"
#include "../Applewin.h"
// 2.6.2.13 Added: Can now enable/disable selected symbol table(s) !
// Allow the user to disable/enable symbol tables

View File

@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "SaveState_Structs_v1.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "CPU.h"
#include "Disk.h"
#include "DiskLog.h"
@ -45,7 +45,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Video.h"
#include "YamlHelper.h"
#include "..\resource\resource.h"
#include "../resource/resource.h"
#if LOG_DISK_NIBBLES_USE_RUNTIME_VAR
static bool g_bLogDisk_NibblesRW = false; // From VS Debugger, change this to true/false during runtime for precise nibble logging
@ -92,7 +92,7 @@ const char* DiskGetDiskPathFilename(const int iDrive)
return g_aFloppyDisk[iDrive].fullname;
}
char* DiskGetCurrentState(void)
const char* DiskGetCurrentState(void)
{
if (g_aFloppyDisk[currdrive].imagehandle == NULL)
return "Empty";
@ -134,7 +134,7 @@ void Disk_LoadLastDiskImage(const int iDrive)
char sFilePath[ MAX_PATH + 1];
sFilePath[0] = 0;
char *pRegKey = (iDrive == DRIVE_1)
const char *pRegKey = (iDrive == DRIVE_1)
? REGVALUE_PREF_LAST_DISK_1
: REGVALUE_PREF_LAST_DISK_2;
@ -541,7 +541,7 @@ void DiskInitialize(void)
{
int loop = NUM_DRIVES;
while (loop--)
ZeroMemory(&g_aFloppyDisk[loop], sizeof(Disk_t));
g_aFloppyDisk[loop].clear();
}
//===========================================================================
@ -557,7 +557,7 @@ ImageError_e DiskInsert(const int iDrive, LPCTSTR pszImageFilename, const bool b
{
int track = fptr->track;
int phase = fptr->phase;
ZeroMemory(fptr, sizeof(Disk_t));
fptr->clear();
fptr->track = track;
fptr->phase = phase;
}
@ -1256,7 +1256,7 @@ int DiskSetSnapshot_v1(const SS_CARD_DISK2* const pSS)
for(UINT i=0; i<NUM_DRIVES; i++)
{
DiskEject(i); // Remove any disk & update Registry to reflect empty drive
ZeroMemory(&g_aFloppyDisk[i], sizeof(Disk_t));
g_aFloppyDisk[i].clear();
}
for(UINT i=0; i<NUM_DRIVES; i++)
@ -1447,9 +1447,7 @@ static void DiskLoadSnapshotDriveUnit(YamlLoadHelper& yamlLoadHelper, UINT unit)
g_aFloppyDisk[unit].trackimagedata = yamlLoadHelper.LoadUint(SS_YAML_KEY_TRACK_IMAGE_DATA);
g_aFloppyDisk[unit].trackimagedirty = yamlLoadHelper.LoadUint(SS_YAML_KEY_TRACK_IMAGE_DIRTY);
std::vector<BYTE> track;
track.resize(NIBBLES_PER_TRACK);
memset(&track[0], 0, track.size());
std::vector<BYTE> track(NIBBLES_PER_TRACK);
if (yamlLoadHelper.GetSubMap(SS_YAML_KEY_TRACK_IMAGE))
{
yamlLoadHelper.LoadMemory(&track[0], NIBBLES_PER_TRACK);
@ -1505,7 +1503,7 @@ bool DiskLoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT slot, UINT vers
for(UINT i=0; i<NUM_DRIVES; i++)
{
DiskEject(i); // Remove any disk & update Registry to reflect empty drive
ZeroMemory(&g_aFloppyDisk[i], sizeof(Disk_t));
g_aFloppyDisk[i].clear();
}
DiskLoadSnapshotDriveUnit(yamlLoadHelper, DRIVE_1);

View File

@ -66,7 +66,7 @@ int DiskGetCurrentTrack();
int DiskGetTrack( int drive );
int DiskGetCurrentPhase();
int DiskGetCurrentOffset();
char* DiskGetCurrentState();
const char* DiskGetCurrentState();
bool DiskSelect(const int iDrive);
void DiskUpdateDriveState(DWORD);
bool DiskDriveSwap(void);
@ -104,22 +104,26 @@ struct Disk_t
DWORD writelight;
int nibbles; // Init'd by ReadTrack() -> ImageReadTrack()
const Disk_t& operator= (const Disk_t& other)
Disk_t()
{
memcpy(imagename, other.imagename, sizeof(imagename));
memcpy(fullname , other.fullname, sizeof(fullname));
strFilenameInZip = other.strFilenameInZip;
imagehandle = other.imagehandle;
bWriteProtected = other.bWriteProtected;
track = other.track;
trackimage = other.trackimage;
phase = other.phase;
byte = other.byte;
trackimagedata = other.trackimagedata;
trackimagedirty = other.trackimagedirty;
spinning = other.spinning;
writelight = other.writelight;
nibbles = other.nibbles;
return *this;
clear();
}
void clear()
{
ZeroMemory(imagename, sizeof(imagename));
ZeroMemory(fullname, sizeof(fullname));
strFilenameInZip.clear();
imagehandle = NULL;
bWriteProtected = false;
track = 0;
trackimage = NULL;
phase = 0;
byte = 0;
trackimagedata = FALSE;
trackimagedirty = FALSE;
spinning = 0;
writelight = 0;
nibbles = 0;
}
};

View File

@ -236,7 +236,7 @@ bool ImageIsMultiFileZip(ImageInfo* const pImageInfo)
const char* ImageGetPathname(ImageInfo* const pImageInfo)
{
static char* szEmpty = "";
static const char* szEmpty = "";
return pImageInfo ? pImageInfo->szFilename : szEmpty;
}

View File

@ -27,12 +27,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "stdafx.h"
#include "StdAfx.h"
#include "Common.h"
#include "zlib.h"
#include "unzip.h"
#include "iowin32.h"
#include "CPU.h"
#include "Disk.h"
@ -650,8 +649,8 @@ public:
virtual UINT GetImageSizeForCreate(void) { return TRACK_DENIBBLIZED_SIZE * TRACKS_STANDARD; }
virtual eImageType GetType(void) { return eImageDO; }
virtual char* GetCreateExtensions(void) { return ".do;.dsk"; }
virtual char* GetRejectExtensions(void) { return ".nib;.iie;.po;.prg"; }
virtual const char* GetCreateExtensions(void) { return ".do;.dsk"; }
virtual const char* GetRejectExtensions(void) { return ".nib;.iie;.po;.prg"; }
};
//-------------------------------------
@ -713,8 +712,8 @@ public:
}
virtual eImageType GetType(void) { return eImagePO; }
virtual char* GetCreateExtensions(void) { return ".po"; }
virtual char* GetRejectExtensions(void) { return ".do;.iie;.nib;.prg"; }
virtual const char* GetCreateExtensions(void) { return ".po"; }
virtual const char* GetRejectExtensions(void) { return ".do;.iie;.nib;.prg"; }
};
//-------------------------------------
@ -753,8 +752,8 @@ public:
virtual UINT GetImageSizeForCreate(void) { return NIB1_TRACK_SIZE * TRACKS_STANDARD; }
virtual eImageType GetType(void) { return eImageNIB1; }
virtual char* GetCreateExtensions(void) { return ".nib"; }
virtual char* GetRejectExtensions(void) { return ".do;.iie;.po;.prg"; }
virtual const char* GetCreateExtensions(void) { return ".nib"; }
virtual const char* GetRejectExtensions(void) { return ".do;.iie;.po;.prg"; }
};
//-------------------------------------
@ -790,8 +789,8 @@ public:
}
virtual eImageType GetType(void) { return eImageNIB2; }
virtual char* GetCreateExtensions(void) { return ".nb2"; }
virtual char* GetRejectExtensions(void) { return ".do;.iie;.po;.prg;.2mg;.2img"; }
virtual const char* GetCreateExtensions(void) { return ".nb2"; }
virtual const char* GetRejectExtensions(void) { return ".do;.iie;.po;.prg;.2mg;.2img"; }
};
//-------------------------------------
@ -831,8 +830,8 @@ public:
}
virtual eImageType GetType(void) { return eImageHDV; }
virtual char* GetCreateExtensions(void) { return ".hdv"; }
virtual char* GetRejectExtensions(void) { return ".do;.iie;.prg"; }
virtual const char* GetCreateExtensions(void) { return ".hdv"; }
virtual const char* GetRejectExtensions(void) { return ".do;.iie;.prg"; }
};
//-------------------------------------
@ -900,8 +899,8 @@ public:
}
virtual eImageType GetType(void) { return eImageIIE; }
virtual char* GetCreateExtensions(void) { return ".iie"; }
virtual char* GetRejectExtensions(void) { return ".do.;.nib;.po;.prg;.2mg;.2img"; }
virtual const char* GetCreateExtensions(void) { return ".iie"; }
virtual const char* GetRejectExtensions(void) { return ".do.;.nib;.po;.prg;.2mg;.2img"; }
private:
void ConvertSectorOrder(LPBYTE sourceorder)
@ -974,8 +973,8 @@ public:
virtual bool AllowRW(void) { return false; }
virtual eImageType GetType(void) { return eImageAPL; }
virtual char* GetCreateExtensions(void) { return ".apl"; }
virtual char* GetRejectExtensions(void) { return ".do;.dsk;.iie;.nib;.po;.2mg;.2img"; }
virtual const char* GetCreateExtensions(void) { return ".apl"; }
virtual const char* GetRejectExtensions(void) { return ".do;.dsk;.iie;.nib;.po;.2mg;.2img"; }
};
//-------------------------------------
@ -1025,8 +1024,8 @@ public:
virtual bool AllowRW(void) { return false; }
virtual eImageType GetType(void) { return eImagePRG; }
virtual char* GetCreateExtensions(void) { return ".prg"; }
virtual char* GetRejectExtensions(void) { return ".do;.dsk;.iie;.nib;.po;.2mg;.2img"; }
virtual const char* GetCreateExtensions(void) { return ".prg"; }
virtual const char* GetRejectExtensions(void) { return ".do;.dsk;.iie;.nib;.po;.2mg;.2img"; }
};
//-----------------------------------------------------------------------------
@ -1208,10 +1207,7 @@ ImageError_e CImageHelperBase::CheckGZipFile(LPCTSTR pszImageFilename, ImageInfo
ImageError_e CImageHelperBase::CheckZipFile(LPCTSTR pszImageFilename, ImageInfo* pImageInfo, std::string& strFilenameInZip)
{
zlib_filefunc_def ffunc;
fill_win32_filefunc(&ffunc); // TODO: Ditch this and use unzOpen() instead?
unzFile hZipFile = unzOpen2(pszImageFilename, &ffunc);
unzFile hZipFile = unzOpen(pszImageFilename);
if (hZipFile == NULL)
return eIMAGE_ERROR_UNABLE_TO_OPEN_ZIP;

View File

@ -65,8 +65,8 @@ public:
virtual UINT GetImageSizeForCreate(void) { _ASSERT(0); return (UINT)-1; }
virtual eImageType GetType(void) = 0;
virtual char* GetCreateExtensions(void) = 0;
virtual char* GetRejectExtensions(void) = 0;
virtual const char* GetCreateExtensions(void) = 0;
virtual const char* GetRejectExtensions(void) = 0;
void SetVolumeNumber(const BYTE uVolumeNumber) { m_uVolumeNumber = uVolumeNumber; }
bool IsValidImageSize(const DWORD uImageSize);

View File

@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h"
#include <sys/stat.h>
#include "AppleWin.h"
#include "Applewin.h"
#include "CPU.h"
#include "Disk.h"
#include "DiskImage.h"
@ -52,9 +52,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#endif
#include "Video.h"
#include "..\resource\resource.h"
#include "Configuration\PropertySheet.h"
#include "Debugger\Debug.h"
#include "../resource/resource.h"
#include "Configuration/PropertySheet.h"
#include "Debugger/Debug.h"
//#define ENABLE_MENU 0

View File

@ -28,16 +28,16 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "DiskImage.h" // ImageError_e, Disk_Status_e
#include "DiskImageHelper.h"
#include "Frame.h"
#include "HardDisk.h"
#include "Harddisk.h"
#include "Memory.h"
#include "Registry.h"
#include "YamlHelper.h"
#include "..\resource\resource.h"
#include "../resource/resource.h"
/*
Memory map:
@ -114,6 +114,32 @@ Overview
struct HDD
{
HDD()
{
clear();
}
void clear()
{
// This is not a POD (there is a std::string)
// ZeroMemory does not work
ZeroMemory(imagename, sizeof(imagename));
ZeroMemory(fullname, sizeof(fullname));
strFilenameInZip.clear();
imagehandle = NULL;
bWriteProtected = false;
hd_error = 0;
hd_memblock = 0;
hd_diskblock = 0;
hd_buf_ptr = 0;
hd_imageloaded = false;
ZeroMemory(hd_buf, sizeof(hd_buf));
#if HD_LED
hd_status_next = DISK_STATUS_OFF;
hd_status_prev = DISK_STATUS_OFF;
#endif
}
// From Disk_t
TCHAR imagename[ MAX_DISK_IMAGE_NAME + 1 ]; // <FILENAME> (ie. no extension) [not used]
TCHAR fullname[ MAX_DISK_FULL_NAME + 1 ]; // <FILENAME.EXT> or <FILENAME.zip>
@ -143,7 +169,7 @@ static BYTE g_nHD_UnitNum = HARDDISK_1<<7; // b7=unit
// . ProDOS will write to Command before switching drives
static BYTE g_nHD_Command;
static HDD g_HardDisk[NUM_HARDDISKS] = {0};
static HDD g_HardDisk[NUM_HARDDISKS];
static bool g_bSaveDiskImage = true; // Save the DiskImage name to Registry
static UINT g_uSlot = 7;
@ -187,7 +213,7 @@ void HD_LoadLastDiskImage(const int iDrive)
char sFilePath[ MAX_PATH + 1];
sFilePath[0] = 0;
char *pRegKey = (iDrive == HARDDISK_1)
const char *pRegKey = (iDrive == HARDDISK_1)
? REGVALUE_PREF_LAST_HARDDISK_1
: REGVALUE_PREF_LAST_HARDDISK_2;
@ -340,7 +366,7 @@ void HD_Destroy(void)
}
// pszImageFilename is qualified with path
static BOOL HD_Insert(const int iDrive, LPCTSTR pszImageFilename)
BOOL HD_Insert(const int iDrive, LPCTSTR pszImageFilename)
{
if (*pszImageFilename == 0x00)
return FALSE;
@ -806,7 +832,7 @@ bool HD_LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version, co
for (UINT i=0; i<NUM_HARDDISKS; i++)
{
HD_Unplug(i);
ZeroMemory(&g_HardDisk[i], sizeof(HDD));
g_HardDisk[i].clear();
}
bool bResSelectImage1 = HD_LoadSnapshotHDDUnit(yamlLoadHelper, HARDDISK_1);

View File

@ -38,6 +38,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
void HD_Reset(void);
void HD_Load_Rom(const LPBYTE pCxRomPeripheral, const UINT uSlot);
bool HD_Select(const int iDrive);
BOOL HD_Insert(const int iDrive, LPCTSTR pszImageFilename);
void HD_Unplug(const int iDrive);
bool HD_IsDriveUnplugged(const int iDrive);
void HD_LoadLastDiskImage(const int iDrive);

View File

@ -39,12 +39,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "CPU.h"
#include "Memory.h"
#include "YamlHelper.h"
#include "Configuration\PropertySheet.h"
#include "Configuration/PropertySheet.h"
#define BUTTONTIME 5000 // This is the latch (debounce) time in usecs for the joystick buttons

View File

@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "Frame.h"
#include "Keyboard.h"
#include "Pravets.h"

View File

@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "CPU.h"
#include "Disk.h"
#include "Frame.h"
@ -52,10 +52,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Video.h"
#include "z80emu.h"
#include "Z80VICE\z80.h"
#include "..\resource\resource.h"
#include "Configuration\PropertySheet.h"
#include "Debugger\DebugDefs.h"
#include "Z80VICE/z80.h"
#include "../resource/resource.h"
#include "Configuration/IPropertySheet.h"
#include "Debugger/DebugDefs.h"
#include "YamlHelper.h"
#define SW_80STORE (memmode & MF_80STORE)
@ -1242,6 +1242,12 @@ void MemInitialize()
g_pAppTitle,
MB_ICONEXCLAMATION | MB_SETFOREGROUND);
// memimage has been freed
// if we have come here we should use newloc
//
// this happens when running under valgrind
memimage = (LPBYTE)newloc;
#ifdef RAMWORKS
// allocate memory for RAMWorks III - up to 8MB
g_uActiveBank = 0;

View File

@ -79,7 +79,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "SaveState_Structs_v1.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "CPU.h"
#include "Log.h"
#include "Memory.h"

View File

@ -40,7 +40,7 @@ Etc.
*/
#include "stdafx.h"
#include "StdAfx.h"
#include "SaveState_Structs_common.h"
#include "Common.h"
@ -49,10 +49,9 @@ Etc.
#include "Log.h"
#include "Memory.h"
#include "MouseInterface.h"
#include "SoundCore.h" // SAFE_RELEASE()
#include "YamlHelper.h"
#include "..\resource\resource.h"
#include "../resource/resource.h"
#ifdef _DEBUG
#define _DEBUG_SPURIOUS_IRQ
@ -762,6 +761,7 @@ bool CMouseInterface::LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT sl
//#define STRICT
#define DIRECTINPUT_VERSION 0x0800
#include "SoundCore.h" // SAFE_RELEASE()
#include <dinput.h>
extern bool g_bDisableDirectInput; // currently in AppleWin.h

View File

@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// Includes
#include "StdAfx.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "CPU.h"
#include "Frame.h" // FRAMEBUFFER_W FRAMEBUFFER_H
#include "Memory.h" // MemGetMainPtr() MemGetBankPtr()

View File

@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "StdAfx.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "NTSC_CharSet.h"

View File

@ -28,13 +28,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "Memory.h"
#include "ParallelPrinter.h"
#include "Registry.h"
#include "YamlHelper.h"
#include "..\resource\resource.h"
#include "../resource/resource.h"
static DWORD inactivity = 0;
static unsigned int g_PrinterIdleLimit = 10;
@ -169,7 +169,7 @@ static BYTE __stdcall PrintTransmit(WORD, WORD, BYTE, BYTE value, ULONG)
return 0;
}
char c = NULL;
char c = 0;
if ((g_Apple2Type == A2TYPE_PRAVETS8A) && g_bConvertEncoding) //This is print conversion for Pravets 8A/C. Print conversion for Pravets82/M is still to be done.
{
if ((value > 90) && (value < 128)) //This range shall be set more precisely

View File

@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "Frame.h"
#include "Keyboard.h"
#include "Tape.h"

View File

@ -7,3 +7,5 @@ BOOL RegLoadString (LPCTSTR,LPCTSTR,BOOL,LPTSTR,DWORD);
BOOL RegLoadValue (LPCTSTR,LPCTSTR,BOOL,DWORD *);
void RegSaveString (LPCTSTR,LPCTSTR,BOOL,LPCTSTR);
void RegSaveValue (LPCTSTR,LPCTSTR,BOOL,DWORD);
BOOL RegLoadValue (LPCTSTR,LPCTSTR,BOOL,BOOL *);

View File

@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Author: Various
*/
#include "Stdafx.h"
#include "StdAfx.h"
#include "Riff.h"
static HANDLE g_hRiffFile = INVALID_HANDLE_VALUE;

View File

@ -32,7 +32,7 @@
*/
#include "StdAfx.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "Memory.h"
#include "SAM.h"
#include "Speaker.h"

View File

@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "SaveState_Structs_v1.h"
#include "YamlHelper.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "CPU.h"
#include "Disk.h"
#include "Frame.h"
@ -48,8 +48,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Video.h"
#include "z80emu.h"
#include "Configuration\Config.h"
#include "Configuration\IPropertySheet.h"
#include "Configuration/Config.h"
#include "Configuration/IPropertySheet.h"
#define DEFAULT_SNAPSHOT_NAME "SaveState.aws.yaml"
@ -138,10 +138,10 @@ static void Snapshot_LoadState_v1() // .aws v1.0.0.1, up to (and including) Appl
HANDLE hFile = CreateFile( g_strSaveStatePathname.c_str(),
GENERIC_READ,
0,
NULL,
0,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
0);
if(hFile == INVALID_HANDLE_VALUE)
throw std::string("File not found: ") + g_strSaveStatePathname;

View File

@ -40,7 +40,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "CPU.h"
#include "Disk.h" // DiskIsSpinning()
#include "Frame.h"
@ -48,7 +48,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "SerialComms.h"
#include "YamlHelper.h"
#include "..\resource\resource.h"
#include "../resource/resource.h"
//#define SUPPORT_MODEM
#define TCP_SERIAL_PORT 1977

View File

@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "Frame.h"
#include "SoundCore.h"
#include "Speaker.h"

View File

@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "CPU.h"
#include "Frame.h"
#include "Memory.h"
@ -37,7 +37,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Video.h" // VideoRedrawScreen()
#include "YamlHelper.h"
#include "Debugger\Debug.h" // For DWORD extbench
#include "Debugger/Debug.h" // For DWORD extbench
// Notes:
//

View File

@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "Keyboard.h"
#include "Memory.h"
#include "Pravets.h"

View File

@ -24,7 +24,7 @@
*
*/
#include "..\StdAfx.h"
#include "../StdAfx.h"
#include <assert.h>
#include <stdio.h>
@ -43,8 +43,8 @@
#endif
typedef unsigned int UINT;
#include "..\Common.h" // For: IS_APPLE2
#include "..\Memory.h"
#include "../Common.h" // For: IS_APPLE2
#include "../Memory.h"
/**/
/** #define TFE_DEBUG_DUMP 1 **/

View File

@ -27,7 +27,7 @@
#ifndef _TFE_H
#define _TFE_H
#include "..\CommonVICE\types.h"
#include "../CommonVICE/types.h"
#include <stdio.h>
/* define this only if VICE should write each and every frame received

View File

@ -28,7 +28,7 @@
#ifndef _TFEARCH_H
#define _TFEARCH_H
#include "..\CommonVICE\types.h"
#include "../CommonVICE/types.h"
extern int tfe_arch_init(void);
extern void tfe_arch_pre_reset(void);

View File

@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "CPU.h"
#include "Frame.h"
#include "Keyboard.h"
@ -37,8 +37,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Video.h"
#include "NTSC.h"
#include "..\resource\resource.h"
#include "Configuration\PropertySheet.h"
#include "../resource/resource.h"
#include "Configuration/PropertySheet.h"
#include "YamlHelper.h"
#define SW_80COL (g_uVideoMode & VF_80COL)

View File

@ -154,7 +154,7 @@ int YamlHelper::ParseMap(MapYaml& mapYaml)
mapValue.value = pValue;
mapValue.subMap = NULL;
mapYaml[std::string(pKey)] = mapValue;
delete [] pKey; pKey = NULL;
free(pKey); pKey = NULL;
}
bKey = bKey ? false : true;
@ -166,7 +166,7 @@ int YamlHelper::ParseMap(MapYaml& mapYaml)
}
if (pKey)
delete [] pKey;
free(pKey);
return res;
}

View File

@ -25,7 +25,7 @@
*/
#include "daa.h"
#include "..\CommonVICE\types.h" // [AppleWin-TC]
#include "../CommonVICE/types.h" // [AppleWin-TC]
const BYTE daa_reg_a[2048] = {

View File

@ -27,7 +27,7 @@
#ifndef _DAA_H
#define _DAA_H
#include "..\CommonVICE\types.h" // [AppleWin-TC]
#include "../CommonVICE/types.h" // [AppleWin-TC]
extern const BYTE daa_reg_a[];
extern const BYTE daa_reg_f[];

View File

@ -24,12 +24,12 @@
*
*/
#include "..\StdAfx.h"
#include "../StdAfx.h"
#include "..\AppleWin.h"
#include "..\CPU.h"
#include "..\Memory.h"
#include "..\YamlHelper.h"
#include "../Applewin.h"
#include "../CPU.h"
#include "../Memory.h"
#include "../YamlHelper.h"
#undef IN // Defined in windef.h
@ -39,15 +39,15 @@
#include <stdlib.h>
#include "..\CommonVICE\6510core.h" // [AppleWin-TC]
#include "..\CommonVICE\alarm.h"
#include "../CommonVICE/6510core.h" // [AppleWin-TC]
#include "../CommonVICE/alarm.h"
#include "daa.h"
//#include "debug.h" // [AppleWin-TC]
#include "..\CommonVICE\interrupt.h"
#include "../CommonVICE/interrupt.h"
//#include "log.h" // [AppleWin-TC]
//#include "maincpu.h" // [AppleWin-TC]
//#include "monitor.h" // [AppleWin-TC]
#include "..\CommonVICE\types.h"
#include "../CommonVICE/types.h"
#include "z80.h"
#include "z80mem.h"
#include "z80regs.h"
@ -55,7 +55,7 @@
/*#define DEBUG_Z80*/
static CLOCK maincpu_clk = 0; // [AppleWin-TC]
CLOCK maincpu_clk = 0; // [AppleWin-TC]
static BYTE reg_a = 0;
static BYTE reg_b = 0;

View File

@ -44,7 +44,7 @@
//#include "vdc.h"
//#include "vicii-mem.h"
//#include "vicii.h"
#include "..\CommonVICE\types.h" // [AppleWin-TC]
#include "../CommonVICE/types.h" // [AppleWin-TC]
#include "z80mem.h"
#include "z80.h" // [AppleWin-TC] Added for z80_RDMEM() & z80_WRMEM

View File

@ -30,10 +30,10 @@
#ifdef WATCOM_COMPILE
#include "../mem.h"
#else
#include "..\CommonVICE\mem.h" // [AppleWin-TC]
#include "../CommonVICE/mem.h" // [AppleWin-TC]
#endif
#include "..\CommonVICE\types.h" // [AppleWin-TC]
#include "../CommonVICE/types.h" // [AppleWin-TC]
extern int z80mem_resources_init(void);
extern int z80mem_cmdline_options_init(void);

View File

@ -27,7 +27,7 @@
#ifndef _Z80REGS_H
#define _Z80REGS_H
#include "..\CommonVICE\types.h" // [AppleWin-TC]
#include "../CommonVICE/types.h" // [AppleWin-TC]
typedef struct z80_regs_s {
WORD reg_af;

View File

@ -15,7 +15,7 @@
#include "StdAfx.h"
#include "AppleWin.h"
#include "Applewin.h"
#include "CPU.h"
#include "Memory.h"
#include "z80emu.h"

View File

@ -79,10 +79,10 @@ void NTSC_VideoUpdateCycles( long cycles6502 )
//-------------------------------------
#include "../../source/cpu/cpu_general.inl"
#include "../../source/cpu/cpu_instructions.inl"
#include "../../source/cpu/cpu6502.h" // MOS 6502
#include "../../source/cpu/cpu65C02.h" // WDC 65C02
#include "../../source/CPU/cpu_general.inl"
#include "../../source/CPU/cpu_instructions.inl"
#include "../../source/CPU/cpu6502.h" // MOS 6502
#include "../../source/CPU/cpu65C02.h" // WDC 65C02
void init(void)
{