Jump to content
IGNORED

C for the TI-99 Questions


Shift838

Recommended Posts

I did not want to post this in the development area since it's really a question around the C language.

 

I know there have been various tools created for a modern PC to be able to compile C. I have perused the development resources thread entirely on the topic of C, but did not find my answers so:

 

  1. Is the C that needs to be coded in a specific version?
  2. If there is a specific TI-99 version of C, is there any specific documentation that has references to all the operation syntax's and where is it?
  3. Is there a step by step guide using GCC and the python tools to create, compile, link, etc for a program to get it to run on the 99/4A?

 

 

  • Like 3
Link to comment
Share on other sites

in a nutshell.. TI C comes in two varieties..

 

tiny c (c99) which is a subset of C.. with TI centric libraries that are all custom/new so you have to learn them to do things like display graphics,play sounds etc..

GCC which is the industry standard C compiler, with TI centric libraries that are all custom so you have to learn them to do things like display graphics, play sounds etc..

 

see the trend? others can speak more.. but basically you either write your own routines (jedimatt42's favorite) or use tursi's ti99 library for GCC to actually interact with the hardware..

 

Greg

  • Like 1
Link to comment
Share on other sites

I did not use the gcc for the TI yet, but I suppose this is ANSI C, right? Because in c99 you get pretty old classic K&R style.

 

gcc is GNU C which is mostly the same as ansi C but has differences in setup

https://stackoverflow.com/questions/17206568/what-is-the-difference-between-c-c99-ansi-c-and-gnu-c

Link to comment
Share on other sites

My turmoil clone uses GCC to build the cartridge ROM, mostly as an learning exercise. The source code is here. I didn't use any external libraries, because I like having total control of the computer, and wrote my own functions to access the VDP in a way that is similar to what I'm familiar with in assembly language. Here's a description of the files:

  • Makefile: this locates the compiler programs and options that are passed to it, and provides list of inputs and outputs to the compiler, and their dependencies. This is used by the "make" command to build the cartridge binary. The .asm and .c files get compiled to .o files, and the .o files get linked into a .elf file, which gets converted to the .bin file (which also gets zip'd with layout.xml into a .rpk file.)
  • cart_header.asm: this is the assembly source code for the cartridge header required for all cartridge programs running in the >6000 space.
  • crt0.c: this is the C runtime supporting the main program, responsible for turning off interrupts, initializing the workspace pointer and stack pointer, copying non-constant data from ROM to RAM, initializing variables to zero, and then calling the main() function.
  • linkfile: a linker script that lays out where things will end up in memory, and sets up some labels that the C runtime will use to copy data or zero-initialize variables.
  • main.c: this contains the void main() function, and all the rest of the supporting game functions. Some inline assembly is also used to read the joystick, wait for the VDP interrupt, and low-overhead VDP set address and copy data.
  • graphics.h: a C header file containing the graphics data generated from the Magellan file using the gawk command.
  • Like 5
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...