Register

Casio fx-9860G SD- How to read files in the sd card?

Discuss anything related to calculators. For specific help on certain games/programs check the Released Projects subforum.
Senior Member
User avatar
Posts: 604
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750 G II, Casio fx-9750 G II (SH4), Casio fx-9860G, Casio fx-9860 G SD, Casio fx-9860G Slim, Casio fx-9860 GII SD, Casio fx-9860 GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG 20, Casio Classpad fx-cp400, Casio fx-CG 50

Re: Casio fx-9860G SD- How to read files in the sd card?

Postby SimonLothar » Fri Sep 30, 2016 6:15 pm

Seems to be more complex, but I'm still on it. Stay put.
I'll be back!

Senior Member
User avatar
Posts: 604
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750 G II, Casio fx-9750 G II (SH4), Casio fx-9860G, Casio fx-9860 G SD, Casio fx-9860G Slim, Casio fx-9860 GII SD, Casio fx-9860 GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG 20, Casio Classpad fx-cp400, Casio fx-CG 50

Re: Casio fx-9860G SD- How to read files in the sd card?

Postby SimonLothar » Mon Oct 03, 2016 3:34 pm

I think I have to abandon this job with syscalls 0x0C61..0x0C6A. There are so much global system variables involved.
The redirecting mechanism of the F-key return values is very tangled.
I'll be back!

Senior Member
Posts: 112
Joined: Mon Mar 02, 2015 10:53 am
Calculators: Casio fx-CG 20

Re: Casio fx-9860G SD- How to read files in the sd card?

Postby AmazoNKA » Mon Oct 03, 2016 10:38 pm

No worries and thank you for trying- i started thinking anyway that most of the interface will have to be repeated for the sd part too so I will try to finish the interface with the known system calls. So far listing, drawing of icons, scrolling, selecting with f1 is pretty much finished, started on detail f5 as well (also want to exlore if g3p background drawing will be achievable just to learn new things) but still didn't finish alphabetical plus folders sorting, browsing subfolders other functionality and most openlog things which will take some time especially due to having to debug if on real hardware...

Thanks again for your updates and answering questions here

Senior Member
User avatar
Posts: 604
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750 G II, Casio fx-9750 G II (SH4), Casio fx-9860G, Casio fx-9860 G SD, Casio fx-9860G Slim, Casio fx-9860 GII SD, Casio fx-9860 GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG 20, Casio Classpad fx-cp400, Casio fx-CG 50

Re: Casio fx-9860G SD- How to read files in the sd card?

Postby SimonLothar » Thu Oct 20, 2016 8:10 am

One thing could be useful.

Code: Select all
FONTCHARACTER pattern[ FILENAMESIZE ];
unsigned int key;

Bfile_StrToName_ncpy( pattern, "\\\\fls0\\*.*", FILENAMESIZE );
key = Syscall_0C62( pattern, 0 );


It returns either 0x7532 (EXIT) or 0x7534 (EXE) into key.
And it returns the complete path of the selected file into pattern.

Though I did not find out, how to change the peculiar heading "English".
I'll be back!

Senior Member
Posts: 112
Joined: Mon Mar 02, 2015 10:53 am
Calculators: Casio fx-CG 20

Re: Casio fx-9860G SD- How to read files in the sd card?

Postby AmazoNKA » Thu Oct 20, 2016 7:23 pm

That may be useful indeed - i will have a look but will be quite busy for a couple of weeks now.

I suspect "English" may be printed as heading because of the 0 argument at the end of that system call - perhaps changing 0 to other msgno will display other built in strings - i am hopeful it is the case.

Thanks again for still looking at this.

One new thing i wanted to check if you could explain if possible - you documented g3p loading system call and I tried to utilise it in getting background preview etc same way it works in memory app but i failed despite trying many ways to draw the array it uses back to vram... so I wonder if I misunderstood the purpose of that system call or alternatively if you have a working example for it

Senior Member
User avatar
Posts: 604
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750 G II, Casio fx-9750 G II (SH4), Casio fx-9860G, Casio fx-9860 G SD, Casio fx-9860G Slim, Casio fx-9860 GII SD, Casio fx-9860 GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG 20, Casio Classpad fx-cp400, Casio fx-CG 50

Re: Casio fx-9860G SD- How to read files in the sd card?

Postby SimonLothar » Thu Oct 20, 2016 10:01 pm

AmazoNKA wrote:One new thing i wanted to check if you could explain if possible - you documented g3p loading system call and I tried to utilise it in getting background preview etc same way it works in memory app but i failed despite trying many ways to draw the array it uses back to vram... so I wonder if I misunderstood the purpose of that system call or alternatively if you have a working example for it
Here it is:
Example: Show
Code: Select all
//
typedef struct tag_LoadG3P_array{
   void*LoadG3B_buffer_ptr;
   unsigned char colormode;
   unsigned char c2;
   unsigned char c3;
   unsigned char c4;
   int i3;
   unsigned short width;
   unsigned short height;
   int i5;
} TLoadG3P_array;
 
//
void F84_Handler(){

unsigned char screen[0x9000];
TLoadG3P_array LoadG3P_array;
unsigned short filename[ FILENAMESIZE ];
int x, y, i;
unsigned short color_idx;
unsigned int key;   

   memset( &LoadG3P_array, 0, sizeof( LoadG3P_array ) );  // for debugging purposes only
   memset( screen, 0xAA, sizeof( screen ) );  // for debugging purposes only

   Bfile_StrToName_ncpy( filename, "\\\\fls0\\A.G3P", 0x10A );
   
   LoadG3P_array.LoadG3B_buffer_ptr = screen;
   LoadG3P( &LoadG3P_array, filename );  // syscall 0x100F
   
   for ( i=0;i<=7;i++ ){
      for ( y = 0; y < 0x00C0; y++ ){
         for ( x = 0; x < 0x0180; x+=2 ){
            C3Mask( x, y, screen, i );
            color_idx = screen[(y*0x180+x)>>1] >> 4;
            Bdisp_SetPoint_VRAM_WB_C3( x, y, color_idx ); // Syscall 0x0264
            color_idx = screen[(y*0x180+x)>>1] & 0xF;
            Bdisp_SetPoint_VRAM_WB_C3( x+1, y, color_idx );
         }
      }
      GetKey( &key );
   }
   
   return;
}

I'll be back!

Senior Member
Posts: 112
Joined: Mon Mar 02, 2015 10:53 am
Calculators: Casio fx-CG 20

Re: Casio fx-9860G SD- How to read files in the sd card?

Postby AmazoNKA » Sat Nov 05, 2016 11:11 am

Thank you, Simon. Your example of G3P loading was very helpful - I managed to adapt it to be used with Bdisp_WriteGraphVRAM routine as well just to be able to set transparency etc - thanks again.

I also tried replacing 0 in Syscall_0C62( pattern, 0 ) with 1660 or 505 hoping it would replace language "English"/"Deutsch" etc with "SMEM" or "Main mem" but that had no effect. However trying 1 to 11 had very promising results with header, fkeys etc becoming functional as in the following interfaces:
1 - eAct
3 - csv (like in runmat csv open)
2 - text (similar to above probably found in program interface)
4 and 5 - pictplot
6 - similar to above but with geometry background and main f6 key
7 - like text one but list all files
8 - like storage memory interface
9 - transmit interface
10 - like 7 but Backup written in the header
11 - like 8 but from within export interface of memory manager on emulator

I have not thoroughly tested them but suspect using 7, 10 and possibly 9 and 11 as 2nd argument returns the same way you described with 0 argument. I think transmit (9) and export (11) interfaces could be particularly interesting but haven't tested how they work on real hardware.

I hope the above is of some help with the other system calls you wanted to look at originally.

Thanks again for all the research you share

Senior Member
User avatar
Posts: 604
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750 G II, Casio fx-9750 G II (SH4), Casio fx-9860G, Casio fx-9860 G SD, Casio fx-9860G Slim, Casio fx-9860 GII SD, Casio fx-9860 GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG 20, Casio Classpad fx-cp400, Casio fx-CG 50

Re: Casio fx-9860G SD- How to read files in the sd card?

Postby SimonLothar » Sat Nov 05, 2016 7:03 pm

This is, what I found meanwhile:

mode / predefined filename-pattern / heading / predefined F-keys
0 / *.* / "English" / none
1 / *.g3e / "eAct" / OPEN NEW DELETE SEARCH MEMO
2 / *.txt / "Text" / OPEN DELETE SEARCH DETAIL
3 / *.csv / "CSV" / OPEN DELETE SEARCH
4 / *.g3p / "Pict" / OPEN SEARCH DETAIL
5 / *.g3p / "Pict" / OPEN SEARCH DETAIL
6 / *.g3p / "Pict" / OPEN SEARCH MAIN
7 / *.* / "Text" / OPEN SEARCH DETAIL
8 / *.* / "SMEM" / SELECT COPY SEARCH FOLDER DETAIL DELETE
9 / *.* / "SMEM" / SELECT ALL DETAIL TRANSMIT
10 / *.* / "Backup" / OPEN DELETE SEARCH

In my experiments it was necessary to call syscall 0x0133 before calling the following syscalls.
Otherwise the F-keys do not work properly. syscall 0x0133 seems to initialize the F-key redirection system.
I have the notion, that calling 0x133 is not necessary in any situation.

SysCall 0x0C62: int OpenFileDialog( unsigned short*Pattern, int mode );
The heading is not changeable. mode == 7 or mode == 10 use fairly reasonable headings.
With the OPEN-F-Key (F1) 0x3B1 is returned as result.

Some variants:

SysCall 0x0C63: int OpenFileDialog( unsigned short*Pattern, int mode );
This call works like 0x0C62, but it does not return on EXIT. It exclusively uses QUIT to quit the function.

SysCall 0x0C64: int OpenFileDialog( unsigned short*Pattern, int mode );
If Pattern contains a directory path (f. i. "\\fls0\CASIO") when calling 0x0C64, the dialog uses this path as root.

Or a SAVE AS dialog

SysCall 0x0C66: int SaveFileDialog( unsigned short*Pattern, int mode );
mode == 0
the SAVE AS F-Key switches to a filename editor. After hitting EXE inside of this editor, the function returns with result 0x3B2 and the complete fiilepath in Pattern.

Or a select directory dialog

SysCall 0x0C69: int SelectDirectory( unsigned short*Pattern );
It returns 0x302 if the SAVE F-key (F1) is hit. Pattern contains the selected directory.

As for TRANSMIT:
The TRANSMIT F-key (mode == 9) quits the function with result == 0x8D, if finally F1 (Transmit OK? Yes) is hit.
BTW: If F6 (Transmit OK? No) is hit, the display is not refreshed properly.

I'am working with OS 1.03. mode == 11 does not seem to be implemented on real hardware. I just checked OS 2.02, which does not support mode == 11 either.

Every F-Key,which does not quit the function (like DELETE or SEARCH), performs its operation internally!
I'll be back!

Senior Member
Posts: 112
Joined: Mon Mar 02, 2015 10:53 am
Calculators: Casio fx-CG 20

Re: Casio fx-9860G SD- How to read files in the sd card?

Postby AmazoNKA » Thu Sep 14, 2017 11:59 pm

That was really helpful - thank you for the above confirmations. One thing I was hoping to achieve but couldn't was getting multiple files returned by those calls. I can make select all or multiple selections but the return values only seem to keep one file - do you know of any trick to have the whole array of files to be returned please or alternatively (and less preferably) some way of restricting mode 8 and 9 to selection of only one file...

Thanks for everything

Senior Member
User avatar
Posts: 604
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750 G II, Casio fx-9750 G II (SH4), Casio fx-9860G, Casio fx-9860 G SD, Casio fx-9860G Slim, Casio fx-9860 GII SD, Casio fx-9860 GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG 20, Casio Classpad fx-cp400, Casio fx-CG 50

Re: Casio fx-9860G SD- How to read files in the sd card?

Postby SimonLothar » Sat Sep 16, 2017 7:58 am

There must be a buffer somewhere, where the names of the selected files reside in case of mode 8 and 9.
I had a quick look but couldn't find a clue.
I fear the buffer is a local one, hence no longer available after return from the syscall.
A thorough investigation would take some time, which I am a bit short of lately.
Sry.
I'll be back!

PreviousNext

Return to General

Who is online

Users browsing this forum: No registered users and 5 guests