1 /***************************************************************************
3 * ZXEmuT -- ZX Spectrum Emulator with Tcl scripting
5 * Copyright (C) 2012-2022 Ketmar Dark <ketmar@ketmar.no-ip.org>
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, version 3 of the License ONLY.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 **************************************************************************/
20 #ifndef ZXEMUT_JIMAPI_H
21 #define ZXEMUT_JIMAPI_H
25 #include <libspectrum.h>
27 #include "../libzymosis/zymosis.h"
28 #include "emucommon.h"
32 ////////////////////////////////////////////////////////////////////////////////
33 typedef struct SDLJimBinding
{
37 struct SDLJimBinding
*next
;
40 extern SDLJimBinding
*sdlJimBindings
;
43 ////////////////////////////////////////////////////////////////////////////////
44 extern void jimInit (void);
45 extern void jimDeinit (void);
48 #define JIM_INVALID_INTVAL (-2147483648)
50 // return `JIM_INVALID_INTVAL` on error
51 // looks in labels, and in Z80 registers
52 // `allowpgaddr` is used for memory viewer
53 extern int jimGetIntValEx (Jim_Interp
*interp
, Jim_Obj
*obj
, int allowpgaddr
);
54 extern int jimGetIntVal (Jim_Interp
*interp
, Jim_Obj
*obj
);
57 ////////////////////////////////////////////////////////////////////////////////
58 extern int jimEvalFile (const char *fname
, int okifabsent
);
59 extern int jimEvalFile1 (const char *fname
);
61 ////////////////////////////////////////////////////////////////////////////////
62 extern void emuInitBindings (void);
63 extern SDLJimBinding
*sdlFindKeyBind (SDLJimBinding
*list
, uint16_t sdlk
, uint16_t modvalue
);
66 ////////////////////////////////////////////////////////////////////////////////
67 typedef struct UIOverlay_t UIOverlay
;
69 extern UIOverlay
*uiovlFindById (const char *id
);
70 extern void uiovlDraw (void);
71 // returns !0 if the key was eaten
72 extern int uiovlKey (SDL_KeyboardEvent
*key
);
74 extern void uiovlInit (void);
75 extern void uiovlDeinit (void);