It's on the first post, as has always been. Wink
do you mean the one that can turn off the calc?
Yes.
I just uploaded a new version, the link is the same as on the first post.
This one implements settings (press OPTN on the landing screen to access the settings screen), which are saved in the main memory (like Minesweeper2). Use F1-F3 to change each setting.

I implemented three settings: automatically turning off after locking (comes disabled by default), showing the Casio logo when turning off (this is more to prove that it's possible not to show it; comes enabled by default), and opening Run-Matrix after locking.

This last one is very interesting and needs more explanation. I implemented it by calling, using assembly, the syscall 0x1A03 (APP_RUNMAT). And it really works! If the setting is on, after you unlock the calc, it will immediately jump to Run-Matrix. But not the usual Run-Matrix!
This is a "special" Run-Matrix. Explained shortly, it's as if it was running inside CGlocker. When at this Run-Matrix you press Menu, you won't find the first item selected, but the CGlocker icon. And if you press Menu again, or press EXE for selecting CGlocker, instead of the "press EXE to lock(...)" you'll get on the "special Run-Matrix"!

I say it is "special" not only because of this, but because the Setup menu doesn't work (try pressing Shift+Menu and see for yourself). Conversion (OPTN-F6-F1) works right too, although it is an add-in.

I'm using the following code to call Run-Matrix from CGlocker:

Code:

__asm__(   
         "mov.l syscall_APP_RUNMAT, r0\n\t"
         "mov.l syscall_table_branch, r2\n\t"
         "jmp @r2\n\t"
         "mov #1, r4\n\t"
         "syscall_table_branch: .long 0x80020070\n\t"
         "syscall_APP_RUNMAT: .long 0x1A03"
         );


There are also syscalls for opening other menu items contained in the OS (not add-ins). I found them in the miniSDK CHM help file...
Cool stuff, looks like this is becoming cooler and cooler. As for one thing, the line "mov #1, r4\n\t" in your assembly can simply be changed to "nop\n\t", that syscall doesn't need a first parameter of 1, AFAIK.

EDIT: and since those last two lines are data right after the code, you're going to have to LDS an address after the data into PR, or else those values will be treated as instructions.
It does need that value of 1, yes. Read this (section 5.2) and you'll understand why: ftp://ftp.mirrorservice.org/pub/sourceforge/f/project/fx/fxsdk/documentation/fxreverse-docs-1/fxreverse-docs-1.pdf

(your tip about reading older docs for older calcs was very helpful)
(this document is yet another proof that Simon Lothar knows A LOT)
Oh, I see it needs a runmode param. It also seems to need a stripID; you should probably load #0 into r5 just to make sure it always satisfies the function.
I think it only needs the stripID if called from eActivity...

If I change any of the code now, the compiler will complain about "misaligned data" and "offset to unaligned destination", like what happened when I put the assembly for the PowerOff syscall. So, someone needs to put these syscalls into libfxcg ASAP Smile
gbl08ma wrote:
I think it only needs the stripID if called from eActivity...

If I change any of the code now, the compiler will complain about "misaligned data" and "offset to unaligned destination", like what happened when I put the assembly for the PowerOff syscall. So, someone needs to put these syscalls into libfxcg ASAP Smile


You could potentially do it, I believe the source to libfxcg is public to everyone to contribute to Wink
In fact, the problem is that I'm too lazy to find out how to compile libfxcg, make the necessary modifications myself and compile. I'll probably have a look at it soon.
asm.h (moved to fxcg/syscall.h in my work which isn't mainline yet) provides macros for syscalls. Your inline assembly is still subject to the alignment issue you encountered earlier, as it happens.

Code:
__asm__("#include <asm.h>\n"
         "\tSYSCALL(_garbage_syscall, 0xFFFF)");

void garbage_syscall();

int main(int argc, char **argv) {
    garbage_syscall();
}
Disclaimer: I didn't test this, and it might not work.

In any case, adding syscalls to libfxcg is staggeringly easy- just add the prototype to the relevant header and create a new .S file for it.
Your code didn't seem to work after the necessary changes, so I just downloaded the libfxcg code from GitHub, made the necessary changes to add the new syscall and compiled it myself - went better than expected.

Run Matrix now opens with one line of code:

Code:
APP_RUNMAT(1,0);


Thanks a ton for your help!

EDIT:
The version 1.0 is released! I'll upload it to the archives ASAP.
gbl08ma wrote:
Your code didn't seem to work after the necessary changes, so I just downloaded the libfxcg code from GitHub, made the necessary changes to add the new syscall and compiled it myself - went better than expected.

Run Matrix now opens with one line of code:

Code:
APP_RUNMAT(1,0);
Don't forget to upstream your patch to the repository! Smile
I'll do it once I add support for more syscalls (there are many APP_* syscalls that aren't in libfxcg yet, but are documented on the miniSDK docs).
Wow! A lot of progress has been made on this! I have been offline for a couple weeks and I'm really happy to see these improvements!
gbl08ma wrote:
I'll do it once I add support for more syscalls (there are many APP_* syscalls that aren't in libfxcg yet, but are documented on the miniSDK docs).
That would be highly appreciated. While you do that, would you be so kind as to quickly document those syscalls on WikiPrizm as well? Smile
Well I'm tired of Prizm development for today, so probably I won't do it now. Later, I'll add the missing syscalls to libfxcg and document them on the wiki.

@flyingfisch: glad to see you like it Smile
ooooooh... Nice font!

EDIT:

Idea: a fake settings menu that allows teachers to reset the storage mem without actually doing it. That way you don't lose addins. But would that be illegal?
In my country teachers have never reset any calcs in exams (and I hope they don't start doing so!), as long as the calcs are authorized you can have anything you want stored in them. I think there are fake reset menus for the TI83/84.
gbl08ma wrote:
In my country teachers have never reset any calcs in exams (and I hope they don't start doing so!), as long as the calcs are authorized you can have anything you want stored in them. I think there are fake reset menus for the TI83/84.


Ok, cool. So would it be to hard to implement it in Cg-Locker?
  
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
Page 3 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

 

Advertisement