cdrom: change pause timing again
[pcsx_rearmed.git] / libpcsxcore / psxcommon.c
1 /***************************************************************************
2  *   Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team              *
3  *                                                                         *
4  *   This program is free software; you can redistribute it and/or modify  *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  *   This program is distributed in the hope that it will be useful,       *
10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA.           *
18  ***************************************************************************/
19
20 #include "psxcommon.h"
21 #include "r3000a.h"
22 #include "psxbios.h"
23
24 #include "cheat.h"
25 #include "ppf.h"
26
27 PcsxConfig Config;
28 boolean NetOpened = FALSE;
29
30 int Log = 0;
31 FILE *emuLog = NULL;
32
33 int EmuInit() {
34         return psxInit();
35 }
36
37 void EmuReset() {
38         FreeCheatSearchResults();
39         FreeCheatSearchMem();
40
41         psxReset();
42 }
43
44 void EmuShutdown() {
45         ClearAllCheats();
46         FreeCheatSearchResults();
47         FreeCheatSearchMem();
48
49         FreePPFCache();
50
51         psxShutdown();
52 }
53
54 void EmuUpdate() {
55         ApplyCheats();
56
57         // reamed hack
58         {
59                 extern void pl_frame_limit(void);
60                 pl_frame_limit();
61         }
62 }
63
64 void __Log(char *fmt, ...) {
65         va_list list;
66 #ifdef LOG_STDOUT
67         char tmp[1024];
68 #endif
69
70         va_start(list, fmt);
71 #ifndef LOG_STDOUT
72         vfprintf(emuLog, fmt, list);
73 #else
74         vsprintf(tmp, fmt, list);
75         SysPrintf(tmp);
76 #endif
77         va_end(list);
78 }