From 4d12a23c68199693707eca09003c9754e82ed9a9 Mon Sep 17 00:00:00 2001 From: tomcw Date: Sun, 24 Nov 2019 15:57:33 +0000 Subject: [PATCH 1/3] Make soundtype default to WAVE (not NONE)! (#355) --- source/Applewin.cpp | 2 +- source/Common.h | 1 + source/Configuration/PageSound.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/Applewin.cpp b/source/Applewin.cpp index 4d76f89a..cb50d1fb 100644 --- a/source/Applewin.cpp +++ b/source/Applewin.cpp @@ -630,7 +630,7 @@ void LoadConfiguration(void) LoadConfigOldJoystick_v1(JN_JOYSTICK1); DWORD dwSoundType; - REGLOAD_DEFAULT(TEXT("Sound Emulation"), &dwSoundType, REG_SOUNDTYPE_NONE); + REGLOAD_DEFAULT(TEXT(REGVALUE_SOUND_EMULATION), &dwSoundType, REG_SOUNDTYPE_WAVE); switch (dwSoundType) { case REG_SOUNDTYPE_NONE: diff --git a/source/Common.h b/source/Common.h index 8097d02e..fd55f0f7 100644 --- a/source/Common.h +++ b/source/Common.h @@ -67,6 +67,7 @@ enum AppMode_e #define REGVALUE_OLD_APPLE2_TYPE "Computer Emulation" // Deprecated #define REGVALUE_CONFIRM_REBOOT "Confirm Reboot" // Added at 1.24.1 PageConfig #define REGVALUE_FS_SHOW_SUBUNIT_STATUS "Full-screen show subunit status" +#define REGVALUE_SOUND_EMULATION "Sound Emulation" #define REGVALUE_SPKR_VOLUME "Speaker Volume" #define REGVALUE_MB_VOLUME "Mockingboard Volume" #define REGVALUE_SAVESTATE_FILENAME "Save State Filename" diff --git a/source/Configuration/PageSound.cpp b/source/Configuration/PageSound.cpp index 4d91cf83..59fe9a6e 100644 --- a/source/Configuration/PageSound.cpp +++ b/source/Configuration/PageSound.cpp @@ -140,7 +140,7 @@ void CPageSound::DlgOK(HWND hWnd) if (SpkrSetEmulationType(hWnd, newSoundType)) { DWORD dwSoundType = (soundtype == SOUND_NONE) ? REG_SOUNDTYPE_NONE : REG_SOUNDTYPE_WAVE; - REGSAVE(TEXT("Sound Emulation"), dwSoundType); + REGSAVE(TEXT(REGVALUE_SOUND_EMULATION), dwSoundType); } // NB. Volume: 0=Loudest, VOLUME_MAX=Silence From dd274bc00057353ba81ccca1d84bdda5b864c0d9 Mon Sep 17 00:00:00 2001 From: tomcw Date: Wed, 27 Nov 2019 22:14:16 +0000 Subject: [PATCH 2/3] Debugger: BPMR|W - ignore next opcode's fetch address as a candidate for memory trap address (#451) --- source/Debugger/Debug.cpp | 5 ++++- source/Debugger/Debugger_Assembler.cpp | 10 +++++++++- source/Debugger/Debugger_Assembler.h | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/source/Debugger/Debug.cpp b/source/Debugger/Debug.cpp index 4c12c51c..f4205905 100644 --- a/source/Debugger/Debug.cpp +++ b/source/Debugger/Debug.cpp @@ -1127,7 +1127,10 @@ int CheckBreakpointsIO () int iTarget; int nAddress; - _6502_GetTargets( regs.pc, &aTarget[0], &aTarget[1], &aTarget[2], &nBytes, false ); + // bIgnoreNextOpcodeAddress = true: + // . JSR addr16: ignore addr16 as a target + // . RTS/RTI : ignore return as a target + _6502_GetTargets( regs.pc, &aTarget[0], &aTarget[1], &aTarget[2], &nBytes, true, true, true ); if (nBytes) { diff --git a/source/Debugger/Debugger_Assembler.cpp b/source/Debugger/Debugger_Assembler.cpp index 350fa207..2a292e66 100644 --- a/source/Debugger/Debugger_Assembler.cpp +++ b/source/Debugger/Debugger_Assembler.cpp @@ -583,7 +583,8 @@ bool _6502_GetStackReturnAddress ( WORD & nAddress_ ) //=========================================================================== -bool _6502_GetTargets ( WORD nAddress, int *pTargetPartial_, int *pTargetPartial2_, int *pTargetPointer_, int * pTargetBytes_, bool bIgnoreJSRJMP, bool bIgnoreBranch ) +bool _6502_GetTargets ( WORD nAddress, int *pTargetPartial_, int *pTargetPartial2_, int *pTargetPointer_, int * pTargetBytes_, + bool bIgnoreJSRJMP /*= true*/, bool bIgnoreBranch /*= true*/, bool bIgnoreNextOpcodeAddress /*= false*/ ) { bool bStatus = false; @@ -782,6 +783,13 @@ bool _6502_GetTargets ( WORD nAddress, int *pTargetPartial_, int *pTargetPartial *pTargetBytes_ = 0; } } + + if (bIgnoreNextOpcodeAddress) + { + *pTargetPointer_ = NO_6502_TARGET; + if (pTargetBytes_) + *pTargetBytes_ = 0; + } return bStatus; } diff --git a/source/Debugger/Debugger_Assembler.h b/source/Debugger/Debugger_Assembler.h index 61391901..c4976d1b 100644 --- a/source/Debugger/Debugger_Assembler.h +++ b/source/Debugger/Debugger_Assembler.h @@ -194,7 +194,7 @@ extern int g_aAssemblerFirstDirective[ NUM_ASSEMBLERS ]; void _6502_GetOpcodeOpmodeOpbyte( int & iOpcode_, int & iOpmode_, int & nOpbytes_ ); bool _6502_GetStackReturnAddress( WORD & nAddress_ ); bool _6502_GetTargets( WORD nAddress, int *pTargetPartial_, int *pTargetPartial2_, int *pTargetPointer_, int * pBytes_ - , const bool bIgnoreJSRJMP = true, bool bIgnoreBranch = true ); + , const bool bIgnoreJSRJMP = true, bool bIgnoreBranch = true, bool bIgnoreNextOpcodeAddress = false ); bool _6502_GetTargetAddress( const WORD & nAddress, WORD & nTarget_ ); bool _6502_IsOpcodeBranch( int nOpcode ); bool _6502_IsOpcodeValid( int nOpcode ); From 6af3b0b0287201770fb2ffe6636daa5e5d1bdc7d Mon Sep 17 00:00:00 2001 From: Andrea Date: Thu, 28 Nov 2019 22:06:34 +0000 Subject: [PATCH 3/3] Color (RGB Monitor): speed up 'Pure CPU MHz (video update)'. (PR #730) --- source/RGBMonitor.cpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/source/RGBMonitor.cpp b/source/RGBMonitor.cpp index 3312b3a6..0f501456 100644 --- a/source/RGBMonitor.cpp +++ b/source/RGBMonitor.cpp @@ -495,8 +495,7 @@ static void CopyMixedSource(int x, int y, int sx, int sy, bgra_t *pVideoAddress) { _ASSERT( colormixbuffer[h] < (sizeof(PalIndex2RGB)/sizeof(PalIndex2RGB[0])) ); const RGBQUAD& rRGB = PalIndex2RGB[ colormixbuffer[h] ]; - const UINT32 rgb = (((UINT32)rRGB.rgbRed)<<16) | (((UINT32)rRGB.rgbGreen)<<8) | ((UINT32)rRGB.rgbBlue); - *(pDst+nBytes) = rgb; + *(pDst+nBytes) = *reinterpret_cast(&rRGB); } pDst -= frameBufferWidth; @@ -512,28 +511,27 @@ static void CopySource(int w, int h, int sx, int sy, bgra_t *pVideoAddress, cons UINT32* pDst = (UINT32*) pVideoAddress; const BYTE* const pSrc = g_aSourceStartofLine[ sy ] + sx; + const bool bIsHalfScanLines = IsVideoStyle(VS_HALF_SCANLINES); + const UINT frameBufferWidth = GetFrameBufferWidth(); + while (h--) { - int nBytes = w; - while (nBytes) + if (bIsHalfScanLines && !(h & 1)) { - --nBytes; - - if (IsVideoStyle(VS_HALF_SCANLINES) && !(h & 1)) - { - // 50% Half Scan Line clears every odd scanline (and SHIFT+PrintScreen saves only the even rows) - *(pDst+nBytes) = 0; - } - else + // 50% Half Scan Line clears every odd scanline (and SHIFT+PrintScreen saves only the even rows) + std::fill(pDst, pDst + w, 0); + } + else + { + for (int nBytes=0; nBytes(&rRGB); } } - pDst -= GetFrameBufferWidth(); + pDst -= frameBufferWidth; } }