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;
|
//uint8 *pbitmap = ppuv_palette;
|
||||||
if (!hNTView) return;
|
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];
|
//char str[50];
|
||||||
//sprintf(str,"%d,%d,%d",horzscroll,vertscroll,ntmirroring);
|
//sprintf(str,"%d,%d,%d",horzscroll,vertscroll,ntmirroring);
|
||||||
|
|
17
src/ppu.cpp
17
src/ppu.cpp
|
@ -266,6 +266,7 @@ struct PPUREGS {
|
||||||
}
|
}
|
||||||
} ppur;
|
} ppur;
|
||||||
|
|
||||||
|
|
||||||
static void makeppulut(void)
|
static void makeppulut(void)
|
||||||
{
|
{
|
||||||
int x;
|
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
|
//whether to use the new ppu (new PPU doesn't handle MMC5 extra nametables at all
|
||||||
int newppu = 0;
|
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)
|
static DECLFR(A2002)
|
||||||
|
|
|
@ -17,6 +17,8 @@ extern uint8 PPUCHRRAM;
|
||||||
void FCEUPPU_SaveState(void);
|
void FCEUPPU_SaveState(void);
|
||||||
void FCEUPPU_LoadState(int version);
|
void FCEUPPU_LoadState(int version);
|
||||||
uint8* FCEUPPU_GetCHR(uint32 vadr, uint32 refreshaddr);
|
uint8* FCEUPPU_GetCHR(uint32 vadr, uint32 refreshaddr);
|
||||||
|
void ppu_getScroll(int &xpos, int &ypos);
|
||||||
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#define FASTCALL __fastcall
|
#define FASTCALL __fastcall
|
||||||
|
|
Loading…
Reference in New Issue