mirror of https://github.com/stella-emu/stella.git
82 lines
2.5 KiB
C++
82 lines
2.5 KiB
C++
//============================================================================
|
|
//
|
|
// SSSS tt lll lll
|
|
// SS SS tt ll ll
|
|
// SS tttttt eeee ll ll aaaa
|
|
// SSSS tt ee ee ll ll aa
|
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
|
// SS SS tt ee ll ll aa aa
|
|
// SSSS ttt eeeee llll llll aaaaa
|
|
//
|
|
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
|
//
|
|
// See the file "license" for information on usage and redistribution of
|
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
|
//
|
|
// $Id: TiaOutputWidget.cxx,v 1.4 2005-08-03 13:26:02 stephena Exp $
|
|
//
|
|
// Based on code from ScummVM - Scumm Interpreter
|
|
// Copyright (C) 2002-2004 The ScummVM project
|
|
//============================================================================
|
|
|
|
#include "OSystem.hxx"
|
|
#include "FrameBuffer.hxx"
|
|
#include "Widget.hxx"
|
|
#include "GuiObject.hxx"
|
|
|
|
#include "TiaOutputWidget.hxx"
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
TiaOutputWidget::TiaOutputWidget(GuiObject* boss, int x, int y, int w, int h)
|
|
: Widget(boss, x, y, w, h),
|
|
CommandSender(boss)
|
|
{
|
|
}
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
TiaOutputWidget::~TiaOutputWidget()
|
|
{
|
|
}
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
void TiaOutputWidget::advanceScanline(int lines)
|
|
{
|
|
while(lines)
|
|
{
|
|
instance()->console().mediaSource().updateScanline();
|
|
--lines;
|
|
}
|
|
setDirty(); draw();
|
|
}
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
void TiaOutputWidget::advance(int frames)
|
|
{
|
|
while(frames)
|
|
{
|
|
instance()->console().mediaSource().update();
|
|
--frames;
|
|
}
|
|
setDirty(); draw();
|
|
}
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
void TiaOutputWidget::handleMouseDown(int x, int y, int button, int clickCount)
|
|
{
|
|
int xstart = atoi(instance()->console().properties().get("Display.XStart").c_str());
|
|
int ystart = atoi(instance()->console().properties().get("Display.YStart").c_str());
|
|
|
|
cerr << "TiaOutputWidget button press:" << endl
|
|
<< "x = " << x << ", y = " << y << endl
|
|
<< "xstart = " << xstart << ", ystart = " << ystart << endl
|
|
<< endl;
|
|
}
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
void TiaOutputWidget::drawWidget(bool hilite)
|
|
{
|
|
cerr << "TiaOutputWidget::drawWidget\n";
|
|
instance()->frameBuffer().refreshTIA();
|
|
instance()->frameBuffer().drawMediaSource();
|
|
}
|