mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-26 08:49:37 +00:00
Avoid double responsibility for state.
This commit is contained in:
parent
56831e02fc
commit
dd5b4b484a
@ -266,7 +266,7 @@ void TMS9918<personality>::run_for(const HalfCycles cycles) {
|
|||||||
LineBuffer &next_line_buffer = this->line_buffers_[this->write_pointer_.row];
|
LineBuffer &next_line_buffer = this->line_buffers_[this->write_pointer_.row];
|
||||||
|
|
||||||
// Establish the output mode for the next line.
|
// Establish the output mode for the next line.
|
||||||
this->set_current_screen_mode();
|
this->screen_mode_ = this->current_screen_mode();
|
||||||
|
|
||||||
// Based on the output mode, pick a line mode.
|
// Based on the output mode, pick a line mode.
|
||||||
next_line_buffer.first_pixel_output_column = Timing<personality>::FirstPixelCycle;
|
next_line_buffer.first_pixel_output_column = Timing<personality>::FirstPixelCycle;
|
||||||
|
@ -298,43 +298,35 @@ template <Personality personality> struct Base {
|
|||||||
size_t sprite_generator_table_address;
|
size_t sprite_generator_table_address;
|
||||||
} master_system_;
|
} master_system_;
|
||||||
|
|
||||||
void set_current_screen_mode() {
|
ScreenMode current_screen_mode() const {
|
||||||
if(blank_display_) {
|
if(blank_display_) {
|
||||||
screen_mode_ = ScreenMode::Blank;
|
return ScreenMode::Blank;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if constexpr (is_sega_vdp(personality)) {
|
if constexpr (is_sega_vdp(personality)) {
|
||||||
if(master_system_.mode4_enable) {
|
if(master_system_.mode4_enable) {
|
||||||
screen_mode_ = ScreenMode::SMSMode4;
|
return ScreenMode::SMSMode4;
|
||||||
mode_timing_.maximum_visible_sprites = 8;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mode_timing_.maximum_visible_sprites = 4;
|
|
||||||
if(!mode1_enable_ && !mode2_enable_ && !mode3_enable_) {
|
if(!mode1_enable_ && !mode2_enable_ && !mode3_enable_) {
|
||||||
screen_mode_ = ScreenMode::ColouredText;
|
return ScreenMode::ColouredText;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mode1_enable_ && !mode2_enable_ && !mode3_enable_) {
|
if(mode1_enable_ && !mode2_enable_ && !mode3_enable_) {
|
||||||
screen_mode_ = ScreenMode::Text;
|
return ScreenMode::Text;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!mode1_enable_ && mode2_enable_ && !mode3_enable_) {
|
if(!mode1_enable_ && mode2_enable_ && !mode3_enable_) {
|
||||||
screen_mode_ = ScreenMode::Graphics;
|
return ScreenMode::Graphics;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!mode1_enable_ && !mode2_enable_ && mode3_enable_) {
|
if(!mode1_enable_ && !mode2_enable_ && mode3_enable_) {
|
||||||
screen_mode_ = ScreenMode::MultiColour;
|
return ScreenMode::MultiColour;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: undocumented TMS modes.
|
// TODO: undocumented TMS modes.
|
||||||
screen_mode_ = ScreenMode::Blank;
|
return ScreenMode::Blank;
|
||||||
}
|
}
|
||||||
|
|
||||||
void do_external_slot(int access_column) {
|
void do_external_slot(int access_column) {
|
||||||
|
Loading…
Reference in New Issue
Block a user