1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-05 10:28:58 +00:00

Makes initial attempt at collecting sprite contents.

With test plotting, indicating some sort of issue.
This commit is contained in:
Thomas Harte 2018-10-07 16:53:25 -04:00
parent df411b4ede
commit ee20e42372
2 changed files with 17 additions and 24 deletions

View File

@ -783,27 +783,20 @@ void Base::draw_sms(int start, int end) {
// EXPERIMENTAL: chuck sprite outlines on as a post-fix.
for(int c = 0; c < sprite_set_.fetched_sprite_slot; ++c) {
int x = -sprite_set_.active_sprites[c].shift_position;
pattern = *reinterpret_cast<uint32_t *>(sprite_set_.active_sprites[c].image);
for(int ox = x; ox < x+8; ox++) {
if(ox >= 0 && ox < 256) pixel_origin_[ox] = 0xffffffff;
if(ox >= 0 && ox < 256) {
pixel_origin_[ox] =
master_system_.colour_ram[
((pattern_index[3] & 0x80) >> 4) |
((pattern_index[2] & 0x80) >> 5) |
((pattern_index[1] & 0x80) >> 6) |
((pattern_index[0] & 0x80) >> 7) |
0x10
];
}
pattern <<= 1;
}
}
}
// const int pixels_left = pixels_end - output_column_;
// const int pixel_location = output_column_ - first_pixel_column_;
// const int reverses[2] = {0, 7};
// for(int c = 0; c < pixels_left; ++c) {
// const int column = (pixel_location + c) >> 3;
// const int shift = 4 + (((pixel_location + c) & 7) ^ reverses[(master_system_.names[column].flags&2) >> 1]);
// int value =
// (
// (
// ((master_system_.tile_graphics[column][3] << shift) & 0x800) |
// ((master_system_.tile_graphics[column][2] << (shift - 1)) & 0x400) |
// ((master_system_.tile_graphics[column][1] << (shift - 2)) & 0x200) |
// ((master_system_.tile_graphics[column][0] << (shift - 3)) & 0x100)
// ) >> 8
// ) | ((master_system_.names[column].flags&0x08) << 1);
//
// pixel_target_[c] = master_system_.colour_ram[value];
// }
}

View File

@ -585,13 +585,13 @@ class Base {
-ram_[\
(sprite_attribute_table_address_ | 0x7f) & (0x3f80 | (sprite_set_.active_sprites[sprite].index << 1))\
] + (master_system_.shift_sprites_8px_left ? 8 : 0); \
sprite_set_.active_sprites[sprite].image[0] = \
sprite_set_.active_sprites[sprite].image[1] = \
sprite_set_.active_sprites[sprite].image[2] = \
sprite_set_.active_sprites[sprite].image[3] = 0xff; \
size_t graphic_location = (sprite_generator_table_address_ | 0xfff) & (0x2000 | (sprite_set_.active_sprites[sprite].index << 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]; \
sprite_set_.active_sprites[sprite].image[2] = ram_[graphic_location+2]; \
sprite_set_.active_sprites[sprite].image[3] = ram_[graphic_location+3]; \
}
// size_t graphic_location = sprite_generator_table_address_; \
#define sprite_fetch_block(location, sprite) \
slot(location): \