[z88dk-dev] Ti file routines

Bridge to the z88dk-developers mailing list
Post Reply
Henk Poley

[z88dk-dev] Ti file routines

Post by Henk Poley »

Here is my newest version of the Ti-file-routines (I know, updating too
much)

I now only have to make lseek() and write() work, and maybe a bugfix here
and there... Some optimizations... (update_filepointers(), erm...)

hahhhh, finished :) ... almost :(

Are there any other routines that should be made? Like create(), remove(),
etc.

Are those open()/close() routines really ANSI C? I only have read about
fopen() (and the rest) in C-handbooks...

Okay I ask too much, but could you all please take look at the code, and
surch for possible bugs/opts... The Ti-83 filesystem is quite simple (it's
all RAM...)
So you don't have to know much about the Ti (just read the comments if you
don't understand)

Henk Poley
Stefano Bodrato

Post by Stefano Bodrato »

I've "ported" the compiler to some other Ti-83 shells :)

Cool

Like Zes and Venus, shells who don't have a "visual interface", but start
your programs directly from the prompt. (so you don't need an icon and a
program-description.)
And also Anova, an SOS compatible shell, which uses a 5-bytes icon (instead
of the 8-bytes with Ti-Explorer and Ashell).

Okay, not being funny but you probably want to be able to switch between
them easily, so it might be nice to use the -startup= idea - take a look
at z88_crt0.asm - it allows you to switch between different startups for a
machine without having different machine identifiers (i.e. +[]).

Please leave this to me !!



_______________________________________________
z88dk-developers mailing list
z88dk-developers@...
http://lists.sourceforge.net/lists/listinfo/z88dk-developers
Henk Poley

Post by Henk Poley »

[Dominic Morris wrote:]
On Wed, 7 Mar 2001, Stefano Bodrato wrote:
This could be a good start for the GBDK libraries support...

What? I'm not sure that z88dk can be retargetted to the gameboy without a
serious rethink about the generated code. The compiler produces pure z80,
using alternate registers where needed, this just couldn't be done for a
gameboy.

I think he ment that we could easely use the GBDK clib (not the asm part!)
on the z88dk, because all things are compatible (in a way).

Oh, we might be supporting a new machine quite soon, the
Xircom Rex 6000
which is a tiny PDA thing, unfortunately it comes without documentation
and has it's own proprietary API and stuff so the bulk of the z88dk
library won't be used (so no ANSI terminal/graphics Stefano!), so there's
virtually no porting - it's just guessing where to get/store the values
from the system calls - I think most of it maybe done now there's just a
few hanger-ons that I've got to find/disassemble etc

Xircom Rex 6000 is a beauty, "PDA thingy", hmm, it's the about size of a
creditcard, it has only 4 keys. Well, don't thing you'll be able to write
an ANSI-C keyboardhandler...
It has a small LCD display with icons and text, I think it has almost as
much pixels as the Ti-82/83(+), so the graphics-lib could be used, if you
find out how to write to the screen. (or memory mapped graphics?)

I've heard that it is possible to program for the thing, but they said was
kinda like difficult, so they probably ment assembly-programming. If so,
there should be some programming specs around.

I'll look if I can find anyting about it with Subme ( http://www.subme.com/
)
Maybe there are some good hidden specs/docs.

Henk Poley

_______________________________________________
z88dk-developers mailing list
z88dk-developers@...
http://lists.sourceforge.net/lists/listinfo/z88dk-developers
Stefano Bodrato

Post by Stefano Bodrato »

This could be a good start for the GBDK libraries support...

What? I'm not sure that z88dk can be retargetted to the gameboy without a
serious rethink about the generated code. The compiler produces pure z80,
using alternate registers where needed, this just couldn't be done for a
gameboy.

That wasn't my point.. I was thinking to compile GBDK C sources with the
Z88DK..


Oh, we might be supporting a new machine quite soon, the Xircom Rex 6000...

Yes, I noticed it. (It looks there is still a lot of interest around the Z80
cpu; I fount a curious "project 5" page, the new Zilog EZ80 CPU with web
capabilities, etc.) ?


... (so no ANSI terminal/graphics Stefano!)

We'll see...

Ah, is there already some-file-thing for the ZX Spectrum ? If yes, I'd like
to add Microdrive/Opus Discovery things in the future..





_______________________________________________
z88dk-developers mailing list
z88dk-developers@...
http://lists.sourceforge.net/lists/listinfo/z88dk-developers
Henk Poley

Post by Henk Poley »

[Dominic Morris wrote:]
Okay, I've had a look through, and here are some comments:

close.c - Icky not checking, but hey, WTF eh? BTW wouldn't it be better
to do a:
[..code..]
rather than the ldir stuff? - certainly less memory

Okay, I'll change that.. (but what do you mean with 'lcky'?)

lseek: Read a long from (hl) by call l_glong (it's a lib routine and as
long as you're code has a C wrapper (which it does!) it'll be defined)

Thanks, now I could find out (via the asm code of l_glong) how I should
read/return a long...

our "long blah = 1" would be stored as
DEFB 01h,00h,00h,00h
and loaded as:
HLDE = 1, where HLD=0 and and E = 1
so DE is the part I need to add to the *file_cursor
and HL is the part I'll need to check if it's zero (because files that big
don't exist on the Ti).

writebyte: Yes, z80asm should know the undocumented op-codes

Okay :)

I think the real test is to just to run the routines (maybe on an
emulator or something) - you can start at things all days long but until
you try them you don't find the bugs really.

I know... but first the "stare-at-it-Technology(TM)"...
And I haven't had the compiler working...

I already tried to compile it via linux (make...) but I got some errors
with one of the compiles and it aborted (with saying the very informative
string "error 2")...
Maybe it's because the directory was on my Win98 (FAT32) partition, but
that shouldn't be it.

Henk Poley

_______________________________________________
z88dk-developers mailing list
z88dk-developers@...
http://lists.sourceforge.net/lists/listinfo/z88dk-developers
Henk Poley

Post by Henk Poley »

writebyte: Yes, z80asm should know the undocumented op-codes

hmm, the only thing, the "undocumented OP-code" I used doesn't exist...
adding FD or DD will transform HL into IX or IY

so ld h,(hl)
will become ld h,(ix+n)
and not ld ixh,(hl)

Henk Poley


_______________________________________________
z88dk-developers mailing list
z88dk-developers@...
http://lists.sourceforge.net/lists/listinfo/z88dk-developers
Stefano Bodrato

Post by Stefano Bodrato »

Like Zes and Venus, shells who don't have a "visual interface", but start
your programs directly from the prompt. (so you don't need an icon and a
program-description.)
And also Anova, an SOS compatible shell, which uses a 5-bytes icon (instead
of the 8-bytes with Ti-Explorer and Ashell).

Okay, not being funny but you probably want to be able to switch between
them easily, so it might be nice to use the -startup= idea - take a look
at z88_crt0.asm - it allows you to switch between different startups for a
machine without having different machine identifiers (i.e. +[]).

Do you prefer a -startup=<shellname> or a -shell=<name> flag ?


_______________________________________________
z88dk-developers mailing list
z88dk-developers@...
http://lists.sourceforge.net/lists/listinfo/z88dk-developers
Stefano Bodrato

Post by Stefano Bodrato »

[Different startup files for the TI83 causing a mess - an easy switch
between them]

Do you prefer a -startup=<shellname> or a -shell=<name> flag ?

-startup= takes a number I'm afraid! I don't think z80asm does string
comparisons.

Ok. So 1 will be ION, 2 TI EXPLORER, etc...
Is it better to keep the -startup= parameter or, -shell= ?



_______________________________________________
z88dk-developers mailing list
z88dk-developers@...
http://lists.sourceforge.net/lists/listinfo/z88dk-developers
Stefano Bodrato

Post by Stefano Bodrato »

-startup usage with ti83_crt0:
1 (or undefined) - ION
2 - VENUS
3 - ZES
4 - ANOVA
5,6,7 - TI EXPLORER, Ashell, SOS (is there any difference?)

It seems the ports haven't been tested, Henk ! I'll do what I can.



_______________________________________________
z88dk-developers mailing list
z88dk-developers@...
http://lists.sourceforge.net/lists/listinfo/z88dk-developers
Post Reply