reverted r1342
This commit is contained in:
parent
dbf5319806
commit
fb1e6fa613
68
src/ppu.cpp
68
src/ppu.cpp
|
@ -49,7 +49,6 @@
|
|||
#define SpriteON (PPU[1]&0x10) //Show Sprite
|
||||
#define ScreenON (PPU[1]&0x08) //Show screen
|
||||
#define PPUON (PPU[1]&0x18) //PPU should operate
|
||||
#define GRAYSCALE (PPU[1]&0x01) //Grayscale (AND palette entries with 0x30)
|
||||
|
||||
#define SpriteLeft8 (PPU[1]&0x04)
|
||||
#define BGLeft8 (PPU[1]&0x02)
|
||||
|
@ -342,31 +341,14 @@ int FCEUPPU_GetAttr(int ntnum, int xt, int yt) {
|
|||
//new ppu-----
|
||||
inline void FFCEUX_PPUWrite_Default(uint32 A, uint8 V) {
|
||||
uint32 tmp = A;
|
||||
|
||||
if(tmp>=0x3F00)
|
||||
{
|
||||
// hmmm....
|
||||
switch (tmp & 0x1F)
|
||||
{
|
||||
case 0x10: case 0x14: case 0x18: case 0x1C:
|
||||
PALRAM[tmp & 0x0C] =
|
||||
PALRAM[tmp & 0x1C] = V & 0x3F;
|
||||
break;
|
||||
|
||||
case 0x0: case 0x4: case 0x8: case 0xC:
|
||||
|
||||
PALRAM[tmp & 0x1F] =
|
||||
PALRAM[(tmp & 0x1F) | 0x10] = V & 0x3F;
|
||||
break;
|
||||
|
||||
default:
|
||||
PALRAM[tmp & 0x1F] = V & 0x3F;
|
||||
|
||||
}
|
||||
/* if(!(tmp&0xf))
|
||||
if(!(tmp&0xf))
|
||||
PALRAM[0x00]=PALRAM[0x04]=PALRAM[0x08]=PALRAM[0x0C]=V&0x3F;
|
||||
else if(tmp&3) PALRAM[(tmp&0x1f)]=V&0x3f;*/
|
||||
else if(tmp&3) PALRAM[(tmp&0x1f)]=V&0x3f;
|
||||
}
|
||||
|
||||
else if(tmp<0x2000)
|
||||
{
|
||||
if(PPUCHRRAM&(1<<(tmp>>10)))
|
||||
|
@ -475,20 +457,7 @@ static DECLFR(A2007)
|
|||
if(newppu) {
|
||||
//mbg
|
||||
ret = VRAMBuffer;
|
||||
RefreshAddr = ppur.get_2007access() & 0x3FFF;
|
||||
if ((RefreshAddr & 0x3F00) == 0x3F00)
|
||||
{
|
||||
//if it is in the palette range bypass the
|
||||
//delayed read, and what gets filled in the temp
|
||||
//buffer is the address - 0x1000, also
|
||||
//if grayscale is set then the return is AND with 0x30
|
||||
//to get a gray color reading
|
||||
ret = PALRAM[RefreshAddr & 0x1F];
|
||||
if (GRAYSCALE)
|
||||
ret &= 0x30;
|
||||
VRAMBuffer = CALL_PPUREAD(RefreshAddr - 0x1000);
|
||||
}
|
||||
else
|
||||
RefreshAddr = ppur.get_2007access();
|
||||
VRAMBuffer = CALL_PPUREAD(RefreshAddr);
|
||||
ppur.increment2007(INC32!=0);
|
||||
RefreshAddr = ppur.get_2007access();
|
||||
|
@ -508,18 +477,10 @@ static DECLFR(A2007)
|
|||
{
|
||||
VRAMBuffer=VPage[tmp>>10][tmp];
|
||||
}
|
||||
else if (tmp < 0x3F00)
|
||||
else
|
||||
{
|
||||
VRAMBuffer=vnapage[(tmp>>10)&0x3][tmp&0x3FF];
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = PALRAM[RefreshAddr & 0x1F];
|
||||
if (GRAYSCALE)
|
||||
ret &= 0x30;
|
||||
VRAMBuffer = vnapage[(tmp>>10)&0x3][tmp&0x3FF];
|
||||
}
|
||||
|
||||
}
|
||||
#ifdef FCEUDEF_DEBUGGER
|
||||
if(!fceuindbg)
|
||||
|
@ -666,7 +627,7 @@ static DECLFW(B2007)
|
|||
uint32 tmp=RefreshAddr&0x3FFF;
|
||||
|
||||
if(newppu) {
|
||||
RefreshAddr = ppur.get_2007access() & 0x3FFF;
|
||||
RefreshAddr = ppur.get_2007access();
|
||||
CALL_PPUWRITE(RefreshAddr,V);
|
||||
//printf("%04x ",RefreshAddr);
|
||||
ppur.increment2007(INC32!=0);
|
||||
|
@ -678,26 +639,11 @@ static DECLFW(B2007)
|
|||
PPUGenLatch=V;
|
||||
if(tmp>=0x3F00)
|
||||
{
|
||||
switch (tmp & 0x1F)
|
||||
{
|
||||
case 0x10: case 0x14: case 0x18: case 0x1C:
|
||||
PALRAM[tmp & 0x0C] =
|
||||
PALRAM[tmp & 0x1C] = V & 0x3F;
|
||||
break;
|
||||
case 0x0: case 0x4: case 0x8: case 0xC:
|
||||
PALRAM[tmp & 0x1F] =
|
||||
PALRAM[(tmp & 0x1F) | 0x10] = V & 0x3F;
|
||||
break;
|
||||
default:
|
||||
PALRAM[tmp & 0x1F] = V & 0x3F;
|
||||
}
|
||||
/*
|
||||
// hmmm....
|
||||
if(!(tmp&0xf))
|
||||
PALRAM[0x00]=PALRAM[0x04]=PALRAM[0x08]=PALRAM[0x0C]=V&0x3F;
|
||||
else if(tmp&3) PALRAM[(tmp&0x1f)]=V&0x3f;*/
|
||||
else if(tmp&3) PALRAM[(tmp&0x1f)]=V&0x3f;
|
||||
}
|
||||
|
||||
else if(tmp<0x2000)
|
||||
{
|
||||
if(PPUCHRRAM&(1<<(tmp>>10)))
|
||||
|
|
Loading…
Reference in New Issue