From 32a0f49f4d70fe79def8718ec0b4e2460d629d6c Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 2 Jun 2007 14:31:36 +0000 Subject: [PATCH] some leaks fixed git-svn-id: file:///home/notaz/opt/svn/fceu@145 be3aeb3a-fb24-0410-a615-afba39da0efa --- drivers/gp2x/menu.c | 4 ++-- drivers/gp2x/minimal.c | 3 ++- drivers/gp2x_test/minimal.c | 1 + fds.c | 45 ++++++++++++++++++++++--------------- general.c | 7 ------ ines.c | 1 + unif.c | 1 + 7 files changed, 34 insertions(+), 28 deletions(-) diff --git a/drivers/gp2x/menu.c b/drivers/gp2x/menu.c index 25c886f..cdd06b2 100644 --- a/drivers/gp2x/menu.c +++ b/drivers/gp2x/menu.c @@ -1044,7 +1044,7 @@ static int menu_loop_options(void) static void draw_menu_credits(void) { - char vstr[16]; + char vstr[32]; //int tl_x = 15, tl_y = 70; gp2x_fceu_copy_bg(); @@ -1054,7 +1054,7 @@ static void draw_menu_credits(void) gp2x_text_out15(20, 40, "(c) notaz, 2007"); gp2x_text_out15(20, 70, "Based on FCE Ultra versions"); - gp2x_text_out15(20, 80, "0.81 and 0.98.15"); + gp2x_text_out15(20, 80, "0.81 and 0.98.1x"); gp2x_text_out15(20, 110, " - Credits - "); gp2x_text_out15(20, 130, "Bero: FCE"); diff --git a/drivers/gp2x/minimal.c b/drivers/gp2x/minimal.c index 1ac5129..e11643e 100644 --- a/drivers/gp2x/minimal.c +++ b/drivers/gp2x/minimal.c @@ -68,7 +68,8 @@ void gp2x_video_flip(void) // since we are using the mmu hack, we must flush the cache first // (the params are most likely wrong, but they seem to work somehow) - flushcache(addr, addr + 320*240*2, 0); + //flushcache(addr, addr + 320*240*2, 0); + flushcache(gp2x_screen, (char *)gp2x_screen + 320*240*2, 0); lsw = (unsigned short) addr; msw = (unsigned short)(addr >> 16); diff --git a/drivers/gp2x_test/minimal.c b/drivers/gp2x_test/minimal.c index a32a08f..793af74 100644 --- a/drivers/gp2x_test/minimal.c +++ b/drivers/gp2x_test/minimal.c @@ -235,6 +235,7 @@ void gp2x_deinit(void) SDL_QuitSubSystem(SDL_INIT_VIDEO); SDL_Quit(); + free(gp2x_screen); if (sounddev > 0) close(sounddev); gp2x_usbjoy_deinit(); } diff --git a/fds.c b/fds.c index e5307ac..501aefc 100644 --- a/fds.c +++ b/fds.c @@ -917,30 +917,39 @@ void FDSClose(void) int x; char *fn; - if(!DiskWritten) return; - - fn=FCEU_MakeFName(FCEUMKF_FDS,0,0); - - if(!(fp=FCEUD_UTF8fopen(fn,"wb"))) + if(!DiskWritten) { - free(fn); - return; - } - free(fn); + fn=FCEU_MakeFName(FCEUMKF_FDS,0,0); - for(x=0;x