Make ProDOS utils cross platform. (#1406)

* Move ProDOS utils to separate file.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>

* Use std::vector to fix and avoid memory leaks.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>

* Remove TEXT and TCHAR.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>

---------

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
Andrea
2025-06-13 16:51:59 +01:00
committed by GitHub
parent cdba020ca7
commit 75cc573d0e
8 changed files with 1125 additions and 1017 deletions

View File

@@ -99,6 +99,8 @@
<ClInclude Include="source\NTSC_CharSet.h" />
<ClInclude Include="source\ParallelPrinter.h" />
<ClInclude Include="source\Pravets.h" />
<ClInclude Include="source\ProDOS_Utils.h" />
<ClInclude Include="source\ProDOS_FileSystem.h" />
<ClInclude Include="source\Registry.h" />
<ClInclude Include="source\RGBMonitor.h" />
<ClInclude Include="source\Riff.h" />
@@ -210,6 +212,7 @@
<ClCompile Include="source\NTSC_CharSet.cpp" />
<ClCompile Include="source\ParallelPrinter.cpp" />
<ClCompile Include="source\Pravets.cpp" />
<ClCompile Include="source\ProDOS_Utils.cpp" />
<ClCompile Include="source\Registry.cpp" />
<ClCompile Include="source\Riff.cpp" />
<ClCompile Include="source\SaveState.cpp" />

View File

@@ -106,6 +106,9 @@
<ClCompile Include="source\Configuration\PageSound.cpp">
<Filter>Source Files\Configuration</Filter>
</ClCompile>
<ClCompile Include="source\ProDOS_Utils.cpp">
<Filter>Source Files\Emulator</Filter>
</ClCompile>
<ClCompile Include="source\ParallelPrinter.cpp">
<Filter>Source Files\Emulator</Filter>
</ClCompile>
@@ -426,6 +429,12 @@
<ClInclude Include="source\ParallelPrinter.h">
<Filter>Source Files\Emulator</Filter>
</ClInclude>
<ClInclude Include="source\ProDOS_Utils.h">
<Filter>Source Files\Emulator</Filter>
</ClInclude>
<ClInclude Include="source\ProDOS_FileSystem.h">
<Filter>Source Files\Emulator</Filter>
</ClInclude>
<ClInclude Include="source\Tfe\Pcap.h">
<Filter>Source Files\Uthernet</Filter>
</ClInclude>

View File

@@ -99,6 +99,8 @@
<ClInclude Include="source\NTSC_CharSet.h" />
<ClInclude Include="source\ParallelPrinter.h" />
<ClInclude Include="source\Pravets.h" />
<ClInclude Include="source\ProDOS_FileSystem.h" />
<ClInclude Include="source\ProDOS_Utils.h" />
<ClInclude Include="source\Registry.h" />
<ClInclude Include="source\RGBMonitor.h" />
<ClInclude Include="source\Riff.h" />
@@ -179,6 +181,7 @@
<ClCompile Include="source\FourPlay.cpp" />
<ClCompile Include="source\FrameBase.cpp" />
<ClCompile Include="source\MockingboardCardManager.cpp" />
<ClCompile Include="source\ProDOS_Utils.cpp" />
<ClCompile Include="source\RGBMonitor.cpp" />
<ClCompile Include="source\SAM.cpp" />
<ClCompile Include="source\Debugger\Debug.cpp" />

View File

@@ -277,6 +277,9 @@
<ClCompile Include="source\Windows\DXSoundBuffer.cpp">
<Filter>Source Files\Windows</Filter>
</ClCompile>
<ClCompile Include="source\ProDOS_Utils.cpp">
<Filter>Source Files\Emulator</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="source\CommonVICE\6510core.h">
@@ -426,6 +429,9 @@
<ClInclude Include="source\ParallelPrinter.h">
<Filter>Source Files\Emulator</Filter>
</ClInclude>
<ClInclude Include="source\ProDOS_FileSystem.h">
<Filter>Source Files\Emulator</Filter>
</ClInclude>
<ClInclude Include="source\Tfe\Pcap.h">
<Filter>Source Files\Uthernet</Filter>
</ClInclude>
@@ -627,6 +633,9 @@
<ClInclude Include="source\Windows\DXSoundBuffer.h">
<Filter>Source Files\Windows</Filter>
</ClInclude>
<ClInclude Include="source\ProDOS_Utils.h">
<Filter>Source Files\Emulator</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="resource\Applewin.bmp">

View File

@@ -213,7 +213,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// --- ProDOS Block Functions ---
// ------------------------------------------------------------------------
int ProDOS_BlockGetDirectoryBlockCount ( uint8_t *pDiskBytes, int nOffset )
inline int ProDOS_BlockGetDirectoryBlockCount ( uint8_t *pDiskBytes, int nOffset )
{
int nBlocks = 0;
int nNextBlock = 0;

1012
source/ProDOS_Utils.cpp Normal file

File diff suppressed because it is too large Load Diff

34
source/ProDOS_Utils.h Normal file
View File

@@ -0,0 +1,34 @@
/*
AppleWin : An Apple //e emulator for Windows
Copyright (C) 1994-1996, Michael O'Brien
Copyright (C) 1999-2001, Oliver Schmidt
Copyright (C) 2002-2005, Tom Charlesworth
Copyright (C) 2006-2014, Tom Charlesworth, Michael Pohoreski
AppleWin 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.
AppleWin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with AppleWin; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#pragma once
class FrameBase;
void New_DOSProDOS_Disk( const char * pTitle, const std::string & pathname, const size_t nDiskSize,
const bool bIsDOS33, const bool bNewDiskCopyBitsyBoot, const bool bNewDiskCopyBitsyBye, const bool bNewDiskCopyBASIC, const bool bNewDiskCopyProDOS,
FrameBase *pFrame ); // file will be overwritten
void New_Blank_Disk( const char * pTitle, const std::string & pathname,
const size_t nDiskSize, const bool bIsHardDisk, FrameBase *pFrame ); // file will be overwritten
void Format_ProDOS_Disk( const std::string & pathname, FrameBase *pFrame); // file must exist
void Format_DOS33_Disk( const std::string & pathname, FrameBase *pFrame); // file must exist

File diff suppressed because it is too large Load Diff