Hello everyone,

iam new here and i hope someone could help me.

I want to program a simple Add-in for my Casio FX CG20 that says Hello World.
But i really dont know how i should start. I read the Prizm Programming Portal but it dont help me really.


Iam Wrote this with codeblocks but how i get it into g3a?

#include <fxcg/display.h>
#include <fxcg/keyboard.h>

int main() {
PrintXY(3,8,"--Hello World!", TEXT_MODE_NORMAL, TEXT_COLOR_RED); // Place it somewhere on the screen. Note that x,y are 1-indexed.

int key;
while(1)
GetKey(&key); // Loop forever

return 0; // Needed if you have main returning int, but will never be reached.
}


Maybe my first steps are wrong. Please tell me what i done wrong?

mfg Boko
are you on Windows or something else? Have you set up SDK for prizm? From my experience and from reading other people's post it is not very easy setup but definitely it is possible to have at least partial success with most things working at the end but the degree of success may vary depending on your platform. There are more and better posts on this but from memory on windows you extract the sdk anywhere on your pc and I believe it automatically includes Tari's mkg3a utility to make g3a add-ins from your source files. Also projects or examples folders there is where I would recommend you have a look at - the setup works by converting your source files into g3a files by running a make.bat file from there which takes makefile info and converts c etc files from src folder and using Tari's tool creates g3a. So that how I would summarize it but reading other posts here and perhaps on wiki prizm or other forums may help you more to iron out any versioning or specific OS problem - plus there are other alternatives to achieve g3a files. I hope this helps to get you started or to have some general insight into this process.

Once you confirm what platform you use - I hope more specific help can be provided by members here.
yes i use Windows 7. yes i tried wiki prizm but there are not enough details for me is there no introduction with some pictures or somethin like that.

For write the Programm i use CodeBlocks

thanks for help amazonka
Is there someone who would help me to start step by step to create my first add-in?

Which program i need?
boko500E wrote:
Is there someone who would help me to start step by step to create my first add-in?

Which program i need?

In the future, please edit your post as opposed to double posting! Thanks Smile
boko500E wrote:
Is there someone who would help me to start step by step to create my first add-in?

Which program i need?

even when I started just over a year ago to try and achieve the same it was difficult to find up-to-date or even live links but I think we should be able to achieve most of the things if we take time to read through as many posts as possible here like sticky post and so on. So even so I was only partially successful and may by now have forgotten something let's get started and have a step by step for you and other people.

Kerm helpfully posted this link recently:
KermMartian wrote:
I'm not sure where the direct download link on WikiPrizm went, but there appear to be direct download links on Jonimus's website: http://jonimoose.net/2011/casio-prizm-gcc-sdk-v0-3/
I would download this http://jonimoose.net/calcstuff/prizm/PrizmSDK-0.3.zip and extract it into a location like "C:\PrizmSDK" (or OneDrive\PrizmSDK if you use OneDrive by Microsoft on Windows but it costed me some files overwrites so be warned to be careful with using it). So basically extracting zip file into c drive and then renaming PrizmSDK-0.3 folder to PrizmSDK should do the trick to avoid spaces in the location path etc. Once this is done you should see like bin (incl mkg3a.exe file), common, include and so on, as well as Readme.txt file which should help you also.

So if this step was missed by you during your setup for Windows I hope the above helps you but let me know if I'm starting at the wrong place with this. Otherwise confirm if you have done the above and we could try to compile some of the example projects first and try to update the above SDK a bit more using Tari's builds etc
ok lets start.
First: For programming i use DEV C and there i installed it i extract the zip from PrizmSDK.
Then i started the Example and then i try to compile and get ERROR.

I dont know what one drive or c drive is.
And what i have to do now?

#include <fxcg/display.h>
#include <fxcg/keyboard.h>

int main() {
PrintXY(3,8,"--Hello World!", TEXT_MODE_NORMAL, TEXT_COLOR_RED); // Place it somewhere on the screen. Note that x,y are 1-indexed.

int key;
while(1)
GetKey(&key); // Loop forever

return 0; // Needed if you have main returning int, but will never be reached.
}

1 26 P:\Dev-Cpp\PrizmSDK\projects\example\src\example.c [Error] fxcg/display.h: No such file or directory
compilation terminated.
so everything from the zip file is in you P:\Dev-Cpp\PrizmSDK folder now, isn't it?
Yes everthing by the ZIP file is in P:\Dev-Cpp\PrizmSDK.
Ok, as a first step please navigate to sub-folder projects\example there and run/double click make.bat file
Code:

C:\PrizmSDK-0.3\projects\example>..\..\bin\make.exe
sh3eb-elf-gcc -MMD -MP -MF C:/PrizmSDK-0.3/projects/example/build/example.d -Os
-Wall -mb -m4a-nofpu -mhitachi -nostdlib   -IC:/PrizmSDK-0.3/projects/example/bu
ild -IC:/PrizmSDK-0.3/include -c C:/PrizmSDK-0.3/projects/example/src/example.c
-o example.o
C:/PrizmSDK-0.3/projects/example/src/example.c:4:6: warning: return type of 'mai
n' is not 'int' [-Wmain]
C:/PrizmSDK-0.3/projects/example/src/example.c: In function 'main':
C:/PrizmSDK-0.3/projects/example/src/example.c:6:10: warning: variable 'blah' se
t but not used [-Wunused-but-set-variable]
sh3eb-elf-gcc  example.o -mb -m4a-nofpu -mhitachi -nostdlib -TC:/PrizmSDK-0.3/co
mmon/prizm.ld -Wl,-static -Wl,-gc-sections  -LC:/PrizmSDK-0.3/lib -lfxcg -lgcc -
o C:/PrizmSDK-0.3/projects/example/example.bin
mkg3a -n basic:example -i uns:../unselected.bmp -i sel:../selected.bmp C:/PrizmS
DK-0.3/projects/example/example.bin C:/PrizmSDK-0.3/projects/example/example.g3a


C:\PrizmSDK-0.3\projects\example>pause
Press any key to continue . . .
should appear in the dos window and example.g3a in that subfolder - this is just to test the SDK and creation of the add-ins itself not specifically your code nor anything to do with codeblocks.


Is this step working for you please?
yes this step works:)
Good, so you can now create simple add-ins using this setup and by just copying example folder with all the bat and makefile files and just editing src file code, selected/unselected bmp file for your add-in icons, etc.

At some point you may need to update your sdk and this may cause extra problems in itself but many of them can be resolved by editing your #include header file references for newer sdk and playing with makefiles but for me it felt like trial and error exercise because I am not knowledgeable enough with those. I can only recommend backing up or keeping copies of working setup while experimenting with/testing new ones.

Good luck
But there i can put my Hello World code in?

If i open the src folder and put my code on example. The makebat.file says Error.
I believe it could be because of
Code:
#include <fxcg/display.h>
#include <fxcg/keyboard.h>
is what you wrote (and I believe it is right for the newer SDK) but I believe the original example (and SDK) uses legacy structure i.e. before sdk was updated so they have
Code:
#include <display_syscalls.h>
#include <keyboard_syscalls.h>
so it would be things like this (or maybe constants for colour and text styles) were missing in that SDK so if you take it slowly at first to look for such differences it will help you going forward in case you won't be able to update your SDK. I just want you to get confident that you can create add-ins first. Try taking the original example code and modify it to what you need and to see if it produces errors and let know which ones exactly. I'm pretty sure we will work it out soon.
  
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 1
» 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