aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2017-04-09 03:47:47 +0200
committerStapleButter <thetotalworm@gmail.com>2017-04-09 03:47:47 +0200
commit28ebd56fb8f0df6d13b2077f3f499a1456df6528 (patch)
treec67082d693b2c128a0c0560022643bcc7a0167cc /src
parentbc70f0037247bc4ba68c8c330982c578b2e8f431 (diff)
* fix bug with 0-line tall windows (would be enabled for the whole screen)
* map some I/O ports
Diffstat (limited to 'src')
-rw-r--r--src/GPU2D.cpp10
-rw-r--r--src/NDS.cpp8
2 files changed, 10 insertions, 8 deletions
diff --git a/src/GPU2D.cpp b/src/GPU2D.cpp
index 224bfa9..c688129 100644
--- a/src/GPU2D.cpp
+++ b/src/GPU2D.cpp
@@ -155,6 +155,8 @@ u16 GPU2D::Read16(u32 addr)
case 0x064: return CaptureCnt & 0xFFFF;
case 0x066: return CaptureCnt >> 16;
+
+ case 0x06C: return MasterBrightness;
}
printf("unknown GPU read16 %08X\n", addr);
@@ -746,10 +748,10 @@ u16* GPU2D::GetOBJExtPal(u32 pal)
void GPU2D::CheckWindows(u32 line)
{
line &= 0xFF;
- if (line == Win0Coords[2]) Win0Active = true;
- else if (line == Win0Coords[3]) Win0Active = false;
- if (line == Win1Coords[2]) Win1Active = true;
- else if (line == Win1Coords[3]) Win1Active = false;
+ if (line == Win0Coords[3]) Win0Active = false;
+ else if (line == Win0Coords[2]) Win0Active = true;
+ if (line == Win1Coords[3]) Win1Active = false;
+ else if (line == Win1Coords[2]) Win1Active = true;
}
void GPU2D::CalculateWindowMask(u32 line, u8* mask)
diff --git a/src/NDS.cpp b/src/NDS.cpp
index 682ed50..0948748 100644
--- a/src/NDS.cpp
+++ b/src/NDS.cpp
@@ -1397,11 +1397,11 @@ u16 ARM9IORead16(u32 addr)
case 0x04000304: return PowerControl9;
}
- if (addr >= 0x04000000 && addr < 0x04000060)
+ if ((addr >= 0x04000000 && addr < 0x04000060) || (addr == 0x0400006C))
{
return GPU::GPU2D_A->Read16(addr);
}
- if (addr >= 0x04001000 && addr < 0x04001060)
+ if ((addr >= 0x04001000 && addr < 0x04001060) || (addr == 0x0400106C))
{
return GPU::GPU2D_B->Read16(addr);
}
@@ -1507,11 +1507,11 @@ u32 ARM9IORead32(u32 addr)
return 0;
}
- if (addr >= 0x04000000 && addr < 0x04000060)
+ if ((addr >= 0x04000000 && addr < 0x04000060) || (addr == 0x0400006C))
{
return GPU::GPU2D_A->Read32(addr);
}
- if (addr >= 0x04001000 && addr < 0x04001060)
+ if ((addr >= 0x04001000 && addr < 0x04001060) || (addr == 0x0400106C))
{
return GPU::GPU2D_B->Read32(addr);
}