1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-11 08:30:55 +00:00

Fixes 16px-high sprites.

This commit is contained in:
Thomas Harte 2018-10-10 20:34:00 -04:00
parent acdc84e08c
commit 50e23f4a2e
2 changed files with 6 additions and 4 deletions

View File

@ -63,7 +63,7 @@ Base::Base(Personality p) :
}
if(is_sega_vdp(personality_)) {
mode_timing_.line_interrupt_position = 15;
mode_timing_.line_interrupt_position = 4;
}
}
@ -507,7 +507,9 @@ void TMS9918::set_register(int address, uint8_t value) {
}
uint8_t TMS9918::get_current_line() {
return static_cast<uint8_t>(row_);
const int source_row = (column_ < mode_timing_.line_interrupt_position) ? (row_ + mode_timing_.pixel_lines - 1)%mode_timing_.pixel_lines : row_;
return static_cast<uint8_t>(source_row);
}
uint8_t TMS9918::get_register(int address) {

View File

@ -164,7 +164,7 @@ class Base {
bool allow_sprite_terminator = true;
} mode_timing_;
uint8_t line_interrupt_target = 0;
uint8_t line_interrupt_target = 0xff;
uint8_t line_interrupt_counter = 0;
bool enable_line_interrupts_ = false;
bool line_interrupt_pending_ = false;
@ -590,7 +590,7 @@ class Base {
] - (master_system_.shift_sprites_8px_left ? size_t(8) : size_t(0)); \
const uint8_t name = ram_[\
sprite_attribute_table_address_ & size_t(0x3f81 | (sprite_set_.active_sprites[sprite].index << 1))\
];\
] & (sprites_16x16_ ? ~1 : ~0);\
const size_t graphic_location = sprite_generator_table_address_ & size_t(0x2000 | (name << 5) | (sprite_set_.active_sprites[sprite].row << 2)); \
sprite_set_.active_sprites[sprite].image[0] = ram_[graphic_location]; \
sprite_set_.active_sprites[sprite].image[1] = ram_[graphic_location+1]; \