You can help CodeWalrus stay online by donating here. | New CodeWalrus | Old (dark mode) | Old (light) | Discord server
We have an anniversary Game Jam! Click here for more info.

A new Casio PRIZM calculator: The fx-CG50

b/Calculator Talk Started by Dream of Omnimaga, January 14, 2017, 03:04:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

u/gbl08ma July 04, 2017, 11:46:44 AM
I am aware of that and I've seen the issue that was opened in the Eigenmath GitHub.

I have also identified the problem, in fact I did so some months ago. The VRAM address is hardcoded. Utilities doesn't have this problem, as it reads the VRAM address using the appropriate syscall when it starts, caching that address to RAM and using it for custom VRAM manipulation functions from then on. Eigenmath uses a hardcoded address for these custom functions, which is why on some calculators the graphics are glitched.
It appears that the Graph 90+E uses a different VRAM address than the fx-CG50 (since on the emulator for the latter at least, the add-in doesn't show any problems).

I also know how to fix this in terms of code, it's a matter of reusing the solution from Utilities.
Now, you may think that the problem is basically solved as the steps that are usually 90% of the work are done (identifying the problem and drafting a solution). The problem is that I no longer have a Prizm development environment on any of my machines. And it's a bit tricky to set one up.
First, I need a custom mkg3a (because the add-in has a eActivity strip, and vanilla mkg3a doesn't have support for that) and I'm not sure I still have the source code to that custom mkg3a anywhere.
Second, I need to use my fork of libfxcg (this is not very hard).
Third, if I recall correctly there are some library shenanigans regarding the C math functions. I'm not sure but I think Eigenmath was the add-in where I had to use a library frankensteined from miniSDK or whatever that terrible libfxcg alternative was called.
Finally, ideally I'd like to use the same 4.x GCC I used before, as a long long time ago I tried GCC 5 and 6 without success. It appears that at the time these versions of GCC had some problem emitting code for the Prizm SH4 CPU architecture. It's probably fixed by now, or the problem might be in my code, or in libfxcg, after all. But I don't want to waste time figuring that out.

I'll see if I can boot the Linux install I supposedly still have on the hard disk I used to have on my laptop. That's supposedly where I had the environment I used to develop Eigenmath and Utilities.
This will take a while though, and there's a chance I'll have to fight bitrot, and that's why I haven't started yet. Furthermore, fixing Eigenmath is obviously not the only thing I had postponed to the summer and there are more urgent things in my to-do list.

@critor, how do you prefer I send you builds for testing?
Last Edit: July 04, 2017, 11:49:22 AM by gbl08ma
u/critor July 04, 2017, 11:54:16 AM
Quote from: gbl08ma on July 04, 2017, 11:46:44 AMIt appears that the Graph 90+E uses a different VRAM address than the fx-CG50 (since on the emulator for the latter at least, the add-in doesn't show any problems).
I'd advise you not to trust the Casio emulator. Even in Graph 90+E mode apps are working, although most of them don't on real hardware.

From what I could read on http://www.casiopeia.net/forum/viewtopic.php?f=2&t=1783 , the real fx-CG50 is sharing the same problem as the real Graph 90+E.

Quote from: gbl08ma on July 04, 2017, 11:46:44 AM@critor, how do you prefer I send you builds for testing?
Email to [email protected] would be better - since I might not get the PM notification.


Thank you very much for your very prompt reply. :)
Last Edit: July 04, 2017, 11:56:02 AM by critor
u/gbl08ma July 04, 2017, 11:58:13 AM
That's sad. It means the emulator OS diverges from the OS running on real hardware even more than with the fx-CG10/20. It's probably a good time for someone to resume working on a QEMU-based emulator, or to figure out a way to run OS images on the official emulator that are closer to what runs on real hardware. Fortunately I don't intend to develop anything else for this platform other than one-off fixes like this.

Can you check if my image viewer still runs fine on real hardware for both JPEG and PNG?
u/critor July 04, 2017, 12:10:19 PM
Quote from: gbl08ma on July 04, 2017, 11:58:13 AMCan you check if my image viewer still runs fine on real hardware for both JPEG and PNG?
JPEG/PNG images seem to be working perfectly. The scrolling is so fast compared to the fx-CG10/20 ! :D

The file browser though has the same kind of graphic glitches as eigenmath :
u/gbl08ma July 04, 2017, 12:11:50 PM
OK, fortunately if I manage to fix Eigenmath I can also fix the Image Viewer very easily. It's just a matter of getting to my old development environment, if it still works. Perhaps later today I'll be able to do that.
u/gbl08ma July 04, 2017, 07:31:11 PM
@critor, I sent you test builds. If everything works fine then the only thing left to do is to tag the git commit, rebuild them so the version strings gets updated, and upload them to the various places on the internet where I originally uploaded them.

Icons will stay in the fx-CG 10/20 style for now. I hope someone works on a solution to automatically and safely swap the icon on the first run, so separate builds for different models are not needed. Given the trouble previous Prizm OS versions had when writing or otherwise manipulating g3a files from add-ins, I'm not hopeful...
u/critor July 04, 2017, 07:38:09 PM
Ok, thanks you very much. :)

Are they supposed to still work on the fx-CG10/20 ?
(I don't have it anymore)
u/gbl08ma July 04, 2017, 07:39:58 PM
Yes, they will work on previous versions as well. But you don't need to test that, as the emulator does an OK job and I already checked.
u/critor July 04, 2017, 07:41:00 PM
So it's great if the same build is working on all models - thanks ! :)
u/Dream of Omnimaga July 04, 2017, 07:58:43 PM
A community emulator would definitively be a must for adequate C development on this calculator series, even though the audience would be smaller. The official emulator costs $200 anyway. (almost twice as much as the original PRIZM calculator)
u/critor July 04, 2017, 08:03:24 PM
Not $200, worse.
It's a subscription now - you have to go on paying forever :P
u/Dream of Omnimaga July 04, 2017, 08:04:34 PM
Wait, so it's now like Xbox Live, PS Plus, World of Warcraft and MS Office?
u/gbl08ma July 04, 2017, 08:11:41 PM
And unfortunately, unlike earlier versions of the fx-CG10/20 manager, I have not been made aware of any registry hacks for the newer emulators.

If you use PlayOnLinux you can always create a new virtual disk (Wine config) every time the 90-day trials expire, though. This is what I used to do...
For Windows I'm not sure if there's any sandboxing tool that will allow for something like that.

I think in the longer run it'd be best to get an open-source alternative going on so we can stop pretending we didn't read EULAs.
u/gbl08ma July 04, 2017, 11:34:37 PM
critor says the image viewer appears to be fixed, but Eigenmath is crashing and causing system instability.

In the interest of the public, here's a copy of the email I just sent him, as it summarizes the situation very well.

----
I have bad news. I can't reproduce the problem on the previous model, neither on the emulator nor on real hardware, and I can't do it on the emulator for the new models, no matter which mode is selected.

I also have little idea of what could be causing the crashes and general instability. Only thing that comes to mind is if they changed the RAM areas in size or the way they are supposed to be initialized. But that doesn't explain how other add-ins run so well.

It could also have something to do with one user timer that the add-in installs (and carefully uninstalls when it's supposed to), to be able to abort computations. Maybe tomorrow I'll send you a build that doesn't install any timers, to see if that fixes the problem. Maybe Casio broke the timer API, or the timer system entirely, with the new OS. I don't think it's a functionality that official add-ins use.

I might give this problem some more hours of attention tomorrow, but failing the timer idea, I'm afraid this can't be fixed unless the OS change that causes the problems is identified. I don't own one of these calculators and since the emulator is significantly different, it makes everything very hard. I have also lost all familiarity with the code of my Eigenmath port, which was never exactly a miracle of software engineering to begin with. In fact, I lost familiarity with lots of quirks of the Casio syscalls. So things take a lot of time and effort as I need to restudy everything.

Is the PC and target always the same?

At least the image viewer appears to be fixed.
u/gbl08ma July 08, 2017, 06:37:55 PM
An update to the image viewer has been released. The g3a works on all Prizm models.

For Eigenmath, I don't know what to do and I've given up for now.
Website statistics


MyCalcs | Ticalc.org | Cemetech | Omnimaga | TI-Basic Developer | MaxCoderz | TI-Story | Casiocalc.org | Casiopeia | The Museum of HP Calculators | HPCalc.org | CnCalc.org | Music 2000 Community | TI Education | Casio Education | HP Calcs | NumWorks | SwissMicros | Sharp Calculators
Powered by EzPortal