tinypy: minor fixes

git-svn-id: svn://kolibrios.org@8476 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
maxcodehack 2020-12-26 11:49:39 +00:00
parent 6db1f4dd5a
commit 0f14837705
4 changed files with 39 additions and 33 deletions

View File

@ -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 \
MODULES_DIR = $(abspath ../modules)
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 $(KOLIBRI_M_OBJ)
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)

View File

@ -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();
}

View File

@ -9,7 +9,7 @@ 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

View File

@ -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;
}
/**/