Hi,
The z88dk devel kit works fine for my ti83 regular.
Thank you for this great software
It's not so easy to make it working because for ti83 regular without shell you need to squish code so your -create-app doesn't works.
I must use :
all:
zcc +ti83ansi -lm -startup=10 -o hello hello.c
bin2bin83 hello
bin2var output.bin OUTPUT.83p
clean:
rm *.83p
Here bin2bin83 is for squishing.
bin2var is to replace -create-app.
-startup=10 is for plain TIOS (no shell).
The generated code is a bit long but it works
see http://www.yaronet.com/posts.php?s=138500
But when I try to use gray.h lib I got a compilation error (linker I think?!).
tib@cobra:~/Code/z80/C/gray$ make
zcc +ti83ansi -lm -startup=10 -o hello hello.c
cp /usr/share/z88dk/lib/ti83_crt0.opt /tmp/tmpXXWvhZpD.opt
cp /tmp/tmpXXWvhZpD.opt /tmp/tmpXXWvhZpD.asm
z88dk-zcpp -I. -DZ80 -DSMALL_C -DTI83 -D__TI83__ -DSCCZ80 -I/usr/share/z88dk/include hello.c /tmp/tmpXXkBTfBp.i
z88dk-sccz80 -// -startup=10 /tmp/tmpXXkBTfBp.i
z88dk-copt /usr/share/z88dk/lib/z80rules.2 < /tmp/tmpXXkBTfBp.asm > /tmp/tmpXXkBTfBp.op1
z88dk-copt /usr/share/z88dk/lib/z80rules.1 < /tmp/tmpXXkBTfBp.op1 > /tmp/tmpXXkBTfBp.opt
z88dk-z80asm -eopt -ns -Mo /tmp/tmpXXkBTfBp.opt
z88dk-z80asm -a -m -Mo -ohello -i/usr/share/z88dk/lib/clibs/gen_math -i/usr/share/z88dk/lib/clibs/ndos -i/usr/share/z88dk/lib/clibs/ti83ansi_clib -i/usr/share/z88dk/lib/clibs/z80_crt0 /tmp/tmpXXWvhZpD.opt /tmp/tmpXXkBTfBp.o
1 errors occurred during assembly
Key to filenames:
/tmp/tmpXXkBTfBp.o = hello.c
File '/tmp/tmpXXkBTfBp.asm', Module 'HELLO', Symbol not defined
Error in expression G_PLOT
make: *** [all] Error 1
Here is the code :
1 #include <stdio.h>
2 #include <gray.h>
3
4 main() {
5
6 printf("hello world\n\n\n\n");
7 while (1) {
8 // ne finit jamais
9 g_plot(4, 4, 0);
10 }
11
12
13 }
I got the same error while compiling startrek example code snippets (no error for tictactoe and ansi test example).
What is the problem?
Is there some path variable to define to say to linker where is gray.h (in my case it's /usr/share/z88dk/include/gray.h)
Could you help me please?
Best regards.
Thibault Duponchelle.
Need some help to use graylib functions.
Ciao Thibault !
I will try to compile your code and try to find out what's wrong.
What happens if you try to compile the default example ?
http://z88dk.cvs.sourceforge.net/viewvc ... /graygfx.c
I will try to compile your code and try to find out what's wrong.
What happens if you try to compile the default example ?
http://z88dk.cvs.sourceforge.net/viewvc ... /graygfx.c
Hi,
I just have found the reason...
In fact I have to add a -ltigray83 in the command line to specify to link explicitly the tigray lib like this :
all:
zcc +ti83ansi -ltigray83 -startup=10 -o hello hello.c
bin2bin83 hello
bin2var output.bin OUTPUT.83p
clean:
rm *.83p
It works fine on emulator
That's cool !
Just one little question :
Why the generated code is so big ?
Thank you for the answer
Regards
Thibault
I just have found the reason...
In fact I have to add a -ltigray83 in the command line to specify to link explicitly the tigray lib like this :
all:
zcc +ti83ansi -ltigray83 -startup=10 -o hello hello.c
bin2bin83 hello
bin2var output.bin OUTPUT.83p
clean:
rm *.83p
It works fine on emulator
That's cool !
Just one little question :
Why the generated code is so big ?
Thank you for the answer
Regards
Thibault
Re,
I suspected the answer was the stdio.h even if I have asked the question
Does only the used function add some code defs?
I would mean : is the other function definition in the generated code or only if these one that were used really?
You should already know that TI z80 have two police (called by _vputs and _puts) included in the system (rom call).
One is used by classic home screen (one char is a sprite of 5 pixels by 7 pixels), the other is the graph (smaller police coordinates are in pixel).
Is it a reason to implement another police?
Is the code generated smaller if I use +83 instead +ti83ansi ?
(The file size is a major concern of TI z80 developer)
Thank you for your answer
Regards
Thibault
edit : And the graygfx example code works fine too
I suspected the answer was the stdio.h even if I have asked the question
Does only the used function add some code defs?
I would mean : is the other function definition in the generated code or only if these one that were used really?
You should already know that TI z80 have two police (called by _vputs and _puts) included in the system (rom call).
One is used by classic home screen (one char is a sprite of 5 pixels by 7 pixels), the other is the graph (smaller police coordinates are in pixel).
Is it a reason to implement another police?
Is the code generated smaller if I use +83 instead +ti83ansi ?
(The file size is a major concern of TI z80 developer)
Thank you for your answer
Regards
Thibault
edit : And the graygfx example code works fine too
Last edited by contra-sh on Mon Feb 28, 2011 8:30 pm, edited 1 time in total.
Re,
Could you help me to compile this code please :
#include <graphics.h>
#include <malloc.h>
#include <gui.h>
main()
{
struct gui_win win;
win->x = 30; win->y = 15;
win->flags = WIN_BORDER|WIN_SHADOW;
win->height = 20; win->width = 40;
win_open (win);
}
I currently use :
zcc +ti83 -lmalloc -lx11 -startup=10 -o gfx gfx.c
But it give me an error :
cp /usr/share/z88dk/lib/ti83_crt0.opt /tmp/tmpXX2uoyMH.opt
cp /tmp/tmpXX2uoyMH.opt /tmp/tmpXX2uoyMH.asm
z88dk-zcpp -I. -DZ80 -DSMALL_C -DTI83 -D__TI83__ -DSCCZ80 -I/usr/share/z88dk/include gfx.c /tmp/tmpXXVxwD4W.i
z88dk-sccz80 -// -startup=10 /tmp/tmpXXVxwD4W.i
z88dk-copt /usr/share/z88dk/lib/z80rules.2 < /tmp/tmpXXVxwD4W.asm > /tmp/tmpXXVxwD4W.op1
z88dk-copt /usr/share/z88dk/lib/z80rules.1 < /tmp/tmpXXVxwD4W.op1 > /tmp/tmpXXVxwD4W.opt
z88dk-z80asm -eopt -ns -Mo /tmp/tmpXXVxwD4W.opt
z88dk-z80asm -a -m -Mo -ogfx -i/usr/share/z88dk/lib/clibs/x11 -i/usr/share/z88dk/lib/clibs/malloc -i/usr/share/z88dk/lib/clibs/ndos -i/usr/share/z88dk/lib/clibs/ti83_clib -i/usr/share/z88dk/lib/clibs/z80_crt0 /tmp/tmpXX2uoyMH.opt /tmp/tmpXXVxwD4W.o
2 errors occurred during assembly
Key to filenames:
/tmp/tmpXXVxwD4W.o = gfx.c
File '/usr/share/z88dk/lib/clibs/malloc.lib', Module 'FREE', Symbol not defined
Error in expression _HEAP
File '/usr/share/z88dk/lib/clibs/malloc.lib', Module 'MALLOC', Symbol not defined
Error in expression _HEAP
Why does it talk about free and heap (malloc is well defined and linked... it seems)?
(if I drop -lmalloc I get 10 or more malloc errors)
An idea?
Best regards.
Thibault
Could you help me to compile this code please :
#include <graphics.h>
#include <malloc.h>
#include <gui.h>
main()
{
struct gui_win win;
win->x = 30; win->y = 15;
win->flags = WIN_BORDER|WIN_SHADOW;
win->height = 20; win->width = 40;
win_open (win);
}
I currently use :
zcc +ti83 -lmalloc -lx11 -startup=10 -o gfx gfx.c
But it give me an error :
cp /usr/share/z88dk/lib/ti83_crt0.opt /tmp/tmpXX2uoyMH.opt
cp /tmp/tmpXX2uoyMH.opt /tmp/tmpXX2uoyMH.asm
z88dk-zcpp -I. -DZ80 -DSMALL_C -DTI83 -D__TI83__ -DSCCZ80 -I/usr/share/z88dk/include gfx.c /tmp/tmpXXVxwD4W.i
z88dk-sccz80 -// -startup=10 /tmp/tmpXXVxwD4W.i
z88dk-copt /usr/share/z88dk/lib/z80rules.2 < /tmp/tmpXXVxwD4W.asm > /tmp/tmpXXVxwD4W.op1
z88dk-copt /usr/share/z88dk/lib/z80rules.1 < /tmp/tmpXXVxwD4W.op1 > /tmp/tmpXXVxwD4W.opt
z88dk-z80asm -eopt -ns -Mo /tmp/tmpXXVxwD4W.opt
z88dk-z80asm -a -m -Mo -ogfx -i/usr/share/z88dk/lib/clibs/x11 -i/usr/share/z88dk/lib/clibs/malloc -i/usr/share/z88dk/lib/clibs/ndos -i/usr/share/z88dk/lib/clibs/ti83_clib -i/usr/share/z88dk/lib/clibs/z80_crt0 /tmp/tmpXX2uoyMH.opt /tmp/tmpXXVxwD4W.o
2 errors occurred during assembly
Key to filenames:
/tmp/tmpXXVxwD4W.o = gfx.c
File '/usr/share/z88dk/lib/clibs/malloc.lib', Module 'FREE', Symbol not defined
Error in expression _HEAP
File '/usr/share/z88dk/lib/clibs/malloc.lib', Module 'MALLOC', Symbol not defined
Error in expression _HEAP
Why does it talk about free and heap (malloc is well defined and linked... it seems)?
(if I drop -lmalloc I get 10 or more malloc errors)
An idea?
Best regards.
Thibault
Last edited by contra-sh on Mon Feb 28, 2011 10:59 pm, edited 1 time in total.
You could try using +ti83 rather than ti83ansi - that looks like it uses ROM routines rather than the ANSI terminal driver.contra-sh wrote:You should already know that TI z80 have two police (called by _vputs and _puts) included in the system (rom call).
One is used by classic home screen (one char is a sprite of 5 pixels by 7 pixels), the other is the graph (smaller police coordinates are in pixel).
Looking at the wiki, http://www.z88dk.org/wiki/doku.php?id=l ... allocation it looks like you need to specify where the heap is located - this obviously varies on a per target and program basis.contra-sh wrote:Re,
Could you help me to compile this code please :
Thank you very very muchdom wrote:Looking at the wiki, http://www.z88dk.org/wiki/doku.php?id=l ... allocation it looks like you need to specify where the heap is located - this obviously varies on a per target and program basis.
That's was exactly the problem.
Sorry to do not have found by myself and wasted a part of your time
Here a screenhsot wich demonstrates how it works on ti emulator
Best regards.
And thank you
Thibault.
About the resulting code size when 'stdio0 is used.. are you using the old 1.9 versio ?
Have you tried a recent build ?
http://nightly.z88dk.org/
Have you tried a recent build ?
http://nightly.z88dk.org/