mirror of https://github.com/stella-emu/stella.git
Per-scanline update *almost* works correctly! Actually it's working,
except it lets you keep advancing past the end of the frame. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@659 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
55d57ed1ea
commit
3a49da3b6c
|
@ -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: TIA.cxx,v 1.49 2005-07-16 16:09:37 urchlay Exp $
|
||||
// $Id: TIA.cxx,v 1.50 2005-07-16 18:25:53 urchlay Exp $
|
||||
//============================================================================
|
||||
|
||||
#include <cassert>
|
||||
|
@ -490,7 +490,7 @@ bool TIA::load(Deserializer& in)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void TIA::update(int cpuCycles)
|
||||
void TIA::update()
|
||||
{
|
||||
if(!myPartialFrameFlag) {
|
||||
// This stuff should only happen at the beginning of a new frame.
|
||||
|
@ -544,8 +544,7 @@ void TIA::update(int cpuCycles)
|
|||
myPartialFrameFlag = true;
|
||||
|
||||
// Execute instructions until frame is finished, or a breakpoint/trap hits
|
||||
mySystem->m6502().execute(cpuCycles);
|
||||
cerr << "myPartialFrameFlag==" << myPartialFrameFlag << endl;
|
||||
mySystem->m6502().execute(25000);
|
||||
|
||||
// TODO: have code here that handles errors....
|
||||
|
||||
|
@ -562,19 +561,23 @@ void TIA::update(int cpuCycles)
|
|||
}
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void TIA::update()
|
||||
{
|
||||
update(25000);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void TIA::updateScanline()
|
||||
{
|
||||
// FIXME - extend this method to draw partial scanlines
|
||||
// ie, when step/trace is called from the debugger
|
||||
|
||||
update(76);
|
||||
int totalClocks = (mySystem->cycles() * 3) - myClockWhenFrameStarted;
|
||||
int endClock = ((totalClocks + 228) / 228) * 228;
|
||||
|
||||
int clock;
|
||||
do {
|
||||
mySystem->m6502().execute(1);
|
||||
clock = mySystem->cycles() * 3;
|
||||
} while(clock < endClock);
|
||||
|
||||
totalClocks = (mySystem->cycles() * 3) - myClockWhenFrameStarted;
|
||||
myCurrentScanline = totalClocks / 228;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -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: TIA.hxx,v 1.27 2005-07-16 16:09:37 urchlay Exp $
|
||||
// $Id: TIA.hxx,v 1.28 2005-07-16 18:25:54 urchlay Exp $
|
||||
//============================================================================
|
||||
|
||||
#ifndef TIA_HXX
|
||||
|
@ -42,7 +42,7 @@ class Settings;
|
|||
be displayed on screen.
|
||||
|
||||
@author Bradford W. Mott
|
||||
@version $Id: TIA.hxx,v 1.27 2005-07-16 16:09:37 urchlay Exp $
|
||||
@version $Id: TIA.hxx,v 1.28 2005-07-16 18:25:54 urchlay Exp $
|
||||
*/
|
||||
class TIA : public Device , public MediaSource
|
||||
{
|
||||
|
@ -129,11 +129,6 @@ class TIA : public Device , public MediaSource
|
|||
*/
|
||||
virtual void update();
|
||||
|
||||
/* The backend update method. Currently pointless to make this public, as
|
||||
we don't support partial scanline updates, but give it time :)
|
||||
*/
|
||||
void update(int cpuCycles);
|
||||
|
||||
/**
|
||||
This method should be called to update the media source with
|
||||
a new scanline.
|
||||
|
|
Loading…
Reference in New Issue