MAMEWorld >> EmuChat
View all threads Index   Flat Mode Flat  

Trnzaddict
MAME Fan
Reged: 01/24/10
Posts: 49
Send PM
Modified machine.c in source won't compile
11/01/14 10:02 PM


Hi guys, a question for the devs. I modified the machine.c file to stop the "save/load state"messages. I did this because the damn deco cassette games just have too long of a boot up sequence and I saved states for all the games in the driver for my cab right after the countdown is over so they load seamlessly without the message showing up.

Now I did this trick when I compiled 148 and I had 0 problems.

I'm using the latest toolchain from 9-14. 64 bit.

I'm getting the "ünused variable ópnamed'in the cmd promt window when compiling towards the end of the process.

This is the section it can't compile. All's I did was delete the popmessages as instructed from the byoac forums.

Code:


//-------------------------------------------------
// handle_saveload - attempt to perform a save
// or load
//-------------------------------------------------

void running_machine::handle_saveload()
{
UINT32 openflags = (m_saveload_schedule == SLS_LOAD) ? OPEN_FLAG_READ : (OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
const char *opnamed = (m_saveload_schedule == SLS_LOAD) ? "loaded" : "saved";
const char *opname = (m_saveload_schedule == SLS_LOAD) ? "load" : "save";
file_error filerr = FILERR_NONE;

// if no name, bail
emu_file file(m_saveload_searchpath, openflags);
if (!m_saveload_pending_file)
goto cancel;

// if there are anonymous timers, we can't save just yet, and we can't load yet either
// because the timers might overwrite data we have loaded
if (!m_scheduler.can_save())
{
// if more than a second has passed, we're probably screwed
if ((this->time() - m_saveload_schedule_time) > attotime::from_seconds(1))
{

goto cancel;
}
return;
}

// open the file
filerr = file.open(m_saveload_pending_file);
if (filerr == FILERR_NONE)
{
// read/write the save state
save_error saverr = (m_saveload_schedule == SLS_LOAD) ? m_save.read_file(file) : m_save.write_file(file);

// handle the result
switch (saverr)
{
case STATERR_ILLEGAL_REGISTRATIONS:

break;

case STATERR_INVALID_HEADER:

break;

case STATERR_READ_ERROR:

break;

case STATERR_WRITE_ERROR:

break;

case STATERR_NONE:




break;

default:

break;
}

// close and perhaps delete the file
if (saverr != STATERR_NONE && m_saveload_schedule == SLS_SAVE)
file.remove_on_close();
}



// unschedule the operation
cancel:
m_saveload_pending_file.reset();
m_saveload_searchpath = NULL;
m_saveload_schedule = SLS_NONE;
}




Can someone tell me why the error is happening?







Entire thread
Subject Posted by Posted on
* Modified machine.c in source won't compile Trnzaddict 11/01/14 10:02 PM
. * Re: Modified machine.c in source won't compile krick  11/02/14 12:23 AM
. * Re: Modified machine.c in source won't compile Olivier Galibert  11/01/14 11:05 PM
. * Re: Modified machine.c in source won't compile Trnzaddict  11/01/14 11:39 PM
. * Re: Modified machine.c in source won't compile MooglyGuy  11/03/14 12:24 AM
. * Re: Modified machine.c in source won't compile B2K24  11/01/14 11:00 PM
. * Re: Modified machine.c in source won't compile Trnzaddict  11/01/14 11:41 PM
. * Besides..... Traso  11/05/14 01:17 AM
. * Re: Besides..... redk9258  11/05/14 03:11 AM
. * Re: Besides..... B2K24  11/05/14 01:44 AM
. * Re: Besides..... Trnzaddict  11/07/14 01:42 AM
. * Re: Besides..... Olivier Galibert  11/24/14 07:19 PM
. * Re: Besides..... Trnzaddict  11/24/14 09:10 PM
. * Re: Besides..... Olivier Galibert  11/25/14 07:49 AM
. * Re: Besides..... *DELETED* Anonymous  11/25/14 12:21 PM
. * Re: Besides..... Trnzaddict  11/25/14 03:29 PM
. * Re: Besides..... krick  11/07/14 03:24 AM
. * Re: Besides..... B2K24  11/07/14 03:18 AM

Extra information Permissions
Moderator:  Robbbert, Tafoid 
0 registered and 146 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 3076