diff --git a/trunk/src/drivers/win/ntview.cpp b/trunk/src/drivers/win/ntview.cpp index 25e5f563..7debd096 100644 --- a/trunk/src/drivers/win/ntview.cpp +++ b/trunk/src/drivers/win/ntview.cpp @@ -107,6 +107,10 @@ extern uint8 XOffset; int xpos, ypos; int scrolllines = 1; +int attview = 0; + +// checkerboard tile for attribute view +const uint8 ATTRIBUTE_VIEW_TILE[16] = { 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF }; //if you pass this 1 then it will draw no matter what. If you pass it 0 //then it will draw if redrawtables is true @@ -193,7 +197,7 @@ void ChangeMirroring(){ return; } -INLINE void DrawChr(uint8 *pbitmap,uint8 *chr,int pal){ +INLINE void DrawChr(uint8 *pbitmap,const uint8 *chr,int pal){ int y, x, tmp, index=0, p=0; uint8 chr0, chr1; //uint8 *table = &VPage[0][0]; //use the background table @@ -280,8 +284,11 @@ void DrawNameTable(int scanline, int ntnum, bool invalidateCache) { a = FCEUPPU_GetAttr(ntnum,x,y); + const uint8* chrp = FCEUPPU_GetCHR(ptable+chr,refreshaddr); + if (attview) chrp = ATTRIBUTE_VIEW_TILE; + //a good way to do it: - DrawChr(pbitmap,FCEUPPU_GetCHR(ptable+chr,refreshaddr),a); + DrawChr(pbitmap,chrp,a); tablecache[ntaddr] = table[ntaddr]; tablecache[attraddr] = table[attraddr]; @@ -411,6 +418,7 @@ BOOL CALLBACK NTViewCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) SelectObject (pDC, CreatePen (PS_SOLID, 2, RGB (255, 255, 255))) ; CheckDlgButton(hwndDlg, IDC_NTVIEW_SHOW_SCROLL_LINES, BST_CHECKED); + CheckDlgButton(hwndDlg, IDC_NTVIEW_SHOW_ATTRIBUTES, BST_UNCHECKED); //clear cache //memset(palcache,0,32); //memset(ntcache0,0,0x400); @@ -537,6 +545,10 @@ BOOL CALLBACK NTViewCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) scrolllines ^= 1; chrchanged = 1; break; + case IDC_NTVIEW_SHOW_ATTRIBUTES : + attview ^= 1; + chrchanged = 1; + break; } break; } diff --git a/trunk/src/drivers/win/res.rc b/trunk/src/drivers/win/res.rc index b942a800..8437e2a7 100644 --- a/trunk/src/drivers/win/res.rc +++ b/trunk/src/drivers/win/res.rc @@ -878,7 +878,8 @@ BEGIN CONTROL "Single Screen (Table 3)",IDC_NTVIEW_MIRROR_SS_TABLE_3, "Button",BS_AUTORADIOBUTTON,113,377,90,10 GROUPBOX "Current Mirroring",65532,7,332,214,58 - CONTROL "Show Scroll Lines",IDC_NTVIEW_SHOW_SCROLL_LINES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,101,319,69,10 + CONTROL "Show Scroll Lines",IDC_NTVIEW_SHOW_SCROLL_LINES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,101,313,69,10 + CONTROL "Show Attributes", IDC_NTVIEW_SHOW_ATTRIBUTES, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,101,324,69,10 CONTROL "Horizontal",IDC_NTVIEW_MIRROR_HORIZONTAL,"Button",BS_AUTORADIOBUTTON,15,344,47,10 GROUPBOX "Properties",65531,227,336,122,60 LTEXT "Tile ID:", IDC_NTVIEW_PROPERTIES_LINE_1,237,346,110,10 diff --git a/trunk/src/drivers/win/resource.h b/trunk/src/drivers/win/resource.h index c95bb1e6..77fd5f4f 100644 --- a/trunk/src/drivers/win/resource.h +++ b/trunk/src/drivers/win/resource.h @@ -505,6 +505,7 @@ #define MW_ADDR02 1007 #define IDC_NTVIEW_MIRROR_SS_TABLE_3 1007 #define IDC_NTVIEW_SHOW_SCROLL_LINES 1008 +#define IDC_NTVIEW_SHOW_ATTRIBUTES 1009 #define MW_ADDR03 1010 #define MW_ADDR04 1013 #define MW_ADDR05 1016