diff --git a/Components/9918/Implementation/Draw.hpp b/Components/9918/Implementation/Draw.hpp index 9d40920eb..876008608 100644 --- a/Components/9918/Implementation/Draw.hpp +++ b/Components/9918/Implementation/Draw.hpp @@ -495,8 +495,8 @@ void Base::draw_yamaha(LineBuffer &buffer, int start, int end) { while(start < end) { pixel_target_[start] = palette_pack( - uint8_t((buffer.bitmap[start] & 0xe0) + ((buffer.bitmap[start] & 0xe0) >> 3) + ((buffer.bitmap[start] & 0xe0) >> 6)), uint8_t((buffer.bitmap[start] & 0x1c) + ((buffer.bitmap[start] & 0x1c) << 3) + ((buffer.bitmap[start] & 0x1c) >> 3)), + uint8_t((buffer.bitmap[start] & 0xe0) + ((buffer.bitmap[start] & 0xe0) >> 3) + ((buffer.bitmap[start] & 0xe0) >> 6)), uint8_t((buffer.bitmap[start] & 0x03) + ((buffer.bitmap[start] & 0x03) << 2) + ((buffer.bitmap[start] & 0x03) << 4) + ((buffer.bitmap[start] & 0x03) << 6)) ); ++start; diff --git a/Components/9918/Implementation/Fetch.hpp b/Components/9918/Implementation/Fetch.hpp index 5e53e8970..e08a8303f 100644 --- a/Components/9918/Implementation/Fetch.hpp +++ b/Components/9918/Implementation/Fetch.hpp @@ -586,8 +586,6 @@ template void Base::fetch_sms(LineBuffer &line_buffer template template void Base::fetch_yamaha(LineBuffer &line_buffer, LineBuffer &next_line_buffer, int y, int end) { - const AddressT rotated_name_ = pattern_name_address_ >> 1; - CharacterFetcher character_fetcher(this, line_buffer, next_line_buffer, y); TextFetcher text_fetcher(this, line_buffer, y); SpriteFetcher sprite_fetcher(this, line_buffer, next_line_buffer, y); @@ -698,14 +696,14 @@ template void Base::fetch_yamaha(LineBuffer &line_ const auto start = bits<15>((y << 7) | (column >> 1)); // Fetch from alternate banks. - line_buffer.bitmap[column + 0] = ram_[rotated_name_ & AddressT(start + 0)]; - line_buffer.bitmap[column + 1] = ram2[rotated_name_ & AddressT(start + 0)]; - line_buffer.bitmap[column + 2] = ram_[rotated_name_ & AddressT(start + 1)]; - line_buffer.bitmap[column + 3] = ram2[rotated_name_ & AddressT(start + 1)]; - line_buffer.bitmap[column + 4] = ram_[rotated_name_ & AddressT(start + 2)]; - line_buffer.bitmap[column + 5] = ram2[rotated_name_ & AddressT(start + 2)]; - line_buffer.bitmap[column + 6] = ram_[rotated_name_ & AddressT(start + 3)]; - line_buffer.bitmap[column + 7] = ram2[rotated_name_ & AddressT(start + 3)]; + line_buffer.bitmap[column + 0] = ram_[pattern_name_address_ & AddressT(start + 0) & 0xffff]; + line_buffer.bitmap[column + 1] = ram2[pattern_name_address_ & AddressT(start + 0) & 0xffff]; + line_buffer.bitmap[column + 2] = ram_[pattern_name_address_ & AddressT(start + 1) & 0xffff]; + line_buffer.bitmap[column + 3] = ram2[pattern_name_address_ & AddressT(start + 1) & 0xffff]; + line_buffer.bitmap[column + 4] = ram_[pattern_name_address_ & AddressT(start + 2) & 0xffff]; + line_buffer.bitmap[column + 5] = ram2[pattern_name_address_ & AddressT(start + 2) & 0xffff]; + line_buffer.bitmap[column + 6] = ram_[pattern_name_address_ & AddressT(start + 3) & 0xffff]; + line_buffer.bitmap[column + 7] = ram2[pattern_name_address_ & AddressT(start + 3) & 0xffff]; } break; default: break;