zymosis: renamed "SLL" to "SLS"
[zymosis.git] / src / ZXEmuT / jimapi.h
blob3298efc53de701e1a557a68b07c2efc519677892
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
23 #include <stdint.h>
24 #include <SDL.h>
25 #include <libspectrum.h>
27 #include "../libzymosis/zymosis.h"
28 #include "emucommon.h"
29 #include "emuvars.h"
32 ////////////////////////////////////////////////////////////////////////////////
33 typedef struct SDLJimBinding {
34 uint16_t sdlk;
35 uint16_t modvalue;
36 Jim_Obj *action;
37 struct SDLJimBinding *next;
38 } SDLJimBinding;
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);
80 #endif