1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-09-28 09:54:49 +00:00

Adjusts vertical timing for display height.

This commit is contained in:
Thomas Harte 2018-10-23 21:20:44 -04:00
parent 90fbad0f1c
commit 2f995eb622
2 changed files with 20 additions and 7 deletions

View File

@ -191,11 +191,27 @@ void TMS9918::run_for(const HalfCycles cycles) {
// ---------------------------------------
// Latch scrolling position, if necessary.
// ---------------------------------------
if(write_pointer_.column < 61 && end_column >= 61) {
if(!write_pointer_.row) {
master_system_.latched_vertical_scroll = master_system_.vertical_scroll;
if(is_sega_vdp(personality_)) {
if(write_pointer_.column < 61 && end_column >= 61) {
if(!write_pointer_.row) {
master_system_.latched_vertical_scroll = master_system_.vertical_scroll;
if(master_system_.mode4_enable) {
mode_timing_.pixel_lines = 192;
if(mode2_enable_ && mode1_enable_) mode_timing_.pixel_lines = 224;
if(mode2_enable_ && mode3_enable_) mode_timing_.pixel_lines = 240;
mode_timing_.sprite_terminator = 0xd0;
if(mode_timing_.pixel_lines != 192) {
mode_timing_.sprite_terminator = 0xf0;
}
mode_timing_.first_vsync_line = (mode_timing_.total_lines + mode_timing_.pixel_lines) >> 1;
mode_timing_.end_of_frame_interrupt_position.row = mode_timing_.pixel_lines + 1;
}
}
line_buffer.latched_horizontal_scroll = master_system_.horizontal_scroll;
}
line_buffer.latched_horizontal_scroll = master_system_.horizontal_scroll;
}

View File

@ -280,9 +280,6 @@ class Base {
if(is_sega_vdp(personality_) && master_system_.mode4_enable) {
screen_mode_ = ScreenMode::SMSMode4;
mode_timing_.pixel_lines = 192;
if(mode2_enable_ && mode1_enable_) mode_timing_.pixel_lines = 224;
if(mode2_enable_ && mode3_enable_) mode_timing_.pixel_lines = 240;
mode_timing_.maximum_visible_sprites = 8;
return;
}