2016-10-12 23:20:23 +00:00
|
|
|
//
|
|
|
|
// Video.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 12/10/2016.
|
|
|
|
// Copyright © 2016 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2016-10-17 02:14:01 +00:00
|
|
|
#ifndef Machines_Oric_Video_hpp
|
|
|
|
#define Machines_Oric_Video_hpp
|
2016-10-12 23:20:23 +00:00
|
|
|
|
|
|
|
#include "../../Outputs/CRT/CRT.hpp"
|
|
|
|
|
|
|
|
namespace Oric {
|
|
|
|
|
|
|
|
class VideoOutput {
|
|
|
|
public:
|
|
|
|
VideoOutput(uint8_t *memory);
|
2016-10-13 01:29:21 +00:00
|
|
|
std::shared_ptr<Outputs::CRT::CRT> get_crt();
|
2016-10-12 23:20:23 +00:00
|
|
|
void run_for_cycles(int number_of_cycles);
|
|
|
|
|
|
|
|
private:
|
2016-11-22 14:28:45 +00:00
|
|
|
uint8_t *ram_;
|
|
|
|
std::shared_ptr<Outputs::CRT::CRT> crt_;
|
2016-10-13 01:29:21 +00:00
|
|
|
|
2016-10-20 11:34:23 +00:00
|
|
|
// Counters and limits
|
2016-11-22 14:28:45 +00:00
|
|
|
int counter_, frame_counter_;
|
|
|
|
int v_sync_start_position_, v_sync_end_position_, counter_period_;
|
2016-10-13 01:29:21 +00:00
|
|
|
|
2016-10-31 00:15:47 +00:00
|
|
|
// Output target
|
2016-11-22 14:28:45 +00:00
|
|
|
uint8_t *pixel_target_;
|
2016-10-13 01:29:21 +00:00
|
|
|
|
|
|
|
// Registers
|
2016-11-22 14:28:45 +00:00
|
|
|
uint8_t ink_, paper_;
|
2016-10-13 23:34:29 +00:00
|
|
|
|
2016-11-22 14:28:45 +00:00
|
|
|
int character_set_base_address_;
|
2016-10-31 00:16:22 +00:00
|
|
|
inline void set_character_set_base_address();
|
2016-10-13 23:34:29 +00:00
|
|
|
|
2016-11-22 14:28:45 +00:00
|
|
|
bool is_graphics_mode_;
|
|
|
|
bool next_frame_is_sixty_hertz_;
|
|
|
|
bool use_alternative_character_set_;
|
|
|
|
bool use_double_height_characters_;
|
|
|
|
bool blink_text_;
|
2016-10-15 02:39:27 +00:00
|
|
|
|
2016-11-22 14:28:45 +00:00
|
|
|
uint8_t phase_;
|
2016-10-12 23:20:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* Video_hpp */
|