mirror of
https://github.com/TomHarte/CLK.git
synced 2025-08-13 00:25:26 +00:00
'type' is out, at least for the time being.
This commit is contained in:
committed by
Thomas Harte
parent
6a0b4e86c8
commit
82aa6d074a
@@ -11,7 +11,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
using namespace Atari2600;
|
using namespace Atari2600;
|
||||||
static const char atari2600DataType[] = "Atari2600";
|
|
||||||
static const int horizontalTimerReload = 227;
|
static const int horizontalTimerReload = 227;
|
||||||
|
|
||||||
Machine::Machine()
|
Machine::Machine()
|
||||||
@@ -225,9 +224,9 @@ void Machine::output_pixels(unsigned int count)
|
|||||||
{
|
{
|
||||||
switch(_lastOutputState)
|
switch(_lastOutputState)
|
||||||
{
|
{
|
||||||
case OutputState::Blank: _crt->output_blank(_lastOutputStateDuration); break;
|
case OutputState::Blank: _crt->output_blank(_lastOutputStateDuration); break;
|
||||||
case OutputState::Sync: _crt->output_sync(_lastOutputStateDuration); break;
|
case OutputState::Sync: _crt->output_sync(_lastOutputStateDuration); break;
|
||||||
case OutputState::Pixel: _crt->output_data(_lastOutputStateDuration, atari2600DataType); break;
|
case OutputState::Pixel: _crt->output_data(_lastOutputStateDuration); break;
|
||||||
}
|
}
|
||||||
_lastOutputStateDuration = 0;
|
_lastOutputStateDuration = 0;
|
||||||
_lastOutputState = state;
|
_lastOutputState = state;
|
||||||
|
@@ -168,7 +168,7 @@ CRT::SyncEvent CRT::get_next_horizontal_sync_event(bool hsync_is_requested, unsi
|
|||||||
return proposedEvent;
|
return proposedEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRT::advance_cycles(unsigned int number_of_cycles, bool hsync_requested, bool vsync_requested, const bool vsync_charging, const Type type, const char *data_type)
|
void CRT::advance_cycles(unsigned int number_of_cycles, bool hsync_requested, bool vsync_requested, const bool vsync_charging, const Type type)
|
||||||
{
|
{
|
||||||
number_of_cycles *= _time_multiplier;
|
number_of_cycles *= _time_multiplier;
|
||||||
|
|
||||||
@@ -349,28 +349,28 @@ void CRT::output_sync(unsigned int number_of_cycles)
|
|||||||
{
|
{
|
||||||
bool _hsync_requested = !_is_receiving_sync; // ensure this really is edge triggered; someone calling output_sync twice in succession shouldn't trigger it twice
|
bool _hsync_requested = !_is_receiving_sync; // ensure this really is edge triggered; someone calling output_sync twice in succession shouldn't trigger it twice
|
||||||
_is_receiving_sync = true;
|
_is_receiving_sync = true;
|
||||||
advance_cycles(number_of_cycles, _hsync_requested, false, true, Type::Sync, nullptr);
|
advance_cycles(number_of_cycles, _hsync_requested, false, true, Type::Sync);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRT::output_blank(unsigned int number_of_cycles)
|
void CRT::output_blank(unsigned int number_of_cycles)
|
||||||
{
|
{
|
||||||
bool _vsync_requested = _is_receiving_sync;
|
bool _vsync_requested = _is_receiving_sync;
|
||||||
_is_receiving_sync = false;
|
_is_receiving_sync = false;
|
||||||
advance_cycles(number_of_cycles, false, _vsync_requested, false, Type::Blank, nullptr);
|
advance_cycles(number_of_cycles, false, _vsync_requested, false, Type::Blank);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRT::output_level(unsigned int number_of_cycles, const char *type)
|
void CRT::output_level(unsigned int number_of_cycles)
|
||||||
{
|
{
|
||||||
bool _vsync_requested = _is_receiving_sync;
|
bool _vsync_requested = _is_receiving_sync;
|
||||||
_is_receiving_sync = false;
|
_is_receiving_sync = false;
|
||||||
advance_cycles(number_of_cycles, false, _vsync_requested, false, Type::Level, type);
|
advance_cycles(number_of_cycles, false, _vsync_requested, false, Type::Level);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRT::output_data(unsigned int number_of_cycles, const char *type)
|
void CRT::output_data(unsigned int number_of_cycles)
|
||||||
{
|
{
|
||||||
bool _vsync_requested = _is_receiving_sync;
|
bool _vsync_requested = _is_receiving_sync;
|
||||||
_is_receiving_sync = false;
|
_is_receiving_sync = false;
|
||||||
advance_cycles(number_of_cycles, false, _vsync_requested, false, Type::Data, type);
|
advance_cycles(number_of_cycles, false, _vsync_requested, false, Type::Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Buffer supply
|
#pragma mark - Buffer supply
|
||||||
|
@@ -55,8 +55,8 @@ class CRT {
|
|||||||
|
|
||||||
void output_sync(unsigned int number_of_cycles);
|
void output_sync(unsigned int number_of_cycles);
|
||||||
void output_blank(unsigned int number_of_cycles);
|
void output_blank(unsigned int number_of_cycles);
|
||||||
void output_level(unsigned int number_of_cycles, const char *type);
|
void output_level(unsigned int number_of_cycles);
|
||||||
void output_data(unsigned int number_of_cycles, const char *type);
|
void output_data(unsigned int number_of_cycles);
|
||||||
|
|
||||||
class CRTDelegate {
|
class CRTDelegate {
|
||||||
public:
|
public:
|
||||||
@@ -110,7 +110,7 @@ class CRT {
|
|||||||
enum Type {
|
enum Type {
|
||||||
Sync, Level, Data, Blank
|
Sync, Level, Data, Blank
|
||||||
} type;
|
} type;
|
||||||
void advance_cycles(unsigned int number_of_cycles, bool hsync_requested, bool vsync_requested, bool vsync_charging, Type type, const char *data_type);
|
void advance_cycles(unsigned int number_of_cycles, bool hsync_requested, bool vsync_requested, bool vsync_charging, Type type);
|
||||||
|
|
||||||
// the inner entry point that determines whether and when the next sync event will occur within
|
// the inner entry point that determines whether and when the next sync event will occur within
|
||||||
// the current output window
|
// the current output window
|
||||||
|
Reference in New Issue
Block a user