fix ntview for new ppu?
[[Split portion of a mixed commit.]]
This commit is contained in:
parent
60abe35afb
commit
621cc8e260
|
@ -299,10 +299,8 @@ void FCEUD_UpdateNTView(int scanline, bool drawall) {
|
|||
//uint8 *pbitmap = ppuv_palette;
|
||||
if (!hNTView) return;
|
||||
|
||||
xpos = ((RefreshAddr & 0x400) >> 2) | ((RefreshAddr & 0x1F) << 3) | XOffset;
|
||||
ppu_getScroll(xpos,ypos);
|
||||
|
||||
ypos = ((RefreshAddr & 0x3E0) >> 2) | ((RefreshAddr & 0x7000) >> 12);
|
||||
if(RefreshAddr & 0x800) ypos += 240;
|
||||
|
||||
//char str[50];
|
||||
//sprintf(str,"%d,%d,%d",horzscroll,vertscroll,ntmirroring);
|
||||
|
|
17
src/ppu.cpp
17
src/ppu.cpp
|
@ -266,6 +266,7 @@ struct PPUREGS {
|
|||
}
|
||||
} ppur;
|
||||
|
||||
|
||||
static void makeppulut(void)
|
||||
{
|
||||
int x;
|
||||
|
@ -471,6 +472,22 @@ void (*FFCEUX_PPUWrite)(uint32 A, uint8 V) = 0;
|
|||
|
||||
//whether to use the new ppu (new PPU doesn't handle MMC5 extra nametables at all
|
||||
int newppu = 0;
|
||||
|
||||
void ppu_getScroll(int &xpos, int &ypos)
|
||||
{
|
||||
if(newppu)
|
||||
{
|
||||
ypos = ppur._vt*8 + ppur._fv + ppur._v*256;
|
||||
xpos = ppur._ht*8 + ppur.fh + ppur._h*256;
|
||||
}
|
||||
else
|
||||
{
|
||||
xpos = ((RefreshAddr & 0x400) >> 2) | ((RefreshAddr & 0x1F) << 3) | XOffset;
|
||||
|
||||
ypos = ((RefreshAddr & 0x3E0) >> 2) | ((RefreshAddr & 0x7000) >> 12);
|
||||
if(RefreshAddr & 0x800) ypos += 240;
|
||||
}
|
||||
}
|
||||
//---------------
|
||||
|
||||
static DECLFR(A2002)
|
||||
|
|
Loading…
Reference in New Issue