From 5edd659949aea68ace1c9637405d34a6b402c3b4 Mon Sep 17 00:00:00 2001 From: mjbudd77 Date: Sat, 6 Feb 2021 13:41:16 -0500 Subject: [PATCH] Re-added memset statement to ensure that Qt GUI memory is zeroed at startup. --- src/drivers/Qt/nes_shm.cpp | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/src/drivers/Qt/nes_shm.cpp b/src/drivers/Qt/nes_shm.cpp index 575b743c..ba6ec9d0 100644 --- a/src/drivers/Qt/nes_shm.cpp +++ b/src/drivers/Qt/nes_shm.cpp @@ -39,33 +39,7 @@ nes_shm_t *open_nes_shm(void) vaddr = (nes_shm_t*)malloc( sizeof(struct nes_shm_t) ); - //int shmId; - //struct shmid_ds ds; - - //shmId = shmget( IPC_PRIVATE, sizeof(struct nes_shm_t), IPC_CREAT | S_IRWXU | S_IRWXG ); - - //if ( shmId == -1 ) - //{ - // perror("Error: GL shmget Failed:"); - // return NULL; - //} - //printf("Created ShmID: %i \n", shmId ); - - //vaddr = (nes_shm_t*)shmat( shmId, NULL, 0); - - //if ( vaddr == (nes_shm_t*)-1 ) - //{ - // perror("Error: NES shmat Failed:"); - // return NULL; - //} - //memset( vaddr, 0, sizeof(struct nes_shm_t)); - - //if ( shmctl( shmId, IPC_RMID, &ds ) != 0 ) - //{ - // perror("Error: GLX shmctl IPC_RMID Failed:"); - //} - - //sem_init( &vaddr->sem, 1, 1 ); + memset( vaddr, 0, sizeof(struct nes_shm_t)); vaddr->video.ncol = 256; vaddr->video.nrow = 256;