From 314928a3339c3c36f820106e3a9679adb19f706d Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Fri, 4 Jan 2008 18:09:45 +0000 Subject: [PATCH] (From Oliver Stoneberg) beastrzb097u2red.patch - added GAME_NOT_WORKING flag, so this bogus bug report can be removed (not even worth 1 buck!) 20080104_1.patch - fixes a memory in src/mame/machine/stvcd.c memoryleak0118u1ora.patch - fixes a memory leak, that only happened when no RawInput API was available memory_leak0111u6ora_1.patch - only a partial patch - model3.c still missing --- makefile | 1 - src/emu/mame.c | 1 - src/mame/drivers/cps3.c | 12 +++++++++++- src/mame/drivers/cubocd32.c | 2 +- src/mame/drivers/zn.c | 2 +- src/mame/includes/cubocd32.h | 2 +- src/mame/machine/cubocd32.c | 12 +++++++++++- src/mame/machine/stvcd.c | 8 +++++++- src/osd/windows/input.c | 4 ++-- src/tools/chdman.c | 2 +- 10 files changed, 35 insertions(+), 11 deletions(-) diff --git a/makefile b/makefile index 8aff71a3aa5..b4544b80029 100644 --- a/makefile +++ b/makefile @@ -314,7 +314,6 @@ CFLAGS += -O$(OPTIMIZE) # and make all errors into warnings ifneq ($(OPTIMIZE),0) CFLAGS += -Werror $(ARCHOPTS) -fno-strict-aliasing -#CFLAGS += $(ARCHOPTS) -fno-strict-aliasing endif # if symbols are on, make sure we have frame pointers diff --git a/src/emu/mame.c b/src/emu/mame.c index 95abf4b74b1..f45d913e8c1 100644 --- a/src/emu/mame.c +++ b/src/emu/mame.c @@ -1162,7 +1162,6 @@ void CLIB_DECL popmessage(const char *format, ...) /* otherwise, generate the buffer and call the UI to display the message */ else { - extern void CLIB_DECL ui_popup(const char *format, ...) ATTR_PRINTF(1,2); va_list arg; /* dump to the buffer */ diff --git a/src/mame/drivers/cps3.c b/src/mame/drivers/cps3.c index 6aafda60f05..1ad3d8e8296 100644 --- a/src/mame/drivers/cps3.c +++ b/src/mame/drivers/cps3.c @@ -2509,10 +2509,19 @@ static const struct WD33C93interface scsi_intf = NULL /* command completion IRQ */ }; -static MACHINE_RESET( cps3 ) +static void cps3_exit(running_machine *machine) +{ + wd33c93_exit(&scsi_intf); +} + +static MACHINE_START( cps3 ) { wd33c93_init(&scsi_intf); + add_exit_callback(machine, cps3_exit); +} +static MACHINE_RESET( cps3 ) +{ if (cps3_use_fastboot) { fastboot_timer = timer_alloc(fastboot_timer_callback, NULL); @@ -2734,6 +2743,7 @@ static MACHINE_DRIVER_START( cps3 ) MDRV_SCREEN_SIZE(512*2, 224*2) MDRV_SCREEN_VISIBLE_AREA(0, (384*1)-1, 0, 223/*511*/) + MDRV_MACHINE_START(cps3) MDRV_MACHINE_RESET(cps3) MDRV_NVRAM_HANDLER( cps3 ) MDRV_PALETTE_LENGTH(0x10000) // actually 0x20000 ... diff --git a/src/mame/drivers/cubocd32.c b/src/mame/drivers/cubocd32.c index c8068652bce..169b03c8618 100644 --- a/src/mame/drivers/cubocd32.c +++ b/src/mame/drivers/cubocd32.c @@ -384,7 +384,7 @@ static DRIVER_INIT( cd32 ) memory_configure_bank(1, 1, 1, memory_region(REGION_USER1), 0); /* intialize akiko */ - amiga_akiko_init(); + amiga_akiko_init(machine); } /***************************************************************************************************/ diff --git a/src/mame/drivers/zn.c b/src/mame/drivers/zn.c index 3f7a833479f..aab3910790d 100644 --- a/src/mame/drivers/zn.c +++ b/src/mame/drivers/zn.c @@ -4679,7 +4679,7 @@ GAME( 1997, taitogn, 0, coh3002t, zn, coh3002t, ROT0, "Sony/Taito", "Tai GAME( 1997, psarc95, 0, coh1002e, zn, coh1002e, ROT0, "Sony/Eighting/Raizing", "PS Arcade 95", GAME_IS_BIOS_ROOT ) GAME( 1997, beastrzr, psarc95, coh1002e, zn, coh1002e, ROT0, "Eighting/Raizing", "Beastorizer (USA)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) -GAME( 1997, beastrzb, psarc95, coh1002e, zn, coh1002e, ROT0, "Eighting/Raizing", "Beastorizer (USA Bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) +GAME( 1997, beastrzb, psarc95, coh1002e, zn, coh1002e, ROT0, "Eighting/Raizing", "Beastorizer (USA Bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) GAME( 1998, bldyror2, psarc95, coh1002e, zn, coh1002e, ROT0, "Eighting/Raizing", "Bloody Roar 2 (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) GAME( 2000, brvblade, tps, coh1002e, zn, coh1002e, ROT270, "Eighting/Raizing", "Brave Blade (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) diff --git a/src/mame/includes/cubocd32.h b/src/mame/includes/cubocd32.h index b274592d9b1..7d94c0abf94 100644 --- a/src/mame/includes/cubocd32.h +++ b/src/mame/includes/cubocd32.h @@ -9,7 +9,7 @@ CuboCD32 definitions /*----------- defined in machine/cubocd32.c -----------*/ -extern void amiga_akiko_init(void); +extern void amiga_akiko_init(running_machine* machine); extern NVRAM_HANDLER( cd32 ); extern READ32_HANDLER(amiga_akiko32_r); extern WRITE32_HANDLER(amiga_akiko32_w); diff --git a/src/mame/machine/cubocd32.c b/src/mame/machine/cubocd32.c index 920b67591ea..72f2e664758 100644 --- a/src/mame/machine/cubocd32.c +++ b/src/mame/machine/cubocd32.c @@ -68,7 +68,15 @@ static struct akiko_def static TIMER_CALLBACK(akiko_dma_proc); static TIMER_CALLBACK(akiko_frame_proc); -void amiga_akiko_init(void) +static void amiga_akiko_exit(running_machine* machine) +{ + if( akiko.cdrom ) { + cdrom_close(akiko.cdrom); + akiko.cdrom = (cdrom_file *)NULL; + } +} + +void amiga_akiko_init(running_machine* machine) { i2cmem_init( 0, I2CMEM_SLAVE_ADDRESS, NVRAM_PAGE_SIZE, NVRAM_SIZE, NULL ); @@ -98,6 +106,8 @@ void amiga_akiko_init(void) akiko.cdrom_toc = NULL; akiko.dma_timer = timer_alloc(akiko_dma_proc, NULL); akiko.frame_timer = timer_alloc(akiko_frame_proc, NULL); + + add_exit_callback(machine, amiga_akiko_exit); /* create the TOC table */ if ( akiko.cdrom != NULL && cdrom_get_last_track(akiko.cdrom) ) diff --git a/src/mame/machine/stvcd.c b/src/mame/machine/stvcd.c index a0b442f3089..7bf850c4517 100644 --- a/src/mame/machine/stvcd.c +++ b/src/mame/machine/stvcd.c @@ -1237,7 +1237,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) cr3 = cr4 = 0; // first 4 bytes = FAD - finfbuf[0] = (curdir[temp].firstfad>>24)&0xff; + finfbuf[0] = (curdir[temp].firstfad>>24)&0xff; finfbuf[1] = (curdir[temp].firstfad>>16)&0xff; finfbuf[2] = (curdir[temp].firstfad>>8)&0xff; finfbuf[3] = (curdir[temp].firstfad&0xff); @@ -1557,6 +1557,12 @@ void stvcd_exit(running_machine* machine) free((void *)curdir); curdir = (direntryT *)NULL; } + + if (cdrom) + { + cdrom_close(cdrom); + cdrom = (cdrom_file *)NULL; + } } static void cd_readTOC(void) diff --git a/src/osd/windows/input.c b/src/osd/windows/input.c index aa591d55ebd..b1b36ba60a8 100644 --- a/src/osd/windows/input.c +++ b/src/osd/windows/input.c @@ -1095,8 +1095,8 @@ static void dinput_exit(running_machine *machine) // release all our devices while (joystick_list != NULL && joystick_list->dinput.device != NULL) dinput_device_release(joystick_list); - while (lightgun_list != NULL && lightgun_list->dinput.device != NULL) - dinput_device_release(lightgun_list); + while (lightgun_list != NULL) + generic_device_free(lightgun_list); while (mouse_list != NULL && mouse_list->dinput.device != NULL) dinput_device_release(mouse_list); while (keyboard_list != NULL && keyboard_list->dinput.device != NULL) diff --git a/src/tools/chdman.c b/src/tools/chdman.c index c599cccab97..8f5be2ee9f5 100644 --- a/src/tools/chdman.c +++ b/src/tools/chdman.c @@ -145,7 +145,7 @@ static char *big_int_string(UINT64 intvalue) progress - generic progress callback -------------------------------------------------*/ -static void progress(int forceit, const char *fmt, ...) +static void ATTR_PRINTF(2,3) progress(int forceit, const char *fmt, ...) { clock_t curtime = clock(); va_list arg;