* added "Clear" button to Message Log
* Taseditor: fixed sneaky Greenzone bug
This commit is contained in:
parent
9750ad4940
commit
acfb5bf912
|
@ -4,7 +4,7 @@
|
|||
static HWND logwin = 0;
|
||||
|
||||
static char *logtext[MAXIMUM_NUMBER_OF_LOGS];
|
||||
static unsigned int logcount=0;
|
||||
static int logcount=0;
|
||||
|
||||
int MLogPosX=0,MLogPosY=0; //X,Y coordinates of dialog
|
||||
|
||||
|
@ -20,7 +20,7 @@ unsigned int truncated_logcount()
|
|||
void RedoText(void)
|
||||
{
|
||||
char textbuf[65536] = { 0 };
|
||||
unsigned int x;
|
||||
int x;
|
||||
int tbs=0; // textbuf size
|
||||
int cs; // current log size
|
||||
|
||||
|
@ -94,14 +94,21 @@ BOOL CALLBACK LogCon(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
break;
|
||||
case WM_COMMAND:
|
||||
if(HIWORD(wParam)==BN_CLICKED)
|
||||
{
|
||||
if (HIWORD(wParam) == BN_CLICKED)
|
||||
{
|
||||
DestroyWindow(hwndDlg);
|
||||
|
||||
// Clear the handle
|
||||
logwin = 0;
|
||||
if (LOWORD(wParam) == IDB_CLEAR_LOG)
|
||||
{
|
||||
ClearLog();
|
||||
} else if (LOWORD(wParam) == IDB_CLOSE_LOG)
|
||||
{
|
||||
DestroyWindow(hwndDlg);
|
||||
// Clear the handle
|
||||
logwin = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -116,9 +123,21 @@ void MakeLogWindow(void)
|
|||
{
|
||||
logwin = CreateDialog(fceu_hInstance, "MESSAGELOG" , 0, LogCon);
|
||||
RedoText(); // XXX jeblanchard Why didn't this work in WM_INITDIALOG?
|
||||
} else
|
||||
{
|
||||
SetFocus(logwin);
|
||||
}
|
||||
}
|
||||
|
||||
void ClearLog()
|
||||
{
|
||||
for (logcount--; logcount >= 0; logcount--)
|
||||
free(logtext[truncated_logcount()]);
|
||||
logcount = 0;
|
||||
if (logwin)
|
||||
RedoText();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a textual log message to the message buffer.
|
||||
*
|
||||
|
|
|
@ -5,3 +5,4 @@
|
|||
|
||||
void MakeLogWindow(void);
|
||||
void AddLogText(const char *text, unsigned int add_newline);
|
||||
void ClearLog();
|
||||
|
|
|
@ -800,13 +800,14 @@ BEGIN
|
|||
RTEXT "Filter:",65484,6,255,21,12,SS_CENTERIMAGE | NOT WS_GROUP
|
||||
END
|
||||
|
||||
MESSAGELOG DIALOGEX 33, 38, 262, 237
|
||||
MESSAGELOG DIALOGEX 33, 38, 262, 233
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Message Log"
|
||||
FONT 9, "Terminal", 0, 0, 0x0
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "Close",1,224,220,34,14
|
||||
EDITTEXT LBL_LOG_TEXT,4,15,254,202,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL
|
||||
EDITTEXT LBL_LOG_TEXT,3,3,255,208,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL
|
||||
PUSHBUTTON "Clear",IDB_CLEAR_LOG,156,214,49,16
|
||||
PUSHBUTTON "Close",IDB_CLOSE_LOG,209,214,49,16
|
||||
END
|
||||
|
||||
NETMOO DIALOGEX 44, 59, 365, 209
|
||||
|
@ -1917,7 +1918,6 @@ BEGIN
|
|||
|
||||
"MESSAGELOG", DIALOG
|
||||
BEGIN
|
||||
BOTTOMMARGIN, 184
|
||||
END
|
||||
|
||||
"NETMOO", DIALOG
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
#define CLOSE_BUTTON 1
|
||||
#define BUTTON_CLOSE 1
|
||||
#define BTN_CLOSE 1
|
||||
#define IDB_CLOSE_LOG 1
|
||||
#define IDB_CLOSE_LOG2 2
|
||||
#define IDB_CLEAR_LOG 2
|
||||
#define MENU_OPEN_FILE 100
|
||||
#define EDIT_ROMS 100
|
||||
#define LBL_LOG_TEXT 100
|
||||
|
|
|
@ -183,7 +183,7 @@ public:
|
|||
if(incr<256)
|
||||
{
|
||||
//sanity check: should never be less than 256
|
||||
printf("OHNO -- %d -- shouldnt be less than 256!\n",incr);
|
||||
FCEU_printf("OHNO -- %d -- shouldnt be less than 256!\n", incr);
|
||||
}
|
||||
|
||||
incr = (incr*scale)>>8; //apply scaling factor
|
||||
|
|
|
@ -416,7 +416,7 @@ void GREENZONE::InvalidateAndCheck(int after)
|
|||
{
|
||||
if (after >= currMovieData.getNumRecords())
|
||||
after = currMovieData.getNumRecords() - 1;
|
||||
if (greenZoneCount > after + 1)
|
||||
if (greenZoneCount > after + 1 || currFrameCounter > after)
|
||||
{
|
||||
// clear all savestates that became irrelevant
|
||||
for (int i = greenZoneCount - 1; i > after; i--)
|
||||
|
|
|
@ -233,6 +233,7 @@ void PLAYBACK::update()
|
|||
lost_position_is_stable = false;
|
||||
}
|
||||
|
||||
// called after saving the project, because saving uses the progressbar for itself
|
||||
void PLAYBACK::updateProgressbar()
|
||||
{
|
||||
if (pause_frame)
|
||||
|
@ -247,6 +248,7 @@ void PLAYBACK::updateProgressbar()
|
|||
// cleared progressbar
|
||||
SetProgressbar(0, 1);
|
||||
}
|
||||
RedrawWindow(hwndProgressbar, NULL, NULL, RDW_INVALIDATE);
|
||||
}
|
||||
|
||||
void PLAYBACK::ToggleEmulationPause()
|
||||
|
|
|
@ -292,7 +292,7 @@ void RecolorResizableSurface()
|
|||
{
|
||||
// fill the surface using BG color from PPU
|
||||
unsigned char r, g, b;
|
||||
FCEUD_GetPalette(0x80 + PALRAM[0], &r, &g, &b);
|
||||
FCEUD_GetPalette(0x80 | PALRAM[0], &r, &g, &b);
|
||||
blitfx.dwFillColor = (r << 16) + (g << 8) + b;
|
||||
ddrval = IDirectDrawSurface7_Blt(lpDDSResizable, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_ASYNC, &blitfx);
|
||||
} else
|
||||
|
|
Loading…
Reference in New Issue