diff --git a/programs/develop/tinypy/tinypy/Makefile b/programs/develop/tinypy/tinypy/Makefile index e626c91269..b90fcef873 100644 --- a/programs/develop/tinypy/tinypy/Makefile +++ b/programs/develop/tinypy/tinypy/Makefile @@ -1,4 +1,4 @@ -NAME=tinypy +NAME = tinypy CC = kos32-gcc LD = kos32-ld @@ -13,24 +13,24 @@ CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -mpreferred-stack-boundary=2 \ INCLUDES= -I. -I$(SDK_DIR)/sources/newlib/libc/include LIBPATH:= -L $(SDK_DIR)/lib -L /home/autobuild/tools/win32/mingw32/lib -KOLIBRI_M_OBJ= ../modules/kolibri/init.o \ - ../modules/kolibri/fs.o \ - ../modules/kolibri/net.o \ - ../modules/kolibri/gui.o \ - ../modules/kolibri/debug.o \ - - -OBJECTS = tpmain.o $(KOLIBRI_M_OBJ) +MODULES_DIR = $(abspath ../modules) -all:$(NAME) +MODULES_OBJ = $(MODULES_DIR)/kolibri/init.o \ + $(MODULES_DIR)/kolibri/fs.o \ + $(MODULES_DIR)/kolibri/net.o \ + $(MODULES_DIR)/kolibri/gui.o \ + $(MODULES_DIR)/kolibri/debug.o + +OBJECTS = tpmain.o $(MODULES_OBJ) + +all: $(NAME) $(NAME): $(OBJECTS) - $(LD) $(LIBPATH) --subsystem native -o $@ $(OBJECTS) $(LDFLAGS) -n -Map $(NAME).map - kos32-objcopy $@ -O binary - kpack $@ + $(LD) $(LIBPATH) --subsystem native -o $@ $(OBJECTS) $(LDFLAGS) -n # -Map $(NAME).map + objcopy $@ -O binary %.o : %.c Makefile $(CC) -c $(INCLUDES) $(CFLAGS) -o $@ $< clean: - rm -f *.o $(NAME).map $(KOLIBRI_M_OBJ) + rm -f *.o $(NAME).map $(MODULES_OBJ) diff --git a/programs/develop/tinypy/tinypy/koconsole.c b/programs/develop/tinypy/tinypy/koconsole.c index e5fedd29a0..3eaed26678 100644 --- a/programs/develop/tinypy/tinypy/koconsole.c +++ b/programs/develop/tinypy/tinypy/koconsole.c @@ -8,6 +8,7 @@ void (* _stdcall con_init)(unsigned w_w, unsigned w_h, unsigned s_w, unsigned s_ int (* _cdecl con_printf)(const char* format,...); void (* _stdcall con_exit)(char bCloseWindow); void (* __stdcall con_gets)(char* str, int n); +void (* _stdcall con_set_title)(const char* title); void CONSOLE_INIT(const char title[]) { @@ -21,7 +22,9 @@ void CONSOLE_INIT(const char title[]) !(con_gets = ( __stdcall void (*)(char*, int)) kol_cofflib_procload (imp, "con_gets"))|| !(con_exit = ( _stdcall void (*)(char)) - kol_cofflib_procload (imp, "con_exit"))) + kol_cofflib_procload (imp, "con_exit")) || + !(con_set_title = ( _stdcall void (*)(const char*)) + kol_cofflib_procload (imp, "con_set_title"))) { kol_exit(); } diff --git a/programs/develop/tinypy/tinypy/test.py b/programs/develop/tinypy/tinypy/test.py index 86fa808a25..fc86f2bb76 100644 --- a/programs/develop/tinypy/tinypy/test.py +++ b/programs/develop/tinypy/tinypy/test.py @@ -9,13 +9,13 @@ def onkey(): def onbtn(): print("Button pressed") -if __name__=="__main__": - kolibri.debug_print("Debug test line\n") - w = kolibri.window(10,10,400, 400, False) - w.on_show = onshow - w.on_key = onkey - w.on_button = onbtn - w.show() - print("running") - w.run() - print("Exit") + +kolibri.debug_print("Debug test line\n") +w = kolibri.window(10,10,400, 400, False) +w.on_show = onshow +w.on_key = onkey +w.on_button = onbtn +w.show() +print("running") +w.run() +print("Exit") diff --git a/programs/develop/tinypy/tinypy/tpmain.c b/programs/develop/tinypy/tinypy/tpmain.c index a9e965c2cb..4114570db1 100644 --- a/programs/develop/tinypy/tinypy/tpmain.c +++ b/programs/develop/tinypy/tinypy/tpmain.c @@ -1,19 +1,22 @@ -#include "tp.c" /* INCLUDE */ -const char header[]="TinyPy for kolibriOS"; +#include "tp.c" -//extern void kolibri_dbg_init(tp_vm *tp); //__attribute__((__stdcall__)); +const char header[] = "TinyPy for KolibriOS"; -void main(int argc, const char *argv[]) { +int main(int argc, const char *argv[]) { + /* INIT */ tp_vm *tp = tp_init(argc, argv); kolibri_init(tp); CONSOLE_INIT(header); - /* INIT */ tp_call(tp,"py2bc","tinypy",tp_None); - con_printf("Done"); +// con_printf("Done"); tp_deinit(tp); - kol_exit(); - return; + + // Exit console + con_exit(0); + + // Exit program + return 0; } /**/