Cleaned up a few unused variables. Added blit and render counters to help debug if GUI rendering is on time with emulation thread.

This commit is contained in:
mjbudd77 2021-06-23 20:30:33 -04:00
parent 0b7c7f1924
commit 572e89ee90
5 changed files with 16 additions and 43 deletions

View File

@ -653,5 +653,6 @@ void ConsoleViewGL_t::paintGL(void)
glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D);
glDisable(GL_TEXTURE_RECTANGLE); glDisable(GL_TEXTURE_RECTANGLE);
nes_shm->render_count++;
//printf("Paint GL!\n"); //printf("Paint GL!\n");
} }

View File

@ -650,4 +650,5 @@ void ConsoleViewSDL_t::render(void)
SDL_RenderPresent(sdlRenderer); SDL_RenderPresent(sdlRenderer);
nes_shm->render_count++;
} }

View File

@ -3914,7 +3914,6 @@ void consoleWin_t::syncActionConfig( QAction *act, const char *property )
void consoleWin_t::updatePeriodic(void) void consoleWin_t::updatePeriodic(void)
{ {
// Process all events before attempting to render viewport // Process all events before attempting to render viewport
QCoreApplication::processEvents(); QCoreApplication::processEvents();

View File

@ -34,36 +34,6 @@ struct nes_shm_t
char runEmulator; char runEmulator;
char blitUpdated; char blitUpdated;
// Pass Key Events back to QT Gui
struct
{
int head;
int tail;
struct {
int type;
int keycode;
int state;
} data[64];
} keyEventBuf;
// Gui Command Event Queue
struct
{
int head;
int tail;
struct {
int id;
union {
int i32[4];
float f32[4];
} param;
} cmd[64];
} guiEvent;
uint32_t pixbuf[1048576]; // 1024 x 1024 uint32_t pixbuf[1048576]; // 1024 x 1024
void clear_pixbuf(void) void clear_pixbuf(void)
@ -71,19 +41,19 @@ struct nes_shm_t
memset( pixbuf, 0, sizeof(pixbuf) ); memset( pixbuf, 0, sizeof(pixbuf) );
} }
struct sndBuf_t struct sndBuf_t
{ {
int head; int head;
int tail; int tail;
int16_t data[NES_AUDIO_BUFLEN]; int16_t data[NES_AUDIO_BUFLEN];
unsigned int starveCounter; unsigned int starveCounter;
} sndBuf; } sndBuf;
void push_sound_sample( int16_t sample ) void push_sound_sample( int16_t sample )
{ {
sndBuf.data[ sndBuf.head ] = sample; sndBuf.data[ sndBuf.head ] = sample;
sndBuf.head = (sndBuf.head + 1) % NES_AUDIO_BUFLEN; sndBuf.head = (sndBuf.head + 1) % NES_AUDIO_BUFLEN;
} }
}; };
extern nes_shm_t *nes_shm; extern nes_shm_t *nes_shm;

View File

@ -265,6 +265,7 @@ int InitVideo(FCEUGI *gi)
nes_shm->video.yscale = 1; nes_shm->video.yscale = 1;
break; break;
} }
nes_shm->render_count = nes_shm->blit_count = 0;
s_inited = 1; s_inited = 1;
@ -475,6 +476,7 @@ BlitScreen(uint8 *XBuf)
{ {
Blit8ToHigh(XBuf + NOFFSET, dest, bw, s_tlines, pitch, ixScale, iyScale); Blit8ToHigh(XBuf + NOFFSET, dest, bw, s_tlines, pitch, ixScale, iyScale);
} }
nes_shm->blit_count++;
nes_shm->blitUpdated = 1; nes_shm->blitUpdated = 1;
aviRecordAddFrame(); aviRecordAddFrame();