2016-10-12 19:20:23 -04:00
|
|
|
//
|
|
|
|
// Video.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 12/10/2016.
|
|
|
|
// Copyright © 2016 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2016-10-16 22:14:01 -04:00
|
|
|
#ifndef Machines_Oric_Video_hpp
|
|
|
|
#define Machines_Oric_Video_hpp
|
2016-10-12 19:20:23 -04:00
|
|
|
|
|
|
|
#include "../../Outputs/CRT/CRT.hpp"
|
|
|
|
|
|
|
|
namespace Oric {
|
|
|
|
|
|
|
|
class VideoOutput {
|
|
|
|
public:
|
|
|
|
VideoOutput(uint8_t *memory);
|
2016-10-12 21:29:21 -04:00
|
|
|
std::shared_ptr<Outputs::CRT::CRT> get_crt();
|
2016-10-12 19:20:23 -04:00
|
|
|
void run_for_cycles(int number_of_cycles);
|
|
|
|
|
|
|
|
private:
|
|
|
|
uint8_t *_ram;
|
2016-10-12 21:29:21 -04:00
|
|
|
std::shared_ptr<Outputs::CRT::CRT> _crt;
|
|
|
|
|
2016-10-20 07:34:23 -04:00
|
|
|
// Counters and limits
|
2016-10-12 21:29:21 -04:00
|
|
|
int _counter, _frame_counter;
|
2016-10-20 07:34:23 -04:00
|
|
|
int _v_sync_start_position, _v_sync_end_position, _counter_period;
|
2016-10-12 21:29:21 -04:00
|
|
|
|
2016-10-30 20:15:47 -04:00
|
|
|
// Output target
|
2016-10-12 21:29:21 -04:00
|
|
|
uint8_t *_pixel_target;
|
|
|
|
|
|
|
|
// Registers
|
2016-10-13 19:34:29 -04:00
|
|
|
uint8_t _ink, _paper;
|
|
|
|
|
2016-10-13 07:59:11 -04:00
|
|
|
int _character_set_base_address;
|
2016-10-30 20:16:22 -04:00
|
|
|
inline void set_character_set_base_address();
|
2016-10-13 19:34:29 -04:00
|
|
|
|
2016-10-12 21:52:47 -04:00
|
|
|
bool _is_graphics_mode;
|
2016-10-20 07:34:23 -04:00
|
|
|
bool _next_frame_is_sixty_hertz;
|
2016-10-13 19:34:29 -04:00
|
|
|
bool _use_alternative_character_set;
|
|
|
|
bool _use_double_height_characters;
|
|
|
|
bool _blink_text;
|
2016-10-14 22:39:27 -04:00
|
|
|
|
|
|
|
uint8_t _phase;
|
2016-10-12 19:20:23 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* Video_hpp */
|