1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-26 09:29:45 +00:00

Merge branch 'master' into DiskWrites

This commit is contained in:
Thomas Harte 2016-12-22 22:47:19 -05:00
commit 42f25cdffc
2 changed files with 14 additions and 7 deletions

View File

@ -46,6 +46,7 @@ VideoOutput::VideoOutput(uint8_t *memory) :
{
memset(palette_, 0xf, sizeof(palette_));
setup_screen_map();
setup_base_address();
crt_.reset(new Outputs::CRT::CRT(crt_cycles_per_line, 8, Outputs::CRT::DisplayType::PAL50, 1));
crt_->set_rgb_sampling_function(
@ -302,13 +303,7 @@ void VideoOutput::set_register(int address, uint8_t value)
if(new_screen_mode != screen_mode_)
{
screen_mode_ = new_screen_mode;
switch(screen_mode_)
{
case 0: case 1: case 2: screen_mode_base_address_ = 0x3000; break;
case 3: screen_mode_base_address_ = 0x4000; break;
case 4: case 5: screen_mode_base_address_ = 0x5800; break;
case 6: screen_mode_base_address_ = 0x6000; break;
}
setup_base_address();
}
}
break;
@ -372,6 +367,17 @@ void VideoOutput::set_register(int address, uint8_t value)
}
}
void VideoOutput::setup_base_address()
{
switch(screen_mode_)
{
case 0: case 1: case 2: screen_mode_base_address_ = 0x3000; break;
case 3: screen_mode_base_address_ = 0x4000; break;
case 4: case 5: screen_mode_base_address_ = 0x5800; break;
case 6: screen_mode_base_address_ = 0x6000; break;
}
}
#pragma mark - Interrupts
VideoOutput::Interrupt VideoOutput::get_next_interrupt()

View File

@ -77,6 +77,7 @@ class VideoOutput {
inline void start_pixel_line();
inline void end_pixel_line();
inline void output_pixels(unsigned int number_of_cycles);
inline void setup_base_address();
int output_position_, unused_cycles_;