Skip to content

Commit ce7ecd5

Browse files
committed
moved lua source
1 parent eff3ce2 commit ce7ecd5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+81
-60
lines changed

Makefile.am

+65-60
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ CMCFLAGS += -I$(b)/gen
1515
CMCFLAGS += -I$(s)/src/jit
1616
CMCFLAGS += -I$(s)/src
1717
CMCFLAGS += -I$(s)/libfsemu/include
18-
CMCFLAGS += -I$(s)/libfsemu/src/lua
1918
CMCFLAGS += @FREETYPE_CFLAGS@
2019
CMCFLAGS += @GLIB_CFLAGS@
2120
CMCFLAGS += @LUA_CFLAGS@
@@ -89,7 +88,6 @@ fs_uae_SOURCES = \
8988
libfsemu/src/emu/audio_sdl.c \
9089
libfsemu/src/emu/dialog.c \
9190
libfsemu/src/emu/emu.c \
92-
libfsemu/src/emu/emu_lua.c \
9391
libfsemu/src/emu/font.c \
9492
libfsemu/src/emu/hud.c \
9593
libfsemu/src/emu/input.c \
@@ -113,38 +111,6 @@ fs_uae_SOURCES = \
113111
libfsemu/src/init.c \
114112
libfsemu/src/list.c \
115113
libfsemu/src/log.c \
116-
libfsemu/src/lua/lapi.c \
117-
libfsemu/src/lua/lauxlib.c \
118-
libfsemu/src/lua/lbaselib.c \
119-
libfsemu/src/lua/lbitlib.c \
120-
libfsemu/src/lua/lcode.c \
121-
libfsemu/src/lua/lcorolib.c \
122-
libfsemu/src/lua/lctype.c \
123-
libfsemu/src/lua/ldblib.c \
124-
libfsemu/src/lua/ldebug.c \
125-
libfsemu/src/lua/ldo.c \
126-
libfsemu/src/lua/ldump.c \
127-
libfsemu/src/lua/lfunc.c \
128-
libfsemu/src/lua/lgc.c \
129-
libfsemu/src/lua/linit.c \
130-
libfsemu/src/lua/liolib.c \
131-
libfsemu/src/lua/llex.c \
132-
libfsemu/src/lua/lmathlib.c \
133-
libfsemu/src/lua/lmem.c \
134-
libfsemu/src/lua/loadlib.c \
135-
libfsemu/src/lua/lobject.c \
136-
libfsemu/src/lua/lopcodes.c \
137-
libfsemu/src/lua/loslib.c \
138-
libfsemu/src/lua/lparser.c \
139-
libfsemu/src/lua/lstate.c \
140-
libfsemu/src/lua/lstring.c \
141-
libfsemu/src/lua/lstrlib.c \
142-
libfsemu/src/lua/ltable.c \
143-
libfsemu/src/lua/ltablib.c \
144-
libfsemu/src/lua/ltm.c \
145-
libfsemu/src/lua/lundump.c \
146-
libfsemu/src/lua/lvm.c \
147-
libfsemu/src/lua/lzio.c \
148114
libfsemu/src/ml/clock.c \
149115
libfsemu/src/ml/config.c \
150116
libfsemu/src/ml/input.c \
@@ -237,7 +203,6 @@ fs_uae_SOURCES = \
237203
src/fs-uae/input.c \
238204
src/fs-uae/joystick.c \
239205
src/fs-uae/keyboard.c \
240-
src/fs-uae/luascript.c \
241206
src/fs-uae/main.c \
242207
src/fs-uae/menu.c \
243208
src/fs-uae/mouse.c \
@@ -258,7 +223,6 @@ fs_uae_SOURCES = \
258223
src/jit/compemu_fpp.cpp \
259224
src/jit/compemu_support.cpp \
260225
src/keybuf.cpp \
261-
src/luascript.cpp \
262226
src/main.cpp \
263227
src/memory.cpp \
264228
src/missing.cpp \
@@ -379,6 +343,47 @@ fs_uae_SOURCES += \
379343
libudis86/src/udis86.c
380344
endif
381345

346+
if WITH_LUA
347+
AM_CPPFLAGS += -I$(s)/lua/src
348+
fs_uae_SOURCES += \
349+
libfsemu/src/emu/emu_lua.c \
350+
src/fs-uae/luascript.c \
351+
src/luascript.cpp \
352+
fs_uae_SOURCES += \
353+
lua/src/lapi.c \
354+
lua/src/lauxlib.c \
355+
lua/src/lbaselib.c \
356+
lua/src/lbitlib.c \
357+
lua/src/lcode.c \
358+
lua/src/lcorolib.c \
359+
lua/src/lctype.c \
360+
lua/src/ldblib.c \
361+
lua/src/ldebug.c \
362+
lua/src/ldo.c \
363+
lua/src/ldump.c \
364+
lua/src/lfunc.c \
365+
lua/src/lgc.c \
366+
lua/src/linit.c \
367+
lua/src/liolib.c \
368+
lua/src/llex.c \
369+
lua/src/lmathlib.c \
370+
lua/src/lmem.c \
371+
lua/src/loadlib.c \
372+
lua/src/lobject.c \
373+
lua/src/lopcodes.c \
374+
lua/src/loslib.c \
375+
lua/src/lparser.c \
376+
lua/src/lstate.c \
377+
lua/src/lstring.c \
378+
lua/src/lstrlib.c \
379+
lua/src/ltable.c \
380+
lua/src/ltablib.c \
381+
lua/src/ltm.c \
382+
lua/src/lundump.c \
383+
lua/src/lvm.c \
384+
lua/src/lzio.c
385+
endif
386+
382387
if BUILTIN_LIBMPEG2
383388
AM_CPPFLAGS += -I$(s)/libmpeg2/include
384389
fs_uae_LDADD += \
@@ -524,30 +529,30 @@ noinst_HEADERS = \
524529
libfsemu/src/emu/video.h \
525530
libfsemu/src/emu/video_buffer.h \
526531
libfsemu/src/emu/xml_shader.h \
527-
libfsemu/src/lua/lapi.h \
528-
libfsemu/src/lua/lauxlib.h \
529-
libfsemu/src/lua/lcode.h \
530-
libfsemu/src/lua/lctype.h \
531-
libfsemu/src/lua/ldebug.h \
532-
libfsemu/src/lua/ldo.h \
533-
libfsemu/src/lua/lfunc.h \
534-
libfsemu/src/lua/lgc.h \
535-
libfsemu/src/lua/llex.h \
536-
libfsemu/src/lua/llimits.h \
537-
libfsemu/src/lua/lmem.h \
538-
libfsemu/src/lua/lobject.h \
539-
libfsemu/src/lua/lopcodes.h \
540-
libfsemu/src/lua/lparser.h \
541-
libfsemu/src/lua/lstate.h \
542-
libfsemu/src/lua/lstring.h \
543-
libfsemu/src/lua/ltable.h \
544-
libfsemu/src/lua/ltm.h \
545-
libfsemu/src/lua/lua.h \
546-
libfsemu/src/lua/luaconf.h \
547-
libfsemu/src/lua/lualib.h \
548-
libfsemu/src/lua/lundump.h \
549-
libfsemu/src/lua/lvm.h \
550-
libfsemu/src/lua/lzio.h \
532+
lua/src/lapi.h \
533+
lua/src/lauxlib.h \
534+
lua/src/lcode.h \
535+
lua/src/lctype.h \
536+
lua/src/ldebug.h \
537+
lua/src/ldo.h \
538+
lua/src/lfunc.h \
539+
lua/src/lgc.h \
540+
lua/src/llex.h \
541+
lua/src/llimits.h \
542+
lua/src/lmem.h \
543+
lua/src/lobject.h \
544+
lua/src/lopcodes.h \
545+
lua/src/lparser.h \
546+
lua/src/lstate.h \
547+
lua/src/lstring.h \
548+
lua/src/ltable.h \
549+
lua/src/ltm.h \
550+
lua/src/lua.h \
551+
lua/src/luaconf.h \
552+
lua/src/lualib.h \
553+
lua/src/lundump.h \
554+
lua/src/lvm.h \
555+
lua/src/lzio.h \
551556
libfsemu/src/ml/manymouse/manymouse.h \
552557
libfsemu/src/ml/ml_internal.h \
553558
libudis86/src/decode.h \

libfsemu/src/emu/render.c

+2
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,9 @@ static void render_overlays(void) {
912912
}
913913

914914
static void render_frame(double alpha, int perspective) {
915+
#ifdef WITH_LUA
915916
fs_emu_lua_run_handler("on_fs_emu_render_frame");
917+
#endif
916918

917919
#ifdef WITH_LUA
918920

libfsemu/src/emu/video.c

+2
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ void fs_emu_video_init_opengl() {
193193
#ifdef WITH_XML_SHADER
194194
fs_emu_xml_shader_init();
195195
#endif
196+
#ifdef WITH_LUA
196197
fs_emu_lua_run_handler("on_fs_emu_init_video");
198+
#endif
197199
}
198200

199201
void fs_emu_toggle_fullscreen() {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/fs-uae/main.c

+12
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,17 @@ void fs_uae_process_input_event(int line, int action, int state, int playback) {
180180
}
181181

182182
if (load_state) {
183+
#ifdef WITH_LUA
183184
fs_log("run handler on_fs_uae_load_state\n");
184185
fs_emu_lua_run_handler("on_fs_uae_load_state");
186+
#endif
185187
record_event = 0;
186188
}
187189
else if (save_state) {
190+
#ifdef WITH_LUA
188191
fs_log("run handler on_fs_uae_save_state\n");
189192
fs_emu_lua_run_handler("on_fs_uae_save_state");
193+
#endif
190194
record_event = 0;
191195
}
192196

@@ -196,12 +200,16 @@ void fs_uae_process_input_event(int line, int action, int state, int playback) {
196200
amiga_send_input_event(action, state);
197201

198202
if (load_state) {
203+
#ifdef WITH_LUA
199204
fs_log("run handler on_fs_uae_load_state_done\n");
200205
fs_emu_lua_run_handler("on_fs_uae_load_state_done");
206+
#endif
201207
}
202208
else if (save_state) {
209+
#ifdef WITH_LUA
203210
fs_log("run handler on_fs_uae_save_state_done\n");
204211
fs_emu_lua_run_handler("on_fs_uae_save_state_done");
212+
#endif
205213
}
206214
}
207215

@@ -211,7 +219,9 @@ static int input_handler_loop(int line) {
211219
static int last_frame = -1;
212220
if (g_fs_uae_frame != last_frame) {
213221
// only run this for the first input handler loop per frame
222+
#ifdef WITH_LUA
214223
fs_emu_lua_run_handler("on_fs_uae_read_input");
224+
#endif
215225
last_frame = g_fs_uae_frame;
216226
}
217227

@@ -227,7 +237,9 @@ static int input_handler_loop(int line) {
227237

228238
g_fs_uae_last_input_event = action;
229239
g_fs_uae_last_input_event_state = state;
240+
#ifdef WITH_LUA
230241
fs_emu_lua_run_handler("on_fs_uae_input_event");
242+
#endif
231243

232244
// handler can modify input event
233245
//action = g_fs_uae_last_input_event;

0 commit comments

Comments
 (0)