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
;
42 extern int jim_verbose_loading
;
45 ////////////////////////////////////////////////////////////////////////////////
46 extern void jimInit (void);
47 extern void jimDeinit (void);
50 #define JIM_INVALID_INTVAL (-2147483648)
52 // return `JIM_INVALID_INTVAL` on error
53 // looks in labels, and in Z80 registers
54 // `allowpgaddr` is used for memory viewer
55 extern int jimGetIntValEx (Jim_Interp
*interp
, Jim_Obj
*obj
, int allowpgaddr
);
56 extern int jimGetIntVal (Jim_Interp
*interp
, Jim_Obj
*obj
);
59 ////////////////////////////////////////////////////////////////////////////////
60 extern int jimEvalFile (const char *fname
, int okifabsent
);
61 extern int jimEvalFile1 (const char *fname
);
63 ////////////////////////////////////////////////////////////////////////////////
64 extern void emuInitBindings (void);
65 extern SDLJimBinding
*sdlFindKeyBind (SDLJimBinding
*list
, uint16_t sdlk
, uint16_t modvalue
);
68 ////////////////////////////////////////////////////////////////////////////////
69 typedef struct UIOverlay_t UIOverlay
;
71 extern UIOverlay
*uiovlFindById (const char *id
);
72 extern void uiovlDraw (void);
73 // returns !0 if the key was eaten
74 extern int uiovlKey (SDL_KeyboardEvent
*key
);
76 extern void uiovlInit (void);
77 extern void uiovlDeinit (void);