trunk/src/emu/save.c
| r242983 | r242984 | |
| 213 | 213 | return validate_header(header, gamename, sig, errormsg, ""); |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | //------------------------------------------------- |
| 217 | // dispatch_postload - invoke all registered |
| 218 | // postload callbacks for updates |
| 219 | //------------------------------------------------- |
| 216 | 220 | |
| 221 | |
| 222 | void save_manager::dispatch_postload() |
| 223 | { |
| 224 | for (state_callback *func = m_postload_list.first(); func != NULL; func = func->next()) |
| 225 | func->m_func(); |
| 226 | } |
| 227 | |
| 217 | 228 | //------------------------------------------------- |
| 218 | 229 | // read_file - read the data from a file |
| 219 | 230 | //------------------------------------------------- |
| r242983 | r242984 | |
| 253 | 264 | } |
| 254 | 265 | |
| 255 | 266 | // call the post-load functions |
| 256 | | for (state_callback *func = m_postload_list.first(); func != NULL; func = func->next()) |
| 257 | | func->m_func(); |
| 267 | dispatch_postload(); |
| 258 | 268 | |
| 259 | 269 | return STATERR_NONE; |
| 260 | 270 | } |
| 261 | 271 | |
| 272 | //------------------------------------------------- |
| 273 | // dispatch_presave - invoke all registered |
| 274 | // presave callbacks for updates |
| 275 | //------------------------------------------------- |
| 262 | 276 | |
| 277 | |
| 278 | void save_manager::dispatch_presave() |
| 279 | { |
| 280 | for (state_callback *func = m_presave_list.first(); func != NULL; func = func->next()) |
| 281 | func->m_func(); |
| 282 | } |
| 283 | |
| 263 | 284 | //------------------------------------------------- |
| 264 | 285 | // write_file - writes the data to a file |
| 265 | 286 | //------------------------------------------------- |
| r242983 | r242984 | |
| 287 | 308 | file.compress(FCOMPRESS_MEDIUM); |
| 288 | 309 | |
| 289 | 310 | // call the pre-save functions |
| 290 | | for (state_callback *func = m_presave_list.first(); func != NULL; func = func->next()) |
| 291 | | func->m_func(); |
| 311 | dispatch_presave(); |
| 292 | 312 | |
| 293 | 313 | // then write all the data |
| 294 | 314 | for (state_entry *entry = m_entry_list.first(); entry != NULL; entry = entry->next()) |