Skip to content

Commit

Permalink
Merge pull request #248 from audetto/update
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
audetto authored Feb 22, 2025
2 parents a972c72 + d42ea74 commit 736cf99
Show file tree
Hide file tree
Showing 13 changed files with 280 additions and 40 deletions.
10 changes: 10 additions & 0 deletions docs/Debugger_Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
/*
2.9.2.7 Added: QoL for Debugger's view output screen.
When using the debugger to view the ouput screen such as `HGR`, `HGR2`, etc. allow the
keys 0-5 to display the specificed video # page, or 9 to see the current video mode.
0 Pseudo Page 0 ($0000 for graphics, else text page 1)
1 Hardware Page 1 ($2000 for graphics, else text $0400)
2 Hardware Page 2 ($4000 for graphics, else text $0800)
3 Pseudo Page 3 ($6000 for graphics, else text page 1)
4 Pseudo Page 4 ($8000 for graphics, else text page 1)
5 Pseudo Page 5 ($A000 for graphics, else text page 1)
9 Current mode and page
2.9.2.6 Added: QoL: Turning a symbol table on/off now shows the current status.
2.9.2.5 Added: Symbol table for DOS 3.3 using file A2_DOS33.SYM2
Add symbols via: SYMDOS33 <symbol> = <addr>
Expand Down
4 changes: 4 additions & 0 deletions help/Table of Contents.hhc
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@
<param name="Name" value="Memory">
<param name="Local" value="dbg-memory.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="View Output">
<param name="Local" value="dbg-view-output.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Symbols">
<param name="Local" value="dbg-symbols.html">
Expand Down
3 changes: 0 additions & 3 deletions help/dbg-configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
</head>
<body style="DIRECTION: ltr" lang="en-US">
<h2><a name="Configuration"></a>Configuration</h2>
<p><br>
<br>
</p>
<h3><a name="Colors"></a>Colors</h3>
<p>The commands to change color schemes, and colors are:</p>
<p><br>
Expand Down
6 changes: 1 addition & 5 deletions help/dbg-memory.html
Original file line number Diff line number Diff line change
Expand Up @@ -496,14 +496,10 @@ <h3><a name="Memory_Change">Changing Memory</a></h3>
<p><font color="#00b8ff"><font face="Courier"><b>300:60</b></font></font></p>
</td>
<td width="75%">
<p><i><span style="COLOR: white">Same
as Applesoft Poke 768,96</span></i></p>
<p><i><span style="COLOR: white">Same as Applesoft Poke 768,96</span></i></p>
</td>
</tr>
</tbody>
</table>
<h2>
<br>
&nbsp;</h2>
</body>
</html>
7 changes: 6 additions & 1 deletion help/dbg-toc-intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<body style="DIRECTION: ltr" lang="en-US">
<H1>AppleWin Debugger Tutorial</H1>
<P><FONT size="4"><i>By Michael Pohoreski.</i></FONT></P>
<P><FONT size="3">Revision 3.&nbsp; Mar 12, 2006.</FONT></P>
<P><FONT size="3">Revision 4.&nbsp; Feb. 21, 2025.</FONT></P>
<H2>Table of Contents</H2>
<UL>
<LI><A href="#Introduction">Introduction</A>
Expand All @@ -23,6 +23,11 @@ <H2>Table of Contents</H2>
<LI><A href="dbg-memory.html#Memory_Search">Searching Memory</A>
<LI><A href="dbg-memory.html#Memory_Change">Changing Memory</A>
</UL>
<LI><A href="dbg-view-output.html">View Output</a>
<UL>
<LI><A href="dbg-view-output.html#View_Video_Modes">Video Modes</A>
<LI><A href="dbg-view-output.html#View_Output_Keys">Output Keys</A>
</UL>
<LI><A href="dbg-symbols.html">Symbols</A>
<LI><A href="dbg-calculator.html">Calculator</A>
<LI><A href="dbg-windows.html">Windows</A>
Expand Down
174 changes: 174 additions & 0 deletions help/dbg-view-output.html

Large diffs are not rendered by default.

74 changes: 69 additions & 5 deletions source/Debugger/Debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define MAKE_VERSION(a,b,c,d) ((a<<24) | (b<<16) | (c<<8) | (d))

// See /docs/Debugger_Changelog.txt for full details
const int DEBUGGER_VERSION = MAKE_VERSION(2,9,2,6);
const int DEBUGGER_VERSION = MAKE_VERSION(2,9,2,7);


// Public _________________________________________________________________________________________
Expand Down Expand Up @@ -6813,7 +6813,7 @@ enum ViewVideoPage_t

static Update_t _ViewOutput ( ViewVideoPage_t iPage, UINT bVideoModeFlags )
{
switch ( iPage )
switch ( iPage )
{
case VIEW_PAGE_X:
bVideoModeFlags |= (!GetVideo().VideoGetSW80STORE() && GetVideo().VideoGetSWPAGE2()) ? VF_PAGE2 : 0;
Expand Down Expand Up @@ -9205,10 +9205,74 @@ void DebuggerProcessKey ( int keycode )
// VK_F# are already processed, so we can't use them to cycle next video g_nAppMode
// if ((g_nAppMode != MODE_LOGO) && (g_nAppMode != MODE_DEBUG))

GetVideo().ClearSHRResidue(); // Clear the framebuffer to remove any SHR residue in the borders
// 2.9.2.7 Added: QoL for Debugger's view output screen.
// When using the debugger to view the ouput screen such as `HGR`, `HGR2`, etc. allow the
// keys 0-5 to display the specificed video # page, or 9 to see the current video mode.
// 0 Pseudo Page 0 ($0000 for graphics, else text page 1)
// 1 Hardware Page 1 ($2000 for graphics, else text $0400)
// 2 Hardware Page 2 ($4000 for graphics, else text $0800)
// 3 Pseudo Page 3 ($6000 for graphics, else text page 1)
// 4 Pseudo Page 4 ($8000 for graphics, else text page 1)
// 5 Pseudo Page 5 ($A000 for graphics, else text page 1)
// 9 Current mode and page
//
// NOTE: Do we want to allow viewing mixed/full mode since 0-5 always sets fullscreen?
// 7 Mixed-screen mode
// 8 Full-screen mode
//
// NOTE: Keep in sync: ViewVideoPage_t, DebuggerProcessKey(), _ViewOutput()
if (((keycode >= '0') && (keycode <= '5'))
|| (keycode == '9'))
{
ViewVideoPage_t eVideoPage = VIEW_PAGE_X;
UINT bVideoFlags = 0;

DebugVideoMode::Instance().Get( &bVideoFlags );
uint32_t bSavedVideoModeFlags = bVideoFlags;

bVideoFlags &= ~(VF_MIXED | VF_PAGE0 | VF_PAGE2 | VF_PAGE3 | VF_PAGE4 | VF_PAGE5);
switch (keycode)
{
case '0': eVideoPage = VIEW_PAGE_0; bVideoFlags |= VF_PAGE0; break;
case '1': eVideoPage = VIEW_PAGE_1; /* */; break;
case '2': eVideoPage = VIEW_PAGE_2; bVideoFlags |= VF_PAGE2; break;
case '3': eVideoPage = VIEW_PAGE_3; bVideoFlags |= VF_PAGE3; break;
case '4': eVideoPage = VIEW_PAGE_4; bVideoFlags |= VF_PAGE4; break;
case '5': eVideoPage = VIEW_PAGE_5; bVideoFlags |= VF_PAGE5; break;
case '9': /* Don't use VIEW_PAGE_X as it is handled below*/; break;
default:
bool bUnknownViewVideoPage = false;
assert( bUnknownViewVideoPage );
break;
}

if (keycode == '9')
{
GetFrame().VideoRedrawScreen(); // See: CmdWindowViewOutput()
}
else
{
_ViewOutput( eVideoPage, bVideoFlags );
DebugDisplay();
}

// We need to restore the video mode since the original output may be mixed mode
// but switching to page 0-5 will have set full mode.
DebugVideoMode::Instance().Set( bSavedVideoModeFlags );
g_bIgnoreNextKey = true;
}
else
{
GetVideo().ClearSHRResidue(); // Clear the framebuffer to remove any SHR residue in the borders
DebugVideoMode::Instance().Reset();

// Technically this is a bug/feature: Leaving the debugger view output can sometimes be in the wrong view mode
// GetFrame().VideoRedrawScreen();
// DebugVideoMode::Instance().Set( GetVideo().GetVideoMode() );

UpdateDisplay( UPDATE_ALL ); // 1
}

DebugVideoMode::Instance().Reset();
UpdateDisplay( UPDATE_ALL ); // 1
return;
}

Expand Down
4 changes: 0 additions & 4 deletions source/MockingboardCardManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,6 @@ bool MockingboardCardManager::Init(void)
if (!bRes)
return false;

// Volume might've been setup from value in Registry
if (!m_mockingboardVoice.nVolume)
m_mockingboardVoice.nVolume = DSBVOLUME_MAX;

hr = m_mockingboardVoice.lpDSBvoice->SetVolume(m_mockingboardVoice.nVolume);
LogFileOutput("MBCardMgr: SetVolume(), hr=0x%08X\n", hr);

Expand Down
4 changes: 0 additions & 4 deletions source/SSI263.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -919,10 +919,6 @@ bool SSI263::Init(void)
// . NB. we have 2x SSI263 per MB card, and it's rare if 1 is used (and *extremely* rare if 2 are used!)
// . Not so rare, as TotalReplay (at boot) will try to detect an SSI263 (by playing a $00 phoneme).

// Volume might've been setup from value in Registry
if (!SSI263SingleVoice.nVolume)
SSI263SingleVoice.nVolume = DSBVOLUME_MAX;

hr = SSI263SingleVoice.lpDSBvoice->SetVolume(SSI263SingleVoice.nVolume);
LogFileOutput("SSI263::DSInit: SetVolume(), hr=0x%08X\n", hr);

Expand Down
10 changes: 8 additions & 2 deletions source/SaveState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,10 @@ static void Snapshot_LoadState_v2(void)
GetVideo().SetVidHD(false); // Set true later only if VidHDCard is instantiated
GetVideo().VideoResetState();
GetVideo().SetVideoRefreshRate(VR_60HZ); // Default to 60Hz as older save-states won't contain refresh rate
GetCardMgr().GetMockingboardCardMgr().InitializeForLoadingSnapshot(); // GH#609

MockingboardCardManager &mockingboardCardManager = GetCardMgr().GetMockingboardCardMgr();
mockingboardCardManager.InitializeForLoadingSnapshot(); // GH#609

#ifdef USE_SPEECH_API
g_Speech.Reset();
#endif
Expand All @@ -417,7 +420,10 @@ static void Snapshot_LoadState_v2(void)
throw std::runtime_error("Unknown top-level scalar: " + scalar);
}

GetCardMgr().GetMockingboardCardMgr().SetCumulativeCycles();
// Refresh the volume of any new Mockingboard card (and its SSI263 or SC01 chips)
mockingboardCardManager.SetVolume(mockingboardCardManager.GetVolume(), GetPropertySheet().GetVolumeMax());
mockingboardCardManager.SetCumulativeCycles();

frame.SetLoadedSaveStateFlag(true);

// NB. The following disparity should be resolved:
Expand Down
2 changes: 1 addition & 1 deletion source/SoundCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct VOICE
{
bActive = false;
bMute = false;
nVolume = 0;
nVolume = DSBVOLUME_MAX;
nFadeVolume = 0;
dwUserVolume = 0;
bIsSpeaker = false;
Expand Down
6 changes: 0 additions & 6 deletions source/Speaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -973,12 +973,6 @@ bool Spkr_DSInit()
return false;
}

SpeakerVoice.bActive = true;

// Volume might've been setup from value in Registry
if(!SpeakerVoice.nVolume)
SpeakerVoice.nVolume = DSBVOLUME_MAX;

hr = SpeakerVoice.lpDSBvoice->SetVolume(SpeakerVoice.nVolume);
LogFileOutput("Spkr_DSInit: SetVolume(%d) res = %08X\n", SpeakerVoice.nVolume, (uint32_t)hr);

Expand Down
16 changes: 7 additions & 9 deletions source/Utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,6 @@ void LoadConfiguration(bool loadImages)
if(REGLOAD(REGVALUE_THE_FREEZES_F8_ROM, &dwTmp))
GetPropertySheet().SetTheFreezesF8Rom(dwTmp);

dwTmp = 70;
REGLOAD(REGVALUE_SPKR_VOLUME, &dwTmp);
SpkrSetVolume(dwTmp, GetPropertySheet().GetVolumeMax());

dwTmp = 70;
REGLOAD(REGVALUE_MB_VOLUME, &dwTmp);
GetCardMgr().GetMockingboardCardMgr().SetVolume(dwTmp, GetPropertySheet().GetVolumeMax());

if(REGLOAD(REGVALUE_SAVE_STATE_ON_EXIT, &dwTmp))
g_bSaveStateOnExit = dwTmp ? true : false;

Expand Down Expand Up @@ -288,7 +280,13 @@ void LoadConfiguration(bool loadImages)
}
}

//
dwTmp = 70;
REGLOAD(REGVALUE_SPKR_VOLUME, &dwTmp);
SpkrSetVolume(dwTmp, GetPropertySheet().GetVolumeMax());

dwTmp = 70;
REGLOAD(REGVALUE_MB_VOLUME, &dwTmp);
GetCardMgr().GetMockingboardCardMgr().SetVolume(dwTmp, GetPropertySheet().GetVolumeMax());

// Load save-state pathname *before* inserting any harddisk/disk images (for both init & reinit cases)
// NB. inserting harddisk/disk can change snapshot pathname
Expand Down

0 comments on commit 736cf99

Please sign in to comment.