Homebrew picocDS - C programming on the go! (DS Entry)

  • Thread starter Thread starter asiekierka
  • Start date Start date
  • Views Views 4,849
  • Replies Replies 15

asiekierka

Well-Known Member
Member
Joined
Sep 26, 2007
Messages
126
Reaction score
106
Trophies
1
XP
1,342
Country
Poland
So I am working on a proper port of picoc to the DS as my Homebrew Bounty project. I only started working on it today, though.

picoc is a C interpreter with 99% of the ANSI C standard supported. That's right, it's an interpreter.

CURRENT PORT FEATURES:
- a quick port of the picoc interactive shell
- most C standard functions supported
- DS-specific functions added (with more coming!)

HOW TO USE:

Self-explanatory, really. Just input C code into the shell.

Code:
starting picoc v2.1
picoc> char inbuf[80];
picoc> gets(inbuf);
hello!
picoc> printf("I got: %s\n", inbuf);
I got: hello!

Sometimes in interactive mode you want to change a function or redeclare a variable. You can do this using the "delete" statement:

Code:
starting picoc v2.1
picoc> int fred = 1234;
picoc> printf("fred = %d\n", fred);
fred = 1234
picoc> delete fred;
picoc> char *fred = "hello";
picoc> printf("fred = '%s'\n", fred);
fred = 'hello'

You may want to load C files that you've prepared before. Let's assume you want to load test1.c, which is located in the main directory of your SD card. To do that, do this:

Code:
picoc> load "/test1.c";
picoc>

You can now use functions and code from that C file!

Works in both DS and DSi mode, and it's quite fast!

For more information please consult the README or the picoc wiki.

MILESTONES (bXX - build XX):
M1 (done at b02)
- Have it work (b01)
- Most standard C functions working (b02)

M2 (done at b04)
- Add some of the NDS-specific functions (began at b03, still in progress)
- Add loading C files (b04)

M3
Idk. Maybe integrate a text editor?

I fixed the links now
DOWNLOAD:
build 04 (20110326) - binary
build 04 (20110326) - source
 
Vigilante said:
Wow why is it most of the entiries things that people use to program isnt it suppose to be thing people can just go and play and use with

You don't use this to program FOR the DS.

You use this to program ON the DS. In C.
And it should compile on a normal PC, too!

Coding on-the-go is quite awesome in my opinion, that's why I'm working on a port of picoc to the DS.

Also, adding a milestone list to the first post.
 
Nice work asiekierka
Vigilante said:
Wow why is it most of the entiries things that people use to program isnt it suppose to be thing people can just go and play and use with
Even if it were, what exactly would be the problem with additional tools for developers?
Just because it may not be useful to you, does not make it useless to everyone else.
 
This is a cool concept, but I don't see it being very commonly used.

Coding C on a DS just sounds like a pain.

Python or something similar would be a much better fit.
 
Well nevermind then, lol. Still, your idea is one I've wished for in the past, so gg.
smile.gif
 
ecko said:
on the fly syntax checking would be awesome for this

well it does, kind of
when you input a line, or a procedure, it will syntax check it when you're done!
the downside is you have to rewrite everything all over again
 
Bump for awesome. This is something I've wanted for awhile. Your thoughts about a builtin text editor are spot on. Definitely add it. I think you should expose the frame buffer (Just because it'd be easy), perhaps with functions such as drawPixel, drawLine, etc.
 

Site & Scene News

Popular threads in this forum