Register

Problems with file copying function

Discuss issues related to the Casio Prizm 3rd party development
Senior Member
Posts: 141
Joined: Wed May 16, 2012 2:50 pm
Location: Portugal
Calculators: Casio fx-CG20

Re: Problems with file copying function

Postby gbl08ma » Sat Dec 14, 2013 1:15 pm

As I asked how to use the UBC I went reading the chapter on it on the SH7724 manual, and it seems a bit difficult to use, so I'll leave it to the masters :) Also, my 3pin<->RS232 converter is broken (for ages...) and I haven't found time to fix it or buy another one.

SimonLothar wrote:BTW: The names of the preinstalled add-ins are hardcoded in the OS, to invoke special behaviours, which I do not know in detail, yet.
I had already noticed this from looking at OS dumps, it may be some kind of white-list for something. The new ProbSim add-in runs on OS versions earlier than 2.00, and these did not know about the existence of such add-in, and so it is not on the "white-list". But if that "white-list" is related to SMEM operation, then ProbSim poses no problem as it doesn't read (other than for executing itself) or write the SMEM (it only stores data in the MCS, i.e. its settings and also has the option to export to Lists).

SimonLothar wrote:While I am writing this, I wonder, if renaming an add-in accordingly would make a difference? Maybe worth a try.
To "impersonate" another add-in, don't forget to set not only the filename, but also the name fields in the G3A header and perhaps even the version fields (and let's hope the OS doesn't compare the filesize too, but I find this unlikely as different versions of Geometry and PictPlot have different file sizes).

Senior Member
Posts: 369
Joined: Tue Jan 03, 2012 11:24 pm
Calculators: Casio Afx 1.0, Casio fx-9860GII SD, Casio Classpad 330, Casio fx-CG20, Casio Classpad fx-CP400

Re: Problems with file copying function

Postby helder7 » Sat Dec 14, 2013 6:17 pm

TeamFX wrote:Inside LCDR61524A.dll is the text "LCD driver R61524 with touch for CASIO" plus some other touch references. So the touch controller seems to be an integral part of the R61524.

One curious thing I've seen in cncalc is that some ex-word dictionaries have the same screen size and resolution as fx-cp400.
After a google search I also found other dictionaries with the same screen resolution as prizm (384x216), such as
the EW-G550C. Just out of curiosity, do you think they use the same LCD as calcs?
SiO2 + CaCO3 ----------> CaSiO3 + CO2

Senior Member
Posts: 141
Joined: Wed May 16, 2012 2:50 pm
Location: Portugal
Calculators: Casio fx-CG20

Re: Problems with file copying function

Postby gbl08ma » Sat Dec 14, 2013 9:16 pm

helder7 wrote:One curious thing I've seen in cncalc is that some ex-word dictionaries have the same screen size and resolution as fx-cp400.
After a google search I also found other dictionaries with the same screen resolution as prizm (384x216), such as
the EW-G550C. Just out of curiosity, do you think they use the same LCD as calcs?
I think the Prizm MPU, the SH7305, is used in some (if not all) of the current generation of Casio's electronic dictionaries. The SH7305 has a sound processing unit, I couldn't understand what use it could have, and when I asked TeamFX he told me it is used in these dictionaries, which have voice output. Older MPUs have sound processing units, too. I would not be surprised if the LCD or at least the LCD controller was the same, that way Casio can save money by ordering in bigger quantities and they can also reuse device drivers.

Senior Member
Posts: 141
Joined: Wed May 16, 2012 2:50 pm
Location: Portugal
Calculators: Casio fx-CG20

Re: Problems with file copying function

Postby gbl08ma » Sun Dec 15, 2013 5:14 pm

Simon, I kept thinking on the fact that you couldn't reproduce the issue...
You only test on real hardware, right?
I only test on the emulator (helder's test was also with the emulator).
I believe the emulator may have some changes in the way files are handled, look at the way files are imported and exported to and from the emulator: it uses some strange interface on something that looks like an add-in accessible from the memory menu...
The problem with testing with real hardware is that I don't have spare Prizms in case this one breaks...

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

Re: Problems with file copying function

Postby SimonLothar » Sun Dec 15, 2013 5:24 pm

gbl08ma wrote:You only test on real hardware, right?
Yes.
I'll be back!

Senior Member
Posts: 141
Joined: Wed May 16, 2012 2:50 pm
Location: Portugal
Calculators: Casio fx-CG20

Re: Problems with file copying function

Postby gbl08ma » Sun Dec 15, 2013 5:26 pm

Then I think I'll find people to test on real hardware, and see if any can reproduce the issue.

Senior Member
Posts: 141
Joined: Wed May 16, 2012 2:50 pm
Location: Portugal
Calculators: Casio fx-CG20

Re: Problems with file copying function

Postby gbl08ma » Mon Dec 23, 2013 8:03 pm

SimonLothar wrote:The problem should occur with g3a-files only.
sys1dae:Bfile_CreateEntry_OS calls sys0daf:SMEM_CreateEntry (in case of fls0-files). After SMEM_CreateEntry returns, sys0028 is called. sys0028 scans especially for g3a-files and registers the add-ins (with sys0015) anew. That operation kills any running add-in, because the TLB is affected, too. Bfile_CreateEntry_OS runs properly to its RTS and then tries to return to the calling add-in, which has attained nirvana meanwhile, where the calculator follows with good grace.

Solution: never create or delete g3a-files during the run of your add-in.


sys0028 is called during the operation of which syscalls, besides Bfile_CreateEntry_OS? Does Bfile_RenameEntry call it too?
I need to know this information because I want to disable all the functions that may lead to a crash due to sys0028 being called, but I'd rather not disable functions that work fine.

Also, I managed to reproduce the error again on the emulator, and I also found a situation where it never breaks:
- Copying from \\fls0\CASIO\g3p\somefile.g3p into \\fls0\somefile.g3p -> no error with any file
- Copying from \\fls0\CASIO\g3p\somefile.g3p into \\fls0\testfldr\somefile.g3p -> random errors with some files
Conclusion: it has a problem with writing files inside directories (unlikely, because I do this all the time with calendar events and it works file), or it has a problem when the directory is not in ALL CAPS. Eventually, the problem is more generic: the Bfile functions do not like having two files open at the same time, when both files are in directories. I will test further.

EDIT: copying into TESTFLDR still caused an error. But copying to the root is still fine. If this holds to be always true, then fixing this is pretty easy... just a matter of copying to a temporary file in the root, then renaming it to the desired name, thus moving it to the desired destination.

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

Re: Problems with file copying function

Postby SimonLothar » Tue Dec 24, 2013 11:01 am

gbl08ma wrote:sys0028 is called during the operation of which syscalls, besides Bfile_CreateEntry_OS? Does Bfile_RenameEntry call it too?
Yes, under certain circumstances.

After any internal SMEM-syscall has been performed, RefreshAddinsFlag is checked with
sys0de7_Check_RefreshAddinsFlag_
.
If RefreshAddinsFlag is set, it is cleared with
sys0de8_Clear_RefreshAddinsFlag_
and syscall 0028 is called.

Hence syscall 0028 is called, when the SMEM-syscall has set RefreshAddinsFlag. It is not clear to me yet, under which circumstances this happens. It looks like syscall 0028 checks, if at least one of the registered addins has changed position in the flash. In this case the TLB has to be setup anew and things go berserk on return to the calling addin.
I'll be back!

Senior Member
Posts: 141
Joined: Wed May 16, 2012 2:50 pm
Location: Portugal
Calculators: Casio fx-CG20

Re: Problems with file copying function

Postby gbl08ma » Tue Dec 24, 2013 1:06 pm

Thanks for the information. There is the possibility that one can force RefreshAddinsFlag to be always zero, but in that case we would incur in other problems - the list of add-ins in the Main Menu would be "out-of-date", with entries pointing to the wrong flash address.
Note that the SMEM manager in the Memory (F) menu is probably free to delete (and if it could, also move and create) g3a files without needing to set any special flag: since its code is located in a fixed location in the flash, independent of the TLB settings for the add-ins, when sys0028 is called, no harm is done.

Previous

Return to Casio Prizm SDK

Who is online

Users browsing this forum: No registered users and 10 guests