Skip to content

Commit

Permalink
Update texture.c
Browse files Browse the repository at this point in the history
Modif MM3
  • Loading branch information
backgamon authored Dec 30, 2024
1 parent 4a0a8a2 commit 150a4d7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hw/xbox/nv2a/pgraph/vk/texture.c
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,15 @@ static void create_texture(PGRAPHState *pg, int texture_idx)
void *texture_data = (char*)d->vram_ptr + texture_vram_offset;
void *palette_data = (char*)d->vram_ptr + texture_palette_vram_offset;

if(state.width == 1280 && state.height == 480 && state.color_format == NV097_SET_TEXTURE_FORMAT_COLOR_LU_IMAGE_Y16) {
size_t size = state.height*state.width*2;
uint8_t * tex_theft_buf = texture_data;
for(size_t idx = 0; idx < size; idx+=4) {
tex_theft_buf[idx] = tex_theft_buf[idx+2];
tex_theft_buf[idx+1] = tex_theft_buf[idx+3];
}
}

uint64_t content_hash = 0;
if (!surface_to_texture && possibly_dirty) {
content_hash = fast_hash(texture_data, texture_length);
Expand Down

0 comments on commit 150a4d7

Please sign in to comment.