gba: handle 8bit writes to vram
ignore 8bit writes to obj and oam, and duplicate bits for bg and palette memory, as per gbatek. thanks aiju for helping with the implementation.
This commit is contained in:
parent
f554155ed0
commit
0da9e3a7f5
|
@ -315,6 +315,11 @@ memwrite(u32int a, u32int v, int n)
|
||||||
return;
|
return;
|
||||||
case 5:
|
case 5:
|
||||||
b = a & sizeof(pram) - 1;
|
b = a & sizeof(pram) - 1;
|
||||||
|
if(n == 1){
|
||||||
|
b &= ~1;
|
||||||
|
n = 2;
|
||||||
|
v |= v << 8;
|
||||||
|
}
|
||||||
cyc += (n+1) >> 1;
|
cyc += (n+1) >> 1;
|
||||||
ar16write(pram + b/2, b & 1, v, n);
|
ar16write(pram + b/2, b & 1, v, n);
|
||||||
return;
|
return;
|
||||||
|
@ -322,12 +327,19 @@ memwrite(u32int a, u32int v, int n)
|
||||||
b = a & 128*KB - 1;
|
b = a & 128*KB - 1;
|
||||||
if(b >= 64*KB)
|
if(b >= 64*KB)
|
||||||
b &= ~(32*KB);
|
b &= ~(32*KB);
|
||||||
|
if(n == 1 && ((reg[DISPCNT] & 7) > 2 && b < 80*KB || b < 64*KB)){
|
||||||
|
b &= ~1;
|
||||||
|
n = 2;
|
||||||
|
v |= v << 8;
|
||||||
|
}
|
||||||
cyc += (n+1) >> 1;
|
cyc += (n+1) >> 1;
|
||||||
|
if(n != 1)
|
||||||
arwrite(vram + b, v, n);
|
arwrite(vram + b, v, n);
|
||||||
return;
|
return;
|
||||||
case 7:
|
case 7:
|
||||||
b = a & sizeof(oam) - 1;
|
b = a & sizeof(oam) - 1;
|
||||||
cyc++;
|
cyc++;
|
||||||
|
if(n != 1)
|
||||||
ar16write(oam + b/2, b & 1, v, n);
|
ar16write(oam + b/2, b & 1, v, n);
|
||||||
return;
|
return;
|
||||||
case 8: case 9: case 10: case 11: case 12: case 13:
|
case 8: case 9: case 10: case 11: case 12: case 13:
|
||||||
|
|
Loading…
Reference in a new issue