Added & back to the tile8_mem in affine_background_init() and changed memcpy16 to 32

This commit is contained in:
cellos51
2025-08-08 10:44:55 -04:00
parent 650c09af28
commit 6363613f15
3 changed files with 22 additions and 2 deletions
+12 -1
View File
@@ -170,9 +170,20 @@ void update_text_rect_to_right_align_num(Rect* rect, int num, int overflow_direc
void memcpy16_tile8_with_palette_offset(u16* dst, const u16* src, uint hwcount, u8 palette_offset)
{
const u16 offset = (((palette_offset) << 8) | (palette_offset));
for (int i = 0; i < hwcount; i++)
{
// Copying u8 data twice across u16 data
dst[i] = src[i] + (((palette_offset) << 8) | (palette_offset));
dst[i] = src[i] + offset;
}
}
void memcpy32_tile8_with_palette_offset(u32* dst, const u32* src, uint hwcount, u8 palette_offset)
{
const u32 offset = (palette_offset << 24) | (palette_offset << 16) | (palette_offset << 8) | palette_offset;
for (int i = 0; i < hwcount; i++)
{
// Copying u8 data 4 times across u32 data
dst[i] = src[i] + offset;
}
}