I will post here with any questions about programming add-ins on the Prizm.

To start off:
What should I get to start programming a casio add-in?

I would like to turn my basic math program into an add-in, so how would I start off on programming?
Sigh.. I wish Ashbad would finish some more of our book, so we can release it. That would help you a lot. Perhaps you should pm ashbad your email and allow you viewing rights on our google docs book.
First question:
-PrizmSDK, this pretty much get's all the essentials you need.
-Source code editor, Notepad++ recommended

To start off:
-Understand C
-Understand Math in C
Hope you have fun getting started. Be sure to post any questions on anything you don't understand.
I use the gui but I get this

Code:
Hello_World.c:8:1: error: stray '\223' in program
Hello_World.c:8:16: error: 'XXHello' undeclared (first use in this function)
Hello_World.c:8:24: error: expected ')' before 'World'
Hello_World.c:8:24: error: stray '\224' in program
Hello_World.c:8:24: error: too few arguments to function 'PrintXY'


any ideas?
What is your code?

Sounds like you need to do int XXHello somewhere in your program among other things.

Variables need to be defined in C.
Hello_World file:

Code:
#include <keyboard_syscalls.h>
#include <keyboard.hpp>
#include <display_syscalls.h>
#include <color.h>
#define true 1
int main() {

PrintXY(1, 1, "XXHello World!", TEXT_MODE_NORMAL, TEXT_COLOR_BLACK);

int key;

while(true) {

GetKey(&key);

Bdisp_PutDisp_DD();

}

return 0;
}
Use an editor without "pretty quotation marks". In other words, you're using “ and ” where you should be using ".
Notepad++ or Geany are good one Wink
What do you mean by the quotes souvik?

and I'm using notepad++ flyingfisch.

Edit: No errors!!

Edit 2: now I get this when I try to make the file,

Code:
C:\PrizmSDK-0.3\PrizmSDK-0.3\projects\Hello_World>..\..\bin\make.exe 
sh3eb-elf-gcc  example.o Hello_World.o -mb -m4a-nofpu -mhitachi -nostdlib -TC:/PrizmSDK-0.3/PrizmSDK-0.3/common/prizm.ld -Wl,-static -Wl,-gc-sections  -LC:/PrizmSDK-0.3/PrizmSDK-0.3/lib -lfxcg -lgcc -o C:/PrizmSDK-0.3/PrizmSDK-0.3/projects/Hello_World/Hello_World.bin
Hello_World.o: In function `_main':
Hello_World.c:(.text.startup+0x0): multiple definition of `_main'
example.o:example.c:(.text.startup+0x0): first defined here
collect2: ld returned 1 exit status
make[1]: *** [C:/PrizmSDK-0.3/PrizmSDK-0.3/projects/Hello_World/Hello_World.bin] Error 1
make: *** [build] Error 2

C:\PrizmSDK-0.3\PrizmSDK-0.3\projects\Hello_World>pause
Press any key to continue . . .
If you write your code in (shudder) Microsoft Word, it uses what are called Smart Quotes, the tilted quotes that point left and right into the string being quoted. Just about all programming languages require strings quoted in straight quotes (like "these"), and editors like Notepad++ are considerate about keeping the straight quotes that you type as straight quotes. That error means you are compiling hello.c and example.c together, and since both source files have a main function, GCC is confused. Try moving or deleting example.c for now. You'll probably also want to delete example.o, if it doesn't go away on its own.
KermMartian wrote:
If you write your code in (shudder) Microsoft Word, it uses what are called Smart Quotes, the tilted quotes that point left and right into the string being quoted. Just about all programming languages require strings quoted in straight quotes (like "these"), and editors like Notepad++ are considerate about keeping the straight quotes that you type as straight quotes. That error means you are compiling hello.c and example.c together, and since both source files have a main function, GCC is confused. Try moving or deleting example.c for now. You'll probably also want to delete example.o, if it doesn't go away on its own.

Code:
mv src/example.c src/example.c.old && make clean && make
He's on Windows, not Linux - note the C:\.

Code:
ren src/example.c example.c.old
make clean
make
Bah, I saw forward slashes like 'PrizmSDK-0.3/projects/Hello_World/Hello_World.bin' at a quick glance and thought *nix.

Also, you can just comment out the main function in example.c if you still use other functions from that source file.
I'll do that when I get home later today(maybe tomorrow). And, thanks for the help.

Edit: YAY!!! It worked!
*Bump*

What are the define commands? And how would you make a menu to select items to do math with?
krazylegodrummer56 wrote:
*Bump*

What are the define commands? And how would you make a menu to select items to do math with?


Number one, you need to read this. http://www.cplusplus.com/doc/tutorial/preprocessor/

Number two, you could either make one from scratch yourself (once you read a C tutorial or two you should be able to figure out how), or you could try getting SimonL's folding/expanding menu system mini-library to work with the PrizmSDK (unless someone's already done this?)
I don't think anyone has done that yet. I'd probably recommend making one yourself; there are many, many ways you could decide to set it up and implement it.
Ashbad wrote:
or you could try getting SimonL's folding/expanding menu system mini-library to work with the PrizmSDK (unless someone's already done this?)


And where would I find this?
SimLo is active on Casio Scene.

I don't understand what exactly you're talking about but you should have a look on his documentation, there is a lot of things about Bfile syscalls.
Ok so I am now wondering what are the different #includes I can use for the Prizm are? And what are some of the commands I can use for the prizm?

Edit: So Kerm you put an example of a .h file and a .c file under this link?
*bump*


can you guys give an example of usage on Kerm's text input routine (A.K.A how to call it in the main method)?
  
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 4
» 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