Changed Qt GUI AVI recording video pickoff point so that HUD/messages can be optional in the recorded image.

This commit is contained in:
mjbudd77 2021-08-11 21:11:00 -04:00
parent 88da722533
commit a571677cdb
7 changed files with 70 additions and 17 deletions

View File

@ -588,7 +588,7 @@ int aviRecordAddFrame( void )
while ( i < numPixels ) while ( i < numPixels )
{ {
rawVideoBuf[ head ] = nes_shm->pixbuf[i]; i++; rawVideoBuf[ head ] = nes_shm->avibuf[i]; i++;
head = (head + 1) % vbufSize; head = (head + 1) % vbufSize;
} }
@ -677,12 +677,11 @@ void FCEUD_AviStop(void)
return; return;
} }
//************************************************************************************** //**************************************************************************************
void FCEUI_AviVideoUpdate(const unsigned char* buffer) // // This function is implemented in sdl-video.cpp
{ // This is not used by Qt Emulator, avi recording pulls from the post processed video buffer //void FCEUI_AviVideoUpdate(const unsigned char* buffer)
// instead of emulation core video buffer. This allows for the video scaler effects //{
// and higher resolution to be seen in recording. // return;
return; //}
}
//************************************************************************************** //**************************************************************************************
int aviGetSelVideoFormat(void) int aviGetSelVideoFormat(void)
{ {

View File

@ -1799,6 +1799,26 @@ void consoleWin_t::createMainMenu(void)
connect(act, SIGNAL(triggered(bool)), this, SLOT(aviAudioEnableChange(bool)) ); connect(act, SIGNAL(triggered(bool)), this, SLOT(aviAudioEnableChange(bool)) );
aviMenu->addAction(act); aviMenu->addAction(act);
aviMenu->addSeparator();
// Movie -> Avi Recording -> Enable HUD Recording
aviHudAct = new QAction(tr("Enable &HUD Recording"), this);
aviHudAct->setCheckable(true);
aviHudAct->setChecked( FCEUI_AviEnableHUDrecording() );
aviHudAct->setStatusTip(tr("Enable HUD Recording"));
connect(aviHudAct, SIGNAL(triggered(bool)), this, SLOT(setAviHudEnable(bool)) );
aviMenu->addAction(aviHudAct);
// Movie -> Avi Recording -> Enable Message Recording
aviMsgAct = new QAction(tr("Enable &Msg Recording"), this);
aviMsgAct->setCheckable(true);
aviMsgAct->setChecked( !FCEUI_AviDisableMovieMessages() );
aviMsgAct->setStatusTip(tr("Enable Msg Recording"));
connect(aviMsgAct, SIGNAL(triggered(bool)), this, SLOT(setAviMsgEnable(bool)) );
aviMenu->addAction(aviMsgAct);
// Movie -> WAV Recording // Movie -> WAV Recording
subMenu = movieMenu->addMenu( tr("&WAV Recording") ); subMenu = movieMenu->addMenu( tr("&WAV Recording") );
@ -3701,6 +3721,20 @@ void consoleWin_t::aviAudioEnableChange(bool checked)
return; return;
} }
void consoleWin_t::setAviHudEnable(bool checked)
{
FCEUI_SetAviEnableHUDrecording( checked );
g_config->setOption("SDL.RecordHUD", checked );
}
void consoleWin_t::setAviMsgEnable(bool checked)
{
FCEUI_SetAviDisableMovieMessages( !checked );
g_config->setOption("SDL.MovieMsg", checked );
}
void consoleWin_t::aviVideoFormatChanged(int idx) void consoleWin_t::aviVideoFormatChanged(int idx)
{ {
aviSetSelVideoFormat(idx); aviSetSelVideoFormat(idx);

View File

@ -243,6 +243,8 @@ class consoleWin_t : public QMainWindow
QAction *recWavAct; QAction *recWavAct;
QAction *recAsWavAct; QAction *recAsWavAct;
QAction *stopWavAct; QAction *stopWavAct;
QAction *aviHudAct;
QAction *aviMsgAct;
QTimer *gameTimer; QTimer *gameTimer;
@ -417,6 +419,8 @@ class consoleWin_t : public QMainWindow
void aviRecordStop(void); void aviRecordStop(void);
void aviAudioEnableChange(bool); void aviAudioEnableChange(bool);
void aviVideoFormatChanged(int idx); void aviVideoFormatChanged(int idx);
void setAviHudEnable(bool);
void setAviMsgEnable(bool);
void wavRecordStart(void); void wavRecordStart(void);
void wavRecordAsStart(void); void wavRecordAsStart(void);
void wavRecordStop(void); void wavRecordStop(void);

View File

@ -587,8 +587,8 @@ InitConfig()
// pause movie playback at frame x // pause movie playback at frame x
config->addOption("pauseframe", "SDL.PauseFrame", 0); config->addOption("pauseframe", "SDL.PauseFrame", 0);
config->addOption("recordhud", "SDL.RecordHUD", 1); config->addOption("recordhud", "SDL.RecordHUD", 0);
config->addOption("moviemsg", "SDL.MovieMsg", 1); config->addOption("moviemsg", "SDL.MovieMsg", 0);
#ifdef _USE_X264 #ifdef _USE_X264
config->addOption("SDL.AviVideoFormat", AVI_X264); config->addOption("SDL.AviVideoFormat", AVI_X264);

View File

@ -756,7 +756,7 @@ int fceuWrapperInit( int argc, char *argv[] )
// check to see if recording HUD to AVI is enabled // check to see if recording HUD to AVI is enabled
int rh; int rh;
g_config->getOption("SDL.RecordHUD", &rh); g_config->getOption("SDL.RecordHUD", &rh);
if( rh == 0) if( rh )
FCEUI_SetAviEnableHUDrecording(true); FCEUI_SetAviEnableHUDrecording(true);
else else
FCEUI_SetAviEnableHUDrecording(false); FCEUI_SetAviEnableHUDrecording(false);

View File

@ -35,10 +35,12 @@ struct nes_shm_t
char blitUpdated; char blitUpdated;
uint32_t pixbuf[1048576]; // 1024 x 1024 uint32_t pixbuf[1048576]; // 1024 x 1024
uint32_t avibuf[1048576]; // 1024 x 1024
void clear_pixbuf(void) void clear_pixbuf(void)
{ {
memset( pixbuf, 0, sizeof(pixbuf) ); memset( pixbuf, 0, sizeof(pixbuf) );
memset( avibuf, 0, sizeof(avibuf) );
} }
struct sndBuf_t struct sndBuf_t

View File

@ -428,13 +428,10 @@ static void WriteTestPattern(void)
} }
} }
} }
/**
* Pushes the given buffer of bits to the screen. static void
*/ doBlitScreen(uint8_t *XBuf, uint8_t *dest)
void
BlitScreen(uint8 *XBuf)
{ {
uint8 *dest;
int w, h, pitch, bw, ixScale, iyScale; int w, h, pitch, bw, ixScale, iyScale;
// refresh the palette if required // refresh the palette if required
@ -447,7 +444,7 @@ BlitScreen(uint8 *XBuf)
// XXX soules - not entirely sure why this is being done yet // XXX soules - not entirely sure why this is being done yet
XBuf += s_srendline * 256; XBuf += s_srendline * 256;
dest = (uint8*)nes_shm->pixbuf; //dest = (uint8*)nes_shm->pixbuf;
ixScale = nes_shm->video.xscale; ixScale = nes_shm->video.xscale;
iyScale = nes_shm->video.yscale; iyScale = nes_shm->video.yscale;
@ -486,11 +483,28 @@ BlitScreen(uint8 *XBuf)
{ {
Blit8ToHigh(XBuf + NOFFSET, dest, bw, s_tlines, pitch, ixScale, iyScale); Blit8ToHigh(XBuf + NOFFSET, dest, bw, s_tlines, pitch, ixScale, iyScale);
} }
}
/**
* Pushes the given buffer of bits to the screen.
*/
void
BlitScreen(uint8 *XBuf)
{
doBlitScreen(XBuf, (uint8_t*)nes_shm->pixbuf);
nes_shm->blit_count++; nes_shm->blit_count++;
nes_shm->blitUpdated = 1; nes_shm->blitUpdated = 1;
}
void FCEUI_AviVideoUpdate(const unsigned char* buffer)
{ // This is not used by Qt Emulator, avi recording pulls from the post processed video buffer
// instead of emulation core video buffer. This allows for the video scaler effects
// and higher resolution to be seen in recording.
doBlitScreen( (uint8_t*)buffer, (uint8_t*)nes_shm->avibuf);
aviRecordAddFrame(); aviRecordAddFrame();
return;
} }
/** /**