It's on the first post, as has always been.
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:
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...
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.
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)
(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
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
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
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
You could potentially do it, I believe the source to libfxcg is public to everyone to contribute to
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:
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.
Code:
__asm__("#include <asm.h>\n"
"\tSYSCALL(_garbage_syscall, 0xFFFF)");
void garbage_syscall();
int main(int argc, char **argv) {
garbage_syscall();
}
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:
Thanks a ton for your help!
EDIT:
The version 1.0 is released! I'll upload it to the archives ASAP.
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:
Don't forget to upstream your patch to the repository! Run Matrix now opens with one line of code:
Code:
APP_RUNMAT(1,0);
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!
Links to my calculator projects
I lurk #cemetech, if you want to contact me that and email are probably best.
I lurk #cemetech, if you want to contact me that and email are probably best.
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?
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
@flyingfisch: glad to see you like it
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?
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?
Links to my calculator projects
I lurk #cemetech, if you want to contact me that and email are probably best.
I lurk #cemetech, if you want to contact me that and email are probably best.
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?
Links to my calculator projects
I lurk #cemetech, if you want to contact me that and email are probably best.
I lurk #cemetech, if you want to contact me that and email are probably best.
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
» Go to Registration page
» Goto page Previous 1, 2, 3, 4 Next
» View previous topic :: View next topic
» View previous topic :: View next topic
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
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