aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2022-04-09 19:40:35 +0200
committerArisotura <thetotalworm@gmail.com>2022-04-09 19:40:35 +0200
commit0feed13cc4bb9538f921d2c7ccb3aefb7fe0ef51 (patch)
treea007966306e067f2f858f0d63e998e739be04965 /src
parent86f725f2f245b8752ff2ea36371fc9bb31da2b3e (diff)
close gaps in VRAM mapping
Diffstat (limited to 'src')
-rw-r--r--src/GPU.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/GPU.cpp b/src/GPU.cpp
index 6651c2a..47a69cc 100644
--- a/src/GPU.cpp
+++ b/src/GPU.cpp
@@ -529,6 +529,8 @@ u8* GetUniqueBankPtr(u32 mask, u32 offset)
void MapVRAM_AB(u32 bank, u8 cnt)
{
+ cnt &= 0x9B;
+
u8 oldcnt = VRAMCNT[bank];
VRAMCNT[bank] = cnt;
@@ -587,6 +589,8 @@ void MapVRAM_AB(u32 bank, u8 cnt)
void MapVRAM_CD(u32 bank, u8 cnt)
{
+ cnt &= 0x9F;
+
u8 oldcnt = VRAMCNT[bank];
VRAMCNT[bank] = cnt;
@@ -671,6 +675,8 @@ void MapVRAM_CD(u32 bank, u8 cnt)
void MapVRAM_E(u32 bank, u8 cnt)
{
+ cnt &= 0x87;
+
u8 oldcnt = VRAMCNT[bank];
VRAMCNT[bank] = cnt;
@@ -733,6 +739,8 @@ void MapVRAM_E(u32 bank, u8 cnt)
void MapVRAM_FG(u32 bank, u8 cnt)
{
+ cnt &= 0x9F;
+
u8 oldcnt = VRAMCNT[bank];
VRAMCNT[bank] = cnt;
@@ -831,6 +839,8 @@ void MapVRAM_FG(u32 bank, u8 cnt)
void MapVRAM_H(u32 bank, u8 cnt)
{
+ cnt &= 0x83;
+
u8 oldcnt = VRAMCNT[bank];
VRAMCNT[bank] = cnt;
@@ -891,6 +901,8 @@ void MapVRAM_H(u32 bank, u8 cnt)
void MapVRAM_I(u32 bank, u8 cnt)
{
+ cnt &= 0x83;
+
u8 oldcnt = VRAMCNT[bank];
VRAMCNT[bank] = cnt;