From 4a5b2fd9ba78ef0be92973c7d65acccfc4e7110c Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 16 Mar 2023 22:00:47 -0400 Subject: [PATCH] Eliminate logged TODOs that I don't intend to action soon. --- Components/9918/Implementation/9918.cpp | 50 +++++++++------------ Components/9918/Implementation/9918Base.hpp | 2 - 2 files changed, 21 insertions(+), 31 deletions(-) diff --git a/Components/9918/Implementation/9918.cpp b/Components/9918/Implementation/9918.cpp index 5fba619c7..77bfa1f17 100644 --- a/Components/9918/Implementation/9918.cpp +++ b/Components/9918/Implementation/9918.cpp @@ -546,15 +546,16 @@ void TMS9918::run_for(const HalfCycles cycles) { } if(this->pixel_target_) { - // TODO: this dispatch, and the fetch, should be factored into a templatised place, probably. - // ... and should use graphics mode, not fetch mode. - switch(line_buffer.fetch_mode) { - case FetchMode::SMS: draw(draw_sms(relative_start, relative_end, cram_value), Clock::TMSPixel); break; - case FetchMode::Character: draw(draw_tms_character(relative_start, relative_end), Clock::TMSPixel); break; - case FetchMode::Text: draw(template draw_tms_text(relative_start, relative_end), Clock::TMSPixel); break; - case FetchMode::Yamaha: draw(draw_yamaha(relative_start, relative_end), Clock::Internal); break; + if constexpr (is_yamaha_vdp(personality)) { + draw(draw_yamaha(relative_start, relative_end), Clock::Internal); + } else { + switch(line_buffer.fetch_mode) { + case FetchMode::SMS: draw(draw_sms(relative_start, relative_end, cram_value), Clock::TMSPixel); break; + case FetchMode::Character: draw(draw_tms_character(relative_start, relative_end), Clock::TMSPixel); break; + case FetchMode::Text: draw(template draw_tms_text(relative_start, relative_end), Clock::TMSPixel); break; - case FetchMode::Refresh: break; /* Dealt with elsewhere. */ + default: break; /* Dealt with elsewhere. */ + } } } @@ -786,9 +787,11 @@ void Base::commit_register(int reg, uint8_t value) { break; case 8: - LOG("TODO: Yamaha VRAM organisation, sprite disable, etc; " << PADHEX(2) << +value); - Storage::sprites_enabled_ = !(value & 0x02); Storage::solid_background_ = value & 0x20; + Storage::sprites_enabled_ = !(value & 0x02); + if(value & 0x01) { + LOG("TODO: Yamaha greyscale"); + } // b7: "1 = input on colour bus, enable mouse; 1 = output on colour bus, disable mouse" [documentation clearly in error] // b6: 1 = enable light pen // b5: sets the colour of code 0 to the colour of the palette (???) @@ -803,7 +806,10 @@ void Base::commit_register(int reg, uint8_t value) { mode_timing_.end_of_frame_interrupt_position.row = mode_timing_.pixel_lines+1; // TODO: on the Yamaha, at least, tie this interrupt overtly to vertical state. - LOG("TODO: Yamaha line count, interlace, etc; " << PADHEX(2) << +value); + if(value & 0x08) { + LOG("TODO: Yamaha interlace mode"); + } + // b7: 1 = 212 lines of pixels; 0 = 192 // b5 & b4: select simultaneous mode (seems to relate to line length and in-phase colour?) // b3: 1 = interlace on @@ -851,7 +857,9 @@ void Base::commit_register(int reg, uint8_t value) { break; case 18: - LOG("TODO: Yamaha position adjustment; " << PADHEX(2) << +value); + if(value) { + LOG("TODO: Yamaha position adjustment; " << PADHEX(2) << +value); + } // b0-b3: horizontal adjustment // b4-b7: vertical adjustment break; @@ -864,7 +872,7 @@ void Base::commit_register(int reg, uint8_t value) { case 20: case 21: case 22: - LOG("TODO: Yamaha colour burst selection; " << PADHEX(2) << +value); +// LOG("TODO: Yamaha colour burst selection; " << PADHEX(2) << +value); // Documentation is "fill with 0s for no colour burst; magic pattern for colour burst" break; @@ -951,8 +959,6 @@ void Base::commit_register(int reg, uint8_t value) { // (e.g. a line of length 0). if(!Storage::command_ && (value >> 4)) { LOG("TODO: Yamaha command " << PADHEX(2) << +value); - } else { - LOG("Performing Yamaha command " << PADHEX(2) << +value); } // Seed timing information if a command was found. @@ -1133,18 +1139,6 @@ uint8_t Base::read_register() { return result; } -template -uint8_t Base::read_palette() { - LOG("Palette read TODO"); - return 0xff; -} - -template -uint8_t Base::read_register_indirect() { - LOG("Register indirect read TODO"); - return 0xff; -} - template uint8_t TMS9918::read(int address) { const int target = this->masked_address(address); @@ -1157,8 +1151,6 @@ uint8_t TMS9918::read(int address) { default: return 0xff; case 0: return this->read_vram(); case 1: return this->read_register(); - case 2: return this->read_palette(); - case 3: return this->read_register_indirect(); } } diff --git a/Components/9918/Implementation/9918Base.hpp b/Components/9918/Implementation/9918Base.hpp index c3756fcda..a0b95316f 100644 --- a/Components/9918/Implementation/9918Base.hpp +++ b/Components/9918/Implementation/9918Base.hpp @@ -225,8 +225,6 @@ template struct Base: public Storage { void write_register_indirect(uint8_t); uint8_t read_vram(); uint8_t read_register(); - uint8_t read_palette(); - uint8_t read_register_indirect(); void commit_register(int reg, uint8_t value);