1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-23 20:29:42 +00:00

Pulled a few things out as constants, zoomed in a little. Still in a 4:3 window though.

This commit is contained in:
Thomas Harte 2016-01-11 22:18:34 -05:00
parent 72019d0ea3
commit 650077feac
2 changed files with 8 additions and 8 deletions

View File

@ -265,14 +265,16 @@ inline void Machine::evaluate_interrupts()
inline void Machine::update_display()
{
const int end_of_hsync = 3 * cycles_per_line;
const int lines_of_hsync = 3;
const int end_of_hsync = lines_of_hsync * cycles_per_line;
const int first_graphics_line = 28;
if(_frameCycles >= end_of_hsync)
{
// assert sync for the first three lines of the display, with a break at the end for horizontal alignment
if(_outputPosition < end_of_hsync)
{
for(int c = 0; c < 3; c++)
for(int c = 0; c < lines_of_hsync; c++)
{
_crt->output_sync(119 * crt_cycles_multiplier);
_crt->output_blank(9 * crt_cycles_multiplier);
@ -293,12 +295,10 @@ inline void Machine::update_display()
}
else
{
// on lines prior to 28 or after or equal to 284, or on a line that is equal to 8 or 9 modulo 10 in a line-spaced mode,
// the line is then definitely blank.
bool isBlankLine =
((_screenMode == 3) || (_screenMode == 6)) ?
((current_line < 28 || current_line >= 277) || (((current_line - 28)%10) > 7)) :
((current_line < 28 || current_line >= 284));
((current_line < first_graphics_line || current_line >= first_graphics_line+248) || (((current_line - first_graphics_line)%10) > 7)) :
((current_line < first_graphics_line || current_line >= first_graphics_line+256));
if(isBlankLine)
{
@ -319,7 +319,7 @@ inline void Machine::update_display()
_crt->allocate_write_area(80 * crt_cycles_multiplier);
_currentLine = (uint8_t *)_crt->get_write_target_for_buffer(0);
if(current_line == 28)
if(current_line == first_graphics_line)
_startLineAddress = _startScreenAddress;
_currentScreenAddress = _startLineAddress;
}

View File

@ -26,7 +26,7 @@ class ElectronDocument: MachineDocument {
override func windowControllerDidLoadNib(aController: NSWindowController) {
super.windowControllerDidLoadNib(aController)
electron.view = openGLView
// openGLView.frameBounds = CGRectMake(0.1, 0.1, 0.8, 0.8)
openGLView.frameBounds = CGRectMake(0.0225, 0.0625, 0.75, 0.75)
}
override var windowNibName: String? {