Merge remote-tracking branch 'upstream/master' into update

# Conflicts:
#	source/Tfe/tfearch.cpp
This commit is contained in:
Andrea Odetti 2021-10-23 20:25:59 +01:00
commit 4063198e34
17 changed files with 49 additions and 61 deletions

View file

@ -446,7 +446,6 @@ static __forceinline bool IRQ(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn,
(g_bmIRQ & 8) ? "MOUSE" : "UNKNOWN";
LogOutput("IRQ (%08X) (%s)\n", (UINT)g_nCycleIrqStart, pSrc);
#endif
CheckSynchronousInterruptSources(7, uExecutedCycles);
g_interruptInLastExecutionBatch = true;
irqTaken = true;
}

View file

@ -50,18 +50,12 @@ static DWORD Cpu6502(DWORD uTotalCycles, const bool bVideoUpdate)
{
const UINT uZ80Cycles = z80_mainloop(uTotalCycles, uExecutedCycles); CYC(uZ80Cycles)
}
else if (NMI(uExecutedCycles, flagc, flagn, flagv, flagz) || IRQ(uExecutedCycles, flagc, flagn, flagv, flagz))
{
// Allow AppleWin debugger's single-stepping to just step the pending IRQ
}
else
{
if (IRQ(uExecutedCycles, flagc, flagn, flagv, flagz) || NMI(uExecutedCycles, flagc, flagn, flagv, flagz))
{
if (bVideoUpdate)
{
ULONG uElapsedCycles = uExecutedCycles - uPreviousCycles;
NTSC_VideoUpdateCycles(uElapsedCycles);
}
continue; // Allow AppleWin debugger's single-stepping to just step the pending IRQ
}
HEATMAP_X( regs.pc );
Fetch(iOpcode, uExecutedCycles);

View file

@ -50,18 +50,12 @@ static DWORD Cpu65C02(DWORD uTotalCycles, const bool bVideoUpdate)
{
const UINT uZ80Cycles = z80_mainloop(uTotalCycles, uExecutedCycles); CYC(uZ80Cycles)
}
else if (NMI(uExecutedCycles, flagc, flagn, flagv, flagz) || IRQ(uExecutedCycles, flagc, flagn, flagv, flagz))
{
// Allow AppleWin debugger's single-stepping to just step the pending IRQ
}
else
{
if (IRQ(uExecutedCycles, flagc, flagn, flagv, flagz) || NMI(uExecutedCycles, flagc, flagn, flagv, flagz))
{
if (bVideoUpdate)
{
ULONG uElapsedCycles = uExecutedCycles - uPreviousCycles;
NTSC_VideoUpdateCycles(uElapsedCycles);
}
continue; // Allow AppleWin debugger's single-stepping to just step the pending IRQ
}
HEATMAP_X( regs.pc );
Fetch(iOpcode, uExecutedCycles);

View file

@ -140,9 +140,9 @@ void CardManager::RemoveInternal(UINT slot)
m_slot[slot] = NULL;
}
void CardManager::Remove(UINT slot)
void CardManager::Remove(UINT slot, bool updateRegistry/*=true*/)
{
Insert(slot, CT_Empty);
Insert(slot, CT_Empty, updateRegistry);
}
void CardManager::InsertAuxInternal(SS_CARDTYPE type)

View file

@ -29,7 +29,7 @@ public:
}
void Insert(UINT slot, SS_CARDTYPE type, bool updateRegistry = true);
void Remove(UINT slot);
void Remove(UINT slot, bool updateRegistry = true);
SS_CARDTYPE QuerySlot(UINT slot) { _ASSERT(slot<NUM_SLOTS); return m_slot[slot]->QueryType(); }
Card& GetRef(UINT slot)
{

View file

@ -292,7 +292,7 @@ void CPageInput::DlgOK(HWND hWnd)
UINT uNewJoyType1 = SendDlgItemMessage(hWnd, IDC_JOYSTICK1, CB_GETCURSEL, 0, 0);
if (uNewJoyType1 >= J1C_MAX) uNewJoyType1 = 0; // GH#434
const bool bIsSlot4Mouse = m_PropertySheetHelper.GetConfigNew().m_Slot[4] == CT_MouseInterface;
const bool bIsSlot4Mouse = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4] == CT_MouseInterface;
if (JoySetEmulationType(hWnd, m_nJoy0ChoiceTranlationTbl[uNewJoyType0], JN_JOYSTICK0, bIsSlot4Mouse))
{
@ -381,7 +381,7 @@ void CPageInput::InitJoystickChoices(HWND hWnd, int nJoyNum, int nIdcValue)
pszMem += strlen(ppszJoyChoices[nJC_JOYSTICK])+1;
pnJoyTranslationTbl[nIdx++] = nJC_JOYSTICK;
const bool bIsSlot4Mouse = m_PropertySheetHelper.GetConfigNew().m_Slot[4] == CT_MouseInterface;
const bool bIsSlot4Mouse = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4] == CT_MouseInterface;
// Now exclude:
// . the other Joystick type (if it exists) from this new list

View file

@ -814,7 +814,7 @@ Update_t CmdProfile (int nArgs)
if (ProfileSave())
{
TCHAR sText[ CONSOLE_WIDTH ];
ConsoleBufferPushFormat ( sText, " Saved: %s", g_FileNameProfile );
ConsoleBufferPushFormat ( sText, " Saved: %s", g_FileNameProfile.c_str() );
}
else
ConsoleBufferPush( TEXT(" ERROR: Couldn't save file. (In use?)" ) );

View file

@ -1066,11 +1066,11 @@ Update_t CmdHelpSpecific (int nArgs)
// Config - Load / Save
case CMD_CONFIG_LOAD:
ConsoleColorizePrint( sText, " Usage: [\"filename\"]" );
ConsoleBufferPushFormat( sText, " Load debugger configuration from '%s', or the specificed file.", g_sFileNameConfig );
ConsoleBufferPushFormat( sText, " Load debugger configuration from '%s', or the specificed file.", g_sFileNameConfig.c_str() );
break;
case CMD_CONFIG_SAVE:
ConsoleColorizePrint( sText, " Usage: [\"filename\"]" );
ConsoleBufferPushFormat( sText, " Save debugger configuration to '%s', or the specificed file.", g_sFileNameConfig );
ConsoleBufferPushFormat( sText, " Save debugger configuration to '%s', or the specificed file.", g_sFileNameConfig.c_str() );
break;
// Config - Color
case CMD_CONFIG_COLOR:

View file

@ -845,33 +845,20 @@ void Disk2InterfaceCard::NotifyInvalidImage(const int drive, LPCTSTR pszImageFil
bool Disk2InterfaceCard::GetProtect(const int drive)
{
if (IsDriveValid(drive))
{
if (m_floppyDrive[drive].m_disk.m_bWriteProtected)
return true;
}
if (!IsDriveValid(drive))
return true;
return false;
return m_floppyDrive[drive].m_disk.m_bWriteProtected;
}
//===========================================================================
void Disk2InterfaceCard::SetProtect(const int drive, const bool bWriteProtect)
{
if (IsDriveValid( drive ))
{
m_floppyDrive[drive].m_disk.m_bWriteProtected = bWriteProtect;
}
}
//===========================================================================
bool Disk2InterfaceCard::IsDiskImageWriteProtected(const int drive)
{
if (!IsDriveValid(drive))
return true;
return;
return ImageIsWriteProtected(m_floppyDrive[drive].m_disk.m_imagehandle);
m_floppyDrive[drive].m_disk.m_bWriteProtected = bWriteProtect;
}
//===========================================================================
@ -886,6 +873,16 @@ bool Disk2InterfaceCard::IsDriveEmpty(const int drive)
//===========================================================================
bool Disk2InterfaceCard::IsWozImageInDrive(const int drive)
{
if (!IsDriveValid(drive))
return false;
return ImageIsWOZ(m_floppyDrive[drive].m_disk.m_imagehandle);
}
//===========================================================================
#if LOG_DISK_NIBBLES_WRITE
bool Disk2InterfaceCard::LogWriteCheckSyncFF(ULONG& uCycleDelta)
{

View file

@ -148,8 +148,6 @@ public:
bool IsConditionForFullSpeed(void);
void NotifyInvalidImage(const int drive, LPCTSTR pszImageFilename, const ImageError_e Error);
bool GetProtect(const int drive);
void SetProtect(const int drive, const bool bWriteProtect);
UINT GetCurrentFirmware(void) { return m_is13SectorFirmware ? 13 : 16; }
int GetCurrentDrive(void);
int GetCurrentTrack(void);
@ -173,8 +171,10 @@ public:
void LoadLastDiskImage(const int drive);
void SaveLastDiskImage(const int drive);
bool IsDiskImageWriteProtected(const int drive);
bool GetProtect(const int drive);
void SetProtect(const int drive, const bool bWriteProtect);
bool IsDriveEmpty(const int drive);
bool IsWozImageInDrive(const int drive);
bool GetEnhanceDisk(void);
void SetEnhanceDisk(bool bEnhanceDisk);
@ -201,7 +201,6 @@ private:
void DataLoadWriteWOZ(WORD pc, WORD addr, UINT bitCellRemainder);
void DataShiftWriteWOZ(WORD pc, WORD addr, ULONG uExecutedCycles);
void SetSequencerFunction(WORD addr);
void DumpSectorWOZ(FloppyDisk floppy);
void DumpTrackWOZ(FloppyDisk floppy);
bool GetFirmware(WORD lpNameId, BYTE* pDst);
void InitFirmware(LPBYTE pCxRomPeripheral);

View file

@ -196,11 +196,6 @@ UINT ImageGetNumTracks(ImageInfo* const pImageInfo)
return pImageInfo ? pImageInfo->uNumTracks : 0;
}
bool ImageIsWriteProtected(ImageInfo* const pImageInfo)
{
return pImageInfo ? pImageInfo->bWriteProtected : true;
}
bool ImageIsMultiFileZip(ImageInfo* const pImageInfo)
{
return pImageInfo ? (pImageInfo->uNumValidImagesInZip > 1) : false;

View file

@ -86,7 +86,6 @@ bool ImageReadBlock(ImageInfo* const pImageInfo, UINT nBlock, LPBYTE pBlockBuffe
bool ImageWriteBlock(ImageInfo* const pImageInfo, UINT nBlock, LPBYTE pBlockBuffer);
UINT ImageGetNumTracks(ImageInfo* const pImageInfo);
bool ImageIsWriteProtected(ImageInfo* const pImageInfo);
bool ImageIsMultiFileZip(ImageInfo* const pImageInfo);
const std::string & ImageGetPathname(ImageInfo* const pImageInfo);
UINT ImageGetImageSize(ImageInfo* const pImageInfo);

View file

@ -12,5 +12,11 @@ extern FILE* g_fh; // Filehandle for log file
void LogInit(void);
void LogDone(void);
#ifdef _MSC_VER
void LogOutput(LPCTSTR format, ...);
void LogFileOutput(LPCTSTR format, ...);
#else
void LogOutput(LPCTSTR format, ...) __attribute__ ((format (printf, 1, 2)));
void LogFileOutput(LPCTSTR format, ...) __attribute__ ((format (printf, 1, 2)));
#endif

View file

@ -1041,7 +1041,7 @@ static void MB_Update(void)
static bool MB_DSInit()
{
LogFileOutput("MB_DSInit\n", g_bMBAvailable);
LogFileOutput("MB_DSInit\n");
#ifdef NO_DIRECT_X
return false;

View file

@ -27,7 +27,12 @@
/* #define WPCAP */
#ifdef _MSC_VER
#include "pcap.h"
#else
// on Linux and Mac OS X, we use system's pcap.h, which needs to be included as <>
#include <pcap.h>
#endif
#include <assert.h>
#include <stdio.h>

View file

@ -552,7 +552,7 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
if (pMouseCard)
{
// dtor removes event from g_SynchronousEventMgr - do before g_SynchronousEventMgr.Reset()
GetCardMgr().Remove( pMouseCard->GetSlot() );
GetCardMgr().Remove( pMouseCard->GetSlot(), false );
LogFileOutput("Main: CMouseInterface::dtor\n");
}

View file

@ -2005,7 +2005,7 @@ void Win32Frame::ProcessDiskPopupMenu(HWND hwnd, POINT pt, const int iDrive)
// Check menu depending on current floppy protection
{
int iMenuItem = ID_DISKMENU_WRITEPROTECTION_OFF;
if (disk2Card.GetProtect( iDrive ))
if (disk2Card.GetProtect(iDrive))
iMenuItem = ID_DISKMENU_WRITEPROTECTION_ON;
CheckMenuItem(hmenu, iMenuItem, MF_CHECKED);
@ -2014,7 +2014,7 @@ void Win32Frame::ProcessDiskPopupMenu(HWND hwnd, POINT pt, const int iDrive)
if (disk2Card.IsDriveEmpty(iDrive))
EnableMenuItem(hmenu, ID_DISKMENU_EJECT, MF_GRAYED);
if (disk2Card.IsDiskImageWriteProtected(iDrive))
if (disk2Card.GetProtect(iDrive))
{
// If image-file is read-only (or a gzip) then disable these menu items
EnableMenuItem(hmenu, ID_DISKMENU_WRITEPROTECTION_ON, MF_GRAYED);