diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2018-10-12 12:18:17 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2018-10-12 12:18:17 -0400 |
commit | 9377dc23e2dcb8a293d8c0d1193c4d708045e08d (patch) | |
tree | 45eca3d96fe89f574a4f187bd82c9aedf1f614e4 /src/bg.c | |
parent | 714d387cbd8e3a9a9e5b522eed42c8132d41e0b0 (diff) |
through sub_8111F8C
Diffstat (limited to 'src/bg.c')
-rw-r--r-- | src/bg.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -1067,7 +1067,6 @@ void CopyBgTilemapBufferToVram(u8 bg) void CopyToBgTilemapBufferRect(u8 bg, void* src, u8 destX, u8 destY, u8 width, u8 height) { - void* srcCopy; u16 destX16; u16 destY16; u16 mode; @@ -1077,26 +1076,30 @@ void CopyToBgTilemapBufferRect(u8 bg, void* src, u8 destX, u8 destY, u8 width, u switch (GetBgType(bg)) { case 0: - srcCopy = src; + { + u16 * srcCopy = src; for (destY16 = destY; destY16 < (destY + height); destY16++) { for (destX16 = destX; destX16 < (destX + width); destX16++) { - ((u16*)sGpuBgConfigs2[bg].tilemap)[((destY16 * 0x20) + destX16)] = *((u16*)srcCopy)++; + ((u16*)sGpuBgConfigs2[bg].tilemap)[((destY16 * 0x20) + destX16)] = *(srcCopy)++; } } break; + } case 1: - srcCopy = src; + { + u8 * srcCopy = src; mode = GetBgMetricAffineMode(bg, 0x1); for (destY16 = destY; destY16 < (destY + height); destY16++) { for (destX16 = destX; destX16 < (destX + width); destX16++) { - ((u8*)sGpuBgConfigs2[bg].tilemap)[((destY16 * mode) + destX16)] = *((u8*)srcCopy)++; + ((u8*)sGpuBgConfigs2[bg].tilemap)[((destY16 * mode) + destX16)] = *(srcCopy)++; } } break; + } } } } |