You're going to need to unzip your SDK before you can use it. I suggest dumping "PrizmSDK-0.3" (the UNZIPPED folder), into C:. So the path would then be "C:\PrizmSDK-0.3".
zeldaking wrote:
Can I copy and paste all the files into a new folder? then delete the old SDK that is zipped?
Well, in the zip file should be the folder "PrizmSDK-0.3", which you can just copy right into the C: drive. Then, whatever you want to do with the old zip archive is up to.
Ahh okay, thanks. I did the cd <paste> and something happened I typed make and this happened:
Code:
Did I mess up? What now?
Code:
makefile:13: C:\Users\thacker\Documents\DANNY\Calculator: No such file or directory
makefile:13: Calculator Programs\CASIO\PrizmSDK-0.3\common/prizm_rules: No such file or directory
make: *** No rule to make target 'Programs/CASIO/PrizmSDK-0.3/common/prizm_rules'. Stop.
Did I mess up? What now?
you need to change those long paths to the new path of the SDK. So, if you put it in the place I told you to, it would be "C:\PrizmSDK-0.3".
Okay I did this... phew it works. I just need to fix a few errors in my code and it should work. Thanks for all the help.
zeldaking wrote:
Okay I did this... phew it works. I just need to fix a few errors in my code and it should work. Thanks for all the help.
No problem at all, we're glad to get as many Prizm developers as we can. Feel free to ask any questions on how any of the PrizmSDK functions work, as well as the Useful Routines in the respective thread (though, those are documented by the authors and should be easy to figure out).
I do have another question. This won't work. Shouldn't it wait for a key press and then quit?
Code:
Code:
#include keyboard_syscalls.h
#include keyboard.
Int main() {
for(int i = 0; i < LCD_WIDTH_PX*LCD_HEIGHT_PX/2; i++) {
*((unsigned int*)0xA8000000 + i) = 0x00000000;
}
while(PRGM_GetKey() == KEY_PRGM_NONE) {
}
return 0;
}
A few things wrong with that:
- "Int" isn't capitalized. It's "int".
- You don't call Bdisp_PutDisp_DD() at all, so you never update what's in VRAM to the screen.
- You don't ever want to quit an add-in, per-se. What you want to do is call something like this:
Code:
Though you still shouldn't exit an Add-in unless the user presses KEY_PRGM_MENU (the menu key).
EDIT: an of course you should have either " " (quotes) or < > (not sure what to call them in this context) around your includes, such as "#include <keyboard.h>". And of course, that second include needs to be "keyboard.h", not "keyboard.".
- "Int" isn't capitalized. It's "int".
- You don't call Bdisp_PutDisp_DD() at all, so you never update what's in VRAM to the screen.
- You don't ever want to quit an add-in, per-se. What you want to do is call something like this:
Code:
void keymenu(void) {
int key = KEY_PRGM_MENU;
GetKey(&key);
Bdisp_EnableColor(1);
DrawFrame(COLOR_BLACK);
}
Though you still shouldn't exit an Add-in unless the user presses KEY_PRGM_MENU (the menu key).
EDIT: an of course you should have either " " (quotes) or < > (not sure what to call them in this context) around your includes, such as "#include <keyboard.h>". And of course, that second include needs to be "keyboard.h", not "keyboard.".
-
zeldaking
- Expert (Posts: 747)
- 18 Mar 2012 07:02:14 pm
- Last edited by zeldaking on 18 Mar 2012 07:04:42 pm; edited 1 time in total
Okay how do I change it to the KEY_PRGM_MENU? Also can I do:
Code:
Edit: Yeah i figured it was .h
Code:
DrawFrame(COLOR_WHITE);
Edit: Yeah i figured it was .h
zeldaking wrote:
Okay how do I change it to the KEY_PRGM_MENU? Also can I do:
Code:
Yes... assuming that the C constant COLOR_WHITE exists. Code:
DrawFrame(COLOR_WHITE);
zeldaking wrote:
Okay how do I change it to the KEY_PRGM_MENU? Also can I do:
Code:
Code:
DrawFrame(COLOR_WHITE);
As for question one, you should have a main loop in your program which should never exit, in which you should handle MENU. Like so:
Code:
int main() {
...
while(true) { // main program loop
...
if(PRGM_GetKey() == KEY_PRGM_MENU) {
keymenu(); // that function I threw at you last post
}
}
return 0;
}
as for question two, you can, but all DrawFrame does is change the color of the border around the screen.
EDIT: and yes, COLOR_WHITE does exist, if you have Merth's version of color.h (with all those color_t defines for all those crayon-color-sounding colors). If not, white is 0xFFFF.
Okay I did all this, but sadly I still have a problem:
This is what happens when I run rebuild.bat
Code:
???
This is what happens when I run rebuild.bat
Code:
C:/PrizmSDK-0.3/lib\libfxcg.a(crt0.o):In Function 'main': (.pretext+0x50): undefined reference to '_main'
???
zeldaking wrote:
Okay I did all this, but sadly I still have a problem:
This is what happens when I run rebuild.bat
Code:
???
This is what happens when I run rebuild.bat
Code:
C:/PrizmSDK-0.3/lib\libfxcg.a(crt0.o):In Function 'main': (.pretext+0x50): undefined reference to '_main'
???
I'm honestly not sure why that's happening. My only guess is changing "int main() {" to "int main(void) {". Could you give your code here again? Perhaps it's caused by a speeling mitsake in teh coed.
teh code:
Code:
Code:
#include <keyboard_syscalls.h>
#include <keyboard.h>
int main(void) {
while(true) {
if(PRGM_GetKey() == KEY_PRGM_MENU) {
keymenu();
}
}
return 0;
}
void keymenu(void) {
int key = KEY_PRGM_MENU;
GetKey(&key);
Bdisp_EnableColor(1);
DrawFrame(COLOR_BLACK);
}
Add these lines to the beginning of your program:
Code:
Edit:
Also, add this:
Code:
Code:
#include <keyboard.hpp>
#include <color.h>
#define true 1
Edit:
Also, add this:
Code:
int PRGM_GetKey(){
unsigned char buffer[12];
PRGM_GetKey_OS( buffer );
return ( buffer[1] & 0x0F ) * 10 + ( ( buffer[2] & 0xF0 ) >> 4 );
}
Do not forget about this topic: http://msdn.microsoft.com/en-us/library/0e5kx78b.aspx
That said, re-order your functions
That said, re-order your functions
Here is my code:
Code:
Here is what the rebuild.bat says:
Code:
Does this explain my problem?
Code:
#include <keyboard_syscalls.h>
#include <keyboard.h>
#include <keyboard.hpp>
#include <color.h>
#define true 1
void keymenu();
int PRGM_GetKey();
int main(void) {
while(true) {
if(PRGM_GetKey() == KEY_PRGM_MENU) {
keymenu();
}
}
return 0;
}
void keymenu(void) {
int key = KEY_PRGM_MENU;
GetKey(&key);
Bdisp_EnableColor(1);
DrawFrame(COLOR_BLACK);
}
int PRGM_GetKey(){
unsigned char buffer[12];
PRGM_GetKey_OS( buffer );
return ( buffer[1] & 0x0F ) * 10 + ( ( buffer[2] & 0xF0 ) >> 4 );
}
Here is what the rebuild.bat says:
Code:
C:\PrizmSDK-0.3\projects\Prizm>..\..\bin\make.exe clean
rm -f -fr build C:/PrizmSDK-0.3/projects/Prizm/Prizm.bin C:/PrizmSDK-0
.3/projects/Prizm/Prizm.g3a
C:\PrizmSDK-0.3\projects\Prizm>..\..\bin\make.exe
sh3eb-elf-gcc -mb -m4a-nofpu -mhitachi -nostdlib -TC:/PrizmSDK-0.3/common/priz
m.ld -Wl,-static -Wl,-gc-sections -LC:/PrizmSDK-0.3/lib -lfxcg -lgcc -o C:/Priz
mSDK-0.3/projects/Prizm/Prizm.bin
C:/PrizmSDK-0.3/lib\libfxcg.a(crt0.o): In function `main':
(.pretext+0x50): undefined reference to `_main'
collect2: ld returned 1 exit status
make[1]: *** [C:/PrizmSDK-0.3/projects/Prizm/Prizm.bin] Error 1
make: *** [build] Error 2
C:\PrizmSDK-0.3\projects\Prizm>pause
Press any key to continue . . .
Does this explain my problem?
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
» Go to Registration page
» Goto page Previous 1, 2, 3, 4 Next
» View previous topic :: View next topic
» View previous topic :: View next topic
Page 2 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
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