fix bug with ALU operations and shift operands, where the shift operation could obliterate the carry flag

also, misc shit
This commit is contained in:
StapleButter
2017-01-20 15:13:44 +01:00
parent 3e5e8f60c4
commit 7dba0121cb
7 changed files with 97 additions and 51 deletions

View File

@ -89,11 +89,11 @@ void GPU2D::Write16(u32 addr, u16 val)
{
case 0x000:
DispCnt = (DispCnt & 0xFFFF0000) | val;
printf("[L] DISPCNT=%08X\n", DispCnt);
//printf("[L] DISPCNT=%08X\n", DispCnt);
return;
case 0x002:
DispCnt = (DispCnt & 0x0000FFFF) | (val << 16);
printf("[H] DISPCNT=%08X\n", DispCnt);
//printf("[H] DISPCNT=%08X\n", DispCnt);
return;
case 0x008: BGCnt[0] = val; return;
@ -110,7 +110,7 @@ void GPU2D::Write32(u32 addr, u32 val)
switch (addr & 0x00000FFF)
{
case 0x000:
printf("DISPCNT=%08X\n", val);
//printf("DISPCNT=%08X\n", val);
DispCnt = val;
return;
}
@ -222,7 +222,7 @@ void GPU2D::DrawBG_Text_4bpp(u32 line, u16* dst, u32 bgnum)
if (Num)
{
tileset = (u8*)GPU::VRAM_BBG[((bgcnt & 0x000C) >> 2)];
tileset = (u8*)GPU::VRAM_BBG[((bgcnt & 0x003C) >> 2)];
tilemap = (u16*)GPU::VRAM_BBG[((bgcnt & 0x1800) >> 11)];
tilemap += ((bgcnt & 0x0700) << 2);
@ -284,6 +284,7 @@ void GPU2D::DrawBG_Text_4bpp(u32 line, u16* dst, u32 bgnum)
}
//color = (i >> 4) + ((line >> 4) << 4);
//if (Num) color = 0;
//if (yoff>127) color=0;
if (color)
dst[i] = curpal[color];