Added player 3 and 4 to autohold notification window. Made FCEU_DispMessage able to display to different screen locations to do it. Fixed up the input display code for autohold.

Wow, that's a lot of stuff changed for something so basic.
This commit is contained in:
ugetab 2010-05-16 04:18:49 +00:00
parent a56ad34cea
commit 046617c693
28 changed files with 1933 additions and 1912 deletions

View File

@ -1,3 +1,4 @@
16-may-2010 - ugetab - Added player 3 and 4 to autohold notification window. Made FCEU_DispMessage able to display to different screen locations to do it. Made sure to update SDL with the change. Hope SDL still compiles ok.
15-may-2010 - ugetab - Win32 - Added option for palette selection as color for LUA colors. Included an LUA script to display all choices with the value used to pick displayed color. 15-may-2010 - ugetab - Win32 - Added option for palette selection as color for LUA colors. Included an LUA script to display all choices with the value used to pick displayed color.
14-may-2010 - adelikat - Win32 - Replay dialog, when selecting a movie in a relative path (.\movies for example), the recent movies list stores an absolute path instead. 14-may-2010 - adelikat - Win32 - Replay dialog, when selecting a movie in a relative path (.\movies for example), the recent movies list stores an absolute path instead.
14-may-2010 - adelikat - Win32 - When recording a movie, add it to recent movies 14-may-2010 - adelikat - Win32 - When recording a movie, add it to recent movies

View File

@ -139,7 +139,7 @@ static uint64 lreset;
static DECLFW(MMC1_write) static DECLFW(MMC1_write)
{ {
int n=(A>>13)-4; int n=(A>>13)-4;
//FCEU_DispMessage("%016x",timestampbase+timestamp); //FCEU_DispMessage("%016x",0,timestampbase+timestamp);
// FCEU_printf("$%04x:$%02x, $%04x\n",A,V,X.PC); // FCEU_printf("$%04x:$%02x, $%04x\n",A,V,X.PC);
//DumpMem("out",0xe000,0xffff); //DumpMem("out",0xe000,0xffff);

View File

@ -128,7 +128,7 @@ void RebuildSubCheats(void)
if(GetReadHandler(c->addr)==SubCheatsRead) if(GetReadHandler(c->addr)==SubCheatsRead)
{ {
/* Prevent a catastrophe by this check. */ /* Prevent a catastrophe by this check. */
//FCEU_DispMessage("oops"); //FCEU_DispMessage("oops",0);
} }
else else
{ {
@ -144,7 +144,7 @@ void RebuildSubCheats(void)
} }
FrozenAddressCount = numsubcheats; //Update the frozen address list FrozenAddressCount = numsubcheats; //Update the frozen address list
UpdateFrozenList(); UpdateFrozenList();
//FCEUI_DispMessage("Active Cheats: %d", FrozenAddresses.size()/*FrozenAddressCount*/); //Debug //FCEUI_DispMessage("Active Cheats: %d",0, FrozenAddresses.size()/*FrozenAddressCount*/); //Debug
} }
void FCEU_PowerCheats() void FCEU_PowerCheats()
@ -214,8 +214,8 @@ void FCEU_LoadGameCheats(FILE *override)
if(!fp) return; if(!fp) return;
} }
FCEU_DispMessage("Cheats file loaded."); //Tells user a cheats file was loaded. FCEU_DispMessage("Cheats file loaded.",0); //Tells user a cheats file was loaded.
FCEU_printf("Cheats file loaded.\n"); //Sends message to message log. FCEU_printf("Cheats file loaded.\n",0); //Sends message to message log.
while(fgets(linebuf,2048,fp)>0) while(fgets(linebuf,2048,fp)>0)
{ {
char *tbuf=linebuf; char *tbuf=linebuf;
@ -948,5 +948,5 @@ void UpdateFrozenList(void)
FrozenAddresses.push_back(SubCheats[x].addr); FrozenAddresses.push_back(SubCheats[x].addr);
//FCEU_printf("Address %d: %d \n",x,FrozenAddresses[x]); //Debug //FCEU_printf("Address %d: %d \n",x,FrozenAddresses[x]); //Debug
} }
//FCEUI_DispMessage("FrozenCount: %d",FrozenAddressCount);//Debug //FCEUI_DispMessage("FrozenCount: %d",0,FrozenAddressCount);//Debug
} }

View File

@ -135,6 +135,10 @@ void DrawMessage(bool beforeMovie)
uint8 *t; uint8 *t;
guiMessage.howlong--; guiMessage.howlong--;
if (guiMessage.linesFromBottom)
t=XBuf+FCEU_TextScanlineOffsetFromBottom(guiMessage.linesFromBottom)+1;
else
t=XBuf+FCEU_TextScanlineOffsetFromBottom(20)+1; t=XBuf+FCEU_TextScanlineOffsetFromBottom(20)+1;
/* /*

View File

@ -178,7 +178,7 @@ void FCEUD_LuaRunFrom(void);
int32 FCEUI_GetDesiredFPS(void); int32 FCEUI_GetDesiredFPS(void);
void FCEUI_SaveSnapshot(void); void FCEUI_SaveSnapshot(void);
void FCEU_DispMessage(char *format, ...); void FCEU_DispMessage(char *format, int disppos, ...);
#define FCEUI_DispMessage FCEU_DispMessage #define FCEUI_DispMessage FCEU_DispMessage
int FCEUI_DecodePAR(const char *code, int *a, int *v, int *c, int *type); int FCEUI_DecodePAR(const char *code, int *a, int *v, int *c, int *type);

View File

@ -389,7 +389,7 @@ KeyboardCommands()
if(InputType[2] == SIFC_FKB) { if(InputType[2] == SIFC_FKB) {
if(keyonly(SCROLLLOCK)) { if(keyonly(SCROLLLOCK)) {
g_fkbEnabled ^= 1; g_fkbEnabled ^= 1;
FCEUI_DispMessage("Family Keyboard %sabled.", FCEUI_DispMessage("Family Keyboard %sabled.",0,
g_fkbEnabled ? "en" : "dis"); g_fkbEnabled ? "en" : "dis");
} }
SDL_WM_GrabInput(g_fkbEnabled ? SDL_GRAB_ON : SDL_GRAB_OFF); SDL_WM_GrabInput(g_fkbEnabled ? SDL_GRAB_ON : SDL_GRAB_OFF);
@ -427,7 +427,7 @@ KeyboardCommands()
// Toggle Movie auto-backup // Toggle Movie auto-backup
if(keyonly(M) && is_shift) { if(keyonly(M) && is_shift) {
autoMovieBackup ^= 1; autoMovieBackup ^= 1;
FCEUI_DispMessage("Automatic movie backup %sabled.", FCEUI_DispMessage("Automatic movie backup %sabled.",0,
autoMovieBackup ? "en" : "dis"); autoMovieBackup ? "en" : "dis");
} }
@ -585,13 +585,13 @@ KeyboardCommands()
if(_keyonly(Hotkeys[HK_BIND_STATE])) { if(_keyonly(Hotkeys[HK_BIND_STATE])) {
bindSavestate ^= 1; bindSavestate ^= 1;
FCEUI_DispMessage("Savestate binding to movie %sabled.", FCEUI_DispMessage("Savestate binding to movie %sabled.",0,
bindSavestate ? "en" : "dis"); bindSavestate ? "en" : "dis");
} }
if(_keyonly(Hotkeys[HK_FA_LAG_SKIP])) { if(_keyonly(Hotkeys[HK_FA_LAG_SKIP])) {
frameAdvanceLagSkip ^= 1; frameAdvanceLagSkip ^= 1;
FCEUI_DispMessage("Skipping lag in Frame Advance %sabled.", FCEUI_DispMessage("Skipping lag in Frame Advance %sabled.",0,
frameAdvanceLagSkip ? "en" : "dis"); frameAdvanceLagSkip ? "en" : "dis");
} }
@ -602,7 +602,7 @@ KeyboardCommands()
if (_keyonly(Hotkeys[HK_TOGGLE_SUBTITLE])) { if (_keyonly(Hotkeys[HK_TOGGLE_SUBTITLE])) {
extern int movieSubtitles; extern int movieSubtitles;
movieSubtitles ^= 1; movieSubtitles ^= 1;
FCEUI_DispMessage("Movie subtitles o%s.", FCEUI_DispMessage("Movie subtitles o%s.",0,
movieSubtitles ? "n" : "ff"); movieSubtitles ? "n" : "ff");
} }
@ -650,10 +650,10 @@ KeyboardCommands()
} else { } else {
FCEUI_DatachSet(bbuf); FCEUI_DatachSet(bbuf);
} }
FCEUI_DispMessage("Barcode Entered"); FCEUI_DispMessage("Barcode Entered",0);
} else { } else {
bbuft = 0; bbuft = 0;
FCEUI_DispMessage("Enter Barcode"); FCEUI_DispMessage("Enter Barcode",0);
} }
} }
} else { } else {
@ -667,7 +667,7 @@ do { \
bbuf[bbuft++] = '0' + x; \ bbuf[bbuft++] = '0' + x; \
bbuf[bbuft] = 0; \ bbuf[bbuft] = 0; \
} \ } \
FCEUI_DispMessage("Barcode: %s", bbuf); \ FCEUI_DispMessage("Barcode: %s",0, bbuf); \
} \ } \
} while(0) } while(0)

View File

@ -246,7 +246,7 @@ FCEUD_SoundVolumeAdjust(int n)
FCEUI_SetSoundVolume(soundvolume); FCEUI_SetSoundVolume(soundvolume);
g_config->setOption("SDL.SoundVolume", soundvolume); g_config->setOption("SDL.SoundVolume", soundvolume);
FCEU_DispMessage("Sound volume %d.", soundvolume); FCEU_DispMessage("Sound volume %d.",0, soundvolume);
} }
/** /**
@ -261,10 +261,10 @@ FCEUD_SoundToggle(void)
s_mute = 0; s_mute = 0;
FCEUI_SetSoundVolume(soundvolume); FCEUI_SetSoundVolume(soundvolume);
FCEU_DispMessage("Sound mute off."); FCEU_DispMessage("Sound mute off.",0);
} else { } else {
s_mute = 1; s_mute = 1;
FCEUI_SetSoundVolume(0); FCEUI_SetSoundVolume(0);
FCEU_DispMessage("Sound mute on."); FCEU_DispMessage("Sound mute on.",0);
} }
} }

View File

@ -98,7 +98,7 @@ void IncreaseEmulationSpeed(void)
RefreshThrottleFPS(); RefreshThrottleFPS();
FCEU_DispMessage("emulation speed %.1f%%", g_fpsScale*100.0); FCEU_DispMessage("emulation speed %.1f%%",0, g_fpsScale*100.0);
} }
/** /**
@ -112,7 +112,7 @@ void DecreaseEmulationSpeed(void)
RefreshThrottleFPS(); RefreshThrottleFPS();
FCEU_DispMessage("emulation speed %.1f%%", g_fpsScale*100.0); FCEU_DispMessage("emulation speed %.1f%%",0, g_fpsScale*100.0);
} }
/** /**
@ -146,5 +146,5 @@ FCEUD_SetEmulationSpeed(int cmd)
RefreshThrottleFPS(); RefreshThrottleFPS();
FCEU_DispMessage("emulation speed %.1f%%", g_fpsScale*100.0); FCEU_DispMessage("emulation speed %.1f%%",0, g_fpsScale*100.0);
} }

View File

@ -853,7 +853,7 @@ void FCEUD_PrintError(const char *errormsg)
// dummy functions // dummy functions
#define DUMMY(__f) void __f(void) {printf("%s\n", #__f); FCEU_DispMessage("Not implemented.");} #define DUMMY(__f) void __f(void) {printf("%s\n", #__f); FCEU_DispMessage("Not implemented.",0);}
DUMMY(FCEUD_HideMenuToggle) DUMMY(FCEUD_HideMenuToggle)
DUMMY(FCEUD_MovieReplayFrom) DUMMY(FCEUD_MovieReplayFrom)
DUMMY(FCEUD_ToggleStatusIcon) DUMMY(FCEUD_ToggleStatusIcon)

View File

@ -117,7 +117,7 @@ FCEUD_NetworkConnect(void)
if(TSocket < 0) { if(TSocket < 0) {
char* s = "Error creating stream socket."; char* s = "Error creating stream socket.";
puts(s); puts(s);
FCEU_DispMessage(s); FCEU_DispMessage(s,0);
FCEUD_NetworkClose(); FCEUD_NetworkClose();
return 0; return 0;
} }
@ -146,7 +146,7 @@ FCEUD_NetworkConnect(void)
phostentb = gethostbyname(server.c_str()); phostentb = gethostbyname(server.c_str());
if(!phostentb) { if(!phostentb) {
puts("Error getting host network information."); puts("Error getting host network information.");
FCEU_DispMessage("Error getting host info"); FCEU_DispMessage("Error getting host info",0);
close(TSocket); close(TSocket);
FCEUD_NetworkClose(); FCEUD_NetworkClose();
return(0); return(0);
@ -159,7 +159,7 @@ FCEUD_NetworkConnect(void)
error = connect(TSocket, (struct sockaddr *)&sockin, sizeof(sockin)); error = connect(TSocket, (struct sockaddr *)&sockin, sizeof(sockin));
if(error < 0) { if(error < 0) {
puts("Error connecting to remote host."); puts("Error connecting to remote host.");
FCEU_DispMessage("Error connecting to server"); FCEU_DispMessage("Error connecting to server",0);
close(TSocket); close(TSocket);
FCEUD_NetworkClose(); FCEUD_NetworkClose();
return 0; return 0;
@ -228,7 +228,7 @@ FCEUD_NetworkConnect(void)
netdivisor = buf[0]; netdivisor = buf[0];
puts("*** Connection established."); puts("*** Connection established.");
FCEU_DispMessage("Connection established."); FCEU_DispMessage("Connection established.",0);
FCEUDnetplay = 1; FCEUDnetplay = 1;
FCEUI_NetplayStart(localPlayers, netdivisor); FCEUI_NetplayStart(localPlayers, netdivisor);

View File

@ -359,7 +359,7 @@ int FCEUI_AviBegin(const char* fname)
// Don't display at file splits // Don't display at file splits
if(!avi_segnum) if(!avi_segnum)
FCEU_DispMessage("AVI recording started."); FCEU_DispMessage("AVI recording started.",0);
strncpy(saved_cur_avi_fnameandext,fname,MAX_PATH); strncpy(saved_cur_avi_fnameandext,fname,MAX_PATH);
strncpy(saved_avi_fname,fname,MAX_PATH); strncpy(saved_avi_fname,fname,MAX_PATH);
@ -423,7 +423,7 @@ void FCEUI_AviEnd()
// Don't display if we're just starting another segment // Don't display if we're just starting another segment
if(avi_file->tBytes <= 2097152000) if(avi_file->tBytes <= 2097152000)
FCEU_DispMessage("AVI recording ended."); FCEU_DispMessage("AVI recording ended.",0);
avi_destroy(&avi_file); avi_destroy(&avi_file);
} }

View File

@ -295,19 +295,26 @@ void UpdateGamepad()
} }
} }
char inputstr [64]; char inputstr [45];
{ {
uint32 c = JSAutoHeld; uint32 c = JSAutoHeld;
sprintf(inputstr, "%c%c%c%c%c%c%c%c %c%c%c%c%c%c%c%c %c%c%c%c%c%c%c%c %c%c%c%c%c%c%c%c", sprintf(inputstr, "1%c%c%c%c%c%c%c%c 2%c%c%c%c%c%c%c%c\n 3%c%c%c%c%c%c%c%c 4%c%c%c%c%c%c%c%c",
(c&0x40)?'<':' ', (c&0x10)?'^':' ', (c&0x80)?'>':' ', (c&0x20)?'v':' ', (c&0x40)?'<':' ', (c&0x10)?'^':' ', (c&0x80)?'>':' ', (c&0x20)?'v':' ',
(c&0x01)?'A':' ', (c&0x02)?'B':' ', (c&0x08)?'S':' ', (c&0x04)?'s':' ', (c&0x01)?'A':' ', (c&0x02)?'B':' ', (c&0x08)?'S':' ', (c&0x04)?'s':' ',
(c&0x4000)?'<':' ', (c&0x1000)?'^':' ', (c&0x8000)?'>':' ', (c&0x2000)?'v':' ', (c&0x4000)?'<':' ', (c&0x1000)?'^':' ', (c&0x8000)?'>':' ', (c&0x2000)?'v':' ',
(c&0x0100)?'A':' ', (c&0x0200)?'B':' ', (c&0x0800)?'S':' ', (c&0x0400)?'s':' ', (c&0x0100)?'A':' ', (c&0x0200)?'B':' ', (c&0x0800)?'S':' ', (c&0x0400)?'s':' ',
(c&0x40000)?'A':' '); (c&0x400000)?'<':' ', (c&0x100000)?'^':' ', (c&0x800000)?'>':' ', (c&0x200000)?'v':' ',
if(!(c&0xff00)) (c&0x010000)?'A':' ', (c&0x020000)?'B':' ', (c&0x080000)?'S':' ', (c&0x040000)?'s':' ',
inputstr[8] = '\0'; (c&0x40000000)?'<':' ', (c&0x10000000)?'^':' ', (c&0x80000000)?'>':' ', (c&0x20000000)?'v':' ',
(c&0x01000000)?'A':' ', (c&0x02000000)?'B':' ', (c&0x08000000)?'S':' ', (c&0x04000000)?'s':' ');
if(!(c&0xffffff00))
inputstr[9] = '\0';
if(!(c&0xffff0000))
inputstr[19] = '\0';
if(!(c&0xff000000))
inputstr[30] = '\0';
} }
FCEU_DispMessage("Held: %s", inputstr); FCEU_DispMessage("Held: %s", 40, inputstr);
} }
else else
{ {
@ -317,7 +324,7 @@ void UpdateGamepad()
if(autoHoldReset) if(autoHoldReset)
{ {
FCEU_DispMessage("Held: "); FCEU_DispMessage("Held: ",0);
JSAutoHeld = 0; JSAutoHeld = 0;
JSAutoHeldAffected = 0; JSAutoHeldAffected = 0;
autoHoldRefire = 0; autoHoldRefire = 0;
@ -1604,7 +1611,7 @@ void FCEUI_UseInputPreset(int preset)
case 1: memcpy(GamePadConfig, GamePadPreset2, sizeof(GamePadPreset2)); break; case 1: memcpy(GamePadConfig, GamePadPreset2, sizeof(GamePadPreset2)); break;
case 2: memcpy(GamePadConfig, GamePadPreset3, sizeof(GamePadPreset3)); break; case 2: memcpy(GamePadConfig, GamePadPreset3, sizeof(GamePadPreset3)); break;
} }
FCEU_DispMessage("Using input preset %d.",preset+1); FCEU_DispMessage("Using input preset %d.",0,preset+1);
} }
static void PresetExport(int preset) static void PresetExport(int preset)

View File

@ -84,8 +84,8 @@ BOOL CALLBACK MovieOptionsCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
case IDC_MOVIE_DISPLAYSUBTITLES: case IDC_MOVIE_DISPLAYSUBTITLES:
movieSubtitles ^= 1; movieSubtitles ^= 1;
if (movieSubtitles) FCEU_DispMessage("Movie subtitles on"); if (movieSubtitles) FCEU_DispMessage("Movie subtitles on",0);
else FCEU_DispMessage("Movie subtitles off"); else FCEU_DispMessage("Movie subtitles off",0);
break; break;
case IDC_MOVIE_SUBTITLESINAVI: case IDC_MOVIE_SUBTITLESINAVI:

View File

@ -812,12 +812,12 @@ void FCEUD_SoundToggle(void)
if(mute) if(mute)
{ {
mute = false; mute = false;
FCEU_DispMessage("Sound unmuted"); FCEU_DispMessage("Sound unmuted",0);
} }
else else
{ {
mute = true; mute = true;
FCEU_DispMessage("Sound muted"); FCEU_DispMessage("Sound muted",0);
} }
} }
@ -831,5 +831,5 @@ void FCEUD_SoundVolumeAdjust(int n)
} }
mute = false; mute = false;
FCEUI_SetSoundVolume(soundvolume); FCEUI_SetSoundVolume(soundvolume);
FCEU_DispMessage("Sound volume %d.", soundvolume); FCEU_DispMessage("Sound volume %d.",0, soundvolume);
} }

View File

@ -148,5 +148,5 @@ void FCEUD_SetEmulationSpeed(int cmd)
RefreshThrottleFPS(); RefreshThrottleFPS();
FCEU_DispMessage("emulation speed %d%%",(fps_scale*100)>>8); FCEU_DispMessage("emulation speed %d%%",0,(fps_scale*100)>>8);
} }

View File

@ -2154,7 +2154,7 @@ adelikat: Outsourced this to a remappable hotkey
if(wParam==VK_SCROLL) if(wParam==VK_SCROLL)
{ {
cidisabled^=1; cidisabled^=1;
FCEUI_DispMessage("Family Keyboard %sabled.",cidisabled?"en":"dis"); FCEUI_DispMessage("Family Keyboard %sabled.",0,cidisabled?"en":"dis");
} }
if(cidisabled) if(cidisabled)
break; // Hopefully this won't break DInput... break; // Hopefully this won't break DInput...
@ -2164,7 +2164,7 @@ adelikat: Outsourced this to a remappable hotkey
if(wParam==VK_SCROLL) if(wParam==VK_SCROLL)
{ {
cidisabled^=1; cidisabled^=1;
FCEUI_DispMessage("Subor Keyboard %sabled.",cidisabled?"en":"dis"); FCEUI_DispMessage("Subor Keyboard %sabled.",0,cidisabled?"en":"dis");
} }
if(cidisabled) if(cidisabled)
break; break;

View File

@ -112,7 +112,7 @@ bool CheckFileExists(const char* filename); //Receives a filename (fullpath) and
void FCEU_PrintError(char *format, ...); void FCEU_PrintError(char *format, ...);
void FCEU_printf(char *format, ...); void FCEU_printf(char *format, ...);
void FCEU_DispMessage(char *format, ...); void FCEU_DispMessage(char *format, int disppos, ...);
void FCEU_DispMessageOnMovie(char *format, ...); void FCEU_DispMessageOnMovie(char *format, ...);
void SetNESDeemph(uint8 d, int force); void SetNESDeemph(uint8 d, int force);

View File

@ -157,17 +157,17 @@ void FCEU_FDSInsert(void)
if(TotalSides==0) if(TotalSides==0)
{ {
FCEU_DispMessage("Not FDS; can't eject disk."); FCEU_DispMessage("Not FDS; can't eject disk.",0);
return; return;
} }
if(InDisk==255) if(InDisk==255)
{ {
FCEU_DispMessage("Disk %d Side %s Inserted",SelectDisk>>1,(SelectDisk&1)?"B":"A"); FCEU_DispMessage("Disk %d Side %s Inserted",0,SelectDisk>>1,(SelectDisk&1)?"B":"A");
InDisk=SelectDisk; InDisk=SelectDisk;
} }
else else
{ {
FCEU_DispMessage("Disk %d Side %s Ejected",SelectDisk>>1,(SelectDisk&1)?"B":"A"); FCEU_DispMessage("Disk %d Side %s Ejected",0,SelectDisk>>1,(SelectDisk&1)?"B":"A");
InDisk=255; InDisk=255;
} }
} }
@ -186,16 +186,16 @@ void FCEU_FDSSelect(void)
if(TotalSides==0) if(TotalSides==0)
{ {
FCEU_DispMessage("Not FDS; can't select disk."); FCEU_DispMessage("Not FDS; can't select disk.",0);
return; return;
} }
if(InDisk!=255) if(InDisk!=255)
{ {
FCEU_DispMessage("Eject disk before selecting."); FCEU_DispMessage("Eject disk before selecting.",0);
return; return;
} }
SelectDisk=((SelectDisk+1)%TotalSides)&3; SelectDisk=((SelectDisk+1)%TotalSides)&3;
FCEU_DispMessage("Disk %d Side %c Selected",SelectDisk>>1,(SelectDisk&1)?'B':'A'); FCEU_DispMessage("Disk %d Side %c Selected",0,SelectDisk>>1,(SelectDisk&1)?'B':'A');
} }
static void FDSFix(int a) static void FDSFix(int a)

View File

@ -56,7 +56,7 @@ void SexyFilter(int32 *in, int32 *out, int32 count)
mul2=(24<<16)/FSettings.SndRate; mul2=(24<<16)/FSettings.SndRate;
vmul=(FSettings.SoundVolume<<16)*3/4/100; vmul=(FSettings.SoundVolume<<16)*3/4/100;
//FCEU_DispMessage("SoundVolume %d, vmul %d",FSettings.SoundVolume,vmul); //FCEU_DispMessage("SoundVolume %d, vmul %d",0,FSettings.SoundVolume,vmul);
if(FSettings.soundq) vmul/=4; if(FSettings.soundq) vmul/=4;
else vmul*=2; /* TODO: Increase volume in low quality sound rendering code itself */ else vmul*=2; /* TODO: Increase volume in low quality sound rendering code itself */

View File

@ -799,7 +799,7 @@ void FCEUI_HandleEmuCommands(TestCommandState* testfn)
static void CommandUnImpl(void) static void CommandUnImpl(void)
{ {
FCEU_DispMessage("command '%s' unimplemented.", FCEUI_CommandTable[i].name); FCEU_DispMessage("command '%s' unimplemented.",0, FCEUI_CommandTable[i].name);
} }
static void CommandToggleDip(void) static void CommandToggleDip(void)
@ -1043,8 +1043,8 @@ static void CloseRom(void)
static void MovieSubtitleToggle(void) static void MovieSubtitleToggle(void)
{ {
movieSubtitles ^= 1; movieSubtitles ^= 1;
if (movieSubtitles) FCEU_DispMessage("Movie subtitles on"); if (movieSubtitles) FCEU_DispMessage("Movie subtitles on",0);
else FCEU_DispMessage("Movie subtitles off"); else FCEU_DispMessage("Movie subtitles off",0);
} }
static void UndoRedoSavestate(void) static void UndoRedoSavestate(void)

View File

@ -408,7 +408,7 @@ static int emu_unpause(lua_State *L) {
static int emu_message(lua_State *L) { static int emu_message(lua_State *L) {
const char *msg = luaL_checkstring(L,1); const char *msg = luaL_checkstring(L,1);
FCEU_DispMessage("%s", msg); FCEU_DispMessage("%s",0, msg);
return 0; return 0;
@ -4814,7 +4814,7 @@ void FCEU_LuaFrameBoundary() {
} else { } else {
FCEU_LuaOnStop(); FCEU_LuaOnStop();
FCEU_DispMessage("Script died of natural causes.\n"); FCEU_DispMessage("Script died of natural causes.\n",0);
} }
// Past here, the nes actually runs, so any Lua code is called mid-frame. We must // Past here, the nes actually runs, so any Lua code is called mid-frame. We must
@ -4981,7 +4981,7 @@ int FCEU_LoadLuaCode(const char *filename, const char *arg) {
void FCEU_ReloadLuaCode() void FCEU_ReloadLuaCode()
{ {
if (!luaScriptName) if (!luaScriptName)
FCEU_DispMessage("There's no script to reload."); FCEU_DispMessage("There's no script to reload.",0);
else else
FCEU_LoadLuaCode(luaScriptName); FCEU_LoadLuaCode(luaScriptName);
} }

View File

@ -764,7 +764,7 @@ static void StopPlayback()
/// Stop movie recording /// Stop movie recording
static void StopRecording() static void StopRecording()
{ {
FCEU_DispMessage("Movie recording stopped."); FCEU_DispMessage("Movie recording stopped.",0);
movieMode = MOVIEMODE_INACTIVE; movieMode = MOVIEMODE_INACTIVE;
@ -854,13 +854,13 @@ void FCEUMOV_EnterTasEdit()
currMovieData.TryDumpIncremental(); currMovieData.TryDumpIncremental();
FCEU_DispMessage("Tasedit engaged"); FCEU_DispMessage("Tasedit engaged",0);
} }
void FCEUMOV_ExitTasEdit() void FCEUMOV_ExitTasEdit()
{ {
movieMode = MOVIEMODE_INACTIVE; movieMode = MOVIEMODE_INACTIVE;
FCEU_DispMessage("Tasedit disengaged"); FCEU_DispMessage("Tasedit disengaged",0);
currMovieData = MovieData(); currMovieData = MovieData();
} }
@ -964,15 +964,15 @@ bool FCEUI_LoadMovie(const char *fname, bool _read_only, bool tasedit, int _paus
currRerecordCount = currMovieData.rerecordCount; currRerecordCount = currMovieData.rerecordCount;
if(movie_readonly) if(movie_readonly)
FCEU_DispMessage("Replay started Read-Only."); FCEU_DispMessage("Replay started Read-Only.",0);
else else
FCEU_DispMessage("Replay started Read+Write."); FCEU_DispMessage("Replay started Read+Write.",0);
} }
#ifdef CREATE_AVI #ifdef CREATE_AVI
if(LoggingEnabled) if(LoggingEnabled)
{ {
FCEU_DispMessage("Video recording enabled.\n"); FCEU_DispMessage("Video recording enabled.\n",0);
LoggingEnabled = 2; LoggingEnabled = 2;
} }
#endif #endif
@ -1040,7 +1040,7 @@ void FCEUI_SaveMovie(const char *fname, EMOVIE_FLAG flags, std::wstring author)
movie_readonly = false; movie_readonly = false;
currRerecordCount = 0; currRerecordCount = 0;
FCEU_DispMessage("Movie recording started."); FCEU_DispMessage("Movie recording started.",0);
} }
static int _currCommand = 0; static int _currCommand = 0;
@ -1049,7 +1049,7 @@ static int _currCommand = 0;
// Stop movie playback without closing the movie. // Stop movie playback without closing the movie.
static void FinishPlayback() static void FinishPlayback()
{ {
FCEU_DispMessage("Movie finished playing."); FCEU_DispMessage("Movie finished playing.",0);
movieMode = MOVIEMODE_FINISHED; movieMode = MOVIEMODE_FINISHED;
} }
@ -1122,7 +1122,7 @@ void FCEUMOV_AddInputState()
if(FCEUMOV_ShouldPause() && FCEUI_EmulationPaused()==0) if(FCEUMOV_ShouldPause() && FCEUI_EmulationPaused()==0)
{ {
FCEUI_ToggleEmulationPause(); FCEUI_ToggleEmulationPause();
FCEU_DispMessage("Paused at specified movie frame"); FCEU_DispMessage("Paused at specified movie frame",0);
} }
} }
@ -1435,20 +1435,20 @@ void FCEUI_SetMovieToggleReadOnly(bool which)
if (!movie_readonly) //If not already set if (!movie_readonly) //If not already set
{ {
movie_readonly = true; movie_readonly = true;
FCEU_DispMessage("Movie is now Read-Only."); FCEU_DispMessage("Movie is now Read-Only.",0);
} }
else //Else restate message else //Else restate message
FCEU_DispMessage("Movie is Read-Only."); FCEU_DispMessage("Movie is Read-Only.",0);
} }
else //If set to read+write else //If set to read+write
{ {
if (movie_readonly) //If not already set if (movie_readonly) //If not already set
{ {
movie_readonly = false; movie_readonly = false;
FCEU_DispMessage("Movie is now Read+Write."); FCEU_DispMessage("Movie is now Read+Write.",0);
} }
else //Else restate message else //Else restate message
FCEU_DispMessage("Movie is Read+Write."); FCEU_DispMessage("Movie is Read+Write.",0);
} }
} }
void FCEUI_MovieToggleReadOnly() void FCEUI_MovieToggleReadOnly()
@ -1467,7 +1467,7 @@ void FCEUI_MovieToggleReadOnly()
else if (movieMode == MOVIEMODE_FINISHED) else if (movieMode == MOVIEMODE_FINISHED)
strcat(message, " (finished)"); strcat(message, " (finished)");
FCEU_DispMessage(message); FCEU_DispMessage(message,0);
movie_readonly = !movie_readonly; movie_readonly = !movie_readonly;
} }
@ -1481,7 +1481,7 @@ void FCEUI_MoviePlayFromBeginning(void)
currFrameCounter=0; currFrameCounter=0;
movieMode = MOVIEMODE_PLAY; movieMode = MOVIEMODE_PLAY;
FCEU_DispMessage("Movie is now Read-Only. Playing from beginning."); FCEU_DispMessage("Movie is now Read-Only. Playing from beginning.",0);
} }
} }
@ -1561,6 +1561,7 @@ void FCEU_DisplaySubtitles(char *format, ...)
subtitleMessage.howlong = 300; subtitleMessage.howlong = 300;
subtitleMessage.isMovieMessage = subtitlesOnAVI; subtitleMessage.isMovieMessage = subtitlesOnAVI;
subtitleMessage.linesFromBottom = 0;
} }
void FCEUI_CreateMovieFile(std::string fn) void FCEUI_CreateMovieFile(std::string fn)
@ -1622,9 +1623,9 @@ void FCEUI_MakeBackupMovie(bool dispMessage)
if (dispMessage) //If we should inform the user if (dispMessage) //If we should inform the user
{ {
if (overflow) if (overflow)
FCEUI_DispMessage("Backup overflow, overwriting %s",backupFn.c_str()); //Inform user of overflow FCEUI_DispMessage("Backup overflow, overwriting %s",0,backupFn.c_str()); //Inform user of overflow
else else
FCEUI_DispMessage("%s created",backupFn.c_str()); //Inform user of backup filename FCEUI_DispMessage("%s created",0,backupFn.c_str()); //Inform user of backup filename
} }
} }

View File

@ -50,7 +50,7 @@ static int netdcount;
static void NetError(void) static void NetError(void)
{ {
FCEU_DispMessage("Network error/connection lost!"); FCEU_DispMessage("Network error/connection lost!",0);
FCEUD_NetworkClose(); FCEUD_NetworkClose();
} }
@ -310,7 +310,7 @@ void NetplayUpdate(uint8 *joyp)
if(FCEUSS_LoadFP(fp,SSLOADPARAM_BACKUP)) if(FCEUSS_LoadFP(fp,SSLOADPARAM_BACKUP))
{ {
fclose(fp); fclose(fp);
FCEU_DispMessage("Remote state loaded."); FCEU_DispMessage("Remote state loaded.",0);
} else FCEUD_PrintError("File error. (K)ill, (M)aim, (D)estroy?"); } else FCEUD_PrintError("File error. (K)ill, (M)aim, (D)estroy?");
} }
break;*/ break;*/

View File

@ -350,7 +350,7 @@ uint16 metadata_ucs2[]; // ucs-2, ick! sizeof(metadata) = offset_to_savesta
// framets=0; // framets=0;
// nextts=0; // nextts=0;
// nextd = -1; // nextd = -1;
// FCEU_DispMessage("Movie playback started."); // FCEU_DispMessage("Movie playback started.",0);
//} //}
// //
//static int FCEUI_MovieGetInfo_v1(const char* fname, MOVIE_INFO* info) //static int FCEUI_MovieGetInfo_v1(const char* fname, MOVIE_INFO* info)

View File

@ -2002,7 +2002,7 @@ int FCEUPPU_Loop(int skip)
} }
deempcnt[x]=0; deempcnt[x]=0;
} }
//FCEU_DispMessage("%2x:%2x:%2x:%2x:%2x:%2x:%2x:%2x %d",deempcnt[0],deempcnt[1],deempcnt[2],deempcnt[3],deempcnt[4],deempcnt[5],deempcnt[6],deempcnt[7],maxref); //FCEU_DispMessage("%2x:%2x:%2x:%2x:%2x:%2x:%2x:%2x %d",0,deempcnt[0],deempcnt[1],deempcnt[2],deempcnt[3],deempcnt[4],deempcnt[5],deempcnt[6],deempcnt[7],maxref);
//memset(deempcnt,0,sizeof(deempcnt)); //memset(deempcnt,0,sizeof(deempcnt));
SetNESDeemph(maxref,0); SetNESDeemph(maxref,0);
} }

View File

@ -448,7 +448,7 @@ void FCEUSS_Save(const char *fname)
if(geniestage==1) if(geniestage==1)
{ {
FCEU_DispMessage("Cannot save FCS in GG screen."); FCEU_DispMessage("Cannot save FCS in GG screen.",0);
return; return;
} }
@ -477,7 +477,7 @@ void FCEUSS_Save(const char *fname)
if(st == NULL) if(st == NULL)
{ {
FCEU_DispMessage("State %d save error.",CurrentState); FCEU_DispMessage("State %d save error.",0,CurrentState);
return; return;
} }
@ -517,7 +517,7 @@ void FCEUSS_Save(const char *fname)
if(!fname) if(!fname)
{ {
SaveStateStatus[CurrentState]=1; SaveStateStatus[CurrentState]=1;
FCEU_DispMessage("State %d saved.",CurrentState); FCEU_DispMessage("State %d saved.",0,CurrentState);
} }
redoSS = false; //we have a new savestate so redo is not possible redoSS = false; //we have a new savestate so redo is not possible
} }
@ -709,7 +709,7 @@ bool FCEUSS_Load(const char *fname)
if(geniestage==1) if(geniestage==1)
{ {
FCEU_DispMessage("Cannot load FCS in GG screen."); FCEU_DispMessage("Cannot load FCS in GG screen.",0);
return false; return false;
} }
if(fname) if(fname)
@ -726,7 +726,7 @@ bool FCEUSS_Load(const char *fname)
if(st == NULL) if(st == NULL)
{ {
FCEU_DispMessage("State %d load error.",CurrentState); FCEU_DispMessage("State %d load error.",0,CurrentState);
SaveStateStatus[CurrentState]=0; SaveStateStatus[CurrentState]=0;
return false; return false;
} }
@ -740,11 +740,11 @@ bool FCEUSS_Load(const char *fname)
{ {
char szFilename[260]={0}; char szFilename[260]={0};
splitpath(fname, 0, 0, szFilename, 0); splitpath(fname, 0, 0, szFilename, 0);
FCEU_DispMessage("State %s loaded.",szFilename); FCEU_DispMessage("State %s loaded.",0,szFilename);
} }
else else
{ {
FCEU_DispMessage("State %d loaded.",CurrentState); FCEU_DispMessage("State %d loaded.",0,CurrentState);
SaveStateStatus[CurrentState]=1; SaveStateStatus[CurrentState]=1;
} }
delete st; delete st;
@ -787,7 +787,7 @@ bool FCEUSS_Load(const char *fname)
{ {
SaveStateStatus[CurrentState]=1; SaveStateStatus[CurrentState]=1;
} }
FCEU_DispMessage("Error(s) reading state %d!",CurrentState); FCEU_DispMessage("Error(s) reading state %d!",0,CurrentState);
delete st; delete st;
return 0; return 0;
} }
@ -875,7 +875,7 @@ int FCEUI_SelectState(int w, int show)
if(show) if(show)
{ {
StateShow=180; StateShow=180;
FCEU_DispMessage("-select state-"); FCEU_DispMessage("-select state-",0);
} }
return oldstate; return oldstate;
} }
@ -984,14 +984,14 @@ void SwapSaveState()
if (!lastSavestateMade) if (!lastSavestateMade)
{ {
FCEUI_DispMessage("Can't Undo"); FCEUI_DispMessage("Can't Undo",0);
FCEUI_printf("Undo savestate was attempted but unsuccessful because there was not a recently used savestate.\n"); FCEUI_printf("Undo savestate was attempted but unsuccessful because there was not a recently used savestate.\n");
return; //If there is no last savestate, can't undo return; //If there is no last savestate, can't undo
} }
string backup = GenerateBackupSaveStateFn(lastSavestateMade); //Get filename of backup state string backup = GenerateBackupSaveStateFn(lastSavestateMade); //Get filename of backup state
if (!CheckFileExists(backup.c_str())) if (!CheckFileExists(backup.c_str()))
{ {
FCEUI_DispMessage("Can't Undo"); FCEUI_DispMessage("Can't Undo",0);
FCEUI_printf("Undo savestate was attempted but unsuccessful because there was not a backup of the last used savestate.\n"); FCEUI_printf("Undo savestate was attempted but unsuccessful because there was not a backup of the last used savestate.\n");
return; //If no backup, can't undo return; //If no backup, can't undo
} }
@ -1012,8 +1012,8 @@ void SwapSaveState()
else //This was an undo function so next will be redo, so flag it else //This was an undo function so next will be redo, so flag it
redoSS = true; redoSS = true;
FCEUI_DispMessage("%s restored",backup.c_str()); FCEUI_DispMessage("%s restored",0,backup.c_str());
FCEUI_printf("%s restored\n",backup.c_str()); FCEUI_printf("%s restored\n",0,backup.c_str());
} }
//------------------------------------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------------------------------------
@ -1081,7 +1081,7 @@ void LoadBackup()
undoLS = false; //Flag that LoadBackup cannot be run again undoLS = false; //Flag that LoadBackup cannot be run again
} }
else else
FCEUI_DispMessage("Error: Could not load %s",filename.c_str()); FCEUI_DispMessage("Error: Could not load %s",0,filename.c_str());
} }
void RedoLoadState() void RedoLoadState()

View File

@ -188,9 +188,9 @@ static void ReallySnap(void)
{ {
int x=SaveSnapshot(); int x=SaveSnapshot();
if(!x) if(!x)
FCEU_DispMessage("Error saving screen snapshot."); FCEU_DispMessage("Error saving screen snapshot.",0);
else else
FCEU_DispMessage("Screen snapshot %d saved.",x-1); FCEU_DispMessage("Screen snapshot %d saved.",0,x-1);
} }
void FCEU_PutImage(void) void FCEU_PutImage(void)
@ -281,7 +281,7 @@ void FCEU_PutImage(void)
if (!oldInputDisplay) ci = FCEUMOV_Mode(MOVIEMODE_PLAY) ? 0:GetGamepadPressedImmediate() >> (controller * 8); if (!oldInputDisplay) ci = FCEUMOV_Mode(MOVIEMODE_PLAY) ? 0:GetGamepadPressedImmediate() >> (controller * 8);
else ci = 0; else ci = 0;
if (!oldInputDisplay && !FCEUMOV_Mode(MOVIEMODE_PLAY)) held >>= (controller * 8); if (!oldInputDisplay && !FCEUMOV_Mode(MOVIEMODE_PLAY)) held = (held >> 8);
else held = 0; else held = 0;
#else #else
// Put other port info here // Put other port info here
@ -444,21 +444,25 @@ void FCEU_DispMessageOnMovie(char *format, ...)
guiMessage.howlong = 180; guiMessage.howlong = 180;
guiMessage.isMovieMessage = true; guiMessage.isMovieMessage = true;
guiMessage.linesFromBottom = 0;
if (FCEUI_AviIsRecording() && FCEUI_AviDisableMovieMessages()) if (FCEUI_AviIsRecording() && FCEUI_AviDisableMovieMessages())
guiMessage.howlong = 0; guiMessage.howlong = 0;
} }
void FCEU_DispMessage(char *format, ...) void FCEU_DispMessage(char *format, int disppos=0, ...)
{ {
va_list ap; va_list ap;
va_start(ap,format); va_start(ap,disppos);
vsnprintf(guiMessage.errmsg,sizeof(guiMessage.errmsg),format,ap); vsnprintf(guiMessage.errmsg,sizeof(guiMessage.errmsg),format,ap);
va_end(ap); va_end(ap);
guiMessage.howlong = 180; guiMessage.howlong = 180;
guiMessage.isMovieMessage = false; guiMessage.isMovieMessage = false;
guiMessage.linesFromBottom = disppos;
//adelikat: Pretty sure this code fails, Movie playback stopped is done with FCEU_DispMessageOnMovie() //adelikat: Pretty sure this code fails, Movie playback stopped is done with FCEU_DispMessageOnMovie()
#ifdef CREATE_AVI #ifdef CREATE_AVI
if(LoggingEnabled == 2) if(LoggingEnabled == 2)
@ -476,6 +480,7 @@ void FCEU_ResetMessages()
{ {
guiMessage.howlong = 0; guiMessage.howlong = 0;
guiMessage.isMovieMessage = false; guiMessage.isMovieMessage = false;
guiMessage.linesFromBottom = 0;
} }

View File

@ -17,6 +17,9 @@ extern struct GUIMESSAGE
//indicates that the movie should be drawn even on top of movies //indicates that the movie should be drawn even on top of movies
bool isMovieMessage; bool isMovieMessage;
//in case of multiple lines, allow one to move the message
int linesFromBottom;
} guiMessage; } guiMessage;
extern GUIMESSAGE subtitleMessage; extern GUIMESSAGE subtitleMessage;