I want to learn C, but I don't know where to start.
Can someone please help me?
I would start by downloading and installing the toolchain and grabbing the relevant libraries ( https://ce-programming.github.io ), and then browsing around the examples to get a feel for how it all works. When in doubt, your questions should be able to be answered with a nice Google search; or feel free to post any questions here! Smile
MateoConLechuga wrote:
I would start by downloading and installing the toolchain and grabbing the relevant libraries ( https://ce-programming.github.io ), and then browsing around the examples to get a feel for how it all works. When in doubt, your questions should be able to be answered with a nice Google search; or feel free to post any questions here! Smile


Shameless self-promotion (not like we have a choice of toolchain) Razz
I use a mac, and for some reason, it doesn't let me run any of these things. I compiled an example program using Ti planet's online project builder.
jcgter777 wrote:
I use a mac, and for some reason, it doesn't let me run any of these things. I compiled an example program using Ti planet's online project builder.

You need to read how to install for mac then; which just requires downloading the compressed archive and adding a few lines to your profile file. Smile It should tell you on the download page for the toolchain how to accomplish this.
It says that my security preferences don't allow running of things from unidentified developers. Also, I use my mom's mac, which I don't know the password for.
I guess if the restriction is enforced, you might be stuck.
But on the apps (maybe raw binaries too I'm not sure), try rick-click > open.

But anyway, yeah, do read the things Mateo mentioned to install them correctly, it should be doable just fine.
I found a way around it, but I need to install XCode or something, which I don't have enough space for.
Okay. So the only tools I can use at the moment are SourceCoder3, and TI-Planet's inline project builder. I know it's possible, but are there any constraints?
jcgter777 wrote:
Okay. So the only tools I can use at the moment are SourceCoder3, and TI-Planet's inline project builder. I know it's possible, but are there any constraints?

What do you mean by constraints?
MateoConLechuga wrote:
jcgter777 wrote:
Okay. So the only tools I can use at the moment are SourceCoder3, and TI-Planet's inline project builder. I know it's possible, but are there any constraints?

What do you mean by constraints?


I mean constraints as in how building/compiling works. Do I need the c libraries on there?
If you want to use straight C, no, you do not need to use any of the libraries. However, to do most things quickly, they are useful for file access, graphics, and many other things. You can include the graphics library by doing #include <graphx.h> for example, all of which is available inside the examples folder for the toolchain: https://github.com/CE-Programming/toolchain/tree/master/examples
MateoConLechuga wrote:
If you want to use straight C, no, you do not need to use any of the libraries. However, to do most things quickly, they are useful for file access, graphics, and many other things. You can include the graphics library by doing #include <graphx.h> for example, all of which is available inside the examples folder for the toolchain: https://github.com/CE-Programming/toolchain/tree/master/examples


One question I have is that would I be able to make a timer in "straight C"? Also, how would I use the libraries on an online editor?

Sorry for double posting, but I just wanted to ask a question. I have a sprite for z80 ASM, and I was wondering what I'd have to do with it to use it in C. I'll delete this post if i find out. The sprite code is really long, and I was wondering if I could simply do something in one main section instead of a few others as in the sprite demo.

Administrator's note: Double-posting in 24 hours is almost never okay. In this case, editing your post is the correct choice, even if what you're adding is a question.
Quote:
One question I have is that would I be able to make a timer in "straight C"? Also, how would I use the libraries on an online editor?
You'd likely want to use the timer interrupts that C exposes. Take a look at the Second Counter example.

Quote:
I have a sprite for z80 ASM, and I was wondering what I'd have to do with it to use it in C
You can use MateoC's ConvPNG tool to convert it from an image into a sprite useable by the C libraries. The way the standard C SDK Makefiles are written, you don't actually have to do anything manually: just put the image in the correct folder (usually src/gfx), and you're all set. See the GFX Sprite example for a demo of this.
KermMartian wrote:
Quote:
One question I have is that would I be able to make a timer in "straight C"? Also, how would I use the libraries on an online editor?
You'd likely want to use the timer interrupts that C exposes. Take a look at the Second Counter example.

I have that timer on my calc, and have been messing with the code, but I'm trying to define a hundredth second for a cubetimer. I tried in ICE before, and failed because I couldn't find a way around the decimals constraint (despite the awesome code people gave). I just need to get a hold of what certain commands do, and how. Is there like a guide, like for ICE?

Quote:
I have a sprite for z80 ASM, and I was wondering what I'd have to do with it to use it in C
You can use MateoC's ConvPNG tool to convert it from an image into a sprite useable by the C libraries. The way the standard C SDK Makefiles are written, you don't actually have to do anything manually: just put the image in the correct folder (usually src/gfx), and you're all set. See the GFX Sprite example for a demo of this.


I already have the sprite code, which I converted using SC3, but I looked at the apple demo thing, and couldn't piece together how to put my code in where. After looking at the apple sprite, I realized that my sprite code looks different, so it's probably wrong. I wish I could use ConvPNG, but I don't know how to get around the privacy/security settings on my mac (my mom's). Is there another way?
Just dont use the sprite code that you already have, start over with the image, and use convpng
Pieman7373 wrote:
Just dont use the sprite code that you already have, start over with the image, and use convpng


jcgter777 wrote:
I wish I could use ConvPNG, but I don't know how to get around the privacy/security settings on my mac (my mom's). Is there another way?


Another question: Would it be effective if I tried hacking a game like 2048? I wanted to know if that would help to learn the syntax.
I got my own mac (a while ago), so half the problems on this page are solved. i can run convpng, and I can install the toolchain. (yay mateo)

So I've decided my first project is to make the second_counter example in the toolchain have more graphics. So some questions. Where can I throw in gfx_Begin() without disrupting the original flow?

And before that, actually, what are some other things I need to know before messing around with the code? And what do the "void"s mean?
jcgter777 wrote:
So I've decided my first project is to make the second_counter example in the toolchain have more graphics. So some questions. Where can I throw in gfx_Begin() without disrupting the original flow?

I'd suggest replacing os_ClrHome() with it.

jcgter777 wrote:
And before that, actually, what are some other things I need to know before messing around with the code? And what do the "void"s mean?

void is a way of explicitly specifying no type. You cannot read or write a void value.
jcgter777 wrote:
I got my own mac (a while ago), so half the problems on this page are solved. i can run convpng, and I can install the toolchain. (yay mateo)

So I've decided my first project is to make the second_counter example in the toolchain have more graphics. So some questions. Where can I throw in gfx_Begin() without disrupting the original flow?

And before that, actually, what are some other things I need to know before messing around with the code? And what do the "void"s mean?


"gfx_Begin();" is usually placed somewhere near the beginning of "void main()"

"void" basically means "no value.

so:

Code:

void my_function(void) {
}

Takes no inputs, and returns no outputs.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement