Jump to content

Photo

Best C Cross Compiler for TI-99/4A? Possibly with conio.h?

C Cross Compiler Conio

38 replies to this topic

#1 Fabrizio Caruso OFFLINE  

Fabrizio Caruso

    Space Invader

  • 44 posts

Posted Wed Jul 26, 2017 6:27 AM

Hi!

I am writing an open source cross-platform game for *all* 8-bit computer with enough RAM (about 28-30k).

https://github.com/F...-CHASE/releases
My game is written in  ANSI C + conio.h + few patches for a couple of specific targets.
It already exists for about 16 different 8-bit computers/configurations with 6502 and Z80 CPUs.
I would like to make a version for computers with "alternative" CPUs such as the TI-99/4A.

What is the easiest solution for a C cross compiler that could generate code for the TI-99/4A?

Ideally I would like to have conio.h for input/output but I can live without it as long as I get:
1. [output] a function to print a given ASCII character at x,y
2. [input] a function to read the keyboard without waiting for a key press

Any suggestions?

   Fabrizio



#2 Lee Stewart OFFLINE  

Lee Stewart

    River Patroller

  • 3,386 posts
  • Location:Silver Run, Maryland

Posted Wed Jul 26, 2017 6:47 AM

Well, there is GCC for the TI in this forum.  It is currently maintained and should fit your needs.  There is also C99 here somewhere, as well.

 

...lee



#3 TheMole OFFLINE  

TheMole

    Dragonstomper

  • 760 posts
  • Location:Belgium

Posted Wed Jul 26, 2017 6:50 AM

There's really only one, but it's a pretty descent port of gcc (version 4.4), and can be found here: http://atariage.com/...i/#entry2028632

The biggest hurdle is getting it up and running on non-Linux systems, but it has been succesfully compiled on macOS and Windows, so it does work.

 

Unfortunately, I'm not aware of a conio.h implementation that's compatible with the TI, but it should be easy enough to put one together. There is Tursi's libti99 though, which is the go-to library for interacting with the computer's HW (screen, keyboard, joysticks, sound, ...): https://github.com/tursilion/libti99

 

Cool idea, by the way, looking forward to seeing the TI supported!

 

*edit* Lee beat me to the punch...

And true, I forgot about c99c ( http://ti99-geek.nl/.../c99c/c99c.html), but I do want to add that that is a small-c compiler only, not ANSI C compliant in any way.


Edited by TheMole, Wed Jul 26, 2017 7:03 AM.


#4 F.G. Kaal OFFLINE  

F.G. Kaal

    Space Invader

  • 29 posts

Posted Sat Jul 29, 2017 8:23 AM

C99C is written by Clint Pulley and all credits should go to him.

(I only created a few optimizers and I still like C99C).

 

Fred ;-)



#5 Fabrizio Caruso OFFLINE  

Fabrizio Caruso

    Space Invader

  • Topic Starter
  • 44 posts

Posted Thu Nov 2, 2017 8:08 AM

Hi !

 

I have tried to compile my universal 8 bit game CROSS CHASE
https://github.com/F...uso/CROSS-CHASE

 

with C99C but I soon realized it is not possible because C99C is far from being an ANSI C compiler.
CMOC, CC65 and Z88DK all manage to compile my game for more than 50 different configurations.

I have also tried a precompiled version GCC 6809 for Cygwin but it seems to do nothing with the input files...

I would like to compile my game for the Ti 99 but I have not been able to find anything close to the other 8 bit cross compilers.

Any suggestion? Who has succeded in compiling anything in half-modern C (e.g., possibly with extern , // comments, etc.)

  Fabrizio


Edited by Fabrizio Caruso, Thu Nov 2, 2017 8:09 AM.


#6 Lee Stewart OFFLINE  

Lee Stewart

    River Patroller

  • 3,386 posts
  • Location:Silver Run, Maryland

Posted Thu Nov 2, 2017 9:18 AM

Hi !

 

I have tried to compile my universal 8 bit game CROSS CHASE
https://github.com/F...uso/CROSS-CHASE

 

with C99C but I soon realized it is not possible because C99C is far from being an ANSI C compiler.
CMOC, CC65 and Z88DK all manage to compile my game for more than 50 different configurations.

I have also tried a precompiled version GCC 6809 for Cygwin but it seems to do nothing with the input files...

I would like to compile my game for the Ti 99 but I have not been able to find anything close to the other 8 bit cross compilers.

Any suggestion? Who has succeded in compiling anything in half-modern C (e.g., possibly with extern , // comments, etc.)

  Fabrizio

 

Have you tried GCC for the TI, yet?

 

...lee



#7 Fabrizio Caruso OFFLINE  

Fabrizio Caruso

    Space Invader

  • Topic Starter
  • 44 posts

Posted Thu Nov 2, 2017 9:25 AM

I thought the Cygwin version is just a port of GCC for TI, which does not work for me.

GCC for TI does not come in a precompiled version and I am scared about the complicated compilation process and all the reported problems.
The latest report on a different thread was about errors.
I would try it if someone reported that it works for medium/big projects.



#8 Lee Stewart OFFLINE  

Lee Stewart

    River Patroller

  • 3,386 posts
  • Location:Silver Run, Maryland

Posted Thu Nov 2, 2017 9:31 AM

I am pretty sure that both Tursi and TheMole have compiled sizable projects with it.  They should be along shortly to discuss it.  I believe others have used it successfully, as well.  I have not yet used it, even though C is my favorite non-TI-99/4A language.  On the 4A, my fave is Forth, which is no surprise, I'm sure.

 

...lee



#9 Tursi OFFLINE  

Tursi

    River Patroller

  • 4,823 posts
  • HarmlessLion
  • Location:BUR

Posted Thu Nov 2, 2017 10:13 AM

The GCC port includes a script to build it in whatever environment you're in, you should be able to make that go for you (I did it in Cygwin in the past, my recent build used the Windows Subsystem for Linux. If it works there, it should work anywhere).

c99 is K&R syntax, so modern apps require a bit of work to even try to build there.

As far as conio goes, I've got a function that handles printing anywhere in my libti99, as well as functions to switch to 40 column if that helps. You can link it or just rip them out as needed. ;) http://github.com/tursilion/libti99

#10 Tursi OFFLINE  

Tursi

    River Patroller

  • 4,823 posts
  • HarmlessLion
  • Location:BUR

Posted Thu Nov 2, 2017 10:14 AM

Oh, I'd previously built Text Elite with the GCC compiler, but floats were not well supported then and that caused me some grief. Converting ints to chars and back was sometimes an issue. But the compiler has seen a lot of updates since then and is pretty well stable.

#11 Fabrizio Caruso OFFLINE  

Fabrizio Caruso

    Space Invader

  • Topic Starter
  • 44 posts

Posted Thu Nov 2, 2017 11:54 AM

I have tried the Cygwin precompiled version, but it does not seem to work for me.

I have moved the dll files in /bin as described in the readme file but the compiler does nothing with the input files.

 

Where can I find a working version for Cygwin?
If there is no working pre-build Cygwin version where can I at least find a detailed (possibly not too hard) description for the build process for Cygwin?

 


Edited by Fabrizio Caruso, Thu Nov 2, 2017 11:55 AM.


#12 Tursi OFFLINE  

Tursi

    River Patroller

  • 4,823 posts
  • HarmlessLion
  • Location:BUR

Posted Thu Nov 2, 2017 4:05 PM

Post one of the GCC thread has the patches and the installer -- use the installer to automate the build. - http://atariage.com/...r-the-ti/page-1

 

(Post 1 also has the manual build instructions right above the changelist).

 

I couldn't find the instructions for the installer script, but I know they are in there. I've used it a couple times myself and it goes out and downloads stuff for you. ;) But the manual build isn't too hard!



#13 Fabrizio Caruso OFFLINE  

Fabrizio Caruso

    Space Invader

  • Topic Starter
  • 44 posts

Posted Thu Nov 2, 2017 7:00 PM

I am trying to run install under Cygwin. I guess some files are missing. Maybe in the end it will work. For the moment I am not yet there.

$ ./install.sh ../gcc_ti99
Using these patches:
    binutils-2.19.1-tms9900-1.7.patch
    gcc-4.4.0-tms9900-1.16.patch

=== Creating output directory ===
=== Getting Binutils sources ===
--2017-11-03 02:41:30--  http://ftp.gnu.org/g...-2.19.1.tar.bz2
Resolving ftp.gnu.org (ftp.gnu.org)... 208.118.235.20
Connecting to ftp.gnu.org (ftp.gnu.org)|208.118.235.20|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 16306586 (16M) [application/x-bzip2]
Saving to: ‘binutils-2.19.1.tar.bz2’

binutils-2.19.1.tar 100%[===================>]  15.55M   312KB/s    in 70s

2017-11-03 02:42:41 (228 KB/s) - ‘binutils-2.19.1.tar.bz2’ saved [16306586/16306586]

=== Getting GCC sources ===
--2017-11-03 02:42:41--  http://ftp.gnu.org/g...cc-4.4.0.tar.gz
Resolving ftp.gnu.org (ftp.gnu.org)... 208.118.235.20, 2001:4830:134:3::b
Connecting to ftp.gnu.org (ftp.gnu.org)|208.118.235.20|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 81816176 (78M) [application/x-gzip]
Saving to: ‘gcc-4.4.0.tar.gz’

gcc-4.4.0.tar.gz    100%[===================>]  78.03M   132KB/s    in 7m 16s

2017-11-03 02:49:57 (183 KB/s) - ‘gcc-4.4.0.tar.gz’ saved [81816176/81816176]

=== Make build directory ===
=== Decompressing and patching Binutils sources ===
./install.sh: line 83: patch: command not found
=== Failed to patch Binutils sources ===
 


Edited by Fabrizio Caruso, Thu Nov 2, 2017 7:53 PM.


#14 unhuman OFFLINE  

unhuman

    Stargunner

  • 1,153 posts
  • Location:Vienna, VA

Posted Thu Nov 2, 2017 7:39 PM

That should be pretty easy to resolve - you just need to find out which package to install with Cygwin...  By default, it's pretty bare-bones and you need to tell it what features to install.

 

The installer does not seem to work:
$ ./install.sh ../gcc_ti99
./install.sh: line 4: tree: command not found
./install.sh: line 5: tree: command not found



#15 Tursi OFFLINE  

Tursi

    River Patroller

  • 4,823 posts
  • HarmlessLion
  • Location:BUR

Posted Fri Nov 3, 2017 1:41 AM

Right... so you need patch -- you probably don't have GCC installed either, as by default Cygwin doesn't have it (the native GCC is needed to build the GCC cross-compiler). Apparently 'tree' as well... you can read the install script and see what commands it needs, then add them via Cygwin setup.

I don't have Cygwin installed or I'd just give you mine, but you can get through it!

#16 Fabrizio Caruso OFFLINE  

Fabrizio Caruso

    Space Invader

  • Topic Starter
  • 44 posts

Posted Fri Nov 3, 2017 2:30 AM

The installer fails to build binutils... 
The installer fetches and install the required GCC version (4.4)
I am using the very latest Cygwin version and the installer found on the GCC for TI thread.

What else do I need to build GCC for TI?

Remark: texinfo is installed in Cygwin.

Is there an up to date installer that works with current Cygwin?
 

./elf.texi:11: raising the section level of @subsubsection which is too low
make[3]: *** [Makefile:394: bfd.info] Error 1
make[3]: Leaving directory '/cygdrive/c/Users/Brizio/Retro/gcc-installer/build/binutils-2.19.1/bfd/doc'
Making info in po
make[3]: Entering directory '/cygdrive/c/Users/Brizio/Retro/gcc-installer/build/binutils-2.19.1/bfd/po'
( if test 'x../.././bfd/po' != 'x.'; then \
    posrcprefix='../.././bfd/'; \
  else \
    posrcprefix="../"; \
  fi; \
  rm -f SRC-POTFILES-t SRC-POTFILES \
    && (sed -e '/^#/d' \
            -e '/^[     ]*$/d' \
            -e "s@.*@   $posrcprefix& \\\\@" < ../.././bfd/po/SRC-POTFILES.in \
        | sed -e '$s/\\$//') > SRC-POTFILES-t \
    && chmod a-w SRC-POTFILES-t \
    && mv SRC-POTFILES-t SRC-POTFILES )
( rm -f BLD-POTFILES-t BLD-POTFILES \
    && (sed -e '/^#/d' \
            -e '/^[     ]*$/d' \
            -e "s@.*@   ../& \\\\@" < ../.././bfd/po/BLD-POTFILES.in \
        | sed -e '$s/\\$//') > BLD-POTFILES-t \
    && chmod a-w BLD-POTFILES-t \
    && mv BLD-POTFILES-t BLD-POTFILES )
cd .. \
  && CONFIG_FILES=po/Makefile.in:po/Make-in \
     CONFIG_HEADERS= /bin/sh ./config.status
config.status: creating po/Makefile.in
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default-1 commands
config.status: executing bfd_stdint.h commands
config.status: executing default commands
make[3]: Nothing to be done for 'info'.
make[3]: Leaving directory '/cygdrive/c/Users/Brizio/Retro/gcc-installer/build/binutils-2.19.1/bfd/po'
make[3]: Entering directory '/cygdrive/c/Users/Brizio/Retro/gcc-installer/build/binutils-2.19.1/bfd'
make[3]: Nothing to be done for 'info-am'.
make[3]: Leaving directory '/cygdrive/c/Users/Brizio/Retro/gcc-installer/build/binutils-2.19.1/bfd'
make[2]: *** [Makefile:1094: info-recursive] Error 1
make[2]: Leaving directory '/cygdrive/c/Users/Brizio/Retro/gcc-installer/build/binutils-2.19.1/bfd'
make[1]: *** [Makefile:3100: all-bfd] Error 2
make[1]: Leaving directory '/cygdrive/c/Users/Brizio/Retro/gcc-installer/build/binutils-2.19.1'
make: *** [Makefile:723: all] Error 2
=== Failed to build Binutils ===

Edited by Fabrizio Caruso, Fri Nov 3, 2017 11:43 AM.


#17 unhuman OFFLINE  

unhuman

    Stargunner

  • 1,153 posts
  • Location:Vienna, VA

Posted Fri Nov 3, 2017 6:39 AM

I just got to work - I use Cygwin a lot...  tree is there.  make sure you change your View to "Full" and it's there.  :)  Installed it and works fine.


Edited by unhuman, Fri Nov 3, 2017 6:40 AM.


#18 TheBF OFFLINE  

TheBF

    Moonsweeper

  • 369 posts
  • Location:The Great White North

Posted Fri Nov 3, 2017 7:22 AM

./elf.texi:11: raising the section level of @subsubsection which is too low
make[3]: *** [Makefile:394: bfd.info] Error 1
make[3]: Leaving directory '/cygdrive/c/Users/Brizio/Retro/gcc-installer/build/binutils-2.19.1/bfd/doc'
Making info in po
make[3]: Entering directory '/cygdrive/c/Users/Brizio/Retro/gcc-installer/build/binutils-2.19.1/bfd/po'
( if test 'x../.././bfd/po' != 'x.'; then \
    posrcprefix='../.././bfd/'; \
  else \
    posrcprefix="../"; \
  fi; \
  rm -f SRC-POTFILES-t SRC-POTFILES \
    && (sed -e '/^#/d' \
            -e '/^[     ]*$/d' \
            -e "s@.*@   $posrcprefix& \\\\@" < ../.././bfd/po/SRC-POTFILES.in \
        | sed -e '$s/\\$//') > SRC-POTFILES-t \
    && chmod a-w SRC-POTFILES-t \
    && mv SRC-POTFILES-t SRC-POTFILES )
( rm -f BLD-POTFILES-t BLD-POTFILES \
    && (sed -e '/^#/d' \
            -e '/^[     ]*$/d' \
            -e "s@.*@   ../& \\\\@" < ../.././bfd/po/BLD-POTFILES.in \
        | sed -e '$s/\\$//') > BLD-POTFILES-t \
    && chmod a-w BLD-POTFILES-t \
    && mv BLD-POTFILES-t BLD-POTFILES )
cd .. \
  && CONFIG_FILES=po/Makefile.in:po/Make-in \
     CONFIG_HEADERS= /bin/sh ./config.status
 
 
I have heard people say that Forth is a read only language... :-D
:woozy:
 
But all joking aside, installing Tursi's GCC port is worth enduring all the pain of this holy-crap complex
installation.  From what we have seen it generates excellent 9900 code.
Well... you know, for a C compiler.
 
(ok just a little joking)


#19 Fabrizio Caruso OFFLINE  

Fabrizio Caruso

    Space Invader

  • Topic Starter
  • 44 posts

Posted Fri Nov 3, 2017 7:58 AM

@unhuman My problem is not related to tree which I have installed correctly.

Now the error is: make[3]: *** [Makefile:394: bfd.info] Error 1
Remark: I have installed texinfo.

Could you share your working version? Did you build it with the latest Cygwin? Please share it if it is the case.
I don't know what else I have to do to build it.

@TheBF, you are getting the same problem?

Has anyone manage to build it with the very latest Cygwin?

 



#20 Fabrizio Caruso OFFLINE  

Fabrizio Caruso

    Space Invader

  • Topic Starter
  • 44 posts

Posted Fri Nov 3, 2017 9:31 AM

@Tursi, I am getting the error above despite having
gcc (native 6.4.0)
tree
flex
bison
make
...
texinfo
...

The initial error seems to be
make[3]: *** [Makefile:394: bfd.info] Error 1

which does not tell me much.

I have installed and re-installed texinfo with NO issues.

If I run makeinfo --version I get a warning:
"Can't locate ./Config at /usr/bin/makeinfo line 395

texi2any (GNU texinfo) 6.5
"

I am using the very latest Cygwin installation.

 


Edited by Fabrizio Caruso, Fri Nov 3, 2017 11:45 AM.


#21 TheBF OFFLINE  

TheBF

    Moonsweeper

  • 369 posts
  • Location:The Great White North

Posted Fri Nov 3, 2017 10:35 AM

@unhuman My problem is not related to tree which I have installed correctly.

Now the error is: make[3]: *** [Makefile:394: bfd.info] Error 1
Remark: I have installed texinfo.

Could you share your working version? Did you build it with the latest Cygwin? Please share it if it is the case.
I don't know what else I have to do to build it.

@TheBF, you are getting the same problem?

Has anyone manage to build it with the very latest Cygwin?

 

 

 

 

I have not tried. I am waiting for al the smoke to clear in this thread. 



#22 mizapf OFFLINE  

mizapf

    River Patroller

  • 2,583 posts
  • Location:Germany

Posted Fri Nov 3, 2017 10:55 AM

Is it really "/user/bin/makeinfo"? The typical unix-like path is "/usr/bin/".



#23 Fabrizio Caruso OFFLINE  

Fabrizio Caruso

    Space Invader

  • Topic Starter
  • 44 posts

Posted Fri Nov 3, 2017 11:46 AM

@mizapf, sorry... I fixed the type in my post.

 



#24 Fabrizio Caruso OFFLINE  

Fabrizio Caruso

    Space Invader

  • Topic Starter
  • 44 posts

Posted Fri Nov 3, 2017 11:49 AM

@unhuman, have you managed to get gcc to install on a recent version of Cygwin?

Could I use your working binary? What else would I need?



#25 mizapf OFFLINE  

mizapf

    River Patroller

  • 2,583 posts
  • Location:Germany

Posted Fri Nov 3, 2017 12:16 PM

I'm not sure whether I can help, since I don't have experience in Cygwin; I'm using Linux natively. My makeinfo says

 

$ makeinfo --version
texi2any (GNU texinfo) 6.4
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

 

Could you please zip the texi2any and Makefile files and attach the zip file to your message?







Also tagged with one or more of these keywords: C Cross Compiler, Conio

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users