Register

Casio Basic to SDK

Discuss issues related to the fx-9860G Software Development Kit
Senior Member
User avatar
Posts: 66
Joined: Sun Apr 15, 2012 4:00 pm
Calculators: Casio fx-9860G

Postby aapman55 » Sat May 26, 2012 9:23 am

thanks simon, my program has been finished. Still some tweaking needs to be done.
I still have some questions. The random number generator isnt as random as i hoped. Every time i start the add in the first game (maybe also other games but i especiaklly remember the first one) the pattern is the same.

I tried changing the icon with paint.NET, setting the colors to black and white but it still keeps saying it isnt. which program do you recommend to do the icons?

Senior Member
User avatar
Posts: 605
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400

Postby SimonLothar » Sat May 26, 2012 12:49 pm

aapman55 wrote:The random number generator isnt as random as i hoped. Every time i start the add in the first game (maybe also other games but i especiaklly remember the first one) the pattern is the same.
Name collision with the SDK-library! I shouldn't have used rand() as name for my random-function.

Either rename my function to xrand(), f.i..

or

remove my random function and
use the SDK-library function srand( RTC_GetTicks() ) to initialize the SDK-librarY's random generator
and the SDK-library function rand() to get the random-numbers.

aapman55 wrote:I tried changing the icon with paint.NET, setting the colors to black and white but it still keeps saying it isnt. which program do you recommend to do the icons?
I use Paint. 30x19, b/w. The SDK only binds the inner 17 rows.
I'll be back!

Senior Member
User avatar
Posts: 66
Joined: Sun Apr 15, 2012 4:00 pm
Calculators: Casio fx-9860G

Postby aapman55 » Sat May 26, 2012 4:36 pm

Here is the result.
[ATTACH]48[/ATTACH]

if i want to put your syscalls in a seperate file. it needs to be a .h file right? and can i just do it in notepad?
Attachments
Fusebomb.zip
(0 Bytes) Downloaded 684 times

Senior Member
User avatar
Posts: 605
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400

Postby SimonLothar » Sat May 26, 2012 6:53 pm

aapman55 wrote:if i want to put your syscalls in a seperate file. it needs to be a .h file right??

Yes, but do not forget to enclose the code in the following defines to prevent multiple inclusion
#ifndef __<filename>_H__
#define __<filename>_H__
...
#endif

And you must know, that every sourcefile, where you include this syscall-header-file produces the same code again.

aapman55 wrote:and can i just do it in notepad?
Yes, use a simple editor without formatting. I prefer notepad++.
I'll be back!

Senior Member
User avatar
Posts: 66
Joined: Sun Apr 15, 2012 4:00 pm
Calculators: Casio fx-9860G

Postby aapman55 » Mon May 28, 2012 6:15 pm

I want to put a highscore in it. This will require writing some numbers in a file. How can i best do it?

Senior Member
User avatar
Posts: 605
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400

Postby SimonLothar » Mon May 28, 2012 7:19 pm

aapman55 wrote:I want to put a highscore in it. This will require writing some numbers in a file. How can i best do it?

If the amount of data is small, you should best use the main memory.
Look for the SDK's Bfile-functions.
Bfile_CreateMainMemory;
Bfile_OpenMainMemory;
Bfile_ReadFile
Bfile_WriteFile
Bffile_CloseFile
I'll be back!

Senior Member
User avatar
Posts: 66
Joined: Sun Apr 15, 2012 4:00 pm
Calculators: Casio fx-9860G

Postby aapman55 » Thu May 31, 2012 9:06 pm

hmm. will look into that later when i have some more experience with programming.
Another question: i installed kucalcs revolution fx. I included the revolution.h file and used the cooltext function. it works in the casio sdk, but when i put it on my calc it doesnt appear.
Anyone has experience with revolution fx?

Senior Member
User avatar
Posts: 605
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400

Postby SimonLothar » Thu May 31, 2012 9:25 pm

I'll be back!

Senior Member
User avatar
Posts: 66
Joined: Sun Apr 15, 2012 4:00 pm
Calculators: Casio fx-9860G

Postby aapman55 » Fri Jun 01, 2012 9:00 pm

So the idea is, cooltext writes in the buffer SDK_VRAM that is referring to the old VRAM adress. So using memcpy to copy the buffer SDK_VRAM to the new VRAM address which is defined in the beginning of the program and then subsequently using the other SDK functions like Bdisp_DrawLine_VRAM() the build the screen further. and finally using Bdisp_PutDisp_DD() to get the total screen? Am I right?

what i tried is:

in the begin of the program
Code: Select all
unsigned char vram_address[1024];
vram_address = syscall(0,0,0,0,0x135);



and then in the body

Code: Select all
CoolText(27, 8, FONT_SEVEN, "Fusebombs", SDK_VRAM);
memcpy(SDK_VRAM, vram_address, 1024);
Bdisp_PutDisp_DD();


but it didnt work.
I also tried some other codes but they give some more error messages.

Senior Member
User avatar
Posts: 605
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400

Postby SimonLothar » Fri Jun 01, 2012 9:13 pm

aapman55 wrote:
Code: Select all
CoolText(27, 8, FONT_SEVEN, "Fusebombs", SDK_VRAM);
memcpy(SDK_VRAM, vram_address, 1024);
Bdisp_PutDisp_DD();


if SDK_VRAM is some RAM where CoolText writes to, then I would expect this
Code: Select all
memcpy(SDK_VRAM, vram_address, 1024);
CoolText(27, 8, FONT_SEVEN, "Fusebombs", SDK_VRAM);
memcpy(vram_address, SDK_VRAM, 1024);
Bdisp_PutDisp_DD();
I'll be back!

PreviousNext

Return to Casio fx-9860 SDK

Who is online

Users browsing this forum: No registered users and 29 guests