Fixed remaining debugger font issues (hopefully), and added GUI slider

for adjusting analog paddle threshold (used to eliminate jitter).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1079 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2006-04-05 12:28:39 +00:00
parent b6d4749146
commit 479a987b86
7 changed files with 67 additions and 17 deletions

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: TiaWidget.cxx,v 1.3 2006-03-25 00:34:17 stephena Exp $
// $Id: TiaWidget.cxx,v 1.4 2006-04-05 12:28:37 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -476,7 +476,7 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& font,
// M1 register info
////////////////////////////
// enaM1
xpos = 10; ypos += 2*lineHeight;
xpos = 10; ypos += lineHeight + 6;
t = new StaticTextWidget(boss, font, xpos, ypos+2, 3*fontWidth, fontHeight,
"M1:", kTextAlignLeft);
xpos += 3*fontWidth + 8;
@ -531,7 +531,7 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& font,
// BL register info
////////////////////////////
// enaBL
xpos = 10; ypos += 2*lineHeight;
xpos = 10; ypos += lineHeight + 6;
t = new StaticTextWidget(boss, font, xpos, ypos+2, 3*fontWidth, fontHeight,
"BL:", kTextAlignLeft);
xpos += 3*fontWidth + 8;
@ -586,7 +586,7 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& font,
// PF 0/1/2 registers
////////////////////////////
// PF0
xpos = 10; ypos += 2*lineHeight;
xpos = 10; ypos += lineHeight + 6;
t = new StaticTextWidget(boss, font, xpos, ypos+2, 4*fontWidth, fontHeight,
"PF:", kTextAlignLeft);
xpos += 4*fontWidth;
@ -610,7 +610,7 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& font,
addFocusWidget(myPF[2]);
// PF reflect, score, priority
xpos = 10 + 4*fontWidth; ypos += lineHeight + 2;
xpos = 10 + 4*fontWidth; ypos += lineHeight + 6;
myRefPF = new CheckboxWidget(boss, font, xpos, ypos+1,
"Reflect", kCheckActionCmd);
myRefPF->setTarget(this);

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: EventHandler.cxx,v 1.159 2006-03-27 21:06:44 stephena Exp $
// $Id: EventHandler.cxx,v 1.160 2006-04-05 12:28:37 stephena Exp $
//============================================================================
#include <sstream>
@ -132,10 +132,9 @@ EventHandler::EventHandler(OSystem* osystem)
myGrabMouseFlag = myOSystem->settings().getBool("grabmouse");
setPaddleMode(myOSystem->settings().getInt("paddle"), false);
setPaddleThreshold(myOSystem->settings().getInt("pthresh"));
myFryingFlag = false;
myPaddleThreshold = myOSystem->settings().getInt("pthresh");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -2043,6 +2042,14 @@ void EventHandler::setPaddleSpeed(int num, int speed)
myOSystem->settings().setInt(buf.str(), speed);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EventHandler::setPaddleThreshold(int thresh)
{
myPaddleThreshold = thresh;
myOSystem->settings().setInt("pthresh", thresh);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EventHandler::enterMenuMode(State state)
{

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: EventHandler.hxx,v 1.84 2006-03-27 21:06:44 stephena Exp $
// $Id: EventHandler.hxx,v 1.85 2006-04-05 12:28:37 stephena Exp $
//============================================================================
#ifndef EVENTHANDLER_HXX
@ -107,7 +107,7 @@ struct JoyMouse {
mapping can take place.
@author Stephen Anthony
@version $Id: EventHandler.hxx,v 1.84 2006-03-27 21:06:44 stephena Exp $
@version $Id: EventHandler.hxx,v 1.85 2006-04-05 12:28:37 stephena Exp $
*/
class EventHandler
{
@ -260,6 +260,15 @@ class EventHandler
*/
void setPaddleSpeed(int num, int speed);
/**
Sets the amount by which paddle jitter is detected. Quick movements
of less than this amount constitute jitter, and do not generate
paddle events.
@param thresh The threshold to use for jitter detection
*/
void setPaddleThreshold(int thresh);
inline bool kbdAlt(int mod)
{
#ifndef MAC_OSX

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Settings.cxx,v 1.84 2006-04-04 23:15:43 stephena Exp $
// $Id: Settings.cxx,v 1.85 2006-04-05 12:28:37 stephena Exp $
//============================================================================
#include <cassert>
@ -247,6 +247,12 @@ void Settings::validate()
if(i < 0 || i > 3)
setInternal("paddle", "0");
i = getInt("pthresh");
if(i < 400)
setInternal("pthresh", "400");
else if(i > 800)
setInternal("pthresh", "800");
s = getString("palette");
if(s != "standard" && s != "original" && s != "z26")
setInternal("palette", "standard");

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: InputDialog.cxx,v 1.12 2006-03-02 13:10:53 stephena Exp $
// $Id: InputDialog.cxx,v 1.13 2006-04-05 12:28:39 stephena Exp $
//============================================================================
#include "OSystem.hxx"
@ -27,7 +27,8 @@
#include "bspf.hxx"
enum {
kPaddleChanged = 'PDch',
kPaddleChanged = 'PDch',
kPaddleThreshChanged = 'PDth',
kP0SpeedID = 100,
kP1SpeedID = 101,
kP2SpeedID = 102,
@ -107,7 +108,7 @@ void InputDialog::addVDeviceTab(const GUI::Font& font)
// Add 'mouse to paddle' mapping
ypos += 2*lineHeight;
lwidth = font.getStringWidth("Mouse is paddle: ");
lwidth = font.getStringWidth("Paddle threshold: ");
pwidth = font.getMaxCharWidth() * 5;
myPaddleMode = new SliderWidget(myTab, font, xpos, ypos, pwidth, lineHeight,
"Mouse is paddle: ", lwidth, kPaddleChanged);
@ -118,6 +119,19 @@ void InputDialog::addVDeviceTab(const GUI::Font& font)
myPaddleModeLabel->setFlags(WIDGET_CLEARBG);
wid.push_back(myPaddleMode);
// Add 'paddle threshhold' setting
xpos = 5; ypos += lineHeight + 3;
myPaddleThreshold = new SliderWidget(myTab, font, xpos, ypos, pwidth, lineHeight,
"Paddle threshold: ",
lwidth, kPaddleThreshChanged);
myPaddleThreshold->setMinValue(400); myPaddleThreshold->setMaxValue(800);
xpos += myPaddleThreshold->getWidth() + 5;
myPaddleThresholdLabel = new StaticTextWidget(myTab, font, xpos, ypos+1,
24, lineHeight,
"", kTextAlignLeft);
myPaddleThresholdLabel->setFlags(WIDGET_CLEARBG);
wid.push_back(myPaddleThreshold);
// Add paddle 0 speed
xpos = 5; ypos += lineHeight + 3;
myPaddleSpeed[0] = new SliderWidget(myTab, font, xpos, ypos, pwidth, lineHeight,
@ -187,6 +201,10 @@ void InputDialog::loadConfig()
myPaddleMode->setValue(instance()->settings().getInt("paddle"));
myPaddleModeLabel->setLabel(instance()->settings().getString("paddle"));
// Paddle threshold
myPaddleThreshold->setValue(instance()->settings().getInt("pthresh"));
myPaddleThresholdLabel->setLabel(instance()->settings().getString("pthresh"));
// Paddle speed settings
myPaddleSpeed[0]->setValue(instance()->settings().getInt("p1speed"));
myPaddleLabel[0]->setLabel(instance()->settings().getString("p1speed"));
@ -210,6 +228,10 @@ void InputDialog::saveConfig()
int mode = myPaddleMode->getValue();
instance()->eventHandler().setPaddleMode(mode);
// Paddle threshold
int threshold = myPaddleThreshold->getValue();
instance()->eventHandler().setPaddleThreshold(threshold);
// Paddle speed settings
for(int i = 0; i < 4; ++i)
instance()->eventHandler().setPaddleSpeed(i, myPaddleSpeed[i]->getValue());
@ -275,6 +297,10 @@ void InputDialog::handleCommand(CommandSender* sender, int cmd,
myPaddleModeLabel->setValue(myPaddleMode->getValue());
break;
case kPaddleThreshChanged:
myPaddleThresholdLabel->setValue(myPaddleThreshold->getValue());
break;
case kP0SpeedID:
case kP1SpeedID:
case kP2SpeedID:

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: InputDialog.hxx,v 1.7 2006-03-02 13:10:53 stephena Exp $
// $Id: InputDialog.hxx,v 1.8 2006-04-05 12:28:39 stephena Exp $
//============================================================================
#ifndef INPUT_DIALOG_HXX
@ -61,6 +61,8 @@ class InputDialog : public Dialog
SliderWidget* myPaddleMode;
StaticTextWidget* myPaddleModeLabel;
SliderWidget* myPaddleThreshold;
StaticTextWidget* myPaddleThresholdLabel;
SliderWidget* myPaddleSpeed[4];
StaticTextWidget* myPaddleLabel[4];

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: OptionsDialog.cxx,v 1.37 2006-03-19 20:57:55 stephena Exp $
// $Id: OptionsDialog.cxx,v 1.38 2006-04-05 12:28:39 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -112,7 +112,7 @@ OptionsDialog::OptionsDialog(OSystem* osystem, DialogContainer* parent)
checkBounds(fbWidth, fbHeight, &x, &y, &w, &h);
myAudioDialog = new AudioDialog(myOSystem, parent, font, x, y, w, h);
w = 230; h = 170;
w = 230; h = 185;
checkBounds(fbWidth, fbHeight, &x, &y, &w, &h);
myInputDialog = new InputDialog(myOSystem, parent, font, x, y, w, h);