Author Topic: TIBCC  (Read 3230 times)

0 Members and 1 Guest are viewing this topic.

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
TIBCC
« on: October 04, 2006, 01:34:00 pm »
Ok so I got Iambians new realese of Celtic!!! wOOt.
note to Iambian: putting 0:Asm(prgmCel...  doesn't return the number of lines in the program it crashed my calc

Anyways so I'm making a C compiler to BASIC so that you type the C code into the TI BASIC editor and it's gonig to be in APP form with Basicbuilder because it's going to be huge. I'm going to try to keep it as true to C as possible with printf, scanf, int, char, among other things so that porting computer programs to TI-BASIC is very easy. I was just wondering if anyone would actually use this program??

Features:
int, char, for, while, do-while, typedef, structures, functions, pointers, preprocessor, dynamic memory allocation, parameter passing, global variables, local variables, overdrive base calling(a maybe), and other stuff I can't remember.
so you would be able to write the following example into the program editor then compile it with TIBCC into BASIC. I didnt include things like structures in the example but you would be able to do it

Example:
c1-->
CODE
ec1
Send(NULL),0 //This is Define
Get(prgmname) //This is for header files
void countb:

void main
{
 
There are 10 types of people in this world-- those that can read binary, and those that can't.

Offline bfr

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 819
  • Rating: +4/-0
    • View Profile
    • bfr's website
TIBCC
« Reply #1 on: October 04, 2006, 02:24:00 pm »
Nice idea, but I just don't really see the point in making a C to TI-BASIC converter, no offense.  It's not really going to be any easier, more powerful, or faster.  If you're just making this for the fun of it, then go for it  :thumbup:google.gif .  But it seems like a kind of tricky thing to program - just warning you.  I might be misunderstand what you said, though.  

I'm wondering how you're going to have memory allocation in TI-BASIC o.oblink.gif .

Also, you might want to look over the main function again.   For the third argument in the for() loop, you should also write that as count += 2.  And just one more tip:

c1-->
CODE
ec1
int a:
int b:
c2
ec2

can be written as:

c1
-->
CODE
ec1
int a,b;
c2
ec2

;)wink.gif

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
TIBCC
« Reply #2 on: October 04, 2006, 02:40:00 pm »
hmm interesting, do you want a C to BASIC compiler tho, or BASIC to C? if its the second, I think the compiler would have to be done in asm, or on PC, so basically it would be like tigcc, take C code and convert/optimise it to z80 asm

Dragon__lance

  • Guest
TIBCC
« Reply #3 on: October 04, 2006, 02:46:00 pm »
That'd be so awesome, there exists some C compilers right now, but they may not be the best in terms of speed.

Liazon

  • Guest
TIBCC
« Reply #4 on: October 04, 2006, 03:15:00 pm »
QuoteBegin-xlibman+4 Oct, 2006, 20:4-->
QUOTE (xlibman @ 4 Oct, 2006, 20:40)
or BASIC to C?  

 that'd be a kinda cool way to program comps though :)smile.gif

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
TIBCC
« Reply #5 on: October 04, 2006, 03:17:00 pm »
true :Dbiggrin.gif

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
TIBCC
« Reply #6 on: October 05, 2006, 10:23:00 am »
yea great idea basic to C
@bfr: Yes i was typing very fast and made some typos but another thing is it is very hard to mimick a large or even 4-part structure in TI-BASIC and it would be much easier to handle Big RPG games with structures and unions
@everyone else: Yes maybe I could code a TI-BASIC to C converter but it wouldn't be on-calc it would be written in C on the comp and u would have to type ur BASIC code in so I don't know if you want to do that

EDIT: If anyone has any Line drawing algorithms written in C then feel free to tell me
There are 10 types of people in this world-- those that can read binary, and those that can't.

Liazon

  • Guest
TIBCC
« Reply #7 on: October 05, 2006, 11:09:00 am »
maybe an ASM line drawing routine would be more helpful, but then you'd limit your platform to either z80, 68k, x86, etc.

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
TIBCC
« Reply #8 on: October 05, 2006, 01:48:00 pm »
yes ur right that's why I need a C algorithm to use it with SDL so people on Windows,and Mac can use it
There are 10 types of people in this world-- those that can read binary, and those that can't.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
TIBCC
« Reply #9 on: October 06, 2006, 01:35:00 am »
SDL?

Liazon

  • Guest
TIBCC
« Reply #10 on: October 06, 2006, 10:17:00 am »
it's a graphics library on computer.  iirc, it's forte is in 2D, but I think it also has 3D functions.  funny forte... Allegro XDsmiley.gif

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
TIBCC
« Reply #11 on: October 06, 2006, 12:40:00 pm »
yes it is 2D but you can use it with OpenGL and SDL stands for Simple DirectMedia Library and it provides for cross platform compiling and it also makes things way easier like opening windows and draw pictures and sprites and making OpenGL functions easier also instead of writing a 2000 line OpenGL program it can be more like 800 with SDL
There are 10 types of people in this world-- those that can read binary, and those that can't.

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
TIBCC
« Reply #12 on: October 06, 2006, 03:16:00 pm »
If I make a BASIC to C compiler it won't be able to utlize all the functions to their full potential and also it would only be 94 by 62 so I think that some C knowledge with SDL will still be required
There are 10 types of people in this world-- those that can read binary, and those that can't.