mirror of
https://github.com/fadden/ciderpress.git
synced 2024-10-06 01:56:20 +00:00
More source code shuffling
Moved comments and return types, switched to uint types, added "override" keyword.
This commit is contained in:
parent
aa3145856c
commit
c78017b1d2
@ -445,7 +445,7 @@ void ContentList::OnGetDispInfo(NMHDR* pnmh, LRESULT* pResult)
|
||||
{
|
||||
CString modDate;
|
||||
FormatDate(pEntry->GetModWhen(), &modDate);
|
||||
::lstrcpy(plvdi->item.pszText, (LPCTSTR) modDate);
|
||||
::lstrcpy(plvdi->item.pszText, (LPCWSTR) modDate);
|
||||
}
|
||||
break;
|
||||
case 4: // format
|
||||
|
@ -43,7 +43,7 @@ BOOL ExtractOptionsDialog::OnInitDialog(void)
|
||||
pWnd->SetWindowText(countFmt);
|
||||
} else {
|
||||
countFmt.LoadString(IDS_EXT_SELECTED_COUNTS_FMT);
|
||||
selStr.Format((LPCTSTR) countFmt, fSelectedCount);
|
||||
selStr.Format((LPCWSTR) countFmt, fSelectedCount);
|
||||
pWnd->SetWindowText(selStr);
|
||||
|
||||
if (fSelectedCount == 0)
|
||||
|
@ -241,7 +241,7 @@ void MyRegistry::ConfigureAppID(const WCHAR* appID, const WCHAR* descr,
|
||||
iconStr.Format(L"%ls,%d", exeName, iconIdx);
|
||||
|
||||
if (RegSetValueEx(hIconKey, L"", 0, REG_SZ,
|
||||
(const BYTE*)(LPCTSTR) iconStr,
|
||||
(const BYTE*)(LPCWSTR) iconStr,
|
||||
wcslen(iconStr) * sizeof(WCHAR)) == ERROR_SUCCESS)
|
||||
{
|
||||
LOGI(" Set icon for '%ls' to '%ls'", appID,
|
||||
|
@ -149,7 +149,7 @@ private:
|
||||
*/
|
||||
int OwnExtension(const WCHAR* ext, const WCHAR* appID) const;
|
||||
|
||||
DWORD RegDeleteKeyNT(HKEY hStartKey, LPCTSTR pKeyName) const;
|
||||
DWORD RegDeleteKeyNT(HKEY hStartKey, LPCWSTR pKeyName) const;
|
||||
|
||||
/* key validation */
|
||||
//static uint16_t CalcCRC16(uint16_t seed,
|
||||
|
@ -31,7 +31,7 @@ BOOL UseSelectionDialog::OnInitDialog(void)
|
||||
pWnd->SetWindowText(str);
|
||||
} else {
|
||||
str.LoadString(fSelCountsID);
|
||||
selStr.Format((LPCTSTR) str, fSelectedCount);
|
||||
selStr.Format((LPCWSTR) str, fSelectedCount);
|
||||
pWnd->SetWindowText(selStr);
|
||||
|
||||
if (fSelectedCount == 0)
|
||||
|
@ -49,7 +49,7 @@ BOOL AboutDlg::OnInitDialog()
|
||||
pWnd->GetWindowText(fmt);
|
||||
newText.Format(fmt, kAppMajorVersion, kAppMinorVersion, kAppBugVersion);
|
||||
pWnd->SetWindowText(newText);
|
||||
LOGI("STR is '%ls'", (LPCWSTR) newText);
|
||||
LOGD("STR is '%ls'", (LPCWSTR) newText);
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
|
@ -10,14 +10,7 @@
|
||||
#include "ChooseFilesDlg.h"
|
||||
|
||||
|
||||
/*
|
||||
* Override base class version so we can move our stuff around.
|
||||
*
|
||||
* It's important that the base class be called last, because it calls
|
||||
* Invalidate to redraw the dialog.
|
||||
*/
|
||||
void
|
||||
ChooseFilesDlg::ShiftControls(int deltaX, int deltaY)
|
||||
void ChooseFilesDlg::ShiftControls(int deltaX, int deltaY)
|
||||
{
|
||||
/*
|
||||
* These only need to be here so that the initial move puts them
|
||||
|
@ -24,14 +24,13 @@ public:
|
||||
virtual ~ChooseFilesDlg(void) {}
|
||||
|
||||
private:
|
||||
//virtual bool MyDataExchange(bool saveAndValidate);
|
||||
virtual void ShiftControls(int deltaX, int deltaY);
|
||||
//virtual UINT MyOnCommand(WPARAM wParam, LPARAM lParam);
|
||||
|
||||
//void OnIDHelp(void);
|
||||
|
||||
//int GetButtonCheck(int id);
|
||||
//void SetButtonCheck(int id, int checkVal);
|
||||
/*
|
||||
* Override base class version so we can move our stuff around.
|
||||
*
|
||||
* It's important that the base class be called last, because it calls
|
||||
* Invalidate to redraw the dialog.
|
||||
*/
|
||||
virtual void ShiftControls(int deltaX, int deltaY) override;
|
||||
|
||||
//DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
150
mdc/Main.cpp
150
mdc/Main.cpp
@ -27,10 +27,6 @@ BEGIN_MESSAGE_MAP(MainWindow, CFrameWnd)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
/*
|
||||
* MainWindow constructor. Creates the main window and sets
|
||||
* its properties.
|
||||
*/
|
||||
MainWindow::MainWindow()
|
||||
{
|
||||
static const WCHAR* kAppName = L"MDC";
|
||||
@ -61,11 +57,6 @@ MainWindow::MainWindow()
|
||||
fCancelFlag = false;
|
||||
}
|
||||
|
||||
/*
|
||||
* MainWindow destructor. Close the archive if one is open, but don't try
|
||||
* to shut down any controls in child windows. By this point, Windows has
|
||||
* already snuffed them.
|
||||
*/
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
// int cc;
|
||||
@ -75,21 +66,15 @@ MainWindow::~MainWindow()
|
||||
DiskImgLib::Global::AppCleanup();
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle Exit item by sending a close request.
|
||||
*/
|
||||
void
|
||||
MainWindow::OnFileExit(void)
|
||||
void MainWindow::OnFileExit(void)
|
||||
{
|
||||
// Handle Exit item by sending a close request.
|
||||
SendMessage(WM_CLOSE, 0, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Go to the faddenSoft web site.
|
||||
*/
|
||||
void
|
||||
MainWindow::OnHelpWebSite(void)
|
||||
void MainWindow::OnHelpWebSite(void)
|
||||
{
|
||||
// Go to the faddenSoft web site.
|
||||
int err;
|
||||
|
||||
err = (int) ::ShellExecute(m_hWnd, L"open", kWebSiteURL, NULL, NULL,
|
||||
@ -101,11 +86,7 @@ MainWindow::OnHelpWebSite(void)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Pop up the About box.
|
||||
*/
|
||||
void
|
||||
MainWindow::OnHelpAbout(void)
|
||||
void MainWindow::OnHelpAbout(void)
|
||||
{
|
||||
int result;
|
||||
|
||||
@ -116,11 +97,7 @@ MainWindow::OnHelpAbout(void)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle "scan" item.
|
||||
*/
|
||||
void
|
||||
MainWindow::OnFileScan(void)
|
||||
void MainWindow::OnFileScan(void)
|
||||
{
|
||||
if (0) {
|
||||
CString msg;
|
||||
@ -131,19 +108,7 @@ MainWindow::OnFileScan(void)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Allow events to flow through the message queue whenever the
|
||||
* progress meter gets updated. This will allow us to redraw with
|
||||
* reasonable frequency.
|
||||
*
|
||||
* Calling this can result in other code being called, such as Windows
|
||||
* message handlers, which can lead to reentrancy problems. Make sure
|
||||
* you're adequately semaphored before calling here.
|
||||
*
|
||||
* Returns TRUE if all is well, FALSE if we're trying to quit.
|
||||
*/
|
||||
BOOL
|
||||
MainWindow::PeekAndPump(void)
|
||||
BOOL MainWindow::PeekAndPump(void)
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
@ -167,9 +132,6 @@ MainWindow::PeekAndPump(void)
|
||||
* ==========================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
* Handle a debug message from the DiskImg library.
|
||||
*/
|
||||
/*static*/ void
|
||||
MainWindow::DebugMsgHandler(const char* file, int line, const char* msg)
|
||||
{
|
||||
@ -179,11 +141,9 @@ MainWindow::DebugMsgHandler(const char* file, int line, const char* msg)
|
||||
LOG_BASE(DebugLog::LOG_INFO, file, line, "<diskimg> %hs", msg);
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle a global error message from the NufxLib library.
|
||||
*/
|
||||
/*static*/ NuResult
|
||||
MainWindow::NufxErrorMsgHandler(NuArchive* /*pArchive*/, void* vErrorMessage)
|
||||
|
||||
/*static*/ NuResult MainWindow::NufxErrorMsgHandler(NuArchive* /*pArchive*/,
|
||||
void* vErrorMessage)
|
||||
{
|
||||
const NuErrorMessage* pErrorMessage = (const NuErrorMessage*) vErrorMessage;
|
||||
|
||||
@ -201,11 +161,7 @@ typedef struct ScanOpts {
|
||||
ProgressDlg* pProgress;
|
||||
} ScanOpts;
|
||||
|
||||
/*
|
||||
* Scan a set of files.
|
||||
*/
|
||||
void
|
||||
MainWindow::ScanFiles(void)
|
||||
void MainWindow::ScanFiles(void)
|
||||
{
|
||||
ChooseFilesDlg chooseFiles;
|
||||
ScanOpts scanOpts;
|
||||
@ -361,13 +317,7 @@ typedef struct Win32dirent {
|
||||
|
||||
static const WCHAR kWildMatchAll[] = L"*.*";
|
||||
|
||||
/*
|
||||
* Prepare a directory for reading.
|
||||
*
|
||||
* Allocates a Win32dirent struct that must be freed by the caller.
|
||||
*/
|
||||
Win32dirent*
|
||||
MainWindow::OpenDir(const WCHAR* name)
|
||||
Win32dirent* MainWindow::OpenDir(const WCHAR* name)
|
||||
{
|
||||
Win32dirent* dir = NULL;
|
||||
WCHAR* tmpStr = NULL;
|
||||
@ -411,13 +361,7 @@ failed:
|
||||
goto bail;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get an entry from an open directory.
|
||||
*
|
||||
* Returns a NULL pointer after the last entry has been read.
|
||||
*/
|
||||
Win32dirent*
|
||||
MainWindow::ReadDir(Win32dirent* dir)
|
||||
Win32dirent* MainWindow::ReadDir(Win32dirent* dir)
|
||||
{
|
||||
if (dir->d_first)
|
||||
dir->d_first = 0;
|
||||
@ -433,11 +377,7 @@ MainWindow::ReadDir(Win32dirent* dir)
|
||||
return dir;
|
||||
}
|
||||
|
||||
/*
|
||||
* Close a directory.
|
||||
*/
|
||||
void
|
||||
MainWindow::CloseDir(Win32dirent* dir)
|
||||
void MainWindow::CloseDir(Win32dirent* dir)
|
||||
{
|
||||
if (dir == NULL)
|
||||
return;
|
||||
@ -446,14 +386,7 @@ MainWindow::CloseDir(Win32dirent* dir)
|
||||
free(dir);
|
||||
}
|
||||
|
||||
/*
|
||||
* Process a file or directory. These are expected to be names of files in
|
||||
* the current directory.
|
||||
*
|
||||
* Returns 0 on success, nonzero on error with a message in "*pErrMsg".
|
||||
*/
|
||||
int
|
||||
MainWindow::Process(const WCHAR* pathname, ScanOpts* pScanOpts,
|
||||
int MainWindow::Process(const WCHAR* pathname, ScanOpts* pScanOpts,
|
||||
CString* pErrMsg)
|
||||
{
|
||||
bool exists, isDir, isReadable;
|
||||
@ -498,13 +431,7 @@ bail:
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Win32 recursive directory descent. Scan the contents of a directory.
|
||||
* If a subdirectory is found, follow it; otherwise, call Win32AddFile to
|
||||
* add the file.
|
||||
*/
|
||||
int
|
||||
MainWindow::ProcessDirectory(const WCHAR* dirName, ScanOpts* pScanOpts,
|
||||
int MainWindow::ProcessDirectory(const WCHAR* dirName, ScanOpts* pScanOpts,
|
||||
CString* pErrMsg)
|
||||
{
|
||||
Win32dirent* dirp = NULL;
|
||||
@ -560,14 +487,7 @@ bail:
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Open a disk image and dump the contents.
|
||||
*
|
||||
* Returns 0 on success, nonzero on failure.
|
||||
*/
|
||||
int
|
||||
MainWindow::ScanDiskImage(const WCHAR* pathName, ScanOpts* pScanOpts)
|
||||
int MainWindow::ScanDiskImage(const WCHAR* pathName, ScanOpts* pScanOpts)
|
||||
{
|
||||
ASSERT(pathName != NULL);
|
||||
ASSERT(pScanOpts != NULL);
|
||||
@ -677,11 +597,7 @@ bail:
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Analyze a file's characteristics.
|
||||
*/
|
||||
void
|
||||
MainWindow::AnalyzeFile(const A2File* pFile, RecordKind* pRecordKind,
|
||||
void MainWindow::AnalyzeFile(const A2File* pFile, RecordKind* pRecordKind,
|
||||
LONGLONG* pTotalLen, LONGLONG* pTotalCompLen)
|
||||
{
|
||||
if (pFile->IsVolumeDirectory()) {
|
||||
@ -710,14 +626,7 @@ MainWindow::AnalyzeFile(const A2File* pFile, RecordKind* pRecordKind,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Determine whether the access bits on the record make it a read-only
|
||||
* file or not.
|
||||
*
|
||||
* Uses a simplified view of the access flags.
|
||||
*/
|
||||
bool
|
||||
MainWindow::IsRecordReadOnly(int access)
|
||||
bool MainWindow::IsRecordReadOnly(int access)
|
||||
{
|
||||
if (access == 0x21L || access == 0x01L)
|
||||
return true;
|
||||
@ -761,13 +670,7 @@ static const char gFileTypeNames[256][4] = {
|
||||
"$F8", "OS ", "INT", "IVR", "BAS", "VAR", "REL", "SYS"
|
||||
};
|
||||
|
||||
/*
|
||||
* Return a pointer to the three-letter representation of the file type name.
|
||||
*
|
||||
* Note to self: code down below tests first char for '?'.
|
||||
*/
|
||||
/*static*/ const char*
|
||||
MainWindow::GetFileTypeString(unsigned long fileType)
|
||||
/*static*/ const char* MainWindow::GetFileTypeString(unsigned long fileType)
|
||||
{
|
||||
if (fileType < NELEM(gFileTypeNames))
|
||||
return gFileTypeNames[fileType];
|
||||
@ -778,9 +681,10 @@ MainWindow::GetFileTypeString(unsigned long fileType)
|
||||
/*
|
||||
* Sanitize a string. The Mac likes to stick control characters into
|
||||
* things, e.g. ^C and ^M, and uses high ASCII for special characters.
|
||||
*
|
||||
* TODO: use Mac Roman unicode translation instead
|
||||
*/
|
||||
static void
|
||||
MacSanitize(char* str)
|
||||
static void MacSanitize(char* str)
|
||||
{
|
||||
while (*str != '\0') {
|
||||
*str = DiskImg::MacToASCII(*str);
|
||||
@ -788,13 +692,7 @@ MacSanitize(char* str)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Load the contents of a DiskFS.
|
||||
*
|
||||
* Recursively handle sub-volumes.
|
||||
*/
|
||||
int
|
||||
MainWindow::LoadDiskFSContents(DiskFS* pDiskFS, const char* volName,
|
||||
int MainWindow::LoadDiskFSContents(DiskFS* pDiskFS, const char* volName,
|
||||
ScanOpts* pScanOpts)
|
||||
{
|
||||
static const char* kBlankFileName = "<blank filename>";
|
||||
|
89
mdc/Main.h
89
mdc/Main.h
@ -31,7 +31,17 @@ typedef enum RecordKind {
|
||||
*/
|
||||
class MainWindow : public CFrameWnd {
|
||||
public:
|
||||
/*
|
||||
* MainWindow constructor. Creates the main window and sets
|
||||
* its properties.
|
||||
*/
|
||||
MainWindow(void);
|
||||
|
||||
/*
|
||||
* MainWindow destructor. Close the archive if one is open, but don't try
|
||||
* to shut down any controls in child windows. By this point, Windows has
|
||||
* already snuffed them.
|
||||
*/
|
||||
~MainWindow(void);
|
||||
|
||||
private:
|
||||
@ -40,29 +50,104 @@ private:
|
||||
afx_msg void OnHelpWebSite(void);
|
||||
afx_msg void OnHelpAbout(void);
|
||||
|
||||
/*
|
||||
* Allow events to flow through the message queue whenever the
|
||||
* progress meter gets updated. This will allow us to redraw with
|
||||
* reasonable frequency.
|
||||
*
|
||||
* Calling this can result in other code being called, such as Windows
|
||||
* message handlers, which can lead to reentrancy problems. Make sure
|
||||
* you're adequately semaphored before calling here.
|
||||
*
|
||||
* Returns TRUE if all is well, FALSE if we're trying to quit.
|
||||
*/
|
||||
BOOL PeekAndPump(void);
|
||||
|
||||
/*
|
||||
* Handle a debug message from the DiskImg library.
|
||||
*/
|
||||
static void DebugMsgHandler(const char* file, int line,
|
||||
const char* msg);
|
||||
static NuResult NufxErrorMsgHandler(NuArchive* /*pArchive*/,
|
||||
void* vErrorMessage);
|
||||
|
||||
/*
|
||||
* Scan a set of files.
|
||||
*/
|
||||
void ScanFiles(void);
|
||||
|
||||
/*
|
||||
* Prepare a directory for reading.
|
||||
*
|
||||
* Allocates a Win32dirent struct that must be freed by the caller.
|
||||
*/
|
||||
Win32dirent* OpenDir(const WCHAR* name);
|
||||
|
||||
/*
|
||||
* Get an entry from an open directory.
|
||||
*
|
||||
* Returns a NULL pointer after the last entry has been read.
|
||||
*/
|
||||
Win32dirent* ReadDir(Win32dirent* dir);
|
||||
|
||||
/*
|
||||
* Close a directory.
|
||||
*/
|
||||
void CloseDir(Win32dirent* dir);
|
||||
|
||||
/*
|
||||
* Process a file or directory. These are expected to be names of files in
|
||||
* the current directory.
|
||||
*
|
||||
* Returns 0 on success, nonzero on error with a message in "*pErrMsg".
|
||||
*/
|
||||
int Process(const WCHAR* pathname, ScanOpts* pScanOpts,
|
||||
CString* pErrMsg);
|
||||
|
||||
/*
|
||||
* Win32 recursive directory descent. Scan the contents of a directory.
|
||||
* If a subdirectory is found, follow it; otherwise, call Win32AddFile to
|
||||
* add the file.
|
||||
*/
|
||||
int ProcessDirectory(const WCHAR* dirName, ScanOpts* pScanOpts,
|
||||
CString* pErrMsg);
|
||||
|
||||
/*
|
||||
* Open a disk image and dump the contents.
|
||||
*
|
||||
* Returns 0 on success, nonzero on failure.
|
||||
*/
|
||||
int ScanDiskImage(const WCHAR* pathName, ScanOpts* pScanOpts);
|
||||
int LoadDiskFSContents(DiskFS* pDiskFS, const char* volName,
|
||||
ScanOpts* pScanOpts);
|
||||
|
||||
/*
|
||||
* Analyze a file's characteristics.
|
||||
*/
|
||||
void AnalyzeFile(const A2File* pFile, RecordKind* pRecordKind,
|
||||
LONGLONG* pTotalLen, LONGLONG* pTotalCompLen);
|
||||
|
||||
/*
|
||||
* Determine whether the access bits on the record make it a read-only
|
||||
* file or not.
|
||||
*
|
||||
* Uses a simplified view of the access flags.
|
||||
*/
|
||||
bool IsRecordReadOnly(int access);
|
||||
|
||||
/*
|
||||
* Return a pointer to the three-letter representation of the file type name.
|
||||
*
|
||||
* Note to self: code down below tests first char for '?'.
|
||||
*/
|
||||
static const char* GetFileTypeString(unsigned long fileType);
|
||||
|
||||
/*
|
||||
* Load the contents of a DiskFS.
|
||||
*
|
||||
* Recursively handle sub-volumes.
|
||||
*/
|
||||
int LoadDiskFSContents(DiskFS* pDiskFS, const char* volName,
|
||||
ScanOpts* pScanOpts);
|
||||
|
||||
bool fCancelFlag;
|
||||
//int fTitleAnimation;
|
||||
|
||||
|
@ -12,8 +12,7 @@
|
||||
/*
|
||||
* Decide whether or not we want to handle this file.
|
||||
*/
|
||||
void
|
||||
ReformatAWGS_WP::Examine(ReformatHolder* pHolder)
|
||||
void ReformatAWGS_WP::Examine(ReformatHolder* pHolder)
|
||||
{
|
||||
ReformatHolder::ReformatApplies applies = ReformatHolder::kApplicNot;
|
||||
|
||||
@ -27,8 +26,7 @@ ReformatAWGS_WP::Examine(ReformatHolder* pHolder)
|
||||
/*
|
||||
* Convert AWGS into formatted text.
|
||||
*/
|
||||
int
|
||||
ReformatAWGS_WP::Process(const ReformatHolder* pHolder,
|
||||
int ReformatAWGS_WP::Process(const ReformatHolder* pHolder,
|
||||
ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part,
|
||||
ReformatOutput* pOutput)
|
||||
{
|
||||
@ -148,8 +146,7 @@ ReformatAWGS_WP::Process(const ReformatHolder* pHolder,
|
||||
/*
|
||||
* Read one of the chunks of the file.
|
||||
*/
|
||||
bool
|
||||
ReformatAWGS_WP::ReadChunk(const uint8_t** pSrcBuf, long* pSrcLen,
|
||||
bool ReformatAWGS_WP::ReadChunk(const uint8_t** pSrcBuf, long* pSrcLen,
|
||||
Chunk* pChunk)
|
||||
{
|
||||
/* starts with the saveArray count */
|
||||
@ -205,8 +202,7 @@ ReformatAWGS_WP::ReadChunk(const uint8_t** pSrcBuf, long* pSrcLen,
|
||||
/*
|
||||
* Output a single chunk. We do this by walking down the saveArray.
|
||||
*/
|
||||
void
|
||||
ReformatAWGS_WP::PrintChunk(const Chunk* pChunk)
|
||||
void ReformatAWGS_WP::PrintChunk(const Chunk* pChunk)
|
||||
{
|
||||
const int kDefaultStatusBits = kAWGSJustifyLeft | kAWGSSingleSpace;
|
||||
SaveArrayEntry sae;
|
||||
@ -291,8 +287,7 @@ ReformatAWGS_WP::PrintChunk(const Chunk* pChunk)
|
||||
* skip through them earlier. We don't really need to worry about running
|
||||
* off the end due to a bad file.
|
||||
*/
|
||||
const uint8_t*
|
||||
ReformatAWGS_WP::FindTextBlock(const Chunk* pChunk, int blockNum)
|
||||
const uint8_t* ReformatAWGS_WP::FindTextBlock(const Chunk* pChunk, int blockNum)
|
||||
{
|
||||
const uint8_t* blockPtr = pChunk->textBlocks;
|
||||
uint32_t blockSize;
|
||||
@ -313,8 +308,7 @@ ReformatAWGS_WP::FindTextBlock(const Chunk* pChunk, int blockNum)
|
||||
*
|
||||
* Returns the #of bytes consumed.
|
||||
*/
|
||||
int
|
||||
ReformatAWGS_WP::PrintParagraph(const uint8_t* ptr, long maxLen)
|
||||
int ReformatAWGS_WP::PrintParagraph(const uint8_t* ptr, long maxLen)
|
||||
{
|
||||
const uint8_t* startPtr = ptr;
|
||||
uint16_t firstFont;
|
||||
@ -407,8 +401,7 @@ ReformatAWGS_WP::PrintParagraph(const uint8_t* ptr, long maxLen)
|
||||
/*
|
||||
* Run through the SaveArray and find the highest-numbered ruler index.
|
||||
*/
|
||||
uint16_t
|
||||
ReformatAWGS_WP::GetNumRulers(const uint8_t* pSaveArray,
|
||||
uint16_t ReformatAWGS_WP::GetNumRulers(const uint8_t* pSaveArray,
|
||||
uint16_t saveArrayCount)
|
||||
{
|
||||
SaveArrayEntry sa;
|
||||
@ -438,8 +431,7 @@ ReformatAWGS_WP::GetNumRulers(const uint8_t* pSaveArray,
|
||||
*
|
||||
* These are stored linearly, so we just need to look at the last entry.
|
||||
*/
|
||||
uint16_t
|
||||
ReformatAWGS_WP::GetNumTextBlocks(const uint8_t* pSaveArray,
|
||||
uint16_t ReformatAWGS_WP::GetNumTextBlocks(const uint8_t* pSaveArray,
|
||||
uint16_t saveArrayCount)
|
||||
{
|
||||
SaveArrayEntry sa;
|
||||
@ -480,8 +472,7 @@ ReformatAWGS_WP::GetNumTextBlocks(const uint8_t* pSaveArray,
|
||||
/*
|
||||
* Unpack a SaveArray entry.
|
||||
*/
|
||||
void
|
||||
ReformatAWGS_WP::UnpackSaveArrayEntry(const uint8_t* pSaveArray,
|
||||
void ReformatAWGS_WP::UnpackSaveArrayEntry(const uint8_t* pSaveArray,
|
||||
SaveArrayEntry* pSAE)
|
||||
{
|
||||
pSAE->textBlock = Get16LE(pSaveArray + 0);
|
||||
@ -501,8 +492,7 @@ ReformatAWGS_WP::UnpackSaveArrayEntry(const uint8_t* pSaveArray,
|
||||
*
|
||||
* Returns "true" on success, "false" on failure.
|
||||
*/
|
||||
bool
|
||||
ReformatAWGS_WP::SkipTextBlocks(const uint8_t** pSrcBuf,
|
||||
bool ReformatAWGS_WP::SkipTextBlocks(const uint8_t** pSrcBuf,
|
||||
long* pSrcLen, int textBlockCount)
|
||||
{
|
||||
uint32_t blockSize;
|
||||
|
@ -19,10 +19,10 @@ public:
|
||||
ReformatAWGS_WP(void) {}
|
||||
virtual ~ReformatAWGS_WP(void) {}
|
||||
|
||||
virtual void Examine(ReformatHolder* pHolder);
|
||||
virtual void Examine(ReformatHolder* pHolder) override;
|
||||
virtual int Process(const ReformatHolder* pHolder,
|
||||
ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part,
|
||||
ReformatOutput* pOutput);
|
||||
ReformatOutput* pOutput) override;
|
||||
|
||||
private:
|
||||
/*
|
||||
|
@ -29,8 +29,7 @@
|
||||
/*
|
||||
* Decide whether or not we want to handle this file.
|
||||
*/
|
||||
void
|
||||
ReformatAWP::Examine(ReformatHolder* pHolder)
|
||||
void ReformatAWP::Examine(ReformatHolder* pHolder)
|
||||
{
|
||||
ReformatHolder::ReformatApplies applies = ReformatHolder::kApplicNot;
|
||||
|
||||
@ -44,8 +43,7 @@ ReformatAWP::Examine(ReformatHolder* pHolder)
|
||||
/*
|
||||
* Reformat an AppleWorks WP document.
|
||||
*/
|
||||
int
|
||||
ReformatAWP::Process(const ReformatHolder* pHolder,
|
||||
int ReformatAWP::Process(const ReformatHolder* pHolder,
|
||||
ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part,
|
||||
ReformatOutput* pOutput)
|
||||
{
|
||||
@ -157,8 +155,7 @@ bail:
|
||||
/*
|
||||
* Initialize the DocState structure.
|
||||
*/
|
||||
void
|
||||
ReformatAWP::InitDocState(void)
|
||||
void ReformatAWP::InitDocState(void)
|
||||
{
|
||||
memset(&fDocState, 0, sizeof(fDocState));
|
||||
fDocState.line = 1;
|
||||
@ -167,8 +164,7 @@ ReformatAWP::InitDocState(void)
|
||||
/*
|
||||
* Process a line record.
|
||||
*/
|
||||
int
|
||||
ReformatAWP::ProcessLineRecord(uint8_t lineRecData, uint8_t lineRecCode,
|
||||
int ReformatAWP::ProcessLineRecord(uint8_t lineRecData, uint8_t lineRecCode,
|
||||
const uint8_t** pSrcPtr, long* pLength)
|
||||
{
|
||||
int err = 0;
|
||||
@ -304,8 +300,7 @@ ReformatAWP::ProcessLineRecord(uint8_t lineRecData, uint8_t lineRecCode,
|
||||
*
|
||||
* "lineRecData" has the number of bytes of input that we have yet to read.
|
||||
*/
|
||||
int
|
||||
ReformatAWP::HandleTextRecord(uint8_t lineRecData,
|
||||
int ReformatAWP::HandleTextRecord(uint8_t lineRecData,
|
||||
const uint8_t** pSrcPtr, long* pLength)
|
||||
{
|
||||
int err = 0;
|
||||
@ -473,8 +468,7 @@ bail:
|
||||
/*
|
||||
* Decide whether or not we want to handle this file.
|
||||
*/
|
||||
void
|
||||
ReformatADB::Examine(ReformatHolder* pHolder)
|
||||
void ReformatADB::Examine(ReformatHolder* pHolder)
|
||||
{
|
||||
ReformatHolder::ReformatApplies applies = ReformatHolder::kApplicNot;
|
||||
|
||||
@ -488,8 +482,7 @@ ReformatADB::Examine(ReformatHolder* pHolder)
|
||||
/*
|
||||
* Reformat an AppleWorks DB document.
|
||||
*/
|
||||
int
|
||||
ReformatADB::Process(const ReformatHolder* pHolder,
|
||||
int ReformatADB::Process(const ReformatHolder* pHolder,
|
||||
ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part,
|
||||
ReformatOutput* pOutput)
|
||||
{
|
||||
@ -731,8 +724,7 @@ bail:
|
||||
/*
|
||||
* Decide whether or not we want to handle this file.
|
||||
*/
|
||||
void
|
||||
ReformatASP::Examine(ReformatHolder* pHolder)
|
||||
void ReformatASP::Examine(ReformatHolder* pHolder)
|
||||
{
|
||||
ReformatHolder::ReformatApplies applies = ReformatHolder::kApplicNot;
|
||||
|
||||
@ -746,8 +738,7 @@ ReformatASP::Examine(ReformatHolder* pHolder)
|
||||
/*
|
||||
* Reformat an AppleWorks SS document.
|
||||
*/
|
||||
int
|
||||
ReformatASP::Process(const ReformatHolder* pHolder,
|
||||
int ReformatASP::Process(const ReformatHolder* pHolder,
|
||||
ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part,
|
||||
ReformatOutput* pOutput)
|
||||
{
|
||||
@ -842,8 +833,7 @@ bail:
|
||||
/*
|
||||
* Process one row of spreadsheet data.
|
||||
*/
|
||||
int
|
||||
ReformatASP::ProcessRow(int rowNum, const uint8_t** pSrcPtr, long* pLength)
|
||||
int ReformatASP::ProcessRow(int rowNum, const uint8_t** pSrcPtr, long* pLength)
|
||||
{
|
||||
uint8_t ctrl;
|
||||
bool first = true;
|
||||
@ -898,8 +888,7 @@ ReformatASP::ProcessRow(int rowNum, const uint8_t** pSrcPtr, long* pLength)
|
||||
/*
|
||||
* Process the contents of a single cell.
|
||||
*/
|
||||
void
|
||||
ReformatASP::ProcessCell(const uint8_t* srcPtr, long cellLength)
|
||||
void ReformatASP::ProcessCell(const uint8_t* srcPtr, long cellLength)
|
||||
{
|
||||
uint8_t flag1, flag2;
|
||||
double dval;
|
||||
@ -969,8 +958,7 @@ ReformatASP::ProcessCell(const uint8_t* srcPtr, long cellLength)
|
||||
* Print the AppleWorks SS token pointed to by srcPtr. Some tokens require
|
||||
* several bytes to express.
|
||||
*/
|
||||
void
|
||||
ReformatASP::PrintToken(const uint8_t** pSrcPtr, long* pLength)
|
||||
void ReformatASP::PrintToken(const uint8_t** pSrcPtr, long* pLength)
|
||||
{
|
||||
/* string constants; note these must NOT contain '"' chars */
|
||||
const int kTokenStart = 0xc0;
|
||||
@ -1048,8 +1036,7 @@ ReformatASP::PrintToken(const uint8_t** pSrcPtr, long* pLength)
|
||||
* Format the current column number into something like 'A' or 'BA'. This
|
||||
* stores the value in fPrintColBuf and returns a pointer to it.
|
||||
*/
|
||||
const char*
|
||||
ReformatASP::PrintCol(int col)
|
||||
const char* ReformatASP::PrintCol(int col)
|
||||
{
|
||||
if (col < 0 || col >= 702) {
|
||||
LOGI(" ASP can't PrintCol(%d)", col);
|
||||
@ -1100,8 +1087,7 @@ ReformatASP::PrintCol(int col)
|
||||
* 3F847AE147AE147A
|
||||
* -----
|
||||
*/
|
||||
double
|
||||
ReformatASP::ConvertSANEDouble(const uint8_t* srcPtr)
|
||||
double ReformatASP::ConvertSANEDouble(const uint8_t* srcPtr)
|
||||
{
|
||||
double newVal;
|
||||
uint8_t* dptr;
|
||||
|
@ -19,10 +19,10 @@ public:
|
||||
ReformatAWP(void) { fShowEmbeds = true; }
|
||||
virtual ~ReformatAWP(void) {}
|
||||
|
||||
virtual void Examine(ReformatHolder* pHolder);
|
||||
virtual void Examine(ReformatHolder* pHolder) override;
|
||||
virtual int Process(const ReformatHolder* pHolder,
|
||||
ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part,
|
||||
ReformatOutput* pOutput);
|
||||
ReformatOutput* pOutput) override;
|
||||
|
||||
private:
|
||||
|
||||
@ -156,10 +156,10 @@ public:
|
||||
ReformatADB(void) {}
|
||||
virtual ~ReformatADB(void) {}
|
||||
|
||||
virtual void Examine(ReformatHolder* pHolder);
|
||||
virtual void Examine(ReformatHolder* pHolder) override;
|
||||
virtual int Process(const ReformatHolder* pHolder,
|
||||
ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part,
|
||||
ReformatOutput* pOutput);
|
||||
ReformatOutput* pOutput) override;
|
||||
|
||||
private:
|
||||
enum {
|
||||
@ -179,10 +179,10 @@ public:
|
||||
ReformatASP(void) { fCurrentRow = fCurrentCol = 1; }
|
||||
virtual ~ReformatASP(void) {}
|
||||
|
||||
virtual void Examine(ReformatHolder* pHolder);
|
||||
virtual void Examine(ReformatHolder* pHolder) override;
|
||||
virtual int Process(const ReformatHolder* pHolder,
|
||||
ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part,
|
||||
ReformatOutput* pOutput);
|
||||
ReformatOutput* pOutput) override;
|
||||
|
||||
private:
|
||||
enum {
|
||||
|
105
reformat/Asm.cpp
105
reformat/Asm.cpp
@ -45,8 +45,7 @@
|
||||
/*
|
||||
* Decide whether or not we want to handle this file.
|
||||
*/
|
||||
void
|
||||
ReformatSCAssem::Examine(ReformatHolder* pHolder)
|
||||
void ReformatSCAssem::Examine(ReformatHolder* pHolder)
|
||||
{
|
||||
if (pHolder->GetFileType() == kTypeINT && pHolder->GetAuxType() == 0) {
|
||||
if (ReformatSCAssem::IsSCAssem(pHolder)) {
|
||||
@ -76,8 +75,7 @@ ReformatSCAssem::Examine(ReformatHolder* pHolder)
|
||||
* for marking the end of a line, and have different sets of valid chars. We
|
||||
* don't need to fully validate the file, just test the first line.
|
||||
*/
|
||||
/*static*/ bool
|
||||
ReformatSCAssem::IsSCAssem(const ReformatHolder* pHolder)
|
||||
/*static*/ bool ReformatSCAssem::IsSCAssem(const ReformatHolder* pHolder)
|
||||
{
|
||||
const uint8_t* ptr = pHolder->GetSourceBuf(ReformatHolder::kPartData);
|
||||
long srcLen = pHolder->GetSourceLen(ReformatHolder::kPartData);
|
||||
@ -103,8 +101,7 @@ ReformatSCAssem::IsSCAssem(const ReformatHolder* pHolder)
|
||||
* Reformat an S-C Assembler listing into text. I don't know exactly what the
|
||||
* original listings looked like, so I'm just doing what A2FID.C does.
|
||||
*/
|
||||
int
|
||||
ReformatSCAssem::Process(const ReformatHolder* pHolder,
|
||||
int ReformatSCAssem::Process(const ReformatHolder* pHolder,
|
||||
ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part,
|
||||
ReformatOutput* pOutput)
|
||||
{
|
||||
@ -222,8 +219,7 @@ done:
|
||||
* since the text file contents will match. However, it's probably useful
|
||||
* to support DOS ED/ASM sources with this.
|
||||
*/
|
||||
void
|
||||
ReformatMerlin::Examine(ReformatHolder* pHolder)
|
||||
void ReformatMerlin::Examine(ReformatHolder* pHolder)
|
||||
{
|
||||
if (pHolder->GetFileType() == kTypeTXT) {
|
||||
bool isAsm = ReformatMerlin::IsMerlin(pHolder);
|
||||
@ -271,8 +267,7 @@ ReformatMerlin::Examine(ReformatHolder* pHolder)
|
||||
*
|
||||
* This will also return "true" for DOS ED/ASM files.
|
||||
*/
|
||||
/*static*/ bool
|
||||
ReformatMerlin::IsMerlin(const ReformatHolder* pHolder)
|
||||
/*static*/ bool ReformatMerlin::IsMerlin(const ReformatHolder* pHolder)
|
||||
{
|
||||
const uint8_t* ptr = pHolder->GetSourceBuf(ReformatHolder::kPartData);
|
||||
long srcLen = pHolder->GetSourceLen(ReformatHolder::kPartData);
|
||||
@ -329,8 +324,7 @@ ReformatMerlin::IsMerlin(const ReformatHolder* pHolder)
|
||||
* has been "washed" through a converter or if this is actually a DOS ED/ASM
|
||||
* file, tracking quotes is almost always beneficial.
|
||||
*/
|
||||
int
|
||||
ReformatMerlin::Process(const ReformatHolder* pHolder,
|
||||
int ReformatMerlin::Process(const ReformatHolder* pHolder,
|
||||
ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part,
|
||||
ReformatOutput* pOutput)
|
||||
{
|
||||
@ -430,8 +424,7 @@ ReformatMerlin::Process(const ReformatHolder* pHolder,
|
||||
/*
|
||||
* Decide whether or not we want to handle this file.
|
||||
*/
|
||||
void
|
||||
ReformatLISA2::Examine(ReformatHolder* pHolder)
|
||||
void ReformatLISA2::Examine(ReformatHolder* pHolder)
|
||||
{
|
||||
if (pHolder->GetSourceFormat() == ReformatHolder::kSourceFormatDOS &&
|
||||
pHolder->GetFileType() == kTypeDOS_B)
|
||||
@ -458,8 +451,7 @@ ReformatLISA2::Examine(ReformatHolder* pHolder)
|
||||
/*
|
||||
* Quick sanity check on the file contents.
|
||||
*/
|
||||
bool
|
||||
ReformatLISA2::IsLISA(const ReformatHolder* pHolder)
|
||||
bool ReformatLISA2::IsLISA(const ReformatHolder* pHolder)
|
||||
{
|
||||
const uint8_t* srcPtr = pHolder->GetSourceBuf(ReformatHolder::kPartData);
|
||||
long srcLen = pHolder->GetSourceLen(ReformatHolder::kPartData);
|
||||
@ -518,8 +510,7 @@ static const char gOpcodes[] =
|
||||
/*
|
||||
* Parse a file.
|
||||
*/
|
||||
int
|
||||
ReformatLISA2::Process(const ReformatHolder* pHolder,
|
||||
int ReformatLISA2::Process(const ReformatHolder* pHolder,
|
||||
ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part,
|
||||
ReformatOutput* pOutput)
|
||||
{
|
||||
@ -579,8 +570,7 @@ bail:
|
||||
return retval;
|
||||
}
|
||||
|
||||
void
|
||||
ReformatLISA2::ProcessLine(const uint8_t* buf)
|
||||
void ReformatLISA2::ProcessLine(const uint8_t* buf)
|
||||
{
|
||||
int len = *buf;
|
||||
uint8_t uch;
|
||||
@ -663,7 +653,7 @@ ReformatLISA2::ProcessLine(const uint8_t* buf)
|
||||
|
||||
/*
|
||||
* ===========================================================================
|
||||
* LISA Assembler - v4 and v5
|
||||
* LISA Assembler - v3
|
||||
* ===========================================================================
|
||||
*/
|
||||
|
||||
@ -747,8 +737,7 @@ static const char gMnemonics3[256*3 +1] =
|
||||
/*
|
||||
* Determine whether this is one of our files.
|
||||
*/
|
||||
void
|
||||
ReformatLISA3::Examine(ReformatHolder* pHolder)
|
||||
void ReformatLISA3::Examine(ReformatHolder* pHolder)
|
||||
{
|
||||
/*
|
||||
* Note we cannot false-positive on an INT file on a DOS disk, because
|
||||
@ -780,8 +769,7 @@ ReformatLISA3::Examine(ReformatHolder* pHolder)
|
||||
* Decide if this is one of ours or perhaps an Integer BASIC or S-C
|
||||
* assembler source.
|
||||
*/
|
||||
/*static*/ bool
|
||||
ReformatLISA3::IsLISA(const ReformatHolder* pHolder)
|
||||
/*static*/ bool ReformatLISA3::IsLISA(const ReformatHolder* pHolder)
|
||||
{
|
||||
bool dosStructure = (pHolder->GetSourceFormat() == ReformatHolder::kSourceFormatDOS);
|
||||
const uint8_t* srcPtr = pHolder->GetSourceBuf(ReformatHolder::kPartData);
|
||||
@ -817,8 +805,7 @@ ReformatLISA3::IsLISA(const ReformatHolder* pHolder)
|
||||
/*
|
||||
* Parse a file.
|
||||
*/
|
||||
int
|
||||
ReformatLISA3::Process(const ReformatHolder* pHolder,
|
||||
int ReformatLISA3::Process(const ReformatHolder* pHolder,
|
||||
ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part,
|
||||
ReformatOutput* pOutput)
|
||||
{
|
||||
@ -966,8 +953,7 @@ bail:
|
||||
/*
|
||||
* BIGONE
|
||||
*/
|
||||
void
|
||||
ReformatLISA3::ProcessLine(const uint8_t* codePtr, int len)
|
||||
void ReformatLISA3::ProcessLine(const uint8_t* codePtr, int len)
|
||||
{
|
||||
uint8_t mnemonic = 0;
|
||||
|
||||
@ -1054,8 +1040,7 @@ bail:
|
||||
/*
|
||||
* CNVOPRND
|
||||
*/
|
||||
void
|
||||
ReformatLISA3::ConvertOperand(uint8_t mnemonic,
|
||||
void ReformatLISA3::ConvertOperand(uint8_t mnemonic,
|
||||
const uint8_t** pCodePtr, int* pLen)
|
||||
{
|
||||
static const char kOPRTRST1[] = "+-*/&|^=<>%<><";
|
||||
@ -1163,8 +1148,7 @@ bail:
|
||||
/*
|
||||
* Output a single byte as a binary string.
|
||||
*/
|
||||
void
|
||||
ReformatLISA3::PrintBin(uint8_t val)
|
||||
void ReformatLISA3::PrintBin(uint8_t val)
|
||||
{
|
||||
char buf[9];
|
||||
buf[8] = '\0';
|
||||
@ -1177,9 +1161,8 @@ ReformatLISA3::PrintBin(uint8_t val)
|
||||
/*
|
||||
* OUTNUM
|
||||
*/
|
||||
ReformatLISA3::OperandResult
|
||||
ReformatLISA3::PrintNum(int adrsMode, uint8_t val,
|
||||
const uint8_t** pCodePtr, int* pLen)
|
||||
ReformatLISA3::OperandResult ReformatLISA3::PrintNum(int adrsMode, uint8_t val,
|
||||
const uint8_t** pCodePtr, int* pLen)
|
||||
{
|
||||
const uint8_t* codePtr = *pCodePtr;
|
||||
int len = *pLen;
|
||||
@ -1315,8 +1298,7 @@ bail:
|
||||
* Print symbol table entry. Each entry is an 8-byte label packed into
|
||||
* 6 bytes.
|
||||
*/
|
||||
void
|
||||
ReformatLISA3::PrintSymEntry(int ent)
|
||||
void ReformatLISA3::PrintSymEntry(int ent)
|
||||
{
|
||||
if (ent < 0 || ent >= fSymCount) {
|
||||
Output("!BAD SYM!");
|
||||
@ -1349,8 +1331,7 @@ ReformatLISA3::PrintSymEntry(int ent)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ReformatLISA3::PrintMnemonic(uint8_t val)
|
||||
void ReformatLISA3::PrintMnemonic(uint8_t val)
|
||||
{
|
||||
const char* ptr = &gMnemonics3[val * 3];
|
||||
Output(ptr[0]);
|
||||
@ -1363,8 +1344,7 @@ ReformatLISA3::PrintMnemonic(uint8_t val)
|
||||
*
|
||||
* Prints the comment. Finishes off the operand if necessary.
|
||||
*/
|
||||
void
|
||||
ReformatLISA3::PrintComment(int adrsMode, const uint8_t* codePtr, int len)
|
||||
void ReformatLISA3::PrintComment(int adrsMode, const uint8_t* codePtr, int len)
|
||||
{
|
||||
assert(len >= 0);
|
||||
|
||||
@ -1411,8 +1391,7 @@ ReformatLISA3::PrintComment(int adrsMode, const uint8_t* codePtr, int len)
|
||||
/*
|
||||
* Determine whether this is one of our files.
|
||||
*/
|
||||
void
|
||||
ReformatLISA4::Examine(ReformatHolder* pHolder)
|
||||
void ReformatLISA4::Examine(ReformatHolder* pHolder)
|
||||
{
|
||||
/*
|
||||
* Note we cannot false-positive on an INT file on a DOS disk, because
|
||||
@ -1444,8 +1423,7 @@ ReformatLISA4::Examine(ReformatHolder* pHolder)
|
||||
* Decide if this is one of ours or perhaps an Integer BASIC or S-C
|
||||
* assembler source.
|
||||
*/
|
||||
/*static*/ bool
|
||||
ReformatLISA4::IsLISA(const ReformatHolder* pHolder)
|
||||
/*static*/ bool ReformatLISA4::IsLISA(const ReformatHolder* pHolder)
|
||||
{
|
||||
bool dosStructure = (pHolder->GetSourceFormat() == ReformatHolder::kSourceFormatDOS);
|
||||
const uint8_t* srcPtr = pHolder->GetSourceBuf(ReformatHolder::kPartData);
|
||||
@ -1558,8 +1536,7 @@ static const char* gMnemonics4[] = {
|
||||
/*
|
||||
* Parse a file.
|
||||
*/
|
||||
int
|
||||
ReformatLISA4::Process(const ReformatHolder* pHolder,
|
||||
int ReformatLISA4::Process(const ReformatHolder* pHolder,
|
||||
ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part,
|
||||
ReformatOutput* pOutput)
|
||||
{
|
||||
@ -1585,9 +1562,9 @@ ReformatLISA4::Process(const ReformatHolder* pHolder,
|
||||
fComTab = srcPtr[0x08];
|
||||
fCpuType = srcPtr[0x09];
|
||||
|
||||
LOGI(" LISA4 version = 0x%04x symEnd=%d symCount=%d",
|
||||
LOGD(" LISA4 version = 0x%04x symEnd=%d symCount=%d",
|
||||
version, symEnd, fSymCount);
|
||||
LOGI(" LISA4 opTab=%d adTab=%d comTab=%d cpuType=%d",
|
||||
LOGD(" LISA4 opTab=%d adTab=%d comTab=%d cpuType=%d",
|
||||
fOpTab, fAdTab, fComTab, fCpuType);
|
||||
|
||||
if (symEnd > srcLen) {
|
||||
@ -1731,8 +1708,7 @@ bail:
|
||||
return retval;
|
||||
}
|
||||
|
||||
void
|
||||
ReformatLISA4::ProcessLine(const uint8_t* codePtr, int len)
|
||||
void ReformatLISA4::ProcessLine(const uint8_t* codePtr, int len)
|
||||
{
|
||||
uint8_t mnemonic = 0;
|
||||
|
||||
@ -1835,8 +1811,7 @@ bail:
|
||||
/*
|
||||
* ConvtOperand
|
||||
*/
|
||||
void
|
||||
ReformatLISA4::ConvertOperand(uint8_t mnemonic,
|
||||
void ReformatLISA4::ConvertOperand(uint8_t mnemonic,
|
||||
const uint8_t** pCodePtr, int* pLen)
|
||||
{
|
||||
/*
|
||||
@ -2095,8 +2070,7 @@ not_operator:
|
||||
/*
|
||||
* CnvrtDec - convert to decimal output.
|
||||
*/
|
||||
void
|
||||
ReformatLISA4::PrintDec(int count, const uint8_t** pCodePtr,
|
||||
void ReformatLISA4::PrintDec(int count, const uint8_t** pCodePtr,
|
||||
int* pLen)
|
||||
{
|
||||
const uint8_t* codePtr = *pCodePtr;
|
||||
@ -2118,8 +2092,7 @@ ReformatLISA4::PrintDec(int count, const uint8_t** pCodePtr,
|
||||
/*
|
||||
* CnvrtHex - convert to hex output.
|
||||
*/
|
||||
void
|
||||
ReformatLISA4::PrintHex(int count, const uint8_t** pCodePtr,
|
||||
void ReformatLISA4::PrintHex(int count, const uint8_t** pCodePtr,
|
||||
int* pLen)
|
||||
{
|
||||
const uint8_t* codePtr = *pCodePtr;
|
||||
@ -2142,8 +2115,7 @@ ReformatLISA4::PrintHex(int count, const uint8_t** pCodePtr,
|
||||
/*
|
||||
* CnvrtBin - convert to binary output.
|
||||
*/
|
||||
void
|
||||
ReformatLISA4::PrintBin(int count, const uint8_t** pCodePtr,
|
||||
void ReformatLISA4::PrintBin(int count, const uint8_t** pCodePtr,
|
||||
int* pLen)
|
||||
{
|
||||
const uint8_t* codePtr = *pCodePtr;
|
||||
@ -2171,9 +2143,8 @@ ReformatLISA4::PrintBin(int count, const uint8_t** pCodePtr,
|
||||
/*
|
||||
* OUTNUM
|
||||
*/
|
||||
ReformatLISA4::OperandResult
|
||||
ReformatLISA4::PrintNum(uint8_t opr, const uint8_t** pCodePtr,
|
||||
int* pLen)
|
||||
ReformatLISA4::OperandResult ReformatLISA4::PrintNum(uint8_t opr,
|
||||
const uint8_t** pCodePtr, int* pLen)
|
||||
{
|
||||
OperandResult result = kResultUnknown;
|
||||
const uint8_t* codePtr = *pCodePtr;
|
||||
@ -2295,9 +2266,8 @@ ReformatLISA4::PrintNum(uint8_t opr, const uint8_t** pCodePtr,
|
||||
/*
|
||||
* OutOprComp
|
||||
*/
|
||||
ReformatLISA4::OperandResult
|
||||
ReformatLISA4::PrintComplexOperand(uint8_t opr,
|
||||
const uint8_t** pCodePtr, int* pLen)
|
||||
ReformatLISA4::OperandResult ReformatLISA4::PrintComplexOperand(uint8_t opr,
|
||||
const uint8_t** pCodePtr, int* pLen)
|
||||
{
|
||||
if (opr != kBign_tkn)
|
||||
return PrintNum(opr, pCodePtr, pLen);
|
||||
@ -2360,8 +2330,7 @@ const uint8_t** pCodePtr, int* pLen)
|
||||
/*
|
||||
* Print symbol table entry.
|
||||
*/
|
||||
void
|
||||
ReformatLISA4::PrintSymEntry(int ent)
|
||||
void ReformatLISA4::PrintSymEntry(int ent)
|
||||
{
|
||||
if (ent < 0 || ent >= fSymCount) {
|
||||
Output("!BAD SYM!");
|
||||
|
@ -71,10 +71,10 @@ public:
|
||||
ReformatSCAssem(void) {}
|
||||
virtual ~ReformatSCAssem(void) {}
|
||||
|
||||
virtual void Examine(ReformatHolder* pHolder);
|
||||
virtual void Examine(ReformatHolder* pHolder) override;
|
||||
virtual int Process(const ReformatHolder* pHolder,
|
||||
ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part,
|
||||
ReformatOutput* pOutput);
|
||||
ReformatOutput* pOutput) override;
|
||||
|
||||
/* this gets called by Integer BASIC converter */
|
||||
static bool IsSCAssem(const ReformatHolder* pHolder);
|
||||
@ -89,10 +89,10 @@ public:
|
||||
ReformatMerlin(void) {}
|
||||
virtual ~ReformatMerlin(void) {}
|
||||
|
||||
virtual void Examine(ReformatHolder* pHolder);
|
||||
virtual void Examine(ReformatHolder* pHolder) override;
|
||||
virtual int Process(const ReformatHolder* pHolder,
|
||||
ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part,
|
||||